[OE-core] [PATCH 3/3] image_types_wic: Add variable WIC_EXTENSION

Alexandru Vasiu alexandru.vasiu at ni.com
Mon Aug 27 14:31:05 UTC 2018


Used to specify what extention will have the image file which
is created using wic. The default value is wic. For creating an
ISO image, WIC_EXTENSION will be iso.

Signed-off-by: Alexandru Vasiu <alexandru.vasiu at ni.com>
---
 meta/classes/image.bbclass           | 2 ++
 meta/classes/image_types_wic.bbclass | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 024d2d4c96..c6833a6770 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -607,6 +607,8 @@ python create_symlinks() {
     if not link_name:
         return
     for type in subimages:
+        if type == 'wic':
+            type = d.getVar('WIC_EXTENSION')
         dst = os.path.join(deploy_dir, link_name + "." + type)
         src = img_name + imgsuffix + type
         if os.path.exists(os.path.join(deploy_dir, src)):
diff --git a/meta/classes/image_types_wic.bbclass b/meta/classes/image_types_wic.bbclass
index 5b40a9e919..77cde5763c 100644
--- a/meta/classes/image_types_wic.bbclass
+++ b/meta/classes/image_types_wic.bbclass
@@ -9,6 +9,7 @@ WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks"
 WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks"
 WKS_SEARCH_PATH ?= "${THISDIR}:${@':'.join('%s/wic' % p for p in '${BBPATH}'.split(':'))}:${@':'.join('%s/scripts/lib/wic/canned-wks' % l for l in '${BBPATH}:${COREBASE}'.split(':'))}"
 WKS_FULL_PATH = "${@wks_search(d.getVar('WKS_FILES').split(), d.getVar('WKS_SEARCH_PATH')) or ''}"
+WIC_EXTENSION ??= "wic"
 
 def wks_search(files, search_path):
     for f in files:
@@ -30,7 +31,7 @@ IMAGE_CMD_wic () {
 	fi
 
 	BUILDDIR="${TOPDIR}" wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$out/" ${WIC_CREATE_EXTRA_ARGS}
-	mv "$out/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic"
+	mv "$out/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.${WIC_EXTENSION}"
 	rm -rf "$out/"
 }
 IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES TOPDIR"
-- 
2.18.0




More information about the Openembedded-core mailing list