engineering: Generic EFI vendor-dir discovery and AZL4 ESP support#672
Draft
Britel wants to merge 9 commits into
Draft
engineering: Generic EFI vendor-dir discovery and AZL4 ESP support#672Britel wants to merge 9 commits into
Britel wants to merge 9 commits into
Conversation
Adds is_azl4_or_later() helper, generic EFI vendor-dir discovery via grub-probe, and AZL4 ESP partition layout support. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove redundant ensure!(grub_noprefix) check from ESP setup. generate_boot_filepaths() already finds a working GRUB binary (noprefix, standard, or vendor-dir). The separate policy check was redundant. - Simplify copy_boot_files to return () instead of bool - Attribute grub search format variants to distro conventions (AZL3/Mariner vs AZL4/Fedora), not MIC internals - Update mixed-forms test comment to reference cross-version A/B update scenario Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
No callers remain after the noprefix check removal. Can be re-added if a future change needs version-range gating. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AZL3 ships two GRUB variants: grub2-efi-binary (prefix-relative config lookup) and grub2-efi-binary-noprefix (root-device-relative lookup). Trident's A/B update path requires the noprefix variant on AZL3. Restore the noprefix check, but scope it to AZL3 only using image_distro().is_azl3(). AZL4+ uses standard grubx64.efi in vendor directories and does not need noprefix. This replaces the previous generic ensure! + DISABLE_GRUB_NOPREFIX_CHECK flag with a targeted distro check. No escape hatch needed since the check only fires for AZL3. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the original variable name and preserve the operator escape hatch. Minimize diff from upstream. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the same macro as upstream to minimize diff. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the original if/else if chain with replace (first match). No real-world grub config has multiple search lines. Minimizes diff from upstream. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Adds AZL4 ESP partition layout support to Trident. AZL4 (Fedora-based) places GRUB binaries in vendor directories (
EFI/fedora/,EFI/azurelinux/) instead of the AZL3EFI/BOOT/grubx64-noprefix.eficonvention. This PR makes the ESP setup code distro-agnostic.Part 2 of the AZL4 enablement stack. Depends on PR #642 (AZL4 distro detection + GRUB update path).
Changes
Generic EFI vendor-dir discovery (
esp.rs)find_efi_binary_in_vendor_dirs()— searchesEFI/*/grubx64.efiwhen noprefix and standard paths don't existEFI/BOOT/in vendor scan (already checked as fallback)AZL4 GRUB search format (
grub.rs)re3regex forsearch --fs-uuid --set=root <UUID>(Fedora's grub2 scripts omit--no-floppy, which is a Mariner-specific convention)AZL3 noprefix guard (
esp.rs)ensure!(grub_noprefix)check to AZL3 only viactx.image_distro().is_azl3()DISABLE_GRUB_NOPREFIX_CHECKescape hatchAZL4 distro helpers (
osrelease.rs)is_azl4()helper onDistroAzureLinuxRelease::AzL4variant withVERSION_ID4.x parsing andID_LIKE=fedoradetectionTesting
PR Stack
azl4-1-grub-nativeazl4-2-esp-layoutsazl4-5a-builder-infraazl4-5b-image-pipelineazl4-6-bm-testazl4-7a-qcow2-rustazl4-7b-rollback-stage