Skip to content

Commit

Permalink
uki-esp-image bbclass: initial add
Browse files Browse the repository at this point in the history
This class uses the OE-core uki.bbclass infrastructure to assemble an
ESP image with systemd-boot + UKI.

Systemd-boot is installed through package management, the UKI is picked
up from deploy.

Signed-off-by: Koen Kooi <[email protected]>
  • Loading branch information
koenkooi committed Jan 30, 2025
1 parent 4e69d99 commit 4f01b2b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 135 deletions.
16 changes: 16 additions & 0 deletions classes/uki-esp-image.bbclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Create an ESP image that has a type #2 EFI UKI and systemd-boot

# Optional subfolder, dependant on where the ESP partition gets mounted
# intended to only have a leading slash, no trailing slash e.g. '/EFI', or just empty, ''
ESPFOLDER ?= "/EFI"

do_ukiesp() {
mkdir -p ${IMAGE_ROOTFS}${ESPFOLDER}/EFI/Linux

# Copy over files from deploy into the rootfs
install -m 0755 ${DEPLOY_DIR_IMAGE}/${UKI_FILENAME} ${IMAGE_ROOTFS}${ESPFOLDER}/EFI/Linux
}

addtask ukiesp after do_deploy uki before do_image_complete do_image_wic


15 changes: 13 additions & 2 deletions recipes-kernel/images/esp-qcom-image.bb
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
DESCRIPTION = "EFI System Partition Image to boot Qualcomm boards"

PACKAGE_INSTALL = " \
linux-qcom-uki \
systemd-boot \
"

KERNELDEPMODDEPEND = ""
KERNEL_DEPLOY_DEPEND = ""

inherit image
ESPFOLDER = ""
inherit image uki-esp-image

inherit uki
UKI_FILENAME = "${EFI_LINUX_IMG}"

UKI_CMDLINE="root=${QCOM_BOOTIMG_ROOTFS} rw rootwait"

# Remove leading 'qcom/' from KERNEL_DEVICEREE, we store the file in DEPLOY_DIR_IMAGE directly, not in the qcom/ subfolder
#KERNEL_DEVICETREE := "${@d.getVar('KERNEL_DEVICETREE').strip().replace('qcom/','')}"

# Remove 'upstream' dtb, rely on EFI provided one
KERNEL_DEVICETREE = ""

IMAGE_FSTYPES = "vfat"
IMAGE_FSTYPES_DEBUGFS = ""
Expand Down
133 changes: 0 additions & 133 deletions recipes-kernel/images/linux-qcom-uki.bb

This file was deleted.

0 comments on commit 4f01b2b

Please sign in to comment.