]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Avoid executing emergency hooks twice
authorIgnaz Forster <iforster@suse.com>
Tue, 6 Feb 2018 16:32:47 +0000 (17:32 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Thu, 8 Feb 2018 15:30:05 +0000 (16:30 +0100)
modules.d/99base/dracut-lib.sh

index 675abf22a1a99304bd96fa8413184c43da116396..99cb9dbc6a1e8926ae4188495783bf39a2bcffb6 100755 (executable)
@@ -1084,6 +1084,7 @@ _emergency_shell()
         rm -f -- /.console_lock
     else
         debug_off
+        source_hook "$hook"
         echo
         /sbin/rdsosreport
         echo 'You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot'
@@ -1136,7 +1137,6 @@ emergency_shell()
 
     echo ; echo
     warn "$*"
-    source_hook "$hook"
     echo
 
     _emergency_action=$(getarg rd.emergency)
@@ -1147,6 +1147,7 @@ emergency_shell()
     if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then
         _emergency_shell $_rdshell_name
     else
+        source_hook "$hook"
         warn "$action has failed. To debug this issue add \"rd.shell rd.debug\" to the kernel command line."
         [ -z "$_emergency_action" ] && _emergency_action=halt
     fi