On Tue, 2020-05-19 at 00:00 +0800, hongxu wrote:
> Since wic image creation will temporarily update rootfs/etc/fstab
> to add UUID (*temporarily* means rootfs/etc/fstab will be recovered
> after wic image creation), there is a potential racing risk with other
> image creation (such as tar, ext)
> 
> Such as UUID was unexpected in tar.bz2's fstab:
> $ cat unpack_tar_bz2_dir/etc/fstab
> ...
> UUID=219B-2933 /boot vfat defaults 0 0
> ...
> 
> Explicitly make do_image_wic depend on other do_image_XXX (listed in
> IMAGE_FSTYPES except do_image_wicXXX) to avoid potential racing
> 
> Signed-off-by: Hongxu Jia <hongxu....@windriver.com>
> ---
>  meta/classes/image_types_wic.bbclass | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meta/classes/image_types_wic.bbclass 
> b/meta/classes/image_types_wic.bbclass
> index 96ed0473ee..79bafeb818 100644
> --- a/meta/classes/image_types_wic.bbclass
> +++ b/meta/classes/image_types_wic.bbclass
> @@ -25,6 +25,7 @@ def wks_search(files, search_path):
>  
>  WIC_CREATE_EXTRA_ARGS ?= ""
>  
> +IMAGE_TYPEDEP_wic += "${@' '.join('%s' % r for r in 
> d.getVar('IMAGE_FSTYPES').split() if not r.startswith('wic'))}"
>  IMAGE_CMD_wic () {
>       out="${IMGDEPLOYDIR}/${IMAGE_NAME}"
>       build_wic="${WORKDIR}/build-wic"

I thought wic took a copy of the rootfs which it could them modify for
this reason but I can't find the code which would do that.

I think we should teach wic to take a copy (using hardlinks) as editing
files in the rootfs in do_image_* is not allowed. By using hardlinks
and putting it on the same filesystem as the original (rootfsdir +
".wic" maybe?) then it should be fast.

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#138461): 
https://lists.openembedded.org/g/openembedded-core/message/138461
Mute This Topic: https://lists.openembedded.org/mt/74294520/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to