[OE-core] [PATCH 1/7] image_types: improve wks path specification

Christopher Larson chris_larson at mentor.com
Thu Nov 12 23:46:23 UTC 2015


On Thu, Nov 12, 2015 at 4:40 PM, Christopher Larson <kergoth at gmail.com>
wrote:

> From: Christopher Larson <chris_larson at mentor.com>
>
> Hardcoding a full input path with zero flexibility goes against everything
> the
> Yocto Project is about. Rework it to let the user specify the wks base
> filename with WKS_FILE and it'll search the layers for the wks file and use
> it.
>
> Signed-off-by: Christopher Larson <chris_larson at mentor.com>
> ---
>  meta/classes/image_types.bbclass | 22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/meta/classes/image_types.bbclass
> b/meta/classes/image_types.bbclass
> index 5036919..431df3a 100644
> --- a/meta/classes/image_types.bbclass
> +++ b/meta/classes/image_types.bbclass
> @@ -170,15 +170,23 @@ IMAGE_CMD_ubi () {
>
>  IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o
> ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs ${MKUBIFS_ARGS}"
>
> +WKS_FILE ?= "${FILE_DIRNAME}/${IMAGE_BASENAME}.${MACHINE}.wks"
> +WKS_FULL_PATH = "${@bb.utils.which('${WKS_SEARCH_PATH}', '${WKS_FILE}')
> if not os.path.isabs('${WKS_FILE}') else '${WKS_FILE}'}"
> +WKS_FULL_PATH[vardepvalue] = "${WKS_FULL_PATH}"
> +WKS_SEARCH_PATH ?= "${@':'.join('%s/scripts/lib/wic/canned-wks' % l for l
> in '${BBLAYERS}'.split())}"
> +
>  IMAGE_CMD_wic () {
> -       out=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}
> -       wks=${FILE_DIRNAME}/${IMAGE_BASENAME}.${MACHINE}.wks
> -       [ -e $wks ] || wks=${FILE_DIRNAME}/${IMAGE_BASENAME}.wks
> -       [ -e $wks ] || bbfatal "Kiskstart file $wks doesn't exist"
> -       BUILDDIR=${TOPDIR} wic create $wks --vars
> ${STAGING_DIR_TARGET}/imgdata/ -e ${IMAGE_BASENAME} -o $out/
> -       mv $out/build/${IMAGE_BASENAME}*.direct $out.rootfs.wic
> -       rm -rf $out/
> +       out="${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}"
> +       wks="${WKS_FULL_PATH}"
> +       if [ ! -e "$wks" ]; then
> +               bbfatal "Kickstart file $wks doesn't exist"
> +       fi
> +
> +       BUILDDIR="${TOPDIR}" wic create "$wks" --vars
> "${STAGING_DIR_TARGET}/imgdata/" -e "${IMAGE_BASENAME}" -o "$out/"
> +       mv "$out/build/$(basename "${wks%.wks}")"*.direct "$out.rootfs.wic"
> +       rm -rf "$out/"
>  }
> +IMAGE_CMD_wic[file-checksums] += "${WKS_FULLPATH}"
>

Gah, I'll have to fix this and re-submit if needed, the varname is typoed,
missing _. Also, it might be worth excluding WKS_FULL_PATH from vardeps
entirely -- having to rerun the image build if a layer is moved isn't
ideal, and we already have it in file-checksums.
-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20151112/ef44c4c2/attachment-0002.html>


More information about the Openembedded-core mailing list