summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-07-08 20:18:38 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-07-08 20:18:38 +0000
commit175f6b085ab0a37299ba3882f542d138fb6ca25a (patch)
tree3e2d986232d8f2b688d0d045841b39ac92a90338
parentd3e78daae89b774ac19e126e7cf0f1149cc6df92 (diff)
minor improvements to uninstall-modules: add the PID to the temporary file name to make it less easy to accidentally duplicate, only search directories where we expect that DAHDI or Zaptel modules might be found (known installation locations, even old ones), and always uninstall old DAHDI modules before installing new ones, in case a module is no longer in the tree and shouldn't be left installed
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4575 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--Makefile1
-rwxr-xr-xbuild_tools/uninstall-modules9
2 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 7b41cb0..94ed5aa 100644
--- a/Makefile
+++ b/Makefile
@@ -173,6 +173,7 @@ ifndef DESTDIR
rm -rf /lib/modules/$(KVERS)/zaptel; \
echo "done."; \
fi
+ build_tools/uninstall-modules dahdi $(KVERS)
endif
$(KMAKE) INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=dahdi modules_install
[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
diff --git a/build_tools/uninstall-modules b/build_tools/uninstall-modules
index 45c635c..02b89c9 100755
--- a/build_tools/uninstall-modules
+++ b/build_tools/uninstall-modules
@@ -45,13 +45,16 @@ checkmod() {
while test "${founddep}" = "1"; do
founddep=0
- find /lib/modules/${2} -name \*.ko -print > /tmp/modlist
- exec 9<&0 < /tmp/modlist
+ find /lib/modules/${2}/misc -name \*.ko -print > /tmp/modlist.$$ 2> /dev/null
+ find /lib/modules/${2}/extra -name \*.ko -print >> /tmp/modlist.$$ 2> /dev/null
+ find /lib/modules/${2}/zaptel -name \*.ko -print >> /tmp/modlist.$$ 2> /dev/null
+ find /lib/modules/${2}/dahdi -name \*.ko -print >> /tmp/modlist.$$ 2> /dev/null
+ exec 9<&0 < /tmp/modlist.$$
while read mod; do
checkmod ${mod}
done
exec 0<&9 9<&-
- rm /tmp/modlist
+ rm /tmp/modlist.$$
done
if test -n "${rmlist}"; then