Skip to content

Commit c4b7fef

Browse files
committed
bin/kexec-select-boot/reboot/recovery: reuse reboot+DEBUG conditional prompt for recovery shell access, state where debug logs are in centralized way
Note for linuxboot#1888: warn in code is used mostly to actually warn user of something requiring his attention, and pausing for 2 seconds. Goal is: die: blocking: tell user that something failed, requiring acknowledgement for corrective actions. warn: display "WARNING:" prepended messages which pauses for 2 seconds prior of continuing. This is not an error, nor INFO INFO: gives a trace to the user when in QUIET mode, under /tmp/debug.log related to core components output, typically related to measurements traces. Consequently, putting what is currently under warn->INFO wold be console silenced. We want to get rid of manual "echo +++++" messages. So it seems we lack what is currently named INFO to go into measurement_log, and INFO (green), warn (yellow) and die (red) messages to console. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
1 parent b5cb7ae commit c4b7fef

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

initrd/bin/kexec-select-boot

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -314,17 +314,7 @@ user_select() {
314314
# continue below to boot the new default option
315315
true
316316
else
317-
echo "+++ Rebooting to start the new default option"
318-
sleep 2
319-
if [ "$CONFIG_DEBUG_OUTPUT" != "y" ]; then
320-
reboot ||
321-
die "!!! Failed to reboot system"
322-
else
323-
DEBUG "Rebooting is required prior of booting default boot entry"
324-
# Instead of rebooting, drop to a recovery shell
325-
# for a chance to inspect debug output
326-
recovery "Entering recovery to permit inspection of /tmp/debug.log output, reboot to continue"
327-
fi
317+
warn "Rebooting to start the new default option"
328318
fi
329319
fi
330320

initrd/bin/reboot

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ if [ "$CONFIG_DEBUG_OUTPUT" = "y" ]; then
77
#Generalize user prompt to continue reboot or go to recovery shell
88
read -r -n 1 -s -p "Press Enter to continue reboot or 'r' to go to recovery shell: " REPLY
99
echo
10-
if [ "$REPLY" = "r" ] || [ "$REPLY" = "R" ]; then
10+
if [ "$REPLY" = "r" ] || [ "$REPLY" = "R" ]; then
11+
warn "Use 'less /tmp/debug.log' to see the debug log content"
1112
recovery "Reboot call bypassed to go into recovery shell to debug"
1213
fi
1314
fi

0 commit comments

Comments
 (0)