[OE-core] [PATCH 0/3] Introduces kernel-initramfs recipe to resolve a implicit dependency issue

Bruce Ashfield bruce.ashfield at windriver.com
Tue Jan 19 19:34:51 UTC 2016


On 16-01-05 08:12 AM, Ming Liu wrote:
> In current initramfs bundled kernel packaging policy, there are several
> dependency chains co-existing:
>
> | "core-image-minimal.do_build" -> "core-image-minimal.do_bundle_initramfs"
> | "core-image-minimal.do_bundle_initramfs" -> "virtual/kernel.do_bundle_initramfs"
> | "core-image-minimal.do_bundle_initramfs" -> "core-image-minimal.do_rootfs"

In current master, the above dependency should now be
do_image_complete, correct ?

> | "core-image-minimal.do_rootfs" -> "virtual/kernel.do_package_write_${IMAGE_PKGTYPE}"

And for the one above here, I'm not seeing this dependency. Are you
saying that it comes via the do_image_complete dependency ?

> | "virtual/kernel.do_package_write_${IMAGE_PKGTYPE}" -> "virtual/kernel.do_package"
> | "virtual/kernel.do_package" -> "virtual/kernel.do_install"
> |
> | "virtual/kernel.do_deploy" -> "virtual/kernel.do_bundle_initramfs"
> | "virtual/kernel.do_bundle_initramfs" -> "virtual/kernel.do_install"

I'm somehow missing the above dependency as well. I suppose I could dump
out the dot file, but I'd like to hear it explained here as well. Since
if I can't get the dependency from the text of the commits, it will
become hard to maintain.

>
> We could see, virtual/kernel.do_package is not explicitly depending on
> virtual/kernel.do_bundle_initramfs so far, therefore, there is not a
> workable way to add initramfs bundled kernel image into rootfs, because
> kernel's do_bundle_initramfs could run parallelly with its do_package,
> which means we will get a implicit kernel-image package that sometimes it
> contains the initramfs bundled kernel or sometimes it doesn't.

I do see what you are describing above. If we've defined
INITRAMFS_IMAGE, the anonymous python in kernel.bbclass does make
the kernel's do_bundle_initramfs depend on the initramfs image's
do_image_complete.

Why not just add a task dependency ?

>
> To fix this problem, the idea is to let the initramfs bundled kernel
> packaging depend on do_bundle_initramfs, meanwhile, to avoid the circular
> dependency issue that commit: 609d5a9ab9e58bb1c2bcc2145399fbc8b701b85a
> [ kernel.bbclass, image.bbclass: Implement kernel INITRAMFS dependency and bundling ]

But here's my issue. We know that the INITRAMFS image cannot contain,
or depend on a kernel itself. So the dependency won't be circular.
It is true that we don't enforce that, but that has always been stated
in the commits that created the bundling.

Is it that condition you are trying to enforce with the split ?

Bruce

>
> was trying to address, this dependency has to be splitted from kernel
> recipe(at least, I could not figure out another way to achieve it), so a
> new kernel-initramfs is introduced, in which a dependency chain is created:
>
> | "kernel-initramfs.do_install" -> "virtual/kernel.do_deploy"
> | "virtual/kernel.do_deploy" -> "virtual/kernel.do_bundle_initramfs"
>
> Then the users can add initramfs bundled kernel image into rootfs by:
>
> IMAGE_INSTALL_append = " kernel-initramfs"
>
> without introducing any circular dependencies.
>
> Ming Liu (3):
>    kernel.bbclass: do not install initramfs bundled kernel image
>    image.bbclass: removes bundle_initramfs related code
>    kernel-initramfs: new recipe, creates initramfs bundled kernel
>      packaging
>
>   meta/classes/image.bbclass                    | 11 -----
>   meta/classes/kernel.bbclass                   |  4 --
>   meta/recipes-kernel/linux/kernel-initramfs.bb | 69 +++++++++++++++++++++++++++
>   3 files changed, 69 insertions(+), 15 deletions(-)
>   create mode 100644 meta/recipes-kernel/linux/kernel-initramfs.bb
>




More information about the Openembedded-core mailing list