system/system76-io-dkms: Add douninst.sh.

The douninst.sh script will remove all versions of the module built by
dkms so that this package properly cleans up after itself.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Erich Ritz 2021-08-10 14:37:22 -05:00 committed by Willy Sudiarto Raharjo
parent fa6c85fcad
commit 9164984e60
No known key found for this signature in database
GPG key ID: 3F617144D7238786
4 changed files with 13 additions and 8 deletions

View file

@ -13,5 +13,5 @@ The system76-io dkms module is automatically registered with dkms by
doinst.sh with the following command:
dkms install system76-io/$VER
Old versions of system76-io should be manually unregistered from dkms using:
dkms remove system76-io/$OLD_VER --all
A douninst.sh script is included which calls "dkms remove" to delete all
kernel versions of the old module on package removal or upgrade.

View file

@ -1,7 +1,5 @@
VER=@MODULE_VERSION@
dkms install system76-io/$VER
# Before removing the system76-io package, the following command should
# be run to unregister the module from dkms:
#
# dkms remove system76-io/$VER --all
# Copy a backup of dkms.conf for module removal by douninst.sh.
cp usr/src/system76-io-$VER/dkms.conf etc/dkms/system76-io-$VER.conf

View file

@ -0,0 +1,6 @@
VER=@MODULE_VERSION@
CONF=etc/dkms/system76-io-$VER.conf
if [ -r $CONF ]; then
dkms remove system76-io/$VER --all -c $CONF
rm $CONF
fi

View file

@ -2,7 +2,7 @@
# Slackware build script for system76-io-dkms
# Copyright 2019 Erich Ritz, Scottsdale, Arizona, USA
# Copyright 2019,2021 Erich Ritz, Jenks, Oklahoma, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@ -77,7 +77,7 @@ cp -a \
$PKG/usr/src/$MODNAM-$VERSION
# Edit and install dkms configuration
sed "s/@MODULE_VERSION@/${VERSION}/" "debian/system76-io-dkms.dkms" > "$PKG/usr/src/$MODNAM-$VERSION/dkms.conf"
sed "s/#MODULE_VERSION#/${VERSION}/" "debian/system76-io-dkms.dkms" > "$PKG/usr/src/$MODNAM-$VERSION/dkms.conf"
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
@ -88,6 +88,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
sed "s/@MODULE_VERSION@/${VERSION}/" "$CWD/doinst.sh" > "$PKG/install/doinst.sh"
sed "s/@MODULE_VERSION@/${VERSION}/" "$CWD/douninst.sh" > "$PKG/install/douninst.sh"
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE