@@ -224,11 +224,13 @@ python do_rootfs_wicenv () {
if value:
envf.write('%s="%s"\n' % (var, value.strip()))
envf.close()
- # Copy .env file to deploy directory for later use with stand alone wic
- depdir = d.getVar('IMGDEPLOYDIR')
- bb.utils.copyfile(os.path.join(outdir, basename) + '.env', os.path.join(depdir, basename) + '.env')
}
addtask do_flush_pseudodb after do_rootfs before do_image do_image_qa
-addtask do_rootfs_wicenv after do_image before do_image_wic
+addtask do_rootfs_wicenv after do_image before do_image_wic do_image_wicenv
do_rootfs_wicenv[vardeps] += "${WICVARS}"
do_rootfs_wicenv[prefuncs] = 'set_image_size'
+
+IMAGE_CMD:wicenv () {
+ cp "${STAGING_DIR}/${MACHINE}/imgdata/${IMAGE_BASENAME}.env" \
+ "${IMGDEPLOYDIR}/${IMAGE_BASENAME}.env"
+}
Now that wic is an external tool, using it outside of the normal Yocto build workflow will become more common. So, we need a way for users to specify that they want the .env file used by wic to be placed into ${DEPLOY_DIR_IMAGE}. With this change, if you intend to use wic externally, you should specify: IMAGE_FSTYPES += "wicenv" As we now have a separate IMAGE_CMD for this, we no longer need to deploy the .env file in do_rootfs_wicenv. Signed-off-by: Paul Barker <paul@pbarker.dev> Cc: Trevor Woerner <twoerner@gmail.com> --- meta/classes-recipe/image_types_wic.bbclass | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- base-commit: 9a83f0878b6bacbc7b322cfec076b4e79ad7b8fb change-id: 20260421-wicenv-5790c9066508 Best regards, -- Paul Barker