[OE-core] [PATCH RFC] kernel.bbclass: symlink initramfs kernel bundle to kernel

Bruce Ashfield bruce.ashfield at windriver.com
Thu Jan 5 03:50:26 UTC 2017


On 2017-01-04 3:57 PM, California Sullivan wrote:
> Image creation seems to always grab ${type} (usually bzImage), even if
> we specifically use INITRAMFS_IMAGE_BUNDLE to create a bundled
> initramfs/kernel. Work around this by linking ${type}.initramfs to
> ${type} as a final step when it exists.
>
> Signed-off-by: California Sullivan <california.l.sullivan at intel.com>
> ---
> I've been experimenting with initramfs stuff lately and discovered that
> despite the bundled initramfs being built, it isn't being used by image
> creation by default. This is one way to solve the issue, but ultimately
> its probably a deficiency with image creation. Anyone with more
> knowledge in this area have some thoughts?

I'm also not clear why the image creation wouldn't be grabbing whatever
is named in the INITRAMFS variables.

Is there some interaction between the python in image.bbclass and 
kernel.bbclass ? I see both trying to set the depends on
do_image_complete when INITRAMFS_IMAGE is defined.

.. but yah, other than creating the dependency on the initramfs build,
I don't see the image creation with any extra conditionals to switch to
the initramfs bundled kernel.

So your change should hold up, but I agree it doesn't feel right.

Bruce

>
>  meta/classes/kernel.bbclass | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 3630042..5b5a642 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -618,6 +618,10 @@ kernel_do_deploy() {
>  			initramfs_symlink_name=${type}-initramfs-${MACHINE}
>  			install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.initramfs ${DEPLOYDIR}/${initramfs_base_name}.bin
>  			ln -sf ${initramfs_base_name}.bin ${DEPLOYDIR}/${initramfs_symlink_name}.bin
> +			if [ x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
> +				echo "INITRAMFS_IMAGE_BUNDLE is set. Linking to ${type}..."
> +				ln -sf ${initramfs_base_name}.bin ${DEPLOYDIR}/${type}
> +			fi
>  		fi
>  	done
>  }
>




More information about the Openembedded-core mailing list