From: Dave Young Date: Mon, 8 Oct 2012 09:40:08 +0000 (+0800) Subject: return proper value in function dracut_install X-Git-Tag: 024~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06e9f8870a525e0f8a2016aa3e8cf83611a88754;p=thirdparty%2Fdracut.git return proper value in function dracut_install dracut_install should return the real return value, so module install function can detect the install failure. Such as below in 99base: dracut_install switch_root || dfatal "Failed to install switch_root" Signed-off-by: Dave Young --- diff --git a/dracut-functions.sh b/dracut-functions.sh index 58b0b4dcc..990aadf36 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -563,9 +563,12 @@ if [[ $DRACUT_INSTALL ]]; then } dracut_install() { + local ret #dinfo "initdir=$initdir $DRACUT_INSTALL -l $@" $DRACUT_INSTALL ${initdir+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" - (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || : + ret=$? + (($ret != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || : + return $ret } inst_library() {