diff options
author | Vsevolod Stakhov <vsevolod@FreeBSD.org> | 2005-09-16 11:41:55 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@FreeBSD.org> | 2005-09-16 11:41:55 +0000 |
commit | 8b0303d49003f9c078455b125eb2c22afa0f61b7 (patch) | |
tree | b6c127fbfb72337c76b28a49f429c451a2b5eff5 /audio/emu10kx/pkg-deinstall | |
parent | f98f52441be0f4812793a575472bcf9fec242bb7 (diff) |
Notes
Diffstat (limited to 'audio/emu10kx/pkg-deinstall')
-rw-r--r-- | audio/emu10kx/pkg-deinstall | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/audio/emu10kx/pkg-deinstall b/audio/emu10kx/pkg-deinstall new file mode 100644 index 000000000000..7bc92fe166a6 --- /dev/null +++ b/audio/emu10kx/pkg-deinstall @@ -0,0 +1,29 @@ +#!/bin/sh + +[ "$2" != "DEINSTALL" ] && exit 0 + +#============================================================ +# DEINSTALL +#============================================================ +DRIVERNAME=snd_emu10kx + +# Unload the driver +kldstat -n $DRIVERNAME > /dev/null 2>&1; RESULT=$? +if [ ${RESULT} -eq 0 ]; then + kldunload -n $DRIVERNAME > /dev/null 2>&1; RESULT=$? + if [ ${RESULT} -ne 0 ]; then + echo "ERROR: Failed to unload the $DRIVERNAME module!" + echo "ERROR: Is $DRIVERNAME.ko in use?" + exit 1; + fi +fi + +# Remove the driver +rm /boot/kernel/$DRIVERNAME.ko + +# Remove the driver from loader.conf +grep ${DRIVERNAME}_load /boot/loader.conf > /dev/null 2>&1; RESULT=$? +if [ ${RESULT} -eq 0 ]; then + sed -e /${DRIVERNAME}_load.*/d -i.orig /boot/loader.conf +fi +#============================================================ |