I am building a yocto (kirkstone) distribution that uses a kernel with a bundled initramfs containing logic to start the system. The kernel image containing the bundled initramfs gets built but not installed to the rootfs /boot directory, like the kernel without the bundled initramfs is.

One way I have tried to address this is ROOTFS_POSTPROCESS_COMMAND:append to append a rootfs postprocess command, as described in this similar question.

install_initramfs_kernel() {
    cp -f ${DEPLOY_DIR_IMAGE}/Image.gz-initramfs-${MACHINE}.bin ${IMAGE_ROOTFS}/boot/
    ln -sf Image.gz-initramfs-${MACHINE}.bin ${IMAGE_ROOTFS}/boot/Image.gz
}
ROOTFS_POSTPROCESS_COMMAND:append = " install_initramfs_kernel;"

In my case, the appended command installs the kernel image with the bundled initramfs to the /boot directory and then changes the target of the Image.gz symlink to the kernel w/ the initramfs. It works but when I make changes to the initramfs image and a new kernel image with the initramfs is built, the appended command is not getting executed and the new kernel image does not get installed into the rootfs.

Why is it not getting executed when new kernel image is built? It seems like I need to make the appended function dependent on kernel image file it is installing somehow.

Edit: the metadata changes in code block above are in my custom image recipe

0

There are 0 answers