Skip to content

Commit ffe16ad

Browse files
committed
initrd/etc/functions.sh, DEBUG_LOG_COPY_INSTRUCTIONS: skip EFI configs and add ISO signing instructions
initrd/etc/functions.sh: - Skip *EFI*, *efi*, *x86_64-efi* config files in scan_boot_options() to avoid parsing EFI-only bootloader configs that reference non-existent paths on BIOS-booted systems - Remove stale 'plain text - no ANSI codes' comments from logging functions (ANSI codes are preserved in debug.log) initrd/etc/DEBUG_LOG_COPY_INSTRUCTIONS: - Add ISO signing instructions to recovery shell wall message, telling the user how to mount USB read-write and sign an ISO with gpg --detach-sign Signed-off-by: Thierry Laurion <insurgo@riseup.net>
1 parent 94b7287 commit ffe16ad

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

initrd/etc/DEBUG_LOG_COPY_INSTRUCTIONS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ Welcome to the Recovery Shell!
1111
- 'cp /tmp/debug.log /tmp/measuring_trace.log /media/' # copy both logs
1212
- 'umount /media' # flush writes and safely unmount
1313
- Share both log files with developers.
14+
- To sign an ISO with your GPG key for future USB boot (from recovery shell):
15+
- 'mount-usb.sh --mode rw' # mount USB read-write at /media
16+
- 'gpg --detach-sign --armor /media/ISOs/<iso-file>' # create .asc
17+
- 'umount /media' # flush writes and safely unmount
18+
- Reboot and select the ISO again — signature will be verified

initrd/etc/functions.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ esac
2323
# Red is the universal "error/danger" signal; the "!!! ERROR:" text prefix
2424
# carries the same meaning for users who cannot distinguish red from other
2525
# colors, so color is an enhancement rather than the sole signal.
26-
# debug.log and /dev/kmsg receive plain text (no ANSI).
2726
# Always visible in all output modes.
2827
DIE() {
2928
TRACE_FUNC
@@ -201,8 +200,7 @@ NOTE() {
201200
echo >/dev/console 2>/dev/null
202201
echo -e "\033[3;37mNOTE:\033[0m $*" >/dev/console 2>/dev/null
203202
echo >/dev/console 2>/dev/null
204-
# Log file: plain text - no ANSI codes in debug.log; echo -e so \n in the
205-
# message produces real newlines in the log (multi-line NOTE support).
203+
# Log file: echo -e so \n in the message produces real newlines
206204
echo -e "NOTE: $*" >>/tmp/debug.log
207205

208206
# Sleep to bring the message to the user's awareness: NOTE is infrequent
@@ -249,7 +247,6 @@ NOTE() {
249247
STATUS() {
250248
# Console: bold >> prefix to /dev/console - announces an action in progress.
251249
echo -e "\033[1m >>\033[0m $*" >/dev/console 2>/dev/null
252-
# Log file: plain text - no ANSI codes in debug.log
253250
echo " >> $*" >>/tmp/debug.log
254251
}
255252

@@ -263,7 +260,6 @@ STATUS_OK() {
263260
# 2. Bold green color - instant visual scan for sighted users
264261
# (Same convention as Linux/systemd "[ OK ]" boot messages.)
265262
echo -e "\033[1;32m OK\033[0m $*" >/dev/console 2>/dev/null
266-
# Log file: plain text - no ANSI codes in debug.log
267263
echo " OK $*" >>/tmp/debug.log
268264
}
269265

@@ -308,9 +304,6 @@ INFO() {
308304
echo "INFO: $*" | tee -a /tmp/debug.log /tmp/measuring_trace.log >/dev/null
309305
else
310306
# info mode: green text to /dev/console AND both log files.
311-
# /dev/console = kernel console (follows console= kernel parameter):
312-
# reaches serial, framebuffer, BMC — no process setup needed, callers
313-
# never need to care about redirections.
314307
echo -e "\033[0;32m$*\033[0m" >/dev/console 2>/dev/null
315308
echo "INFO: $*" | tee -a /tmp/debug.log /tmp/measuring_trace.log >/dev/null
316309
fi
@@ -2659,14 +2652,17 @@ scan_boot_options() {
26592652
option_file="$3"
26602653

26612654
if [ -r "$option_file" ]; then rm "$option_file"; fi
2662-
for i in $(find "$bootdir" -name "$config"); do
2655+
find "$bootdir" -name "$config" -print | while IFS= read -r i; do
2656+
case "$i" in
2657+
*EFI* | *efi* | *x86_64-efi*) continue ;;
2658+
esac
26632659
DO_WITH_DEBUG kexec-parse-boot.sh "$bootdir" "$i" >>"$option_file"
26642660
done
26652661
# FC29/30+ may use BLS format grub config files
26662662
# https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault
26672663
# only parse these if $option_file is still empty
26682664
if [ ! -s "$option_file" ] && [ -d "$bootdir/loader/entries" ]; then
2669-
for i in $(find "$bootdir" -name "$config"); do
2665+
find "$bootdir" -name "$config" -print | while IFS= read -r i; do
26702666
kexec-parse-bls.sh "$bootdir" "$i" "$bootdir/loader/entries" >>"$option_file"
26712667
done
26722668
fi

0 commit comments

Comments
 (0)