]> code.ossystems Code Review - openembedded-core.git/commitdiff
image_types.bbclass: Embed IMAGE_NAME in ubinize config file
authorDrew Moseley <drew_moseley@mentor.com>
Fri, 5 Feb 2016 17:56:20 +0000 (10:56 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 7 Feb 2016 17:29:45 +0000 (17:29 +0000)
When using the FSTYPE multiubi, make sure that each image build
has a unique config file.  Without this there is a race condition
when building multiple images in a single bitbake command which
results in errors similar to:

    ERROR: Error: The image creation script
    'blah/tmp/work/blah/core-image-base/1.0-r0/temp/create_image.multiubi' returned 1:
    iniparser: cannot open ubinize_normal.cfg
    ubinize: error!: cannot load the input ini file "ubinize_normal.cfg"
    mv: cannot stat 'ubinize_normal.cfg': No such file or directory
    WARNING: blah/tmp/work/blah/core-image-base/1.0-r0/temp/create_image.multiubi:1 exit 1 from
      mv ubinize${vname}.cfg blahtmp/deploy/images/blah/

Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/image_types.bbclass

index b9599d8bedfe295b9aa06d4de65e73fb90659e82..db8cb37abc44e6e62942196f127c48c744b0f24a 100644 (file)
@@ -126,18 +126,18 @@ multiubi_mkfs() {
                local vname="_$3"
        fi
 
-       echo \[ubifs\] > ubinize${vname}.cfg
-       echo mode=ubi >> ubinize${vname}.cfg
-       echo image=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${vname}.rootfs.ubifs >> ubinize${vname}.cfg
-       echo vol_id=0 >> ubinize${vname}.cfg
-       echo vol_type=dynamic >> ubinize${vname}.cfg
-       echo vol_name=${UBI_VOLNAME} >> ubinize${vname}.cfg
-       echo vol_flags=autoresize >> ubinize${vname}.cfg
+       echo \[ubifs\] > ubinize${vname}-${IMAGE_NAME}.cfg
+       echo mode=ubi >> ubinize${vname}-${IMAGE_NAME}.cfg
+       echo image=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${vname}.rootfs.ubifs >> ubinize${vname}-${IMAGE_NAME}.cfg
+       echo vol_id=0 >> ubinize${vname}-${IMAGE_NAME}.cfg
+       echo vol_type=dynamic >> ubinize${vname}-${IMAGE_NAME}.cfg
+       echo vol_name=${UBI_VOLNAME} >> ubinize${vname}-${IMAGE_NAME}.cfg
+       echo vol_flags=autoresize >> ubinize${vname}-${IMAGE_NAME}.cfg
        mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${vname}.rootfs.ubifs ${mkubifs_args}
-       ubinize -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${vname}.rootfs.ubi ${ubinize_args} ubinize${vname}.cfg
+       ubinize -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${vname}.rootfs.ubi ${ubinize_args} ubinize${vname}-${IMAGE_NAME}.cfg
 
        # Cleanup cfg file
-       mv ubinize${vname}.cfg ${DEPLOY_DIR_IMAGE}/
+       mv ubinize${vname}-${IMAGE_NAME}.cfg ${DEPLOY_DIR_IMAGE}/
 
        # Create own symlinks for 'named' volumes
        if [ -n "$vname" ]; then