Skip to content

Commit 0838740

Browse files
committed
SQUASH ME: uki-esp-image: convert to type#2
Signed-off-by: Koen Kooi <[email protected]>
1 parent bdc44d9 commit 0838740

File tree

1 file changed

+3
-41
lines changed

1 file changed

+3
-41
lines changed

classes/uki-esp-image.bbclass

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,19 @@
1-
# Create an ESP image that has an UKI, systemd-boot and the matching configs
1+
# Create an ESP image that has a type #2 EFI UKI and systemd-boot
22

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

7-
# Optional initrd, filname inside ${DEPLOY_DIR_IMAGE}
8-
ESPINITRD ?= ""
9-
10-
# Title as shown on the console
11-
UKI_TITLE ?= "${DISTRO_NAME} ${DISTRO_VERSION} - ${MACHINE}"
12-
13-
# Kernel CMDLINE
14-
UKI_CMDLINE = " "
15-
UKI_CMDLINE[export] = "1"
16-
177
do_ukiesp() {
188
mkdir -p ${IMAGE_ROOTFS}${ESPFOLDER}/loader/entries
9+
mkdir -p ${IMAGE_ROOTFS}${ESPFOLDER}/Linux
1910

2011
# Copy over files from deploy into the rootfs
21-
install -m 0755 ${DEPLOY_DIR_IMAGE}/${UKI_FILENAME} ${IMAGE_ROOTFS}${ESPFOLDER}
22-
install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_DEVICETREE} ${IMAGE_ROOTFS}${ESPFOLDER}
12+
install -m 0755 ${DEPLOY_DIR_IMAGE}/${UKI_FILENAME} ${IMAGE_ROOTFS}${ESPFOLDER}/Linux
2313

2414
# Add global settings to systemd-boot config
2515
echo "timeout 5" > ${IMAGE_ROOTFS}${ESPFOLDER}/loader/loader.conf
2616

27-
# copy over kernel and optional initrd and dtb
28-
echo "title ${UKI_TITLE}" > ${IMAGE_ROOTFS}${ESPFOLDER}/loader/entries/boot.conf
29-
echo "linux /${UKI_FILENAME}" >> ${IMAGE_ROOTFS}${ESPFOLDER}/loader/entries/boot.conf
30-
31-
# Assemble CMDLINE
32-
# FIXME: don't use QCOM_* variables
33-
if [ -n "${QCOM_BOOTIMG_ROOTFS}" ]; then
34-
UKI_CMDLINE="$UKI_CMDLINE root=${QCOM_BOOTIMG_ROOTFS} rw rootwait"
35-
fi
36-
if [ -n "${SERIAL_CONSOLES}" ]; then
37-
tmp="${SERIAL_CONSOLES}"
38-
for entry in $tmp ; do
39-
baudrate=`echo $entry | sed 's/\;.*//'`
40-
tty=`echo $entry | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
41-
console="$tty","$baudrate"n8
42-
UKI_CMDLINE="$UKI_CMDLINE console=$console"
43-
done
44-
fi
45-
if [ -n "${KERNEL_CMDLINE_EXTRA}" ]; then
46-
UKI_CMDLINE="$UKI_CMDLINE ${KERNEL_CMDLINE_EXTRA}"
47-
fi
48-
echo "options $UKI_CMDLINE" >> ${IMAGE_ROOTFS}${ESPFOLDER}/loader/entries/boot.conf
49-
50-
if [ -n "${ESPINITRD}" ] ; then
51-
install -m 0644 ${DEPLOY_DIR_IMAGE}/${ESPINITRD} ${IMAGE_ROOTFS}${ESPFOLDER}
52-
echo "initrd /${ESPINITRD}" >> ${IMAGE_ROOTFS}${ESPFOLDER}/loader/entries/boot.conf
53-
fi
54-
echo "devicetree /${KERNEL_DEVICETREE}" >> ${IMAGE_ROOTFS}${ESPFOLDER}/loader/entries/boot.conf
5517
}
5618

5719
addtask ukiesp after do_deploy uki before do_image_complete do_image_wic

0 commit comments

Comments
 (0)