Skip to content

Commit a22f895

Browse files
qcom-minimal-image: empty /boot so the ESP can be mounted there
On EFI machines the system boots from the ESP partition via UKIs, so the kernel and boot loader entries staged in /boot of the rootfs are never used. Worse, a non-empty /boot prevents systemd from mounting the ESP there at runtime. Empty /boot at rootfs postprocess time, keeping the directory itself as the mountpoint. Guard on the efi machine feature, matching the ESP image's own gating, since on non-EFI machines /boot may be the real boot path. This also aligns the regular images with the OTA-enabled ones, where meta-updater already splits the boot content out of the rootfs and ships an empty /boot. The cleanup is a no-op for the sota pipeline, which discards the rootfs /boot content on its own. Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
1 parent 8e50f00 commit a22f895

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

recipes-products/images/qcom-minimal-image.bb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,14 @@ python __anonymous() {
3535
d.setVar("KERNEL_DEVICETREE", "")
3636
}
3737

38+
# On EFI machines the system boots via the ESP partition and UKIs, so the
39+
# kernel/loader files staged in /boot are unused; remove them so /boot is an
40+
# empty mountpoint and systemd can mount the ESP there at runtime.
41+
clean_boot_mountpoint() {
42+
if [ -d ${IMAGE_ROOTFS}/boot ]; then
43+
find ${IMAGE_ROOTFS}/boot -mindepth 1 -delete
44+
fi
45+
}
46+
ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'clean_boot_mountpoint ', '', d)}"
47+
3848
BAD_RECOMMENDATIONS += "systemd-networkd"

0 commit comments

Comments
 (0)