| Message ID | 20260415125522.458497-1-srinuvasan.a@siemens.com |
|---|---|
| State | Under Review |
| Headers | show |
| Series | rootfs: run kernel-install after update-initramfs | expand |
On 15.04.26 14:55, srinuvasan.a via isar-users wrote: > From: srinuvasan <srinuvasan.a@siemens.com> > > When efibootguard is used as the primary bootloader and > systemd-boot as secondary, the WIC plugin expects /boot/EFI/Linux > to contain a unified kernel image for first boot. > Err, where/how do you define "primary" and "secondary" EFI bootloaders? Note that EBG is isar-cip-core, and there we definitely do not have such a concept. Can you elaborate what you want to achieve? > Run kernel-install after update-initramfs to ensure the unified > kernel image is generated and placed correctly. > > Invoke kernel-install for UKI generation only when: > - ukify binary is available > - /usr/lib/kernel/install.conf exists > > Signed-off-by: Shivaschandra KL <shivaschandra.k-l@siemens.com> > Signed-off-by: srinuvasan <srinuvasan.a@siemens.com> > --- > meta/classes-recipe/rootfs.bbclass | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) > > diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass > index a9233111..9024f006 100644 > --- a/meta/classes-recipe/rootfs.bbclass > +++ b/meta/classes-recipe/rootfs.bbclass > @@ -14,10 +14,20 @@ ROOTFS_DISTRO ?= "${DISTRO}" > ROOTFS_USE_DRACUT ??= "" > > def initramfs_generator_cmdline(d): > - rootfs_packages = d.getVar('ROOTFS_PACKAGES') or '' > + rootfs_packages = d.getVar('ROOTFS_PACKAGES') or '' > + > if 'dracut' in rootfs_packages or bb.utils.to_boolean(d.getVar('ROOTFS_USE_DRACUT')): > - return "dracut --force --kver \"$kernel_version\"" > - return "update-initramfs -u -v -k \"$kernel_version\"" > + return 'dracut --force --kver "$kernel_version"' > + > + cmdline = 'update-initramfs -u -v -k "$kernel_version"' > + > + cmdline += ( > + '; command -v ukify >/dev/null && [ -f /usr/lib/kernel/install.conf ] && ' Who is using ukify? No one in isar or isar-cip-core at least. Are you referring to an out-of-tree wic plugin with these changes? In-tree (Isar), we still need to enable meta/scripts/lib/wic/plugins/source/bootimg-efi-isar.py to generate UKIs. But that would be systemd-boot UKI-only, no EBG then. Jan > + 'kernel-install add "$kernel_version" "/boot/${kernel##*/}" ' > + '"/boot/initrd.img-$kernel_version" || :' > + ) > + > + return cmdline > > ROOTFS_PACKAGES ?= "" > ROOTFS_VARDEPS ?= "" > @@ -627,6 +637,10 @@ python do_generate_initramfs_setscene () { > } > > rootfs_generate_initramfs[progress] = "custom:rootfs_progress.InitrdProgressHandler" > +rootfs_generate_initramfs:prepend() { > + export kernel > +} > + > rootfs_generate_initramfs() { > if [ -n "$(sudo find '${ROOTFSDIR}/boot' -type f -name 'vmlinu[xz]*')" ]; then > for kernel in ${ROOTFSDIR}/boot/vmlinu[xz]-*; do
diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass index a9233111..9024f006 100644 --- a/meta/classes-recipe/rootfs.bbclass +++ b/meta/classes-recipe/rootfs.bbclass @@ -14,10 +14,20 @@ ROOTFS_DISTRO ?= "${DISTRO}" ROOTFS_USE_DRACUT ??= "" def initramfs_generator_cmdline(d): - rootfs_packages = d.getVar('ROOTFS_PACKAGES') or '' + rootfs_packages = d.getVar('ROOTFS_PACKAGES') or '' + if 'dracut' in rootfs_packages or bb.utils.to_boolean(d.getVar('ROOTFS_USE_DRACUT')): - return "dracut --force --kver \"$kernel_version\"" - return "update-initramfs -u -v -k \"$kernel_version\"" + return 'dracut --force --kver "$kernel_version"' + + cmdline = 'update-initramfs -u -v -k "$kernel_version"' + + cmdline += ( + '; command -v ukify >/dev/null && [ -f /usr/lib/kernel/install.conf ] && ' + 'kernel-install add "$kernel_version" "/boot/${kernel##*/}" ' + '"/boot/initrd.img-$kernel_version" || :' + ) + + return cmdline ROOTFS_PACKAGES ?= "" ROOTFS_VARDEPS ?= "" @@ -627,6 +637,10 @@ python do_generate_initramfs_setscene () { } rootfs_generate_initramfs[progress] = "custom:rootfs_progress.InitrdProgressHandler" +rootfs_generate_initramfs:prepend() { + export kernel +} + rootfs_generate_initramfs() { if [ -n "$(sudo find '${ROOTFSDIR}/boot' -type f -name 'vmlinu[xz]*')" ]; then for kernel in ${ROOTFSDIR}/boot/vmlinu[xz]-*; do