bastion: serve full-driver iPXE for UEFI x86_64, replace stale PV binaries
Some checks failed
CI/CD / lint (push) Successful in 1m15s
CI/CD / typecheck (push) Successful in 1m18s
CI/CD / test (push) Successful in 2m20s
CI/CD / build (push) Successful in 2m31s
CI/CD / publish-rpm (push) Failing after 28s
CI/CD / publish-deb (push) Successful in 26s
Some checks failed
CI/CD / lint (push) Successful in 1m15s
CI/CD / typecheck (push) Successful in 1m18s
CI/CD / test (push) Successful in 2m20s
CI/CD / build (push) Successful in 2m31s
CI/CD / publish-rpm (push) Failing after 28s
CI/CD / publish-deb (push) Successful in 26s
snponly.efi rides the firmware's NII/UNDI stack, and on some NICs that stack cannot receive unicast frames: DHCP (broadcast) succeeds, then every ARP reply is lost and the boot.ipxe HTTP fetch times out. Observed on thebeast's onboard NIC 2026-10-19 -- tcpdump on labmaster showed it answering every ARP request within microseconds while iPXE re-asked for ten seconds and gave up. The full build probes native NIC drivers first and falls back to snp/nii, so hardware that worked before is unaffected. The data dir is a persistent volume, so copy-if-missing would have kept serving the old snponly binary forever; image-shipped binaries now replace on content change (copyIfChanged). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DceLLgGmyS7zTGLaLNjQBd
This commit is contained in:
@@ -35,7 +35,7 @@ FROM --platform=$BUILDPLATFORM fedora:43 AS ipxe-builder
|
|||||||
|
|
||||||
RUN dnf install -y git gcc make perl-interpreter xz-devel gcc-aarch64-linux-gnu && dnf clean all
|
RUN dnf install -y git gcc make perl-interpreter xz-devel gcc-aarch64-linux-gnu && dnf clean all
|
||||||
RUN git clone --depth=1 https://github.com/ipxe/ipxe.git /tmp/ipxe
|
RUN git clone --depth=1 https://github.com/ipxe/ipxe.git /tmp/ipxe
|
||||||
RUN cd /tmp/ipxe/src && make bin-x86_64-efi/snp.efi && \
|
RUN cd /tmp/ipxe/src && make bin-x86_64-efi/snp.efi bin-x86_64-efi/ipxe.efi && \
|
||||||
make CROSS_COMPILE=aarch64-linux-gnu- bin-arm64-efi/snp.efi
|
make CROSS_COMPILE=aarch64-linux-gnu- bin-arm64-efi/snp.efi
|
||||||
|
|
||||||
# ── Stage 2: Production runtime (Fedora -- needs dnsmasq) ───────
|
# ── Stage 2: Production runtime (Fedora -- needs dnsmasq) ───────
|
||||||
@@ -58,6 +58,15 @@ RUN dnf install -y \
|
|||||||
# boot from CD-ROM/USB -- it requires PXE chainloading)
|
# boot from CD-ROM/USB -- it requires PXE chainloading)
|
||||||
COPY --from=ipxe-builder /tmp/ipxe/src/bin-x86_64-efi/snp.efi /usr/share/ipxe/ipxe-snp-x86_64.efi
|
COPY --from=ipxe-builder /tmp/ipxe/src/bin-x86_64-efi/snp.efi /usr/share/ipxe/ipxe-snp-x86_64.efi
|
||||||
COPY --from=ipxe-builder /tmp/ipxe/src/bin-arm64-efi/snp.efi /usr/share/ipxe/arm64-efi/ipxe-snp.efi
|
COPY --from=ipxe-builder /tmp/ipxe/src/bin-arm64-efi/snp.efi /usr/share/ipxe/arm64-efi/ipxe-snp.efi
|
||||||
|
# Full iPXE build (native NIC drivers + snp + nii fallback), served as the
|
||||||
|
# default UEFI x86_64 PXE binary. snponly rides the firmware's NII/UNDI stack,
|
||||||
|
# and on some NICs that stack cannot RECEIVE UNICAST frames: DHCP (broadcast)
|
||||||
|
# works, then every ARP reply is lost and HTTP times out. Observed on
|
||||||
|
# thebeast's onboard NIC 2026-10-19 (tcpdump: labmaster answered every ARP
|
||||||
|
# request within microseconds, iPXE kept re-asking). A native driver bypasses
|
||||||
|
# the firmware stack entirely; NICs without one still fall back to snp/nii,
|
||||||
|
# so machines that worked before are unaffected.
|
||||||
|
COPY --from=ipxe-builder /tmp/ipxe/src/bin-x86_64-efi/ipxe.efi /usr/share/ipxe/ipxe-full-x86_64.efi
|
||||||
|
|
||||||
# Install pnpm
|
# Install pnpm
|
||||||
RUN npm install -g pnpm@9
|
RUN npm install -g pnpm@9
|
||||||
|
|||||||
@@ -16,16 +16,19 @@ import { BastionConnection } from "./services/labd-connection.js";
|
|||||||
import { progressBus } from "./services/progress-events.js";
|
import { progressBus } from "./services/progress-events.js";
|
||||||
import { ensureBootIso } from "./routes/boot-iso.js";
|
import { ensureBootIso } from "./routes/boot-iso.js";
|
||||||
|
|
||||||
function copyIfMissing(src: string, dest: string, label: string): void {
|
// For binaries that ship WITH the image: the data dir is a persistent volume,
|
||||||
if (existsSync(dest)) {
|
// so a copy-if-missing would keep serving whatever build landed there first,
|
||||||
logger.info(` ${label} -- cached`);
|
// forever, across image upgrades. Compare content and replace on change.
|
||||||
return;
|
function copyIfChanged(src: string, dest: string, label: string): void {
|
||||||
}
|
|
||||||
if (!existsSync(src)) {
|
if (!existsSync(src)) {
|
||||||
throw new Error(`${label}: source not found at ${src}`);
|
throw new Error(`${label}: source not found at ${src}`);
|
||||||
}
|
}
|
||||||
|
if (existsSync(dest) && readFileSync(dest).equals(readFileSync(src))) {
|
||||||
|
logger.info(` ${label} -- up to date`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
copyFileSync(src, dest);
|
copyFileSync(src, dest);
|
||||||
logger.info(` ${label} -- copied from ${src}`);
|
logger.info(` ${label} -- installed from ${src}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function download(url: string, dest: string, label: string): void {
|
function download(url: string, dest: string, label: string): void {
|
||||||
@@ -254,18 +257,21 @@ export async function startBastion(overrides: Partial<BastionConfig> = {}): Prom
|
|||||||
if (config.skipArtifacts !== true) {
|
if (config.skipArtifacts !== true) {
|
||||||
logger.info(`Preparing boot artifacts (Fedora ${config.fedoraVersion} ${config.arch})...`);
|
logger.info(`Preparing boot artifacts (Fedora ${config.fedoraVersion} ${config.arch})...`);
|
||||||
|
|
||||||
copyIfMissing(
|
copyIfChanged(
|
||||||
"/usr/share/ipxe/undionly.kpxe",
|
"/usr/share/ipxe/undionly.kpxe",
|
||||||
`${config.tftpDir}/undionly.kpxe`,
|
`${config.tftpDir}/undionly.kpxe`,
|
||||||
"iPXE BIOS",
|
"iPXE BIOS",
|
||||||
);
|
);
|
||||||
copyIfMissing(
|
// Full build (native drivers + snp/nii fallback), NOT snponly: the
|
||||||
"/usr/share/ipxe/ipxe-snponly-x86_64.efi",
|
// firmware NII stack snponly rides cannot receive unicast on some NICs
|
||||||
|
// (thebeast 2026-10-19: DHCP fine, every ARP reply lost, HTTP timeout).
|
||||||
|
copyIfChanged(
|
||||||
|
"/usr/share/ipxe/ipxe-full-x86_64.efi",
|
||||||
`${config.tftpDir}/ipxe.efi`,
|
`${config.tftpDir}/ipxe.efi`,
|
||||||
"iPXE UEFI x86_64",
|
"iPXE UEFI x86_64",
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
copyIfMissing(
|
copyIfChanged(
|
||||||
"/usr/share/ipxe/arm64-efi/snponly.efi",
|
"/usr/share/ipxe/arm64-efi/snponly.efi",
|
||||||
`${config.tftpDir}/ipxe-arm64.efi`,
|
`${config.tftpDir}/ipxe-arm64.efi`,
|
||||||
"iPXE UEFI arm64",
|
"iPXE UEFI arm64",
|
||||||
|
|||||||
Reference in New Issue
Block a user