summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPaul Barker <pbarker@konsulko.com>2021-01-19 16:26:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-27 09:32:45 +0000
commita708630b4f1e3a8e40c84b8edefb4fac2a7db191 (patch)
tree4464ea39c930392838681fce0732b3c8f8325243 /meta
parentd8b7d59e661fb530ef29a4757c92365ac673cd4a (diff)
downloadpoky-a708630b4f1e3a8e40c84b8edefb4fac2a7db191.tar.gz
image_types_wic: Move wic working directory
By default the wic working directory is placed under the output directory. When invoking wic under bitbake, the wic output directory is added to PSEUDO_PATHS_IGNORE to avoid issues with files being removed from outside a pseudo environment (see oe-core commit ad8f5532ff). However, wic will copy the rootfs directory into its working directory if it needs to add or remove content before creating a filesystem image. This copy of the rootfs directory must be tracked by pseudo in order to keep the permissions correct in the resulting image. So we can't have the wic working directory under a path in PSEUDO_PATHS_IGNORE unless we like broken permissions. To fix this the new '-w' argument to wic is used to move the working directory away from the output directory. Note that wic deletes the temporary working directory automatically when it finishes creating an image so users won't normally see the 'tmp-wic' directory under WORKDIR. Fixes [Yocto #14129] (From OE-Core rev: 28d2e131555372a79499746057468cb18db69d69) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 4d07169499c47fa9dc759e6f81843416a6dc25c5) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/image_types_wic.bbclass8
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/classes/image_types_wic.bbclass b/meta/classes/image_types_wic.bbclass
index 000ee4249f..49be1da77a 100644
--- a/meta/classes/image_types_wic.bbclass
+++ b/meta/classes/image_types_wic.bbclass
@@ -29,11 +29,17 @@ WIC_CREATE_EXTRA_ARGS ?= ""
29IMAGE_CMD_wic () { 29IMAGE_CMD_wic () {
30 out="${IMGDEPLOYDIR}/${IMAGE_NAME}" 30 out="${IMGDEPLOYDIR}/${IMAGE_NAME}"
31 build_wic="${WORKDIR}/build-wic" 31 build_wic="${WORKDIR}/build-wic"
32 tmp_wic="${WORKDIR}/tmp-wic"
32 wks="${WKS_FULL_PATH}" 33 wks="${WKS_FULL_PATH}"
34 if [ -e "$tmp_wic" ]; then
35 # Ensure we don't have any junk leftover from a previously interrupted
36 # do_image_wic execution
37 rm -rf "$tmp_wic"
38 fi
33 if [ -z "$wks" ]; then 39 if [ -z "$wks" ]; then
34 bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately." 40 bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately."
35 fi 41 fi
36 BUILDDIR="${TOPDIR}" PSEUDO_UNLOAD=1 wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" ${WIC_CREATE_EXTRA_ARGS} 42 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}
37 mv "$build_wic/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic" 43 mv "$build_wic/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic"
38} 44}
39IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES TOPDIR" 45IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES TOPDIR"