All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/1] image-live: order bootimg after rootfs
@ 2021-05-26 18:32 Guillaume Champagne
  2021-05-26 18:32 ` [RFC PATCH 1/1] image-live.bbclass: order do_bootimg after do_rootfs Guillaume Champagne
  0 siblings, 1 reply; 4+ messages in thread
From: Guillaume Champagne @ 2021-05-26 18:32 UTC (permalink / raw)
  To: openembedded-core, fntoth; +Cc: Guillaume Champagne

Hi,

Following 96f47c39f1d17f073243913d524bde84add41d8f (image-live.bbclass:
optional depends when ROOTFS empty), Ferry noticed that the patch doesn't work
correctly if the image's work directory is empty since IMGDEPLOYDIR may not
exist when do_bootimg runs.

The following patch fixes this by ordering do_bootimg after do_rootfs, since
IMGDEPLOYDIR is created and cleaned before do_rootfs runs (vardeps cleandir).
This shouldn't change the build order for recipes that use a ROOTFS, since
do_bootimg would already be ordered after do_rootfs via the dependency on
do_image_{FS_TYPE}.

I'm sending this as an RFC to get the confirmation that this patch is a right
way to approach the issue. Furthermore, I feel like if there was a way to
entierly skip do_rootfs, that could be great since it doesn't even have to run
if the final image doesn't include that rootfs.

Thanks,
Guillaume

Guillaume Champagne (1):
  image-live.bbclass: order do_bootimg after do_rootfs

 meta/classes/image-live.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFC PATCH 1/1] image-live.bbclass: order do_bootimg after do_rootfs
  2021-05-26 18:32 [RFC PATCH 0/1] image-live: order bootimg after rootfs Guillaume Champagne
@ 2021-05-26 18:32 ` Guillaume Champagne
  2021-06-01 20:12   ` Ferry Toth
       [not found]   ` <16848E63E6244007.7311@lists.openembedded.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Guillaume Champagne @ 2021-05-26 18:32 UTC (permalink / raw)
  To: openembedded-core, fntoth; +Cc: Guillaume Champagne

do_bootimg expects IMGDEPLOYDIR to exist, since it stores its artifacts
there. Therefore, do_bootimg should run after do_rootfs because
IMGDEPLOYDIR is created before do_rootfs runs since IMGDEPLOYDIR is
contained in do_rootfs' [cleandirs] varflag.

When do_bootimg depends on ${PN}:do_image_${LIVE_ROOTFS_TYPE},
do_bootimg is correctly ordered after do_rootfs because
do_image_${FSTYPE} tasks are added after do_image and do_image itself is
added after do_rootfs.

However, when do_bootimg doesn't depend on
${PN}:do_image_${LIVE_ROOTFS_TYPE}
(introduced by: 96f47c39f1d17f073243913d524bde84add41d8f), do_bootimg
can run before do_rootfs, thus before IMGDEPLOYDIR is created. To
avoid this situation, do_bootimg is now explicitly ordered after
do_rootfs.

Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
---
 meta/classes/image-live.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image-live.bbclass b/meta/classes/image-live.bbclass
