diff options
author | Yevgeny Popovych <yevgenyp@pointgrab.com> | 2018-06-19 14:41:50 +0300 |
---|---|---|
committer | Phil Wise <philip.wise@here.com> | 2018-08-14 16:03:10 +0200 |
commit | 625c3a3a7b7390012c26b34ce4bb4cd277d9ed07 (patch) | |
tree | a6b066e51f8b5b6ae004f0eba5b774410b8a512e /classes | |
parent | 9dcfcdb9aa2da833a3b86b87fbbb22b60e5d7e3c (diff) | |
download | meta-updater-625c3a3a7b7390012c26b34ce4bb4cd277d9ed07.tar.gz |
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 <yevgenyp@pointgrab.com>
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image_types_ostree.bbclass | 9 |
1 files changed, 8 insertions, 1 deletions
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 () { | |||
122 | checksum=`sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " "` | 122 | checksum=`sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " "` |
123 | 123 | ||
124 | cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum} | 124 | cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum} |
125 | cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${INITRAMFS_FSTYPES} boot/initramfs-${checksum} | 125 | |
126 | if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then | ||
127 | # this is a hack for ostree not to override init= in kernel cmdline - | ||
128 | # make it think that the initramfs is present (while it is in FIT image) | ||
129 | touch boot/initramfs-${checksum} | ||
130 | else | ||
131 | cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${INITRAMFS_FSTYPES} boot/initramfs-${checksum} | ||
132 | fi | ||
126 | 133 | ||
127 | # Copy image manifest | 134 | # Copy image manifest |
128 | cat ${IMAGE_MANIFEST} | cut -d " " -f1,3 > usr/package.manifest | 135 | cat ${IMAGE_MANIFEST} | cut -d " " -f1,3 > usr/package.manifest |