From 1c77aae941ce4a3d88119835b5359dc67d5d5e20 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Tue, 11 Dec 2007 15:50:51 +0000 Subject: * uninstall-modules: put in build_tools, and remove language suffix. * Close bug #11511. * Some other cleanups of uninstall-modules. Merged revisions 3420,3424 via svnmerge from http://svn.digium.com/svn/zaptel/branches/1.2 git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3425 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- Makefile | 2 +- build_tools/uninstall-modules | 40 ++++++++++++++++++++++++++++++++++++++++ uninstall-modules-sh | 36 ------------------------------------ 3 files changed, 41 insertions(+), 37 deletions(-) create mode 100755 build_tools/uninstall-modules delete mode 100755 uninstall-modules-sh diff --git a/Makefile b/Makefile index 9ad2bb7..7291fee 100644 --- a/Makefile +++ b/Makefile @@ -544,7 +544,7 @@ BASENAMES=$(sort $(shell for x in $(ALL_MODULES); do basename $x; done)) uninstall-modules: ifeq ($(BUILDVER),linux24) else - @./uninstall-modules-sh $(DESTDIR)/lib/modules/$(KVERS) $(BASENAMES) + @./build_tools/uninstall-modules $(DESTDIR)/lib/modules/$(KVERS) $(BASENAMES) @for x in $(ALL_MODULES); do \ rm -f $(DESTDIR)/lib/modules/$(KVERS)/extra/$$x ; \ rm -f $(DESTDIR)/lib/modules/$(KVERS)/misc/$$x ; \ diff --git a/build_tools/uninstall-modules b/build_tools/uninstall-modules new file mode 100755 index 0000000..5d984f0 --- /dev/null +++ b/build_tools/uninstall-modules @@ -0,0 +1,40 @@ +#!/bin/sh +# uninstall-modules +# +# Remove all the modules passed in on the command line from the modules +# directory. This script is called by the makefile. + +KERNEL_MODULES_DIR=$1 +shift +MODULES="$*" + +usage() { + echo "$0: Used to delete kernel modules from the modules directory." + echo "" + echo "Usage:" + echo " $0 MODULES_BASE_DIR mod1 [mod2 [...]]" + echo "" + echo " MODULES_BASE_DIR - typically /lib/odules/KVERS" + echo " modN - (optinally partial) module name to remove." +} + +if [ -z "$KERNEL_MODULES_DIR" ]; then + echo "Missing kernel module directory." + usage + exit 1; +fi + +if [ -z "$MODULES" ]; then + echo "Missing one or more modules to delete." + usage + exit 1; +fi +for mod in $MODULES; do + for file in `cat $KERNEL_MODULES_DIR/modules.dep | cut -d : -f 1 | grep $mod`; do + if [ -e "$file" ]; then + echo "Deleting $file." + rm -f $file + fi + done +done +exit 0 diff --git a/uninstall-modules-sh b/uninstall-modules-sh deleted file mode 100755 index d70255c..0000000 --- a/uninstall-modules-sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# uninstall-modules-sh -# -# Remove all the modules passed in on the command line from the modules -# directory. This script is called by the makefile. -# -# USAGE: uninstall-modules-sh modules to delete ... - -KERNEL_MODULES_DIR=$1 -shift -MODULES=$@ - -function usage { - echo "$0: Used to delete kernel modules from the modules directory." -} - -if [ -z "$KERNEL_MODULES_DIR" ]; then - echo "Missing kernel module directory." - usage - exit 1; -fi - -if [ -z "$MODULES" ]; then - echo "Missing one or more modules to delete." - usage - exit 1; -fi -for mod in $MODULES; do - for file in `cat $KERNEL_MODULES_DIR/modules.dep | cut -d : -f 1 | grep $mod`; do - if [ -e "$file" ]; then - echo "Deleting $file." - rm -f $file - fi - done -done -exit 0 -- cgit v1.2.3