diff options
author | Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | 2020-04-19 08:35:30 +0200 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2021-01-28 04:41:47 -1000 |
commit | 63bebeaf60757967b47cae1e24aa61ec5bcbd61b (patch) | |
tree | a7cd7ee718fffd9059115cb32a34d8df07a7d6b3 /meta/classes | |
parent | 9ea7162e9efc29beacdf1c8f4ec98f4895dd5df6 (diff) | |
download | openembedded-core-contrib-63bebeaf60757967b47cae1e24aa61ec5bcbd61b.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>
Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit dde90a5dd2b22a539095d1bac82acc15c6380ac8)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/image_types_wic.bbclass | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/meta/classes/image_types_wic.bbclass b/meta/classes/image_types_wic.bbclass index 70ea46ef5b..82f0985eeb 100644 --- a/meta/classes/image_types_wic.bbclass +++ b/meta/classes/image_types_wic.bbclass @@ -33,8 +33,7 @@ IMAGE_CMD_wic () { if [ -z "$wks" ]; then bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately." fi - - BUILDDIR="${TOPDIR}" wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" ${WIC_CREATE_EXTRA_ARGS} + BUILDDIR="${TOPDIR}" PSEUDO_UNLOAD=1 wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$build_wic/" ${WIC_CREATE_EXTRA_ARGS} mv "$build_wic/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic" } IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES TOPDIR" @@ -89,6 +88,10 @@ python do_write_wks_template () { bb.utils.copyfile(wks_file, "%s/%s" % (depdir, basename + '-' + os.path.basename(wks_file))) } +do_flush_pseudodb() { + ${FAKEROOTENV} ${FAKEROOTCMD} -S +} + python () { if d.getVar('USING_WIC'): wks_file_u = d.getVar('WKS_FULL_PATH', False) @@ -142,6 +145,7 @@ python do_rootfs_wicenv () { depdir = d.getVar('IMGDEPLOYDIR') bb.utils.copyfile(os.path.join(outdir, basename) + '.env', os.path.join(depdir, basename) + '.env') } +addtask do_flush_pseudodb after do_image before do_image_wic addtask do_rootfs_wicenv after do_image before do_image_wic do_rootfs_wicenv[vardeps] += "${WICVARS}" do_rootfs_wicenv[prefuncs] = 'set_image_size' |