[OE-core] Solving a circular dependency issue between the main image and initramfs

Bartosz Golaszewski brgl at bgdev.pl
Wed Mar 11 08:03:06 UTC 2020


wt., 10 mar 2020 o 23:54 Ayoub Zaki <ayoub.zaki at embexus.com> napisał(a):
>
>
> On 10.03.20 23:02, Bartosz Golaszewski wrote:
>
> wt., 10 mar 2020 o 22:33 Ayoub Zaki <ayoub.zaki at embexus.com> napisał(a):
>
> Do I implement do_install in image.bbclass so that initramfs can
> depend on core-image-full-cmdline:do_populate_sysroot and have the
> artifacts installed locally? But this would mean that the initramfs
> recipe deploys the main image artifact. Should we deploy the images
> earlier (before do_image_complete) for the initramfs recipe to fetch
> from DEPLOY_DIR_IMAGE? Any other ideas?
>
> I think that best thing is to implement the dm-verity stuffs as a wic
> plugin, check this example:
>
>
> https://github.com/intel/intel-iot-refkit/blob/master/meta-refkit-core/scripts/lib/wic/plugins/source/dm-verity.py
>
> This doesn't look like a correct solution. For starters: not every
> platform uses wic. The platform I'm aiming this at uses fastboot and
> requires separate images for each partition.
>
>
> My proposition was refering to your example :
>

The example is there just to include support for one of the reference
boards - BBB in this case. The initramfs itself as well as the rest
should be generic though.

>
> https://github.com/brgl/meta-security/commit/83c8e8fba6988249c9d351aa2ad6e02a71b010df#diff-33f7c29b373860ec45379a5f2dc42a75
>
>
> your are trying to include the dm-verity conversion output to your wic wks using the following:
>
>
> part / --source rawcopy --ondisk mmcblk --sourceparams="file=${IMGDEPLOYDIR}/${DM_VERITY_IMAGE}-${MACHINE}.${DM_VERITY_TYPE}"
>
>
> In this case you will definitely stuck in a circular dependency unless using a Wic plugin.
>

Actually this isn't a problem. The dm-verity class makes do_image_wic
depend on do_image_ext[234] and do_image_btrfs and since do_image_wic
is part of the same recipe, we can fetch the image from IMGDEPLOYDIR
before it's deployed.

Best regards,
Bartosz Golaszewski


More information about the Openembedded-core mailing list