summaryrefslogtreecommitdiffstats
path: root/scripts/common.sh.in
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2014-04-10 10:44:00 -0700
committerBrian Behlendorf <[email protected]>2014-04-10 14:27:00 -0700
commit443c3f73321d18d0092b11390e628e3de9d15d7c (patch)
tree605e2a9c91650f42f71f53d707f562dbd47d770f /scripts/common.sh.in
parent6ac770b1961b9468daf0c69eae6515c608535789 (diff)
Improve zfs.sh error messages
Ensure an error message is logged when the 'zfs.sh' script fails to either load a module or if udev fails to create the /dev/zfs device. Error messages for missing KERNEL_MODULES are suppressed because that functionality may just be built-in to the kernel. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'scripts/common.sh.in')
-rw-r--r--scripts/common.sh.in8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/common.sh.in b/scripts/common.sh.in
index a6586f4aa..2fac2a919 100644
--- a/scripts/common.sh.in
+++ b/scripts/common.sh.in
@@ -207,7 +207,11 @@ load_module() {
echo "Loading ${NAME} ($@)"
fi
- ${LDMOD} $* &>/dev/null || ERROR="Failed to load $1" return 1
+ ${LDMOD} $* &>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "Failed to load ${NAME} ($@)"
+ return 1
+ fi
return 0
}
@@ -216,7 +220,7 @@ load_modules() {
mkdir -p /etc/zfs
for MOD in ${KERNEL_MODULES[*]}; do
- load_module ${MOD}
+ load_module ${MOD} >/dev/null
done
for MOD in ${MODULES[*]}; do