Skip to content

core-initrd: fix create-initrd default option in post installation sc… - #299

Merged
Meulengracht merged 1 commit into
canonical:core20from
john-cabaj:john-cabaj/fix-arm64-create-initrd-case
Aug 3, 2026
Merged

core-initrd: fix create-initrd default option in post installation sc…#299
Meulengracht merged 1 commit into
canonical:core20from
john-cabaj:john-cabaj/fix-arm64-create-initrd-case

Conversation

@john-cabaj

Copy link
Copy Markdown

…ript

6a19b57: "core-initrd: adding "azure-fde" option to post installation script" moved the create-initrd call into only amd64 arches, which broke arm64 and armhf use cases

…ript

6a19b57: "core-initrd: adding "azure-fde" option to post
installation script" moved the create-initrd call into only amd64 arches,
which broke arm64 and armhf use cases

Signed-off-by: John Cabaj <john.cabaj@canonical.com>
fi

# Note focal's systemd & objcopy fail on arm64
# Do not enable arm64, regressed twice now

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this comment wrong now?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I don’t know that’s it’s explicitly wrong, as the only thing that previously guarded was a call to create-efi. Previous to my past commit, create-initrd was called regardless. That’s what this is trying to re-implement.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Right, can you verify this runs fine on arm64?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Seems to have worked:

azure@john-cabaj-uci-test-kcp:~$ sudo apt install ./ubuntu-core-initramfs_51.20_arm64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'ubuntu-core-initramfs' instead of './ubuntu-core-initramfs_51.20_arm64.deb'
The following NEW packages will be installed:
  ubuntu-core-initramfs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
After this operation, 70.7 MB of additional disk space will be used.
Get:1 /home/azure/ubuntu-core-initramfs_51.20_arm64.deb ubuntu-core-initramfs arm64 51.20 [18.9 MB]
Selecting previously unselected package ubuntu-core-initramfs.
(Reading database ... 89662 files and directories currently installed.)
Preparing to unpack .../ubuntu-core-initramfs_51.20_arm64.deb ...
Unpacking ubuntu-core-initramfs (51.20) ...
Setting up ubuntu-core-initramfs (51.20) ...
W: Repository is broken: ubuntu-core-initramfs:arm64 (= 51.20) has no Size information
azure@john-cabaj-uci-test-kcp:~$ /etc/kernel/postinst.d/ubuntu-core-initramfs 
usage: ubuntu-core-initramfs create-initrd [-h] [--root ROOT] [--skeleton SKELETON] [--feature FEATURES [FEATURES ...]] [--kerneldir KERNELDIR] [--kernelver KERNELVER]
                                           [--firmwaredir FIRMWAREDIR] [--output OUTPUT]
ubuntu-core-initramfs create-initrd: error: argument --kernelver: expected one argument
azure@john-cabaj-uci-test-kcp:~$ /etc/kernel/postinst.d/ubuntu-core-initramfs 5.4.0-1151-azure
Traceback (most recent call last):
  File "/usr/bin/ubuntu-core-initramfs", line 248, in <module>
    main()
  File "/usr/bin/ubuntu-core-initramfs", line 244, in main
    globals()[args.subcmd.replace("-", "_")](parser, args)
  File "/usr/bin/ubuntu-core-initramfs", line 77, in create_initrd
    with open(args.output, "wb") as output:
PermissionError: [Errno 13] Permission denied: '/boot/ubuntu-core-initramfs.img-5.4.0-1151-azure'
azure@john-cabaj-uci-test-kcp:~$ sudo /etc/kernel/postinst.d/ubuntu-core-initramfs 5.4.0-1151-azure
azure@john-cabaj-uci-test-kcp:~$

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

initrd generated:

azure@john-cabaj-uci-test-kcp:~$ ls -lt /boot/
total 135225
-rw-r--r-- 1 root root 19927668 Jul 17 16:23 ubuntu-core-initramfs.img-5.4.0-1151-azure
-rw-r--r-- 1 root root 29943639 Jul 17 16:02 initrd.img-5.4.0-1166-azure
drwxr-xr-x 4 root root     4096 Jul 17 16:02 grub
-rw-r--r-- 1 root root 19927743 Jul 17 16:02 ubuntu-core-initramfs.img-5.4.0-1166-azure
lrwxrwxrwx 1 root root       27 Jul 17 16:01 initrd.img -> initrd.img-5.4.0-1166-azure
lrwxrwxrwx 1 root root       24 Jul 17 16:01 vmlinuz -> vmlinuz-5.4.0-1166-azure
lrwxrwxrwx 1 root root       27 Jul 17 15:56 initrd.img.old -> initrd.img-5.4.0-1151-azure
lrwxrwxrwx 1 root root       24 Jul 17 15:56 vmlinuz.old -> vmlinuz-5.4.0-1151-azure
-rw-r--r-- 1 root root 29943381 Jul 17 15:54 initrd.img-5.4.0-1151-azure
-rw------- 1 root root 13141358 Jun 24 18:45 vmlinuz-5.4.0-1166-azure
-rw------- 1 root root  6026324 Jun 24 18:44 System.map-5.4.0-1166-azure
-rw-r--r-- 1 root root   180868 Jun 24 18:44 config-5.4.0-1166-azure
-rw------- 1 root root 13137028 Apr 24  2025 vmlinuz-5.4.0-1151-azure
-rw------- 1 root root  6025670 Apr 24  2025 System.map-5.4.0-1151-azure
-rw-r--r-- 1 root root   180868 Apr 24  2025 config-5.4.0-1151-azure
drwx------ 3 root root      512 Jan  1  1970 efi

@Meulengracht
Meulengracht merged commit fa9a46e into canonical:core20 Aug 3, 2026
1 check failed
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