From 625c3a3a7b7390012c26b34ce4bb4cd277d9ed07 Mon Sep 17 00:00:00 2001 From: Yevgeny Popovych Date: Tue, 19 Jun 2018 14:41:50 +0300 Subject: classes: image_types_ostree: A hack to allow initramfs in FIT The issue is that when only vmlinuz-* file is present (the case when both DTB and initramfs are in FIT), libostree will assume that there is no initramfs at all and will supply different init= parameter on the kernel command line (aimed to boot directly from sysroot). This effectively breaks boot process as init specified on the kernel cmdline is not present in initramfs. Solution is to basically create an empty initramfs-* file when we use FIT. The proper solution would be to make libostree aware of whether we use FIT or not. Note, to actually boot with initramfs in FIT - a change to u-boot script (env) is needed which will remove explicit usage of initramfs. Signed-off-by: Yevgeny Popovych --- classes/image_types_ostree.bbclass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index ba3e868..5f2bf26 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -122,7 +122,14 @@ IMAGE_CMD_ostree () { checksum=`sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " "` cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum} - cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${INITRAMFS_FSTYPES} boot/initramfs-${checksum} + + if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then + # this is a hack for ostree not to override init= in kernel cmdline - + # make it think that the initramfs is present (while it is in FIT image) + touch boot/initramfs-${checksum} + else + cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${INITRAMFS_FSTYPES} boot/initramfs-${checksum} + fi # Copy image manifest cat ${IMAGE_MANIFEST} | cut -d " " -f1,3 > usr/package.manifest -- cgit v1.2.3-54-g00ecf