title: Yocto Warrior on INITRAMFS_IMAGE_BUNDLE and Linux Kernel Image on SD Card Image
body: <p>I am building my Embedded Linux system using Yocto warrior on Ubuntu 18.04. I have my own core image recipe and an initramfs image recipe.</p>
  
  <p>I've been reading the docs ( <a href="https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#var-INITRAMFS_IMAGE" rel="nofollow noreferrer">https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#var-INITRAMFS_IMAGE</a> ) and various posts on the internet in order to come up with the following in my local.conf:</p>
  
  <pre><code># Use the INITRAMFS bundled in kernel
  #KERNEL_IMAGETYPE = "Image-initramfs-jetson-nano.bin"
  #KERNEL_IMAGE_BASE_NAME = "Image-initramfs-jetson-nano.bin"
  #INITRAMFS_LINK_NAME = ""
  INITRAMFS_NAME = "Initramfs"
  INITRAMFS_IMAGE = "tegra-minimal-initramfs"
  INITRAMFS_IMAGE_BUNDLE = "1"
  </code></pre>
  
  <p>These lines do in fact create an initramfs built in version of my Kernel and puts it in the deploy directory by the name <strong>Image-Initramfs.bin</strong>. It is slightly larger than the <strong>Image</strong> kernel file that successfully boots. So Yocto ends up building 2 kernels, one with initramfs, and one without. </p>
  
  <pre><code>ubuntu@ip:~/Desktop/jetson-yocto/build$ du -sh tmp/deploy/images/jetson-nano/Image-Initramfs.bin
  36M tmp/deploy/images/jetson-nano/Image-Initramfs.bin
  ubuntu@ip:~/Desktop/jetson-yocto/build$ du -sh tmp/deploy/images/jetson-nano/Image--4.9+git0+3c02a65d91-r0-jetson-nano-20190729195650.bin 
  33M tmp/deploy/images/jetson-nano/Image--4.9+git0+3c02a65d91-r0-jetson-nano-20190729195650.bin
  </code></pre>
  
  <p>The docs say this is accomplished with a secondary compilation path:</p>
  
  <pre><code>Controls whether or not the image recipe specified by INITRAMFS_IMAGE is run through an extra pass (do_bundle_initramfs) during kernel compilation in order to build a single binary that contains both the kernel image and the initial RAM filesystem (initramfs) image. This makes use of the CONFIG_INITRAMFS_SOURCE kernel feature.
  
  Note
  Using an extra compilation pass to bundle the initramfs avoids a circular dependency between the kernel recipe and the initramfs recipe should the initramfs include kernel modules. Should that be the case, the initramfs recipe depends on the kernel for the kernel modules, and the kernel depends on the initramfs recipe since the initramfs is bundled inside the kernel image.
  </code></pre>
  
  <p>The problem is that this initramfs Kernel is not installed by Yocto into the final SD Card image. Only the non-initramfs Kernel is installed. I have not been able to find a Yocto directive/setting on how to make it install the initramfs version instead of the non-initramfs one. </p>
  
  <p>How can I do this? Thanks. </p>