Skip to content

Commit 220628d

Browse files
committed
initrd/bin/kexec-select-boot.sh: combine fs+display markers, update legend
boot_marker() now reads both kexec_initrd_compat.txt (USB filesystem) and kexec_fb_compat.txt (DRM/KMS display driver) and returns combined: [OK] = both pass [!] = either fails (blank) = unable to verify build_legend() also checks fb compat file for [!] entries. Legend: [OK]=ready (USB+display) [!]=may fail (blank)=unable to check
1 parent a31b20b commit 220628d

2 files changed

Lines changed: 33 additions & 28 deletions

File tree

doc/ux-patterns.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -452,21 +452,15 @@ menu to indicate whether the initramfs supports the USB filesystem:
452452
| Marker | Color | Meaning |
453453
|---|---|---|
454454
| `[OK]` | Green | Ready — USB filesystem and display driver both confirmed present |
455-
| `[!]` | Yellow | May fail — missing USB filesystem module or framebuffer driver |
456-
| (blank) | Default | Could not check — initrd has no loadable modules to inspect |
455+
| `[!]` | Yellow | May fail — missing USB filesystem module or display driver |
456+
| (blank) | Default | Unable to check — initrd has no loadable modules to inspect |
457457

458458
A legend explaining these markers is shown once per session via NOTE.
459-
When all entries are ready, the legend is short. When any entry has
460-
a `[!]` marker, the full legend explains both `[OK]` and `[!]`:
459+
When all entries pass both checks, the legend shows the short form.
460+
When any entry has a `[!]` marker, the full legend includes the warning:
461461

462-
Legend (all ready):
463462
```
464-
[OK]=ready (blank)=could not check
465-
```
466-
467-
Legend (issues found):
468-
```
469-
[OK]=ready [!]=may fail after kexec (blank)=could not check
463+
[OK]=ready (USB+display) [!]=may fail (blank)=unable to check
470464
```
471465
NOTE: [OK]=ready (USB+display) [!]=may fail after kexec (blank)=could not check
472466

initrd/bin/kexec-select-boot.sh

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,13 @@ build_legend() {
137137
local has_issues="n"
138138
if [ -r "/tmp/kexec_initrd_compat.txt" ] && grep -qF '[!]' /tmp/kexec_initrd_compat.txt 2>/dev/null; then
139139
has_issues="y"
140+
elif [ -r "/tmp/kexec_fb_compat.txt" ] && grep -qF '[!]' /tmp/kexec_fb_compat.txt 2>/dev/null; then
141+
has_issues="y"
140142
fi
141143
if [ "$has_issues" = "y" ]; then
142-
printf '\033[0;32m[OK]\033[0m=ready \033[1;33m[!]\033[0m=may fail after kexec (blank)=could not check'
144+
printf '\033[0;32m[OK]\033[0m=ready (USB+display) \033[1;33m[!]\033[0m=may fail (blank)=unable to check'
143145
else
144-
printf '\033[0;32m[OK]\033[0m=ready (blank)=could not check'
146+
printf '\033[0;32m[OK]\033[0m=ready (USB+display) (blank)=unable to check'
145147
fi
146148
}
147149

@@ -293,30 +295,39 @@ parse_option() {
293295
LOG "parse_option: name='$name' kernel='$kernel' initrd='$initrd' params='${params:0:80}...'"
294296
}
295297

296-
# Return the initrd compat marker for the current entry's initrd.
297-
# Reads /tmp/kexec_initrd_compat.txt (written by Layer 1) for USB
298-
# filesystem support. Framebuffer support is handled as a separate
299-
# warning before the menu — efifb/bochs are often built into the
300-
# kernel image and can't be reliably detected from the initrd alone.
298+
# Return the combined compat marker for the current entry's initrd.
299+
# Reads two Layer 1 compat files:
300+
# /tmp/kexec_initrd_compat.txt — USB filesystem support
301+
# /tmp/kexec_fb_compat.txt — DRM/KMS display driver (i915, etc.)
301302
#
302-
# Compat file format:
303-
# initrd/relative/path [OK]
304-
# other/initrd/path [!]
305-
# (absent entries = zero modules, can't verify)
303+
# Combined result:
304+
# [OK] — BOTH filesystem AND display driver confirmed present
305+
# [!] — EITHER filesystem or display driver confirmed missing
306+
# (blank) — cannot verify (no modules in initrd)
306307
#
307-
# Three states:
308-
# [OK] — USB filesystem module confirmed
309-
# [!] — initrd has modules but not the USB filesystem one
310-
# (blank) — zero modules, can't verify (likely built into kernel)
308+
# When the fb compat file has no entry for this initrd (no modules),
309+
# the fs marker is returned alone.
311310
#
312311
# In CLI mode adds ANSI colors: green [OK], yellow [!].
313312
boot_marker() {
314-
local m="" grn="" ylw="" rst=""
313+
local m="" fb="" grn="" ylw="" rst=""
315314
[ "$gui_menu" != "y" ] && { grn=$'\033[0;32m'; ylw=$'\033[1;33m'; rst=$'\033[0m'; }
316315
if [ -n "$initrd" ] && [ -r "/tmp/kexec_initrd_compat.txt" ]; then
317316
local ip=$(echo "$initrd" | sed 's|^/*||')
318317
m=$(grep "^$ip " /tmp/kexec_initrd_compat.txt 2>/dev/null | head -1 | cut -d' ' -f2)
319-
[ -n "$m" ] && LOG "boot_marker: initrd=$ip marker=$m" || LOG "boot_marker: initrd=$ip no compat entry"
318+
[ -n "$m" ] && LOG "boot_marker: initrd=$ip fs=$m" || LOG "boot_marker: initrd=$ip no fs entry"
319+
if [ -r "/tmp/kexec_fb_compat.txt" ]; then
320+
fb=$(grep "^$ip " /tmp/kexec_fb_compat.txt 2>/dev/null | head -1 | cut -d' ' -f2)
321+
[ -n "$fb" ] && LOG "boot_marker: initrd=$ip fb=$fb" || LOG "boot_marker: initrd=$ip no fb entry"
322+
# Combine both
323+
if [ "$m" = "[OK]" ] && [ "$fb" = "[OK]" ]; then
324+
: # both OK
325+
elif [ "$m" = "[!]" ] || [ "$fb" = "[!]" ]; then
326+
m="[!]" # either missing
327+
else
328+
m="" # can't verify
329+
fi
330+
fi
320331
[ "$m" = "[OK]" ] && m="${grn}[OK]${rst}"
321332
[ "$m" = "[!]" ] && m="${ylw}[!]${rst}"
322333
fi

0 commit comments

Comments
 (0)