Name update
This commit is contained in:
@@ -8,12 +8,12 @@
|
||||
//! > Boot from Local HDD
|
||||
//! Installers
|
||||
//! > Linux Installers -> submenu of Linux ISOs
|
||||
//! > Windows Installers -> submenu of Windows ISOs (gated by Settings::windows_enabled)
|
||||
//! > Windows Installers -> submenu of Windows ISOs (controlled by Settings::windows_enabled)
|
||||
//! Tools
|
||||
//! > Utilities -> memtest, etc. (embedded assets only)
|
||||
//! > PXEForge Shell -> drop to iPXE shell with branded prompt
|
||||
//! > OpenPXE Shell -> drop to iPXE shell with branded prompt
|
||||
//! > Network Card Info -> ifstat / config / route dump
|
||||
//! Gated Deployment -> join the gate queue
|
||||
//! Queued Deployment -> join the deployment queue
|
||||
//! ```
|
||||
//!
|
||||
//! ## iPXE is entirely backend — users do not see or write iPXE
|
||||
@@ -22,12 +22,12 @@
|
||||
//! those knobs into iPXE primitives (chain, menu, item, choose, etc.).
|
||||
//! There is intentionally no UI path to upload a custom `.ipxe` script.
|
||||
|
||||
use pxeforge_core::{Settings, TimeoutAction};
|
||||
use pxeforge_iso_store::{BootEntry, BootKind, IsoMeta};
|
||||
use pxeforge_iso_store::introspect::DistroFamily;
|
||||
use openpxe_core::{Settings, TimeoutAction};
|
||||
use openpxe_iso_store::{BootEntry, BootKind, IsoMeta};
|
||||
use openpxe_iso_store::introspect::DistroFamily;
|
||||
use std::fmt::Write as _;
|
||||
|
||||
/// Top-level PXEForge boot menu. Serialized identically for BIOS and UEFI
|
||||
/// Top-level OpenPXE boot menu. Serialized identically for BIOS and UEFI
|
||||
/// clients because iPXE normalises the menu primitives across firmwares.
|
||||
#[must_use]
|
||||
pub fn render_menu(isos: &[IsoMeta], settings: &Settings, base_url: &str) -> String {
|
||||
@@ -35,7 +35,7 @@ pub fn render_menu(isos: &[IsoMeta], settings: &Settings, base_url: &str) -> Str
|
||||
let base = base_url.trim_end_matches('/');
|
||||
let timeout_ms = settings.boot_menu_timeout_secs.saturating_mul(1000);
|
||||
let default_item = match settings.timeout_action {
|
||||
TimeoutAction::GatedDeployment => "gate",
|
||||
TimeoutAction::QueuedDeployment => "queue",
|
||||
// Stay -> iPXE's `--timeout 0` is "no timeout". Pick any default
|
||||
// label; the client waits for keypress. We use the same label as
|
||||
// LocalHdd to keep the menu's pre-highlight stable.
|
||||
@@ -43,12 +43,12 @@ pub fn render_menu(isos: &[IsoMeta], settings: &Settings, base_url: &str) -> Str
|
||||
};
|
||||
|
||||
let _ = writeln!(s, "#!ipxe");
|
||||
let _ = writeln!(s, "# PXEForge top-level menu - auto-generated, do not edit");
|
||||
let _ = writeln!(s, "# OpenPXE top-level menu - auto-generated, do not edit");
|
||||
let _ = writeln!(s, "set base-url {base}");
|
||||
let _ = writeln!(s, "set esc:hex 1b");
|
||||
let _ = writeln!(s, "set cls ${{esc:string}}[2J");
|
||||
let _ = writeln!(s, ":menu");
|
||||
let _ = writeln!(s, "menu PXEForge - network boot menu");
|
||||
let _ = writeln!(s, "menu OpenPXE - network boot menu");
|
||||
let _ = writeln!(s, "item --gap -- ------------------------- Default -------------------------");
|
||||
let _ = writeln!(s, "item local Boot from Local HDD");
|
||||
let _ = writeln!(s, "item --gap -- ----------------------- Installers -----------------------");
|
||||
@@ -66,8 +66,8 @@ pub fn render_menu(isos: &[IsoMeta], settings: &Settings, base_url: &str) -> Str
|
||||
}
|
||||
let _ = writeln!(s, "item --gap -- -------------------------- Tools --------------------------");
|
||||
let _ = writeln!(s, "item tools Tools >");
|
||||
let _ = writeln!(s, "item --gap -- ---------------------- Gated Deployment ---------------------");
|
||||
let _ = writeln!(s, "item gate Gated Deployment (join queue)");
|
||||
let _ = writeln!(s, "item --gap -- ---------------------- Queued Deployment ---------------------");
|
||||
let _ = writeln!(s, "item queue Queued Deployment (join queue)");
|
||||
let _ = writeln!(s, "item --gap");
|
||||
let _ = writeln!(s, "item --key x exit Exit iPXE");
|
||||
|
||||
@@ -84,7 +84,7 @@ pub fn render_menu(isos: &[IsoMeta], settings: &Settings, base_url: &str) -> Str
|
||||
let _ = writeln!(s, "iseq ${{target}} linux && chain {base}/boot/_linux_menu.ipxe || goto menu");
|
||||
let _ = writeln!(s, "iseq ${{target}} windows && chain {base}/boot/_windows_menu.ipxe || goto menu");
|
||||
let _ = writeln!(s, "iseq ${{target}} tools && chain {base}/boot/_tools_menu.ipxe || goto menu");
|
||||
let _ = writeln!(s, "iseq ${{target}} gate && chain {base}/boot/_gate.ipxe || goto menu");
|
||||
let _ = writeln!(s, "iseq ${{target}} queue && chain {base}/boot/_queue.ipxe || goto menu");
|
||||
let _ = writeln!(s, "iseq ${{target}} exit && exit || goto menu");
|
||||
let _ = writeln!(s, "goto menu");
|
||||
s
|
||||
@@ -101,7 +101,7 @@ pub fn render_family_menu(isos: &[IsoMeta], base_url: &str, is_windows: bool) ->
|
||||
let _ = writeln!(s, "#!ipxe");
|
||||
let _ = writeln!(s, "set base-url {base}");
|
||||
let _ = writeln!(s, ":menu");
|
||||
let _ = writeln!(s, "menu PXEForge - {title}");
|
||||
let _ = writeln!(s, "menu OpenPXE - {title}");
|
||||
let filter: fn(DistroFamily) -> bool =
|
||||
if is_windows { is_windows_family } else { is_linux_family };
|
||||
let mut count = 0;
|
||||
@@ -156,9 +156,9 @@ pub fn render_tools_menu(base_url: &str) -> String {
|
||||
let _ = writeln!(s, "#!ipxe");
|
||||
let _ = writeln!(s, "set base-url {base}");
|
||||
let _ = writeln!(s, ":menu");
|
||||
let _ = writeln!(s, "menu PXEForge - Tools");
|
||||
let _ = writeln!(s, "menu OpenPXE - Tools");
|
||||
let _ = writeln!(s, "item --key u util Utilities (memtest, ...)");
|
||||
let _ = writeln!(s, "item --key s shell PXEForge Shell");
|
||||
let _ = writeln!(s, "item --key s shell OpenPXE Shell");
|
||||
let _ = writeln!(s, "item --key n nic Network Card Info");
|
||||
let _ = writeln!(s, "item --gap");
|
||||
let _ = writeln!(s, "item --key r reboot Reboot Computer");
|
||||
@@ -202,7 +202,7 @@ pub fn render_util(base_url: &str) -> String {
|
||||
let mut s = String::new();
|
||||
let _ = writeln!(s, "#!ipxe");
|
||||
let _ = writeln!(s, ":menu");
|
||||
let _ = writeln!(s, "menu PXEForge - Utilities");
|
||||
let _ = writeln!(s, "menu OpenPXE - Utilities");
|
||||
let _ = writeln!(s, "item memtest MemTest86+ (RAM diagnostic)");
|
||||
let _ = writeln!(s, "item --gap");
|
||||
let _ = writeln!(s, "item back < Back");
|
||||
@@ -213,14 +213,14 @@ pub fn render_util(base_url: &str) -> String {
|
||||
s
|
||||
}
|
||||
|
||||
/// "PXEForge Shell" — iPXE shell, branded.
|
||||
/// "OpenPXE Shell" — iPXE shell, branded.
|
||||
#[must_use]
|
||||
pub fn render_shell(base_url: &str) -> String {
|
||||
let base = base_url.trim_end_matches('/');
|
||||
let mut s = String::new();
|
||||
let _ = writeln!(s, "#!ipxe");
|
||||
let _ = writeln!(s, "echo ==========================================");
|
||||
let _ = writeln!(s, "echo PXEForge Shell");
|
||||
let _ = writeln!(s, "echo OpenPXE Shell");
|
||||
let _ = writeln!(s, "echo 'exit' returns to the main menu");
|
||||
let _ = writeln!(s, "echo ==========================================");
|
||||
let _ = writeln!(s, "shell");
|
||||
@@ -247,20 +247,20 @@ pub fn render_nic_info(base_url: &str) -> String {
|
||||
s
|
||||
}
|
||||
|
||||
/// Gated Deployment entry point. Joins the queue, then enters a long-poll
|
||||
/// Queued Deployment entry point. Joins the queue, then enters a long-poll
|
||||
/// loop (iPXE repeats the chain on 3xx redirects / HTTP errors until a
|
||||
/// real script comes back).
|
||||
#[must_use]
|
||||
pub fn render_gate_entry(base_url: &str) -> String {
|
||||
pub fn render_queue_entry(base_url: &str) -> String {
|
||||
let base = base_url.trim_end_matches('/');
|
||||
let mut s = String::new();
|
||||
let _ = writeln!(s, "#!ipxe");
|
||||
let _ = writeln!(s, "# Gated Deployment - join the queue and wait for operator");
|
||||
let _ = writeln!(s, "echo Joining gate queue...");
|
||||
let _ = writeln!(s, "# Queued Deployment - join the queue and wait for operator");
|
||||
let _ = writeln!(s, "echo Joining deployment queue...");
|
||||
// imgfetch writes the body to a file in iPXE's transient FS; we read
|
||||
// the gate id out of the Location-style header by asking the server
|
||||
// the queue entry id out of the Location-style header by asking the server
|
||||
// to put it in the response body as a single token.
|
||||
let _ = writeln!(s, "chain --replace {base}/api/gate/join?mac=${{mac}}");
|
||||
let _ = writeln!(s, "chain --replace {base}/api/queue/join?mac=${{mac}}");
|
||||
s
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user