index 8b08305cdb..fd876ed8e1 100644
--- a/meta/classes/image-live.bbclass
+++ b/meta/classes/image-live.bbclass
@@ -261,4 +261,4 @@ python do_bootimg() {
 do_bootimg[subimages] = "hddimg iso"
 do_bootimg[imgsuffix] = "."
 
-addtask bootimg before do_image_complete
+addtask bootimg before do_image_complete after do_rootfs
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH 1/1] image-live.bbclass: order do_bootimg after do_rootfs
  2021-05-26 18:32 ` [RFC PATCH 1/1] image-live.bbclass: order do_bootimg after do_rootfs Guillaume Champagne
@ 2021-06-01 20:12   ` Ferry Toth
       [not found]   ` <16848E63E6244007.7311@lists.openembedded.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Ferry Toth @ 2021-06-01 20:12 UTC (permalink / raw)
  To: Guillaume Champagne, openembedded-core

Hi

Op 26-05-2021 om 20:32 schreef Guillaume Champagne:
> do_bootimg expects IMGDEPLOYDIR to exist, since it stores its artifacts
> there. Therefore, do_bootimg should run after do_rootfs because
> IMGDEPLOYDIR is created before do_rootfs runs since IMGDEPLOYDIR is
> contained in do_rootfs' [cleandirs] varflag.
>
> When do_bootimg depends on ${PN}:do_image_${LIVE_ROOTFS_TYPE},
> do_bootimg is correctly ordered after do_rootfs because
> do_image_${FSTYPE} tasks are added after do_image and do_image itself is
> added after do_rootfs.
>
> However, when do_bootimg doesn't depend on
> ${PN}:do_image_${LIVE_ROOTFS_TYPE}
> (introduced by: 96f47c39f1d17f073243913d524bde84add41d8f), do_bootimg
> can run before do_rootfs, thus before IMGDEPLOYDIR is created. To
> avoid this situation, do_bootimg is now explicitly ordered after
> do_rootfs.
>
> Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
> ---
> meta/classes/image-live.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/image-live.bbclass 
> b/meta/classes/image-live.bbclass
> index 8b08305cdb..fd876ed8e1 100644
> --- a/meta/classes/image-live.bbclass
> +++ b/meta/classes/image-live.bbclass
> @@ -261,4 +261,4 @@ python do_bootimg() {
> do_bootimg[subimages] = "hddimg iso"
> do_bootimg[imgsuffix] = "."
> -addtask bootimg before do_image_complete
> +addtask bootimg before do_image_complete after do_rootfs

I can not answer your question if this is the right way to go. But I'll 
try this patch next weekend and return here with the results.

Thanks!



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [RFC PATCH 1/1] image-live.bbclass: order do_bootimg after do_rootfs
       [not found]   ` <16848E63E6244007.7311@lists.openembedded.org>
@ 2021-06-05 12:59     ` Ferry Toth
  0 siblings, 0 replies; 4+ messages in thread
From: Ferry Toth @ 2021-06-05 12:59 UTC (permalink / raw)
  To: Guillaume Champagne, openembedded-core

Hi,

Op 01-06-2021 om 22:12 schreef Ferry Toth via lists.openembedded.org:
> Hi
>
> Op 26-05-2021 om 20:32 schreef Guillaume Champagne:
>> do_bootimg expects IMGDEPLOYDIR to exist, since it stores its artifacts
>> there. Therefore, do_bootimg should run after do_rootfs because
>> IMGDEPLOYDIR is created before do_rootfs runs since IMGDEPLOYDIR is
>> contained in do_rootfs' [cleandirs] varflag.
>>
>> When do_bootimg depends on ${PN}:do_image_${LIVE_ROOTFS_TYPE},
>> do_bootimg is correctly ordered after do_rootfs because
>> do_image_${FSTYPE} tasks are added after do_image and do_image itself is
>> added after do_rootfs.
>>
>> However, when do_bootimg doesn't depend on
>> ${PN}:do_image_${LIVE_ROOTFS_TYPE}
>> (introduced by: 96f47c39f1d17f073243913d524bde84add41d8f), do_bootimg
>> can run before do_rootfs, thus before IMGDEPLOYDIR is created. To
>> avoid this situation, do_bootimg is now explicitly ordered after
>> do_rootfs.
>>
>> Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
>> ---
>> meta/classes/image-live.bbclass | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/image-live.bbclass 
>> b/meta/classes/image-live.bbclass
>> index 8b08305cdb..fd876ed8e1 100644
>> --- a/meta/classes/image-live.bbclass
>> +++ b/meta/classes/image-live.bbclass
>> @@ -261,4 +261,4 @@ python do_bootimg() {
>> do_bootimg[subimages] = "hddimg iso"
>> do_bootimg[imgsuffix] = "."
>> -addtask bootimg before do_image_complete
>> +addtask bootimg before do_image_complete after do_rootfs
>
> I can not answer your question if this is the right way to go. But 
> I'll try this patch next weekend and return here with the results.
>
Tested-by: Ferry Toth <fntoth@gmail.com>

I tested this with meta-intel-edison layer from 
https://github.com/edison-fw/meta-intel-edison on Gatesgarth and confirm 
this patch resolves the problem.

I'm looking forward to this being applied to all Yocto versions that 
broke due to "image-live.bbclass: optional depends when ROOTFS empty".

Thanks, Guillaume!

>
>
>
> 
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-05 12:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 18:32 [RFC PATCH 0/1] image-live: order bootimg after rootfs Guillaume Champagne
2021-05-26 18:32 ` [RFC PATCH 1/1] image-live.bbclass: order do_bootimg after do_rootfs Guillaume Champagne
2021-06-01 20:12   ` Ferry Toth
     [not found]   ` <16848E63E6244007.7311@lists.openembedded.org>
2021-06-05 12:59     ` [OE-core] " Ferry Toth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.