How to get bundled initramfs installed in my-image-apalis-imx6.bootfs.tar.xz


This is maybe a dumb question, if so I apologize. So, I have created my own layer to build a custom linux for the aforementioned hardware and software (apalis-imx6q IT and BSP 3.0b4). This creates a proper tezi tarball and I can flash and install it fine.

I recently had a requirement to build an initramfs, bundled into the kernel. I was able to accomplish this just fine too.

The question I have is basically: How do I get the initramfs version into the tezi boot tarball? I have not been able to figure out how to do that.

Right now, two zImages are built and some symlinks to them:

lrwxrwxrwx 2 jon jon       68 Oct 22 20:34 **zImage** -> zImage--4.14-2.3.x+git0+baa6c24240-r0-apalis-imx6-20201023015404.bin
-rw-r--r-- 2 jon jon  6791912 Oct 22 20:34 zImage--4.14-2.3.x+git0+baa6c24240-r0-apalis-imx6-20201023015404.bin
lrwxrwxrwx 2 jon jon       68 Oct 22 20:34 zImage-apalis-imx6.bin -> zImage--4.14-2.3.x+git0+baa6c24240-r0-apalis-imx6-20201023015404.bin
-rw-r--r-- 2 jon jon 13750704 Oct 22 20:34 zImage-initramfs--4.14-2.3.x+git0+baa6c24240-r0-apalis-imx6-20201023015404.bin
lrwxrwxrwx 2 jon jon       78 Oct 22 20:34 **zImage-initramfs-apalis-imx6.bin** -> zImage-initramfs--4.14-2.3.x+git0+baa6c24240-r0-apalis-imx6-20201023015404.bin

However, only zImage is present in the my-image-apalis-imx6.bootfs.tar.xz file, which of course just grabs the non-initramfs version of the kernel image.

I think all I need to do is change this symlink in some fashion. Any suggestions? I have made the change manually to the bootfs tarball and repacked it, then flashed it and things work as expected - I would just like to eliminate that manual step and have it always use zImage → zImage-initramfs-apalis-imx6.bin going forward without improper hacks.


Ok, so it turned out to be pretty trivial to do - it just required spelunking through a lot of yocto. At first I tried just doing it by ‘hand’ in a do_deploy_append() in my kernel bbappend.

This worked but seemed “hacky”.

In the end, all I needed was the following in my local.conf:

IMAGE_BOOT_FILES_append = " zImage-initramfs-apalis-imx6.bin;zImage"


Your solution doesn’t seem too “hacky” in my opinion. According to the Yocto manual:

This seems like the correct way to include additional files into the boot partition/bootfs. So unless you notice anything strange I’d say this seems fine.

Best Regards,


You literally saved me days of banging my head against the computer by posting this solution. Thank you thank you thank you.