initrd.scripts: move test_success() to 00-common.sh and fix it

master
Fabio Erculiani 12 years ago
parent fae57916b9
commit 5722d3826e

@ -41,6 +41,16 @@ verbose_kmsg() {
[ -n "$QUIET" ] && echo '6' > /proc/sys/kernel/printk
}
test_success() {
local ret=${?}
local error_string="${1:-run command}"
if [ "${ret}" != "0" ]; then
bad_msg "Failed to ${1}; failing back to the shell..."
run_shell
fi
}
run_shell() {
/bin/ash
}

@ -114,18 +114,6 @@ find_nfs() {
fi
}
test_success() {
retcode=$?
# If last command failed send error message and fall back to a shell
if [ "$retcode" != '0' ]
then
error_string=$1
error_string="${error_string:-run command}"
bad_msg 'Failed to $1; failing back to the shell...'
run_shell
fi
}
crypt_exec() {
if [ "${CRYPT_SILENT}" = '1' ]
then

Loading…
Cancel
Save