[OE-core] [PATCH] bootimg-efi.py: Use IMGDEPLOYDIR instead of DEPLOY_DIR_IMAGE for initrd

Patrick Ohly patrick.ohly at intel.com
Mon Jul 3 06:45:37 UTC 2017


On Sat, 2017-07-01 at 16:48 -0500, Alejandro Hernandez wrote:
> 
> On 07/01/2017 10:09 AM, Patrick Ohly wrote:
> > Is it really intended that do_image_wic runs for
> > core-image-tiny-initramfs? How and where is the output of
> > core-image-tiny-initramfs used?
> Yes, do_image_wic is intended to run automatically, hence why wic was 
> added to IMAGE_FSTYPES
> I'm not sure I understand what you mean by the second question, but the 
> output is just as in any other image

My point was that core-image-tiny-initramfs isn't like other *-initramfs
image recipes at all, and having an outdated DESCRIPTION in it doesn't
help much either.

> >  From the DESCRIPTION:
> >
> >          core-image-tiny-initramfs doesn't actually generate an image but
> >          rather generates boot and rootfs artifacts into a common
> >          location that can subsequently be picked up by external image
> >          generation tools such as wic.
> This is the old description, when it was though that we would have a common
> artifacts directory, which never happened due to some changes in wic 
> last year
> after which it was decided that core-image-tiny-initramfs would generate 
> the artifacts
> AND a wic image.

If that remains the solution (see below), will the DESCRIPTION and
perhaps even the file name be changed?

> > I still think your patch breaks images which use the initrd parameter to
> > reference an initrd produced by some other recipe.
> I see your point, if an initrd is produced by some other recipe it'd be 
> somewhere else, but at the same time, what if an initrd is produced by 
> the image recipe itself?, like in this case

I see two solutions:
1) keep using the recipe as currently intended and 
   add another sourceparam to bootimg-efi.py which changes the default
   source for initrd from DEPLOY_DIR_IMAGE (the current behavior) to
   IMGDEPLOYDIR
2) use two recipes, one for the initramfs (the current
   core-image-tiny-initramfs.bb, but without wic in IMAGE_FSTYPES) and
   a separate core-image-tiny.bb where do_rootfs gets replaced with
   an empty stub

I personally find the second solution cleaner. It's the standard way of
doing image + initramfs and thus will be easier to understand and have
less unexpected pitfalls.

One such pitfall in solution one exists even with your current patch:
do_image_wic does not depend on do_image_cpio (run "bitbake -g
core-image-tiny-initramfs:do_image_wic", "grep
'^.core-image-tiny-initramfs.do_image_wic' task-depends.dot") and thus
there's a race condition between the two tasks of the same recipe. That
can be fixed, of course, but it is making the solution even more
unusual.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.






More information about the Openembedded-core mailing list