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 <behlendorf1@llnl.gov>
This commit is contained in:
parent
6ac770b196
commit
443c3f7332
|
@ -207,7 +207,11 @@ load_module() {
|
||||||
echo "Loading ${NAME} ($@)"
|
echo "Loading ${NAME} ($@)"
|
||||||
fi
|
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
|
return 0
|
||||||
}
|
}
|
||||||
|
@ -216,7 +220,7 @@ load_modules() {
|
||||||
mkdir -p /etc/zfs
|
mkdir -p /etc/zfs
|
||||||
|
|
||||||
for MOD in ${KERNEL_MODULES[*]}; do
|
for MOD in ${KERNEL_MODULES[*]}; do
|
||||||
load_module ${MOD}
|
load_module ${MOD} >/dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
for MOD in ${MODULES[*]}; do
|
for MOD in ${MODULES[*]}; do
|
||||||
|
|
|
@ -72,8 +72,8 @@ if [ ${UNLOAD} ]; then
|
||||||
else
|
else
|
||||||
stack_clear
|
stack_clear
|
||||||
check_modules || die "${ERROR}"
|
check_modules || die "${ERROR}"
|
||||||
load_modules "$@"
|
load_modules "$@" || die "Failed to load modules"
|
||||||
wait_udev /dev/zfs 30
|
wait_udev /dev/zfs 30 || die "'/dev/zfs' was not created"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue