From f494bb5f2bc3561fd6d5f04c11039b7161d27d38 Mon Sep 17 00:00:00 2001 From: Adriana Kobylak Date: Mon, 29 Jul 2019 16:14:11 -0500 Subject: image_types_phosphor: Split make_rwfs() The make_rwfs() was doing some cleanup before creating the rwfs file. Split it into two functions clean_rwfs() and make_rwfs() for cases where some prep work is needed before calling the rwfs command, such as when using mkfs.ext4 that needs to have a file created before it's converted into ext4. (From meta-phosphor rev: e82e8bc686b0a17f29d1d296f1d52543f2bc5ae0) Change-Id: Idebaab86bfd6ff0c02444d9c62543e97e9ba0dcd Signed-off-by: Adriana Kobylak Signed-off-by: Brad Bishop --- meta-phosphor/classes/image_types_phosphor.bbclass | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'meta-phosphor/classes') diff --git a/meta-phosphor/classes/image_types_phosphor.bbclass b/meta-phosphor/classes/image_types_phosphor.bbclass index 3d919df0f3..dea8c3c125 100644 --- a/meta-phosphor/classes/image_types_phosphor.bbclass +++ b/meta-phosphor/classes/image_types_phosphor.bbclass @@ -92,6 +92,15 @@ mk_empty_image() { | tr '\000' '\377' > $image_dst } +clean_rwfs() { + type=$1 + shift + + rm -f ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.$type + rm -rf $type + mkdir $type +} + make_rwfs() { type=$1 cmd=$2 @@ -99,14 +108,13 @@ make_rwfs() { shift opts="$@" - rm -f ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.$type - rm -rf $type - mkdir $type + mkdir -p $type $cmd $opts } do_generate_rwfs_static() { + clean_rwfs ${OVERLAY_BASETYPE} make_rwfs ${OVERLAY_BASETYPE} "${FLASH_STATIC_RWFS_CMD}" ${OVERLAY_MKFS_OPTS} } do_generate_rwfs_static[dirs] = " ${S}/static" @@ -115,6 +123,7 @@ do_generate_rwfs_static[depends] += " \ " do_generate_rwfs_ubi() { + clean_rwfs ${FLASH_UBI_OVERLAY_BASETYPE} make_rwfs ${FLASH_UBI_OVERLAY_BASETYPE} "${FLASH_UBI_RWFS_CMD}" } do_generate_rwfs_ubi[dirs] = " ${S}/ubi" -- cgit v1.2.3