Skip to contentSkip to conversation

return proper value in function dracut_install

PATCH In review Dave Young 2 participants 2 messages Oct 8, 2012 – Oct 16, 2012 1 message not in the archive

lore
Share & tools
lore

Dave Young

author
#0 lore raw

PATCH 1/1 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"

---
 dracut-functions.sh |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
dracut-functions.sh +4 -1
@@ -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() {

A message that is not in the archive (sent off-list or not yet received): 20121008094008.GA19986-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]

#2 lore raw

Am 08.10.2012 11:40, schrieb Dave Young:

Quoted 18 lines

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"

---
 dracut-functions.sh |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
dracut-functions.sh +0 -0
@@ -563,9 +563,12 @@ if [[ $DRACUT_INSTALL ]]; then
     }
 
     dracut_install() {

dracut-functions.sh if [[ $DRACUT_INSTALL ]]; then · line 574

Quoted 10 lines
dracut-functions.sh +4 -1
+        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() {

https://admin.fedoraproject.org/updates/dracut-024-1.fc18