diff --git a/Cargo.lock b/Cargo.lock index d45fbce..2179eac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2669,7 +2669,7 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openpxe" -version = "0.5.6" +version = "0.5.7" dependencies = [ "anyhow", "axum", @@ -2691,7 +2691,7 @@ dependencies = [ [[package]] name = "openpxe-core" -version = "0.5.6" +version = "0.5.7" dependencies = [ "anyhow", "base64", @@ -2718,7 +2718,7 @@ dependencies = [ [[package]] name = "openpxe-dhcp-proxy" -version = "0.5.6" +version = "0.5.7" dependencies = [ "anyhow", "bytes", @@ -2732,7 +2732,7 @@ dependencies = [ [[package]] name = "openpxe-http-api" -version = "0.5.6" +version = "0.5.7" dependencies = [ "anyhow", "axum", @@ -2768,7 +2768,7 @@ dependencies = [ [[package]] name = "openpxe-ipxe-assets" -version = "0.5.6" +version = "0.5.7" dependencies = [ "openpxe-core", "rust-embed", @@ -2778,7 +2778,7 @@ dependencies = [ [[package]] name = "openpxe-iso-store" -version = "0.5.6" +version = "0.5.7" dependencies = [ "anyhow", "bcrypt", @@ -2807,7 +2807,7 @@ dependencies = [ [[package]] name = "openpxe-tftp" -version = "0.5.6" +version = "0.5.7" dependencies = [ "anyhow", "bytes", @@ -2821,7 +2821,7 @@ dependencies = [ [[package]] name = "openpxe-webui" -version = "0.5.6" +version = "0.5.7" [[package]] name = "p256" diff --git a/Cargo.toml b/Cargo.toml index c9a34e4..9104191 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ members = [ ] [workspace.package] -version = "0.5.6" +version = "0.5.7" edition = "2021" rust-version = "1.95" license = "MIT OR Apache-2.0" diff --git a/crates/http-api/src/ipxe_script.rs b/crates/http-api/src/ipxe_script.rs index 865d086..0927ac2 100644 --- a/crates/http-api/src/ipxe_script.rs +++ b/crates/http-api/src/ipxe_script.rs @@ -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 // dark field, or a default OpenPXE mark when none is uploaded. 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` + - // `CONSOLE_FRAMEBUFFER` (our x86_64 UEFI binaries, built from source - // — see deploy/docker/Dockerfile) this paints the background and - // overlays the menu. On a build *without* PNG support (the fetched - // BIOS/i386/arm64 binaries) the whole `console --picture …` command - // fails and the `|| console` resets to a clean full-screen text - // menu. Either way there's no ASCII placeholder anymore. + // menu text lands below it. + // + // v0.5.7: gate the whole command behind `iseq ${platform} efi`. + // `console --picture` needs IMAGE_PNG + CONSOLE_FRAMEBUFFER, which + // only our from-source UEFI binaries carry (x86_64/arm64 UEFI — see + // deploy/docker/Dockerfile). The fetched BIOS `undionly.kpxe` has + // 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!( 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 // user asked for (e.g. "x86 BIOS", "x86_64 UEFI", "arm64 UEFI"). diff --git a/crates/http-api/src/snapshots/openpxe_http_api__ipxe_script__password_tests__render_menu_snapshot.snap b/crates/http-api/src/snapshots/openpxe_http_api__ipxe_script__password_tests__render_menu_snapshot.snap index ad9d05b..37f9371 100644 --- a/crates/http-api/src/snapshots/openpxe_http_api__ipxe_script__password_tests__render_menu_snapshot.snap +++ b/crates/http-api/src/snapshots/openpxe_http_api__ipxe_script__password_tests__render_menu_snapshot.snap @@ -7,7 +7,7 @@ expression: rendered set base-url http://10.0.0.5 set esc:hex 1b 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} 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