]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
return proper value in function dracut_install
authorDave Young <dyoung@redhat.com>
Mon, 8 Oct 2012 09:40:08 +0000 (17:40 +0800)
committerHarald Hoyer <harald@redhat.com>
Mon, 8 Oct 2012 10:17:28 +0000 (06:17 -0400)
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 <dyoung@redhat.com>
dracut-functions.sh

index 58b0b4dccd1822cddfe07bc78bfd59dc1150ab8c..990aadf36e34bd993ddc72614b8d5a3c68b76d37 100755 (executable)
@@ -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() {