Add a way to populate the boot partition with kernel/initrd from the rootfs for classic builds

Bug #1792561 reported by Łukasz Zemczak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Image
Fix Released
Critical
Łukasz Zemczak

Bug Description

Currently for core (snap) image builds ubuntu-image copies the contents of image/boot/{grub,uboot} from the unpack directory into the boot partition + what gadget.yaml tells it to from the gadget snap contents. Up until now, for the classic case, nothing like this was happening as the initial target was pc and there we didn't actually have to have anything from the rootfs-part of the build inside the boot partition.

For cases of bootloaders such as uboot however, we do need to put some binaries into the boot partition that currently do not come from the gadget tree itself. Things like the kernel and initrd. Currently those are installed and prepared as part of the rootfs. We need to get those into the boot partition somehow. I see two solutions right now:

1) Feature-parity with what's done with snap builds - the gadget stays the same but we now attempt to copy some bits from the rootfs build into the boot partition during populate_bootfs. I like this approach as it would mean we do the same what we do with core images: check if the rootfs build has image/boot/<BOOTLOADER>, if yes then it means that the rootfs wants us to have some additional files in the bootfs. Then we continue normally by installing requested gadget bits as per gadget.yaml.

2) Moving the kernel and initrd into the gadget tree. For raspi we basically anyway fetch the kernel packages from the archive to rip out the dtbs and put them in the gadget tree. In theory we should be able to just get everything we need into the gadget... but would that still make it a gadget tree? (I guess kernel and gadget should be at least theoretically disconnected)

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

I am currently working on 1).

Revision history for this message
Łukasz Zemczak (sil2100) wrote :
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Went with this for now.

Changed in ubuntu-image:
status: In Progress → Fix Committed
Changed in ubuntu-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.