From: Romuald JEANNE Date: Thu, 9 Mar 2023 07:54:52 +0000 (+0100) Subject: image_types: fix vname var init in multiubi_mkfs() function X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~1413 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b5e1cce35e129b21d871ab45b03811fdb6eaf8f;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git image_types: fix vname var init in multiubi_mkfs() function As vname var is needed in multiubi_mkfs() function, we need to keep it defined and use it as parameter to the new write_ubi_config() function. See [YOCTO #15027] Signed-off-by: Romuald JEANNE Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/meta/classes-recipe/image_types.bbclass b/meta/classes-recipe/image_types.bbclass index ae00728a74d..57f54f05885 100644 --- a/meta/classes-recipe/image_types.bbclass +++ b/meta/classes-recipe/image_types.bbclass @@ -161,11 +161,7 @@ UBI_VOLTYPE ?= "dynamic" UBI_IMGTYPE ?= "ubifs" write_ubi_config() { - if [ -z "$1" ]; then - local vname="" - else - local vname="_$1" - fi + local vname="$1" cat < ubinize${vname}-${IMAGE_NAME}.cfg [ubifs] @@ -187,7 +183,12 @@ multiubi_mkfs() { bbfatal "MKUBIFS_ARGS and UBINIZE_ARGS have to be set, see http://www.linux-mtd.infradead.org/faq/ubifs.html for details" fi - write_ubi_config "$3" + if [ -z "$3" ]; then + local vname="" + else + local vname="_$3" + fi + write_ubi_config "${vname}" if [ -n "$vname" ]; then mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubifs ${mkubifs_args}