]> code.ossystems Code Review - openembedded-core.git/commit
image_types.bbclass: fix a race between the ubi and ubifs FSTYPES
authorHongxu Jia <hongxu.jia@windriver.com>
Fri, 12 Apr 2019 09:10:38 +0000 (05:10 -0400)
committerArmin Kuster <akuster808@gmail.com>
Sun, 14 Apr 2019 14:24:27 +0000 (07:24 -0700)
commit5e900f2c9319843c8905713dd3dd12a1ad435976
tree8aefab48ed505528ccd5e6b212291f1117fbf235
parentae87e2fab31590aaf8c2f0672d327d633f896cbd
image_types.bbclass: fix a race between the ubi and ubifs FSTYPES

The ubi, ubifs and multiubi FSTYPES calls `mkfs.ubifs' to create UBIFS
images.

In do_image_ubi, $vname is empty, the name of UBIFS image conflicts with
the one in do_image_ubifs, and it's a race risk.
[do_image_ubi]
mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubifs ${mkubifs_args}
[do_image_ubi]

[do_image_ubifs]
mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ubifs ${MKUBIFS_ARGS}
[do_image_ubifs]

In do_image_multiubi, $vname is not empty, the UBIFS image name does
not conflict with others.

So do not call mkfs.ubifs in do_image_ubi and depend on do_image_ubifs
to create UBIFS images.

The fix does not affect do_image_multiubi which still call mkfs.ubifs to
create multiple UBIFS images and symlinks.

[YOCTO #13272]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/classes/image_types.bbclass