Add Azure Linux 4.0 PXE boot support for LiveOS images#826
Open
vinceaperri wants to merge 2 commits into
Open
Conversation
9a9cc4e to
6f4390e
Compare
cwize1
requested changes
Jul 6, 2026
Add PXE (network) boot support for Azure Linux 4.0 LiveOS images. Azure Linux 4.0 boots via BLS (Boot Loader Specification) entries under boot/loader/entries, which grub cannot enumerate over TFTP, so a PXE-booted AZL4 image reached an empty grub menu. This expands the BLS Type #1 entries into explicit grub menuentry blocks when the PXE artifacts are built, so netboot works without grub reading the entries directory over TFTP. It is wired per distro through a new DistroHandler.UpdateLiveOSGrubCfgForPxe hook plus a shared BLS renderer, so other BLS distros benefit too. Tests (in support of the above): test_pxe.py adds bootstrap and full-OS PXE boot tests for AZL3 and AZL4 over a transient libvirt NAT network (dnsmasq DHCP and TFTP) plus an HTTP server over the extracted artifacts (pxe_server.py). They are skipped on Azure Linux hosts, whose edk2-ovmf lacks the UEFI network stack (EDK II NetworkPkg) and cannot netboot a VM, and run on Ubuntu hosts.
- Run the PXE HTTP server via multiprocessing.Process instead of a python -m http.server subprocess. - Extract PXE artifacts into a world-traversable /var/tmp directory and drop the chmod of ancestor directories.
6f4390e to
629c170
Compare
cwize1
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A PXE-booted Azure Linux 4.0 image stopped at an empty grub menu, because AZL4 uses BLS (Boot Loader Specification) boot entries that grub cannot enumerate over TFTP. This change expands those BLS Type #1 entries into explicit grub
menuentryblocks when the PXE artifacts are built, so netboot works without grub readingboot/loader/entriesover TFTP. It is wired per distro through a newDistroHandler.UpdateLiveOSGrubCfgForPxehook plus a shared BLS renderer, so other BLS distros benefit too.Tests (in support of the above) —
test_pxe.pyadds bootstrap and full-OS PXE boot tests for AZL3 and AZL4 over a transient libvirt NAT network (dnsmasq DHCP and TFTP) plus an HTTP server over the extracted artifacts (pxe_server.py). They are skipped on Azure Linux hosts, whoseedk2-ovmflacks the UEFI network stack (EDK II NetworkPkg) and cannot netboot a VM, and run on Ubuntu hosts.