summaryrefslogtreecommitdiffstats
path: root/meta/classes/image_types_wic.bbclass
diff options
context:
space:
mode:
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>2020-04-19 08:35:30 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-26 14:00:50 +0100
commitc58711f0ea2a4d3b54e9f5f442abe3192f4697d0 (patch)
tree6022cc45dbc3a27510b55a1ac1412d7b9abb07b5 /meta/classes/image_types_wic.bbclass
parent90164f0f3d713de70842317869343dd4a3ef5140 (diff)
downloadpoky-c58711f0ea2a4d3b54e9f5f442abe3192f4697d0.tar.gz
wic: Fix multi images .wks with bitbake
In order to support .wks files with multiple images inside bitbake we need to explicitly set the pseudo database in use. Eg: If we try this .mks: part / --source rootfs --ondisk sda --fstype=ext4 part /export --source rootfs --rootfs=core-image-minimal-mtdutils --fstype=ext4 The username for all the files under /export will be set to the runner of bitbake (usually UID 1000). Before we run wic, we need to make sure that the pseudo database will be flushed, and contains all the data needed. Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: dde90a5dd2b22a539095d1bac82acc15c6380ac8) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image_types_wic.bbclass')
-rw-r--r--meta/classes/image_types_wic.bbclass8
1 files changed, 6 insertions, 2 deletions
diff --git a/meta/classes/image_types_wic.bbclass b/meta/classes/image_types_wic.bbclass
index b83308b45c..96ed0473ee 100644
--- a/meta/classes/image_types_wic.bbclass
+++ b/meta/classes/image_types_wic.bbclass
@@ -32,8 +32,7 @@ IMAGE_CMD_wic () {
32 if [ -z "$wks" ]; then 32 if [ -z "$wks" ]; then
33 bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately." 33 bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately."
34 fi 34 fi
35 35 BUILDDIR="${TOPDIR}" PSEUDO_UNLOAD=1 wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" ${WIC_CREATE_EXTRA_ARGS}
36 BUILDDIR="${TOPDIR}" wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" ${WIC_CREATE_EXTRA_ARGS}
37 mv "$build_wic/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic" 36 mv "$build_wic/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic"
38} 37}
39IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES TOPDIR" 38IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES TOPDIR"
@@ -86,6 +85,10 @@ python do_write_wks_template () {
86 bb.utils.copyfile(wks_file, "%s/%s" % (depdir, basename + '-' + os.path.basename(wks_file))) 85 bb.utils.copyfile(wks_file, "%s/%s" % (depdir, basename + '-' + os.path.basename(wks_file)))
87} 86}
88 87
88do_flush_pseudodb() {
89 ${FAKEROOTENV} ${FAKEROOTCMD} -S
90}
91
89python () { 92python () {
90 if d.getVar('USING_WIC'): 93 if d.getVar('USING_WIC'):
91 wks_file_u = d.getVar('WKS_FULL_PATH', False) 94 wks_file_u = d.getVar('WKS_FULL_PATH', False)
@@ -139,6 +142,7 @@ python do_rootfs_wicenv () {
139 depdir = d.getVar('IMGDEPLOYDIR') 142 depdir = d.getVar('IMGDEPLOYDIR')
140 bb.utils.copyfile(os.path.join(outdir, basename) + '.env', os.path.join(depdir, basename) + '.env') 143 bb.utils.copyfile(os.path.join(outdir, basename) + '.env', os.path.join(depdir, basename) + '.env')
141} 144}
145addtask do_flush_pseudodb after do_image before do_image_wic
142addtask do_rootfs_wicenv after do_image before do_image_wic 146addtask do_rootfs_wicenv after do_image before do_image_wic
143do_rootfs_wicenv[vardeps] += "${WICVARS}" 147do_rootfs_wicenv[vardeps] += "${WICVARS}"
144do_rootfs_wicenv[prefuncs] = 'set_image_size' 148do_rootfs_wicenv[prefuncs] = 'set_image_size'