Skip to content

azl4: trident runtime support#696

Open
bfjelds wants to merge 1 commit into
mainfrom
user/bfjelds/azl4-1-runtime
Open

azl4: trident runtime support#696
bfjelds wants to merge 1 commit into
mainfrom
user/bfjelds/azl4-1-runtime

Conversation

@bfjelds

@bfjelds bfjelds commented Jun 24, 2026

Copy link
Copy Markdown
Member

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

  1. runtime (Rust) ← this PR (into main)
  2. build target + test image definitions (azl4: build target and test image definitions #697)
  3. rollback/servicing pipeline support (azl4: rollback and servicing pipeline support #698)
  4. e2e test configurations (no PR yet)

@bfjelds bfjelds changed the title Enable Azure Linux 4 (azl4) runtime support azl4: trident runtime support Jun 24, 2026
@bfjelds

bfjelds commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

/azp run [GITHUB]-trident-pr-e2e

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@bfjelds bfjelds marked this pull request as ready for review June 25, 2026 00:12
@bfjelds bfjelds requested a review from a team as a code owner June 25, 2026 00:12
Copilot AI review requested due to automatic review settings June 25, 2026 00:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 search stub form, vendor-dir GRUB EFI discovery).
  • Make offline-initialize resilient when lsblk doesn’t surface PTUUID/PARTUUID by falling back to sfdisk and 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.

Comment thread crates/osmodifier/src/grub_cfg.rs
Comment thread crates/trident/src/engine/boot/grub.rs Outdated
Comment thread crates/trident/src/engine/boot/grub.rs
Comment thread crates/trident/src/init/offline/mod.rs Outdated
Comment thread crates/trident/src/init/offline/mod.rs Outdated
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>
@bfjelds bfjelds force-pushed the user/bfjelds/azl4-1-runtime branch from fd80756 to 3ac0bb5 Compare June 25, 2026 00:25
@bfjelds bfjelds requested a review from Copilot June 25, 2026 00:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Comment thread crates/osmodifier/src/grub_cfg.rs
Comment thread crates/osmodifier/src/grub_cfg.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants