]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-systemd/dracut-pre-pivot.sh: Break at switch_root only for bare rd.break
authorHarald Hoyer <harald@redhat.com>
Mon, 7 Mar 2016 11:38:23 +0000 (12:38 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 7 Mar 2016 11:38:23 +0000 (12:38 +0100)
similar to commit ddfea6b54cfa8f8f6c970d970318568c8a8a4c78

Previously, any rd.break=breakpoint would cause a break at the
given breakpoint and also at switch_root.

modules.d/98dracut-systemd/dracut-pre-pivot.sh

index a07cf3e02db7b2bc0937d34cd70dcb094aa403b1..cc70e3c3498a20e2702b05b692abe3ac8946ae40 100755 (executable)
@@ -18,7 +18,9 @@ source_hook pre-pivot
 getarg 'rd.break=cleanup' 'rdbreak=cleanup' && emergency_shell -n cleanup "Break cleanup"
 source_hook cleanup
 
-getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switch_root"
+_bv=$(getarg rd.break -d rdbreak) && [ -z "$_bv" ] &&
+    emergency_shell -n switch_root "Break before switch_root"
+unset _bv
 
 # remove helper symlink
 [ -h /dev/root ] && rm -f -- /dev/root