Skip to content

acl-grub: use dedicated /usr verity hash partitions consistent with UKI; fix arm64 test-image device-init timeout#36

Merged
bfjelds merged 2 commits into
user/bfjelds/ab-verity-partuuid-uki-addons-20260708from
user/bfjelds/acl-grub-hash-partition-consistent-20260723
Jul 24, 2026
Merged

acl-grub: use dedicated /usr verity hash partitions consistent with UKI; fix arm64 test-image device-init timeout#36
bfjelds merged 2 commits into
user/bfjelds/ab-verity-partuuid-uki-addons-20260708from
user/bfjelds/acl-grub-hash-partition-consistent-20260723

Conversation

@bfjelds

@bfjelds bfjelds commented Jul 23, 2026

Copy link
Copy Markdown
Member

Follow-up to #28. GRUB's disk_layout.json still used the legacy single-partition inline-hash verity scheme, but this branch's grub.cfg/grub_install.sh changes switched the verity cmdline to UUID=-based hash identification (dropping hash-offset=), which requires the hash tree to live on its own independently-discoverable partition.

Confirmed via a live acldevel GRUB build: the image built, but hung at boot waiting on dev-disk-by-uuid-<verity_uuid>.device (45s timeout, never resolves) since that UUID isn't blkid-discoverable when the hash is inline.

Separately, real-hardware arm64 test runs surfaced a pre-existing GRUB-only gap: under CI's higher kola --parallel (QEMU-TCG, no HW acceleration), udev can't always bring up ESP/OEM/usr-verity block devices within systemd's default ~45s device-init timeout, causing verity activation to fail and the image to drop to an emergency shell (acl.kdump/acl.kdump.grub flaked this way in CI). UKI test images already work around this via install_uki_timeout_addon(); GRUB test images had no equivalent since GRUB has no addon mechanism.

Changes

  • build_library/disk_layout.json: add dedicated HASH-A/HASH-B partitions (dps-usr-verity type) cross-referenced via verity_hash, mirroring disk_layout_uki.json. ESP stays 128MiB (no AB-staging need on GRUB). BIOS-BOOT partition kept (shared with Portage/flatcar; RPM/GRUB mode already skips installing to it).
  • build_library/vm_image_util.sh: add install_grub_timeout_override() (arm64 test-images only, mirrors install_uki_timeout_addon()'s scoping) which patches systemd.default_device_timeout_sec=120 directly into grub.cfg's linux_cmdline, since GRUB has no signed-addon equivalent for kernel-cmdline injection. Wired into both call sites in install_oem_package().

Both fixes verified locally on real KVM hardware (amd64) and on a real Azure VM (arm64, via QEMU-TCG) -- confirmed the timeout hang reproduces reliably at --parallel=24 against the unpatched image and is fixed by the override, with the kernel arg verified present in the boot console log.

ACL-GRUB still can't do Trident A/B updates (no addon-swap equivalent) -- these changes only fix the partitioning/verity mechanics and arm64 test-image timeout flakiness so GRUB boots and tests correctly, consistent with the UKI scheme instead of silently broken.

Brian Fjeldstad added 2 commits July 23, 2026 20:23
GRUB's disk_layout.json previously used the legacy single-partition
inline-hash verity scheme. The UKI-side changes in this branch switched
grub.cfg's verity cmdline construction to UUID=-based hash identification
(dropping hash-offset=), which only works when the hash tree lives on its
own independently-discoverable partition.

Mirror disk_layout_uki.json's structure: add dedicated HASH-A/HASH-B
partitions (dps-usr-verity type) cross-referenced via verity_hash, so
blkid/udev can resolve systemd.verity_usr_hash=UUID=<verity_uuid> the same
way UKI does. ACL-GRUB still cannot do Trident A/B updates (no addon-swap
equivalent), but the partitioning/verity mechanics are now consistent
between the two boot paths instead of silently broken on GRUB.

ESP stays at 128MiB (no AB-staging need on GRUB). BIOS-BOOT partition is
kept (shared with Portage/flatcar builds; RPM/GRUB mode already skips
installing to it).
install_uki_timeout_addon already works around a CI-only QEMU-TCG flake on
arm64 kola test images: heavy parallel-VM CPU contention can prevent udev
from initialising ESP/OEM/usr-verity devices within the default initrd
device timeout, dropping the VM to an emergency shell. That fix was
UKI-only (built as a signed .efi addon dropped into <uki>.efi.extra.d/).

GRUB has no addon mechanism, so add install_grub_timeout_override: since
grub.cfg is plain text (not signed/embedded like a UKI), patch the
already-written grub.cfg copies on the test image's ESP directly via sed,
appending systemd.default_device_timeout_sec=120 to the shared
linux_cmdline. Same scoping as the UKI addon: arm64 test image only
(INJECT_DOCKER_SYSEXT=true), never applied to production images or amd64.
@bfjelds bfjelds changed the title acl-grub: use dedicated /usr verity hash partitions, consistent with UKI acl-grub: use dedicated /usr verity hash partitions consistent with UKI; fix arm64 test-image device-init timeout Jul 24, 2026
@bfjelds
bfjelds marked this pull request as ready for review July 24, 2026 17:28
@bfjelds
bfjelds requested a review from a team as a code owner July 24, 2026 17:28
@bfjelds
bfjelds merged commit 80b37d3 into user/bfjelds/ab-verity-partuuid-uki-addons-20260708 Jul 24, 2026
2 checks passed
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.

1 participant