Skip to content

Commit 23b9ea6

Browse files
fix(acl): write VHD firstboot addon to active UKI's extra.d directory
cleanup-vhd.sh restores /boot/acl/uki-addons/firstboot.addon.efi onto the ESP so that VMs spawned from the built VHD see flatcar.first_boot=detected and run Ignition. Newer ACL images (PR mariner-org/ACL#27198) renamed the UKI from acl.efi to vmlinuz-<version>.efi per UAPI. systemd-boot only auto-discovers addons in <uki-name>.efi.extra.d/, so writing to the hardcoded acl.efi.extra.d/ left the addon undiscoverable on the new image. Without the addon, the first-boot kernel cmdline arg is absent, Ignition runs in subsequent-boot mode, /etc/.ignition-result.json reports userConfigProvided=true, the enable-oem-cloudinit.service ExecCondition fails, oem-cloudinit never runs, the AgentBaker scriptless #cloud-config customData is never processed, and scriptless E2E tests time out. Discover the active UKI dynamically (matching uki_addon.sh in mariner-org/ACL/acl-scripts) so the same script works against both the old acl.efi naming and the new vmlinuz-<version>.efi naming. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8b96add commit 23b9ea6

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

vhdbuilder/packer/cleanup-vhd.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,19 @@ rm -f /etc/machine-id
1313
touch /etc/machine-id
1414
chmod 644 /etc/machine-id
1515
# Restore the UKI firstboot addon consumed by ignition-quench during this build
16-
# Without this, VMs created from this VHD won't get flatcar.first_boot=detected on the kernel cmdline
17-
if [ -f /boot/acl/uki-addons/firstboot.addon.efi ] && [ ! -f /boot/EFI/Linux/acl.efi.extra.d/firstboot.addon.efi ]; then
18-
install -D -m 0644 /boot/acl/uki-addons/firstboot.addon.efi /boot/EFI/Linux/acl.efi.extra.d/firstboot.addon.efi
16+
# Without this, VMs created from this VHD won't get flatcar.first_boot=detected on the kernel cmdline.
17+
# The active UKI follows UAPI naming (vmlinuz-<version>.efi) on newer ACL images and was
18+
# previously named acl.efi -- discover it dynamically rather than hardcoding either name.
19+
if [ -f /boot/acl/uki-addons/firstboot.addon.efi ]; then
20+
uki_path="$(find /boot/EFI/Linux -maxdepth 1 -type f \
21+
\( -name 'vmlinuz-*.efi' -o -name 'acl.efi' \) 2>/dev/null \
22+
| sort | head -n1)"
23+
if [ -n "${uki_path}" ]; then
24+
addon_dir="${uki_path}.extra.d"
25+
if [ ! -f "${addon_dir}/firstboot.addon.efi" ]; then
26+
install -D -m 0644 /boot/acl/uki-addons/firstboot.addon.efi "${addon_dir}/firstboot.addon.efi"
27+
fi
28+
fi
1929
fi
2030
# Cleanup disk usage diagnostics file (created by generate-disk-usage.sh)
2131
rm -f /opt/azure/disk-usage.txt

0 commit comments

Comments
 (0)