Signed-off-by: Felix Bitterli <[email protected]>
---
backport/Makefile.real | 10 ++++++++++
backport/scripts/compress_modules.sh | 13 ++-----------
backport/scripts/mod_helpers.sh | 11 +++++++++++
backport/scripts/uninstall.sh | 17 +++++++++++++++++
4 files changed, 40 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..b2034c2 100755
--- a/backport/scripts/compress_modules.sh
+++ b/backport/scripts/compress_modules.sh
@@ -2,20 +2,11 @@
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
+ echo COMPRESS $driver
gzip -9 $driver
done
fi
diff --git a/backport/scripts/mod_helpers.sh b/backport/scripts/mod_helpers.sh
new file mode 100644
index 0000000..0845b3e
--- /dev/null
+++ b/backport/scripts/mod_helpers.sh
@@ -0,0 +1,11 @@
+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..7b54d2a
--- /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 ${BACKPORT_PWD} -type f -name *.ko); do
+ mod_name=${KLIB}${KMODDIR}/${driver}${compr}
+ echo " uninstall" $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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html