summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier@dowhile0.org>2018-02-25 22:25:31 +0100
committerJavier Martinez Canillas <javier@dowhile0.org>2018-02-25 22:25:37 +0100
commite3c38f894f146aad18e14196ca39e679f35bf19f (patch)
tree4ce196fedcbe9e451ea18f85dccecfd14afbd264
parentc400d261b75b51eed26bd851e4458c4f6eda8eff (diff)
downloadldd3-e3c38f894f146aad18e14196ca39e679f35bf19f.tar.gz
Don't use absolute path for commands in load/unload scripts
Just let the shell lookup from the user's $PATH since some tools may not be installed in the absolute path used in the scripts. Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
-rwxr-xr-xsbull/sbull_load2
-rwxr-xr-xsbull/sbull_unload2
-rwxr-xr-xscull/scull_load2
-rwxr-xr-xscull/scull_unload2
-rw-r--r--scullc/scullc_load2
-rw-r--r--scullc/scullc_unload2
-rwxr-xr-xsculld/sculld_load2
-rwxr-xr-xsculld/sculld_unload2
-rwxr-xr-xscullp/scullp_load2
-rwxr-xr-xscullp/scullp_unload2
-rwxr-xr-xscullv/scullv_load2
-rwxr-xr-xscullv/scullv_unload2
-rw-r--r--short/short_load2
-rw-r--r--short/short_unload2
-rwxr-xr-xshortprint/shortprint_load2
-rwxr-xr-xshortprint/shortprint_unload2
-rwxr-xr-xsimple/simple_load2
-rwxr-xr-xsimple/simple_unload2
-rwxr-xr-xsnull/snull_load2
-rwxr-xr-xsnull/snull_unload6
20 files changed, 21 insertions, 23 deletions
diff --git a/sbull/sbull_load b/sbull/sbull_load
index 50dd26d..d4850a3 100755
--- a/sbull/sbull_load
+++ b/sbull/sbull_load
@@ -26,7 +26,7 @@ fi
# invoke insmod with all arguments we got
# and use a pathname, as newer modutils don't look in . by default
-/sbin/insmod -f ./$module.ko $* || exit 1
+insmod ./$module.ko $* || exit 1
major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
diff --git a/sbull/sbull_unload b/sbull/sbull_unload
index aa22dfb..821262e 100755
--- a/sbull/sbull_unload
+++ b/sbull/sbull_unload
@@ -3,7 +3,7 @@ module="sbull"
device="sbull"
# invoke rmmod with all arguments we got
-/sbin/rmmod $module $* || exit 1
+rmmod $module $* || exit 1
# Remove stale nodes
rm -f /dev/${device}[a-d]* /dev/${device}
diff --git a/scull/scull_load b/scull/scull_load
index 0da1378..2ef6a54 100755
--- a/scull/scull_load
+++ b/scull/scull_load
@@ -13,7 +13,7 @@ fi
# invoke insmod with all arguments we got
# and use a pathname, as insmod doesn't look in . by default
-/sbin/insmod ./$module.ko $* || exit 1
+insmod ./$module.ko $* || exit 1
# retrieve major number
major=$(awk "\$2==\"$module\" {print \$1}" /proc/devices)
diff --git a/scull/scull_unload b/scull/scull_unload
index 269a0aa..ba8f7ee 100755
--- a/scull/scull_unload
+++ b/scull/scull_unload
@@ -3,7 +3,7 @@ module="scull"
device="scull"
# invoke rmmod with all arguments we got
-/sbin/rmmod $module $* || exit 1
+rmmod $module $* || exit 1
# Remove stale nodes
diff --git a/scullc/scullc_load b/scullc/scullc_load
index 8ca1f69..bcf2e82 100644
--- a/scullc/scullc_load
+++ b/scullc/scullc_load
@@ -15,7 +15,7 @@ rm -f /dev/${device}?
# invoke insmod with all arguments we got
# and use a pathname, as newer modutils don't look in . by default
-/sbin/insmod -f ./$module.ko $* || exit 1
+insmod ./$module.ko $* || exit 1
major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
diff --git a/scullc/scullc_unload b/scullc/scullc_unload
index bb91f71..29a07d7 100644
--- a/scullc/scullc_unload
+++ b/scullc/scullc_unload
@@ -3,7 +3,7 @@ module="scullc"
device="scullc"
# invoke rmmod with all arguments we got
-/sbin/rmmod $module $* || exit 1
+rmmod $module $* || exit 1
# remove nodes
rm -f /dev/${device}[0-3] /dev/${device}
diff --git a/sculld/sculld_load b/sculld/sculld_load
index 14f5541..1436205 100755
--- a/sculld/sculld_load
+++ b/sculld/sculld_load
@@ -15,7 +15,7 @@ rm -f /dev/${device}?
# invoke insmod with all arguments we got
# and use a pathname, as newer modutils don't look in . by default
-/sbin/insmod -f ./$module.ko $* || exit 1
+/insmod ./$module.ko $* || exit 1
major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
diff --git a/sculld/sculld_unload b/sculld/sculld_unload
index edebbf9..643af92 100755
--- a/sculld/sculld_unload
+++ b/sculld/sculld_unload
@@ -3,7 +3,7 @@ module="sculld"
device="sculld"
# invoke rmmod with all arguments we got
-/sbin/rmmod $module $* || exit 1
+rmmod $module $* || exit 1
# remove nodes
rm -f /dev/${device}[0-3] /dev/${device}
diff --git a/scullp/scullp_load b/scullp/scullp_load
index d7dc1ef..ae95a91 100755
--- a/scullp/scullp_load
+++ b/scullp/scullp_load
@@ -15,7 +15,7 @@ rm -f /dev/${device}?
# invoke insmod with all arguments we got
# and use a pathname, as newer modutils don't look in . by default
-/sbin/insmod -f ./$module.ko $* || exit 1
+insmod ./$module.ko $* || exit 1
major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
diff --git a/scullp/scullp_unload b/scullp/scullp_unload
index adf5e2c..9b6a5d2 100755
--- a/scullp/scullp_unload
+++ b/scullp/scullp_unload
@@ -3,7 +3,7 @@ module="scullp"
device="scullp"
# invoke rmmod with all arguments we got
-/sbin/rmmod $module $* || exit 1
+rmmod $module $* || exit 1
# remove nodes
rm -f /dev/${device}[0-3] /dev/${device}
diff --git a/scullv/scullv_load b/scullv/scullv_load
index 9b26276..9ff4941 100755
--- a/scullv/scullv_load
+++ b/scullv/scullv_load
@@ -15,7 +15,7 @@ rm -f /dev/${device}?
# invoke insmod with all arguments we got
# and use a pathname, as newer modutils don't look in . by default
-/sbin/insmod -f ./$module.ko $* || exit 1
+insmod ./$module.ko $* || exit 1
major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
diff --git a/scullv/scullv_unload b/scullv/scullv_unload
index 13608e8..840217f 100755
--- a/scullv/scullv_unload
+++ b/scullv/scullv_unload
@@ -3,7 +3,7 @@ module="scullv"
device="scullv"
# invoke rmmod with all arguments we got
-/sbin/rmmod $module $* || exit 1
+rmmod $module $* || exit 1
# remove nodes
rm -f /dev/${device}[0-3] /dev/${device}
diff --git a/short/short_load b/short/short_load
index 407846c..7d18317 100644
--- a/short/short_load
+++ b/short/short_load
@@ -13,7 +13,7 @@ fi
# invoke insmod with all arguments we got
# and use a pathname, as newer modutils don't look in . by default
-/sbin/insmod ./$module.ko $* || exit 1
+insmod ./$module.ko $* || exit 1
major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
diff --git a/short/short_unload b/short/short_unload
index 7cf64dc..db6b36a 100644
--- a/short/short_unload
+++ b/short/short_unload
@@ -3,7 +3,7 @@ module="short"
device="short"
# invoke rmmod with all arguments we got
-/sbin/rmmod $module $* || exit 1
+rmmod $module $* || exit 1
# Remove stale nodes
diff --git a/shortprint/shortprint_load b/shortprint/shortprint_load
index 4b08609..15944fb 100755
--- a/shortprint/shortprint_load
+++ b/shortprint/shortprint_load
@@ -13,7 +13,7 @@ fi
# invoke insmod with all arguments we got
# and use a pathname, as newer modutils don't look in . by default
-/sbin/insmod -f ./$module.ko $* || exit 1
+insmod ./$module.ko $* || exit 1
major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
diff --git a/shortprint/shortprint_unload b/shortprint/shortprint_unload
index 88e62a7..615b12e 100755
--- a/shortprint/shortprint_unload
+++ b/shortprint/shortprint_unload
@@ -3,7 +3,7 @@ module="shortprint"
device="shortprint"
# invoke rmmod with all arguments we got
-/sbin/rmmod $module $* || exit 1
+rmmod $module $* || exit 1
# Remove stale nodes
rm -f /dev/${device}
diff --git a/simple/simple_load b/simple/simple_load
index 5cd004d..a72e53c 100755
--- a/simple/simple_load
+++ b/simple/simple_load
@@ -12,7 +12,7 @@ fi
# invoke insmod with all arguments we got
# and use a pathname, as newer modutils don't look in . by default
-/sbin/insmod -f ./$module.ko $* || exit 1
+insmod ./$module.ko $* || exit 1
major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
diff --git a/simple/simple_unload b/simple/simple_unload
index dca9421..eae8068 100755
--- a/simple/simple_unload
+++ b/simple/simple_unload
@@ -3,7 +3,7 @@ module="simple"
device="simple"
# invoke rmmod with all arguments we got
-/sbin/rmmod $module $* || exit 1
+rmmod $module $* || exit 1
# Remove stale nodes
rm -f /dev/${device}[rn]
diff --git a/snull/snull_load b/snull/snull_load
index 47de578..3f6627d 100755
--- a/snull/snull_load
+++ b/snull/snull_load
@@ -1,7 +1,5 @@
#!/bin/sh
-export PATH=/sbin:/bin
-
# Use a pathname, as new modutils don't look in the current dir by default
insmod ./snull.ko $*
ifconfig sn0 local0
diff --git a/snull/snull_unload b/snull/snull_unload
index a857ac9..7cc3a39 100755
--- a/snull/snull_unload
+++ b/snull/snull_unload
@@ -1,5 +1,5 @@
#!/bin/sh
-/sbin/ifconfig sn0 down
-/sbin/ifconfig sn1 down
-/sbin/rmmod snull
+ifconfig sn0 down
+ifconfig sn1 down
+rmmod snull