Signed-off-by: Felix Bitterli <ic.felix@xxxxxxxxx> --- backport/Makefile.real | 10 ++++++++++ backport/scripts/compress_modules.sh | 12 +----------- backport/scripts/mod_helpers.sh | 15 +++++++++++++++ backport/scripts/uninstall.sh | 17 +++++++++++++++++ 4 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 backport/scripts/mod_helpers.sh create mode 100755 backport/scripts/uninstall.sh diff --git a/backport/Makefile.real b/backport/Makefile.real index 2a1f640..40d91bd 100644 --- a/backport/Makefile.real +++ b/backport/Makefile.real @@ -101,6 +101,16 @@ install: modules .PHONY: modules_install modules_install: install +.PHONY: uninstall +uninstall: + @./scripts/uninstall.sh + @/sbin/depmod -a + @./scripts/update-initramfs.sh $(KLIB) + @echo + @echo Your backported driver modules should be uninstalled now. + @echo Reboot. + @echo + .PHONY: clean clean: @$(MAKE) -f Makefile.build clean diff --git a/backport/scripts/compress_modules.sh b/backport/scripts/compress_modules.sh index bbf264f..82368b2 100755 --- a/backport/scripts/compress_modules.sh +++ b/backport/scripts/compress_modules.sh @@ -2,17 +2,7 @@ set -e -function mod_filename() -{ - which modinfo > /dev/null 2>&1 - if [[ $? -eq 0 ]]; then - MOD_QUERY="modinfo -F filename" - else - MOD_QUERY="modprobe -l" - fi - mod_path="$($MOD_QUERY $1 | tail -1)" - echo $(basename "$mod_path") -} +source ./scripts/mod_helpers.sh if test "$(mod_filename mac80211)" = "mac80211.ko.gz" ; then for driver in $(find "$1" -type f -name *.ko); do diff --git a/backport/scripts/mod_helpers.sh b/backport/scripts/mod_helpers.sh new file mode 100644 index 0000000..b360a17 --- /dev/null +++ b/backport/scripts/mod_helpers.sh @@ -0,0 +1,15 @@ +function mod_filename() +{ + which modinfo > /dev/null 2>&1 + if [[ $? -eq 0 ]]; then + MOD_QUERY="modinfo -F filename" + else + MOD_QUERY="modprobe -l" + fi + mod_path="$($MOD_QUERY $1 | tail -1)" + echo $(basename "$mod_path") +} diff --git a/backport/scripts/uninstall.sh b/backport/scripts/uninstall.sh new file mode 100755 index 0000000..2dcf4da --- /dev/null +++ b/backport/scripts/uninstall.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e + +source ./scripts/mod_helpers.sh + +if test "$(mod_filename mac80211)" = "mac80211.ko.gz" ; then + compr=".gz" +else + compr="" +fi + +for driver in $(find -type f -name *.ko); do + mod_name=$KLIB"updates/"$driver$compr + echo UNINSTALLING $mod_name + rm -f $mod_name +done -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe backports" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html