azl4: trident runtime support#696
Open
bfjelds wants to merge 1 commit into
Open
Conversation
Member
Author
|
/azp run [GITHUB]-trident-pr-e2e |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Trident runtime support needed to install/service Azure Linux 4 (AzL4), primarily by expanding distro detection and making boot/ESP handling work with Fedora-style layouts (BLS, vendor EFI dirs), while also improving offline-init robustness around missing GPT IDs in chrooted build environments.
Changes:
- Extend os-release parsing and distro predicates to recognize AzL4 and use the image distro in boot flows.
- Improve GRUB/ESP handling for AzL4 (BLS-aware arg extraction, additional GRUB
searchstub form, vendor-dir GRUB EFI discovery). - Make
offline-initializeresilient when lsblk doesn’t surface PTUUID/PARTUUID by falling back tosfdiskand minting/persisting GUIDs when missing.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/trident/src/subsystems/esp.rs | Adds deterministic vendor-dir search for GRUB EFI binary to support AzL4 ESP layouts. |
| crates/trident/src/init/offline/mod.rs | Adds PTUUID/PARTUUID fallback logic via sfdisk and relaxes build-chroot runtime-disk existence check. |
| crates/trident/src/engine/context/mod.rs | Makes image_distro() prefer image os-release when an image is mounted, otherwise host os-release. |
| crates/trident/src/engine/boot/grub.rs | Switches GRUB config update gating to use image distro and treats AzL4 like AzL3 for this flow. |
| crates/osutils/src/testutils/osrelease.rs | Adds a sample AzL4 os-release fixture for tests. |
| crates/osutils/src/sfdisk.rs | Adds helpers to set GPT disk-id and partition UUIDs using sfdisk. |
| crates/osutils/src/osrelease.rs | Recognizes AzL4 from VERSION_ID and adds is_azl4() helpers/enum variant + tests. |
| crates/osutils/src/mkinitrd.rs | Updates initramfs filename pattern selection to include AzL4. |
| crates/osutils/src/grub.rs | Supports an additional GRUB search --fs-uuid --set=root <UUID> stub form (AzL4/Fedora-style). |
| crates/osmodifier/src/grub_cfg.rs | Adds BLS fallback (parse /boot/loader/entries/*.conf) when grub.cfg uses blscfg. |
Add the Trident runtime changes needed to install and service Azure Linux 4 images: grub.cfg / grub boot handling, initramfs regeneration, os-release parsing, ESP and partition handling, and engine context/offline-init plumbing that branch on the detected Azure Linux version. This is the first of a stacked series; build, test-image, pipeline, and e2e changes follow in later PRs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fd80756 to
3ac0bb5
Compare
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
Part 1 of a stacked series splitting Azure Linux 4 (azl4) support into reviewable pieces. This PR contains only the Trident runtime (Rust) changes.
Adds the runtime changes needed to install and service Azure Linux 4 images: grub.cfg / grub boot handling, initramfs regeneration, os-release parsing, ESP and partition (sfdisk) handling, and engine context / offline-init plumbing that branches on the detected Azure Linux version.
Stacked series
main)