]> 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)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 12 Apr 2019 12:32:43 +0000 (13:32 +0100)
commit3e5f075184d91dd99cf25cfe84bba1c946ed0c7c
tree84331735961e57c0a7f7dc8e6e79a0b9b1af8718
parent7469c2a5595337fc4407fa7a2ad06b5bf2347545
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>
meta/classes/image_types.bbclass