debug_off # Turn off debugging for this section
+CAPSH=$(command -v capsh)
+SWITCH_ROOT=$(command -v switch_root)
+
# unexport some vars
export_n root rflags fstype netroot NEWROOT
unset CMDLINE
unset PS4
-CAPSH=$(command -v capsh)
-SWITCH_ROOT=$(command -v switch_root)
PATH=$OLDPATH
export PATH
info "Calling $INIT with capabilities $CAPS_INIT_DROP dropped."
unset RD_DEBUG
exec "$CAPSH" --drop="$CAPS_INIT_DROP" -- \
- -c "exec switch_root \"$NEWROOT\" \"$INIT\" $initargs" \
+ -c "exec \"$SWITCH_ROOT\" \"$NEWROOT\" \"$INIT\" $initargs" \
|| {
warn "Command:"
- warn capsh --drop="$CAPS_INIT_DROP" -- -c exec switch_root "$NEWROOT" "$INIT" "$initargs"
+ warn capsh --drop="$CAPS_INIT_DROP" -- -c exec "$SWITCH_ROOT" "$NEWROOT" "$INIT" "$initargs"
warn "failed."
emergency_shell
}