v0.5.7: skip PNG boot-menu background on legacy BIOS clients

The menu emitted `console --picture … || console`, relying on the
trailing `|| console` to recover on iPXE builds without IMAGE_PNG +
CONSOLE_FRAMEBUFFER. On legacy BIOS (`undionly.kpxe`, no PNG) the
`--picture` attempt misbehaves before the fallback can recover — it
tries to set a framebuffer mode the BIOS console can't honour — so the
boot menu fails to render on BIOS clients.

Fix: gate the command on `iseq ${platform} efi`, so BIOS (`pcbios`)
clients never issue `console --picture` at all and drop straight to the
plain text menu, while UEFI clients still get the graphical background.
This is automatic and per-client — a mixed BIOS+UEFI fleet each gets the
right treatment with no operator toggle. A PNG-less UEFI build (upstream
i386-efi) still falls back gracefully through the same `|| console`.

Menu snapshot updated to match. 254 tests pass, clippy clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
Miles Ward
2026-06-03 19:28:02 -04:00
co-authored by Claude Opus 4.8
parent c0d17fa9ca
commit ac433b30e9
4 changed files with 26 additions and 18 deletions
Generated
+8 -8
View File
@@ -2669,7 +2669,7 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
[[package]] [[package]]
name = "openpxe" name = "openpxe"
version = "0.5.6" version = "0.5.7"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"axum", "axum",
@@ -2691,7 +2691,7 @@ dependencies = [
[[package]] [[package]]
name = "openpxe-core" name = "openpxe-core"
version = "0.5.6" version = "0.5.7"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64", "base64",
@@ -2718,7 +2718,7 @@ dependencies = [
[[package]] [[package]]
name = "openpxe-dhcp-proxy" name = "openpxe-dhcp-proxy"
version = "0.5.6" version = "0.5.7"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@@ -2732,7 +2732,7 @@ dependencies = [
[[package]] [[package]]
name = "openpxe-http-api" name = "openpxe-http-api"
version = "0.5.6" version = "0.5.7"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"axum", "axum",
@@ -2768,7 +2768,7 @@ dependencies = [
[[package]] [[package]]
name = "openpxe-ipxe-assets" name = "openpxe-ipxe-assets"
version = "0.5.6" version = "0.5.7"
dependencies = [ dependencies = [
"openpxe-core", "openpxe-core",
"rust-embed", "rust-embed",
@@ -2778,7 +2778,7 @@ dependencies = [
[[package]] [[package]]
name = "openpxe-iso-store" name = "openpxe-iso-store"
version = "0.5.6" version = "0.5.7"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bcrypt", "bcrypt",
@@ -2807,7 +2807,7 @@ dependencies = [
[[package]] [[package]]
name = "openpxe-tftp" name = "openpxe-tftp"
version = "0.5.6" version = "0.5.7"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@@ -2821,7 +2821,7 @@ dependencies = [
[[package]] [[package]]
name = "openpxe-webui" name = "openpxe-webui"
version = "0.5.6" version = "0.5.7"
[[package]] [[package]]
name = "p256" name = "p256"
+1 -1
View File
@@ -12,7 +12,7 @@ members = [
] ]
[workspace.package] [workspace.package]
version = "0.5.6" version = "0.5.7"
edition = "2021" edition = "2021"
rust-version = "1.95" rust-version = "1.95"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
+16 -8
View File
@@ -61,16 +61,24 @@ pub fn render_menu(isos: &[IsoMeta], settings: &Settings, base_url: &str) -> Str
// returns a full-screen 1024×768 PNG now — the operator's logo on a // returns a full-screen 1024×768 PNG now — the operator's logo on a
// dark field, or a default OpenPXE mark when none is uploaded. The // dark field, or a default OpenPXE mark when none is uploaded. The
// `--top 290` reserves the top band (where the logo paints) so the // `--top 290` reserves the top band (where the logo paints) so the
// menu text lands below it. On an iPXE build *with* `IMAGE_PNG` + // menu text lands below it.
// `CONSOLE_FRAMEBUFFER` (our x86_64 UEFI binaries, built from source //
// — see deploy/docker/Dockerfile) this paints the background and // v0.5.7: gate the whole command behind `iseq ${platform} efi`.
// overlays the menu. On a build *without* PNG support (the fetched // `console --picture` needs IMAGE_PNG + CONSOLE_FRAMEBUFFER, which
// BIOS/i386/arm64 binaries) the whole `console --picture …` command // only our from-source UEFI binaries carry (x86_64/arm64 UEFI — see
// fails and the `|| console` resets to a clean full-screen text // deploy/docker/Dockerfile). The fetched BIOS `undionly.kpxe` has
// menu. Either way there's no ASCII placeholder anymore. // neither, and on legacy BIOS the `--picture` attempt misbehaves
// *before* the trailing `|| console` fallback can recover (it tries
// to set a framebuffer mode the BIOS console can't honour). Guarding
// on platform means BIOS clients never issue the command at all —
// they drop straight to the plain text menu — while UEFI clients
// still get the graphical background. A PNG-less UEFI build (e.g. the
// upstream i386-efi baseline) still falls back gracefully through the
// same `|| console`. No operator toggle needed; mixed BIOS+UEFI
// fleets each get the right treatment automatically.
let _ = writeln!( let _ = writeln!(
s, s,
"console --picture {base}/branding/pxe-logo --top 290 || console" "iseq ${{platform}} efi && console --picture {base}/branding/pxe-logo --top 290 || console"
); );
// Map iPXE's ${{buildarch}} + ${{platform}} into the human form the // Map iPXE's ${{buildarch}} + ${{platform}} into the human form the
// user asked for (e.g. "x86 BIOS", "x86_64 UEFI", "arm64 UEFI"). // user asked for (e.g. "x86 BIOS", "x86_64 UEFI", "arm64 UEFI").
@@ -7,7 +7,7 @@ expression: rendered
set base-url http://10.0.0.5 set base-url http://10.0.0.5
set esc:hex 1b set esc:hex 1b
set cls ${esc:string}[2J set cls ${esc:string}[2J
console --picture http://10.0.0.5/branding/pxe-logo --top 290 || console iseq ${platform} efi && console --picture http://10.0.0.5/branding/pxe-logo --top 290 || console
set arch-label ${buildarch} ${platform} set arch-label ${buildarch} ${platform}
iseq ${buildarch} i386 && iseq ${platform} pcbios && set arch-label x86 BIOS || iseq ${buildarch} x86_64 && iseq ${platform} efi && set arch-label x86_64 UEFI || iseq ${buildarch} arm64 && iseq ${platform} efi && set arch-label arm64 UEFI || true iseq ${buildarch} i386 && iseq ${platform} pcbios && set arch-label x86 BIOS || iseq ${buildarch} x86_64 && iseq ${platform} efi && set arch-label x86_64 UEFI || iseq ${buildarch} arm64 && iseq ${platform} efi && set arch-label arm64 UEFI || true
:menu :menu