diff options
author | Trevor Woerner <twoerner@gmail.com> | 2024-02-22 19:55:27 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-24 16:10:19 +0000 |
commit | dc5a7c76761ed47e0456228956de900d806063bb (patch) | |
tree | 415a4d9d330def572081442884f6fde02f9fc7bc /meta/classes-recipe | |
parent | 405c5b6f04b531c968d0f8348c2dafe363011898 (diff) | |
download | openembedded-core-contrib-dc5a7c76761ed47e0456228956de900d806063bb.tar.gz |
wic: allow imager-specific filename extensions
Currently there is only one defined imager as part of oe-core's wic
implementation: 'direct'. However, having a highly plugin-based design,
wic allows users to define their own imagers (and sources).
Therefore don't hard-code the filename extension of the imager output to
be 'direct' (i.e. the default imager). Allow the extension to follow the
name of the imager being used.
A user can specify a custom imager via the WIC_CREATE_EXTRA_ARGS variable.
If the user does not specify an imager, then 'direct' is assumed.
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe')
-rw-r--r-- | meta/classes-recipe/image_types_wic.bbclass | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index 00620fdc9d..ce7125f6f1 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -71,7 +71,24 @@ IMAGE_CMD:wic () { bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately." fi BUILDDIR="${TOPDIR}" PSEUDO_UNLOAD=1 wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" -w "$tmp_wic" ${WIC_CREATE_EXTRA_ARGS} - mv "$build_wic/$(basename "${wks%.wks}")"*.direct "$out.wic" + + # look to see if the user specifies a custom imager + IMAGER=direct + eval set -- "${WIC_CREATE_EXTRA_ARGS} --" + while [ 1 ]; do + case "$1" in + --imager|-i) + shift + IMAGER=$1 + ;; + --) + shift + break + ;; + esac + shift + done + mv "$build_wic/$(basename "${wks%.wks}")"*.${IMAGER} "$out.wic" } IMAGE_CMD:wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES TOPDIR" do_image_wic[cleandirs] = "${WORKDIR}/build-wic" |