Skip to content

Commit

Permalink
drbd, spec: fix handling of dkms install scriplet
Browse files Browse the repository at this point in the history
The most recent DKMS release (3.1.3) removed the common.postinst script from
RPM packages. Instead, dkms package are encouraged to use the dkms commands
directly in the scriptlets.
  • Loading branch information
WanzenBug committed Dec 12, 2024
1 parent 7f964da commit 32b8700
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drbd-kernel.spec
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,16 @@ rm -rf %{buildroot}
%post -n drbd-dkms
DKMS_NAME=drbd
DKMS_VERSION=%{drbd_version}-%{release}
if [ $1 -gt 1 ] ; then
UPGRADE="1"
fi
/usr/lib/dkms/common.postinst $DKMS_NAME $DKMS_VERSION /usr/share/$DKMS_NAME-$DKMS_VERSION "" $UPGRADE
dkms add -m $DKMS_NAME -v $DKMS_VERSION -q --rpm_safe_upgrade || :
# Rebuild and make available for the currently running kernel:
dkms build -m $DKMS_NAME -v $DKMS_VERSION -q || :
dkms install -m $DKMS_NAME -v $DKMS_VERSION -q --force || :

%preun -n drbd-dkms
DKMS_NAME=drbd
DKMS_VERSION=%{drbd_version}-%{release}
dkms remove -m $DKMS_NAME -v $DKMS_VERSION --all
dkms remove -m $DKMS_NAME -v $DKMS_VERSION -q --all --rpm_safe_upgrade || :

%endif

%changelog
Expand Down

0 comments on commit 32b8700

Please sign in to comment.