[oe] copy combined kernel+initramfs into main image

André Draszik git at andred.net
Fri Nov 11 14:05:05 UTC 2016


On Wed, 2016-11-09 at 17:30 +0000, André Draszik wrote:
> Hi,
> 
> I have a need to copy my bundled initramfs+kernel image into the main
> filesystem image. So far I have failed miserably...
> 
> I have tried to achieve this by:
> 1) adding a new kernel PACKAGE and adding the bundled image file to it
> 2) moving the 'bundle_initramfs' task in kernel.bbclass before do_package
> (rather than before do_deploy)
> 
> 1) on its own is not helpful, because do_bundle_initramfs hasn't run yet,
> i.e. the resulting package will be empty.
> 2) causes a recursive dependency, basically
> kernel:do_bundle_initramfs -> initramfs:do_image_complete ->
> initramfs:do_rootfs -> kernel:do_packagedata
> I think because of do_rootfs[recrdeptask] += "do_packagedata" in
> image.bbclass:
> 
> 
> Now I can't figure out why the kernel's do_packagedata ends up in my
> chain,
> I am not adding any kernel modules to the initramfs image.

If anybody is interested - I basically have a dependency on
do_install[depends] += "virtual/kernel:do_shared_workdir"

in one of the recipes that end up in my initramfs. Just this alone seems to
cause the dependency on kernel:do_packagedata mentioned above...


> [...]
> More generally, is there a way to achieve what I want? Maybe in a
> different
> way?

The solution I came up with instead so is for my image recipe to:

do_rootfs[depends] += "virtual/kernel:do_deploy"
ROOTFS_POSTPROCESS_COMMAND += "copy_kernelinitramfs; "
copy_kernelinitramfs() {
  cp ${DEPLOY_DIR_IMAGE}/bundled-initramfs ${IMAGE_ROOTFS}/boot/
}

Cheers,
Andre'




More information about the Openembedded-devel mailing list