From 9288979fd4333f7afbd5a4838b678634f7d8a375 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Fri, 23 May 2008 14:32:43 +0000 Subject: add configure script git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@4337 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- build_tools/uninstall-modules | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 build_tools/uninstall-modules (limited to 'build_tools/uninstall-modules') diff --git a/build_tools/uninstall-modules b/build_tools/uninstall-modules new file mode 100755 index 0000000..a654c21 --- /dev/null +++ b/build_tools/uninstall-modules @@ -0,0 +1,41 @@ +#!/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/modules/KVERS" + echo " modN - (optionally 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 + BASE=`basename $mod` + for file in `cat $KERNEL_MODULES_DIR/modules.dep | cut -d : -f 1 | grep "$BASE$"`; do + if [ -e "$file" ]; then + #echo "Deleting $file." + rm -f $file + fi + done +done +exit 0 -- cgit v1.2.3