use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct BootEntry { /// Stable id (also the URL slug in generated iPXE scripts). pub id: String, /// Display label shown in the iPXE boot menu. pub title: String, pub kind: BootKind, } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(tag = "kind", rename_all = "snake_case")] pub enum BootKind { /// Linux kernel + initrd chainload. Kernel args carry the distro-specific /// pointer back to the ISO contents served over HTTP. LinuxKernel { kernel_url: String, initrd_urls: Vec, args: KernelArgs, }, /// Windows WinPE boot via wimboot shim. `files` maps in-memory tags to /// HTTP URLs the client fetches. See https://ipxe.org/wimboot . Wimboot { wimboot_url: String, files: Vec<(String, String)>, }, /// SAN-boot the raw ISO as an emulated CD (iPXE `sanboot`). The emulated /// CD is backed by on-demand HTTP range reads, so ISO size is *not* a /// constraint — this is the primary path for Windows (v0.5.8) and for any /// El Torito-bootable image we don't special-case: ESXi/VMvisor /// installers, BSDs, firmware/diagnostic tools, custom spins (v0.6.0). SanBootIso { iso_url: String }, } #[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct KernelArgs { /// Raw kernel command line, already distro-adapted. Do not quote — iPXE /// takes a single space-separated command line. pub cmdline: String, }