Fix for #10835 - WIC should not rely on hddimg creation for finding all needed artifacts
cover Fix for #10835 - WIC should not rely on hddimg creation for finding all needed artifacts
Hi,
This patchset usage of hddimg from wic codebase due to planned deprecation of hddimg.
Wic used hddimg to get 2 types of artifacts - efi and iso artifacts. This dependency is resolved by introducing new tasks to build efi and iso artifacts. This removes dependency to hddimg and also speeds up wic image creation as producing artifacts is faster than building hddimg.
While working on this wic-related code in meta/classes/ has been moved to image-wic.bbclass to make it more maintainable.
The following changes since commit 2d1a68265cda3ad8f36f1d2138c308e9b08114f6:
wic: _exec_cmd: produce error if exit code is not 0 (2017-01-16 17:26:21 +0200)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib ed/wic/dont-use-hddimg-10835
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/wic/dont-use-hddimg-10835
Ed Bartosh (14):
image-wic: move wic-related code to image-wic
grub-efi: set default desination dir
systemd-boot: set default desination dir
image-wic.bbclas: add task do_efi_populate
grub-efi: make do_efi_populate depend on do_deploy
systemd-boot: make do_efi_populate depend on do_deploy
wic: use EFI artifacts from $WORKDIR/efi
image-wic: add task do_build_iso
wic: use INITRD_LIVE in isoimage-isohybrid
wic: isoimage-isohybrid: stop using HDDDIR
image-wic: remove HDDDIR from WICVARS
isoimage-isohybrid: use TRANSLATED_TARGET_ARCH instead of MACHINE_ARCH
selftest: stop using hddimg in the wic test suite
selftest: wic: fix test_iso_image test case
meta/classes/grub-efi.bbclass | 3 +- meta/classes/image-wic.bbclass | 142 +++++++++++++++++++++ meta/classes/image.bbclass | 25 +--- meta/classes/image_types.bbclass | 89 ------------- meta/classes/systemd-boot.bbclass | 3 +- meta/lib/oeqa/selftest/wic.py | 6 +- scripts/lib/wic/plugins/source/bootimg-efi.py | 4 +- .../lib/wic/plugins/source/isoimage-isohybrid.py | 20 +-- 8 files changed, 159 insertions(+), 133 deletions(-) create mode 100644 meta/classes/image-wic.bbclass
Signature · 1 line
2.1.4
PATCH 1/14 image-wic: move wic-related code to image-wic
There is a lot of wic code in image.bbclass and image_types.bbclass Having all code in one place should make it more readable and easier to maintain.
--- meta/classes/image-wic.bbclass | 113 +++++++++++++++++++++++++++++++++++++++ meta/classes/image.bbclass | 25 +-------- meta/classes/image_types.bbclass | 89 ------------------------------ 3 files changed, 115 insertions(+), 112 deletions(-) create mode 100644 meta/classes/image-wic.bbclass
meta/classes/image-wic.bbclass new file +113 -0
@@ -0,0 +1,113 @@ +WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks" +WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks" +WKS_SEARCH_PATH ?= "${THISDIR}:${@':'.join('%s/scripts/lib/wic/canned-wks' % l for l in '${BBPATH}:${COREBASE}'.split(':'))}" +WKS_FULL_PATH = "${@wks_search('${WKS_FILES}'.split(), '${WKS_SEARCH_PATH}') or ''}" + +# The WICVARS variable is used to define list of bitbake variables used in wic code +# variables from this list is written to <image>.env file +WICVARS ?= "BBLAYERS IMGDEPLOYDIR DEPLOY_DIR_IMAGE HDDDIR IMAGE_BASENAME IMAGE_BOOT_FILES IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD ISODIR MACHINE_ARCH ROOTFS_SIZE STAGING_DATADIR STAGING_DIR_NATIVE STAGING_LIBDIR TARGET_SYS WORKDIR" + +def wks_search(files, search_path): + for f in files: + if os.path.isabs(f): + if os.path.exists(f): + return f + else: + searched = bb.utils.which(search_path, f) + if searched: + return searched + +WIC_CREATE_EXTRA_ARGS ?= "" + +IMAGE_CMD_wic () { + out="${IMGDEPLOYDIR}/${IMAGE_NAME}" + wks="${WKS_FULL_PATH}" + 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_TARGET}/imgdata/" -e "${IMAGE_BASENAME}" -o "$out/" ${WIC_CREATE_EXTRA_ARGS} + mv "$out/build/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic" + rm -rf "$out/" +} +IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES" + +# Rebuild when the wks file or vars in WICVARS change +USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${CONVERSIONTYPES}'.split()), '1', '', d)}" +WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}" +do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}" + +python () { + if d.getVar('USING_WIC') and 'do_bootimg' in d: + bb.build.addtask('do_image_wic', '', 'do_bootimg', d) +} + +python do_write_wks_template () { + """Write out expanded template contents to WKS_FULL_PATH.""" + import re + + template_body = d.getVar('_WKS_TEMPLATE') + + # Remove any remnant variable references left behind by the expansion + # due to undefined variables + expand_var_regexp = re.compile(r"\${[^{}@\n\t :]+}") + while True: + new_body = re.sub(expand_var_regexp, '', template_body) + if new_body == template_body: + break + else: + template_body = new_body + + wks_file = d.getVar('WKS_FULL_PATH') + with open(wks_file, 'w') as f: + f.write(template_body) +} + +python () { + if d.getVar('USING_WIC'): + wks_file_u = d.getVar('WKS_FULL_PATH', False) + wks_file = d.expand(wks_file_u) + base, ext = os.path.splitext(wks_file) + if ext == '.in' and os.path.exists(wks_file): + wks_out_file = os.path.join(d.getVar('WORKDIR'), os.path.basename(base)) + d.setVar('WKS_FULL_PATH', wks_out_file) + d.setVar('WKS_TEMPLATE_PATH', wks_file_u) + d.setVar('WKS_FILE_CHECKSUM', '${WKS_TEMPLATE_PATH}:True') + + try: + with open(wks_file, 'r') as f: + body = f.read() + except (IOError, OSError) as exc: + pass + else: + # Previously, I used expandWithRefs to get the dependency list + # and add it to WICVARS, but there's no point re-parsing the + # file in process_wks_template as well, so just put it in + # a variable and let the metadata deal with the deps. + d.setVar('_WKS_TEMPLATE', body) + bb.build.addtask('do_write_wks_template', 'do_image_wic', None, d) +} + + +# +# Write environment variables used by wic +# to tmp/sysroots/<machine>/imgdata/<image>.env +# +python do_rootfs_wicenv () { + wicvars = d.getVar('WICVARS') + if not wicvars: + return + + stdir = d.getVar('STAGING_DIR_TARGET') + outdir = os.path.join(stdir, 'imgdata') + bb.utils.mkdirhier(outdir) + basename = d.getVar('IMAGE_BASENAME') + with open(os.path.join(outdir, basename) + '.env', 'w') as envf: + for var in wicvars.split(): + value = d.getVar(var) + if value: + envf.write('%s="%s"\n' % (var, value.strip())) +} +addtask do_rootfs_wicenv after do_image before do_image_wic +do_rootfs_wicenv[vardeps] += "${WICVARS}" +do_rootfs_wicenv[prefuncs] = 'set_image_size'
meta/classes/image.bbclass +2 -23
@@ -189,6 +189,8 @@ python () { IMAGE_CLASSES += "image_types" inherit ${IMAGE_CLASSES} +inherit image-wic + IMAGE_POSTPROCESS_COMMAND ?= "" # some default locales
@@ -329,29 +331,6 @@ fakeroot python do_image_qa () { } addtask do_image_qa after do_image_complete before do_build -# -# Write environment variables used by wic -# to tmp/sysroots/<machine>/imgdata/<image>.env -# -python do_rootfs_wicenv () { - wicvars = d.getVar('WICVARS') - if not wicvars: - return - - stdir = d.getVar('STAGING_DIR_TARGET') - outdir = os.path.join(stdir, 'imgdata') - bb.utils.mkdirhier(outdir) - basename = d.getVar('IMAGE_BASENAME') - with open(os.path.join(outdir, basename) + '.env', 'w') as envf: - for var in wicvars.split(): - value = d.getVar(var) - if value: - envf.write('%s="%s"\n' % (var, value.strip())) -} -addtask do_rootfs_wicenv after do_image before do_image_wic -do_rootfs_wicenv[vardeps] += "${WICVARS}" -do_rootfs_wicenv[prefuncs] = 'set_image_size' - def setup_debugfs_variables(d): d.appendVar('IMAGE_ROOTFS', '-dbg') d.appendVar('IMAGE_LINK_NAME', '-dbg')
meta/classes/image_types.bbclass +0 -89
98 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH 2/14 grub-efi: set default desination dir
In reply to Ed BartoshFunction efi_populate requires mandatory parameter DESTDIR. It makes it impossible to call this function from python code using bb.build.exec_func as there is no way to pass parameters this way.
Set default value of DESTDIR to ${WORKDIR}/efi. This destination will be used in image-wic.bbclass to install EFI artifacts.
--- meta/classes/grub-efi.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/grub-efi.bbclass +1 -1
@@ -36,7 +36,7 @@ inherit fs-uuid efi_populate() { # DEST must be the root of the image so that EFIDIR is not # nested under a top level directory. - DEST=$1 + DEST=${1-${WORKDIR}/efi} install -d ${DEST}${EFIDIR}
Signature · 1 line
2.1.4
PATCH 3/14 systemd-boot: set default desination dir
In reply to Ed BartoshFunction efi_populate requires mandatory parameter DESTDIR. It makes it impossible to call this function from python code using bb.build.exec_func as there is no way to pass parameters this way.
Set default value of DESTDIR to ${WORKDIR}/efi. This destination will be used in image-wic.bbclass to install EFI artifacts.
--- meta/classes/systemd-boot.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/systemd-boot.bbclass +1 -1
@@ -22,7 +22,7 @@ SYSTEMD_BOOT_TIMEOUT ?= "10" inherit fs-uuid efi_populate() { - DEST=$1 + DEST=${1-${WORKDIR}/efi} EFI_IMAGE="systemd-bootia32.efi" DEST_EFI_IMAGE="bootia32.efi"
Signature · 1 line
2.1.4
PATCH 4/14 image-wic.bbclas: add task do_efi_populate
In reply to Ed BartoshProduce EFI artifacts by calling efi_populate function provided by current EFI provider.
This should eliminate dependency of wic image-efi plugin to hddimg. Instead of getting EFI artifacts from HDDDIR it can get it from $WORKDIR/efi.
[YOCTO #10835]
--- meta/classes/image-wic.bbclass | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
meta/classes/image-wic.bbclass +20 -0
@@ -111,3 +111,23 @@ python do_rootfs_wicenv () { addtask do_rootfs_wicenv after do_image before do_image_wic do_rootfs_wicenv[vardeps] += "${WICVARS}" do_rootfs_wicenv[prefuncs] = 'set_image_size' + +# Populate EFI artifacts + +EFI_PROVIDER ?= "grub-efi" + +EFI_CLASS = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}" +inherit ${EFI_CLASS} + +python do_efi_populate() { + if d.getVar("EFI_CLASS"): + # set variables required for populating efi artifacts + for key, value in [('LABELS', "boot"), ('GRUB_CFG', "grub-wic.cfg")]: + if not d.getVar(key): + d.setVar(key, value) + + bb.build.exec_func('build_efi_cfg', d) + bb.build.exec_func('efi_populate', d) +} + +addtask do_efi_populate after do_rootfs before do_image
Signature · 1 line
2.1.4
PATCH 5/14 grub-efi: make do_efi_populate depend on do_deploy
In reply to Ed BartoshAdded dependency do_efi_populate -> grub-efi:do_deploy to make sure EFI artifacts are depfloyed.
--- meta/classes/grub-efi.bbclass | 1 + 1 file changed, 1 insertion(+)
meta/classes/grub-efi.bbclass +1 -0
@@ -18,6 +18,7 @@ do_bootimg[depends] += "${MLPREFIX}grub-efi:do_deploy" do_bootdirectdisk[depends] += "${MLPREFIX}grub-efi:do_deploy" +do_efi_populate[depends] += "${MLPREFIX}grub-efi:do_deploy" GRUB_SERIAL ?= "console=ttyS0,115200" GRUB_CFG_VM = "${S}/grub_vm.cfg"
Signature · 1 line
2.1.4
PATCH 6/14 systemd-boot: make do_efi_populate depend on do_deploy
In reply to Ed BartoshAdded dependency do_efi_populate -> systemd-boot:do_deploy to make sure EFI artifacts are depfloyed.
--- meta/classes/systemd-boot.bbclass | 1 + 1 file changed, 1 insertion(+)
meta/classes/systemd-boot.bbclass +1 -0
@@ -11,6 +11,7 @@ do_bootimg[depends] += "${MLPREFIX}systemd-boot:do_deploy" do_bootdirectdisk[depends] += "${MLPREFIX}systemd-boot:do_deploy" +do_efi_populate[depends] += "${MLPREFIX}systemd-boot:do_deploy" EFIDIR = "/EFI/BOOT"
Signature · 1 line
2.1.4
PATCH 7/14 wic: use EFI artifacts from $WORKDIR/efi
In reply to Ed BartoshMade bootimg-efi to use EFI artifacts from $WORKDIR/efi instead of $HDDDIR. This should eliminate its dependency on hddimg functionality which is going to be removed soon.
[YOCTO #10835]
--- scripts/lib/wic/plugins/source/bootimg-efi.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
scripts/lib/wic/plugins/source/bootimg-efi.py +1 -3
@@ -167,9 +167,7 @@ class BootimgEFIPlugin(SourcePlugin): In this case, prepare content for an EFI (grub) boot partition. """ if not bootimg_dir: - bootimg_dir = get_bitbake_var("HDDDIR") - if not bootimg_dir: - msger.error("Couldn't find HDDDIR, exiting\n") + bootimg_dir = os.path.join(get_bitbake_var("WORKDIR"), "efi") # just so the result notes display it creator.set_bootimg_dir(bootimg_dir)
Signature · 1 line
2.1.4
PATCH 8/14 image-wic: add task do_build_iso
In reply to Ed BartoshThis task is needed to provide iso artifacts for isoimage-isohybrid wic plugin. Currently this pluing uses hddimg, which is going to be dropped from the codebase soon.
[YOCTO #10835]
--- meta/classes/image-wic.bbclass | 9 +++++++++ 1 file changed, 9 insertions(+)
meta/classes/image-wic.bbclass +9 -0
@@ -131,3 +131,12 @@ python do_efi_populate() { } addtask do_efi_populate after do_rootfs before do_image + +# Build iso artifacts + +python do_build_iso() { + # do_bootimage calls build_iso, check to avoid building twice + if 'do_bootimg' not in d and d.getVar('IMG_LIVE_CLASS'): + bb.build.exec_func('build_iso', d) +} +addtask do_build_iso after do_image before do_image_wic
Signature · 1 line
2.1.4
PATCH 9/14 wic: use INITRD_LIVE in isoimage-isohybrid
In reply to Ed BartoshINITRD variable is not set if hddimg is disabled. isoimage-isohybrid can't get correct name for initrd if INITRD variable is not set.
Added INITRD_LIVE to WICVARS and used it in isoimage-isohybrid code to get initrd artifact name. Used INITRD if INITRD_LIVE is not set.
--- meta/classes/image-wic.bbclass | 2 +- meta/lib/oeqa/selftest/wic.py | 2 +- scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
meta/classes/image-wic.bbclass +1 -1
@@ -5,7 +5,7 @@ WKS_FULL_PATH = "${@wks_search('${WKS_FILES}'.split(), '${WKS_SEARCH_PATH}') or # The WICVARS variable is used to define list of bitbake variables used in wic code # variables from this list is written to <image>.env file -WICVARS ?= "BBLAYERS IMGDEPLOYDIR DEPLOY_DIR_IMAGE HDDDIR IMAGE_BASENAME IMAGE_BOOT_FILES IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD ISODIR MACHINE_ARCH ROOTFS_SIZE STAGING_DATADIR STAGING_DIR_NATIVE STAGING_LIBDIR TARGET_SYS WORKDIR" +WICVARS ?= "BBLAYERS IMGDEPLOYDIR DEPLOY_DIR_IMAGE HDDDIR IMAGE_BASENAME IMAGE_BOOT_FILES IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD INITRD_LIVE ISODIR MACHINE_ARCH ROOTFS_SIZE STAGING_DATADIR STAGING_DIR_NATIVE STAGING_LIBDIR TARGET_SYS WORKDIR" def wks_search(files, search_path): for f in files:
meta/lib/oeqa/selftest/wic.py +1 -1
@@ -351,7 +351,7 @@ class Wic(oeSelfTest): wicvars = set(get_bb_var('WICVARS', image).split()) # filter out optional variables wicvars = wicvars.difference(('HDDDIR', 'IMAGE_BOOT_FILES', - 'INITRD', 'ISODIR')) + 'INITRD', 'INITRD_LIVE', 'ISODIR')) with open(path) as envfile: content = dict(line.split("=", 1) for line in envfile) # test if variables used by wic present in the .env file
scripts/lib/wic/plugins/source/isoimage-isohybrid.py +1 -1
@@ -144,7 +144,7 @@ class IsoImagePlugin(SourcePlugin): Create path for initramfs image """ - initrd = get_bitbake_var("INITRD") + initrd = get_bitbake_var("INITRD_LIVE") or get_bitbake_var("INITRD") if not initrd: initrd_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") if not initrd_dir:
Signature · 1 line
2.1.4
PATCH 10/14 wic: isoimage-isohybrid: stop using HDDDIR
In reply to Ed BartoshStop using HDDDIR in isoimage-isohybrid wic plugin. This variable is set by hddimg code, which is going to be removed soon.
All required artifacts should be available from ISODIR. wic-image.bbclass has been modified to build iso artifacts, so it should be safe to remove usage of HDDDIR.
[YOCTO #10835]
--- scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
scripts/lib/wic/plugins/source/isoimage-isohybrid.py +2 -8
@@ -298,12 +298,8 @@ class IsoImagePlugin(SourcePlugin): part.rootfs_dir = rootfs_dir # Prepare rootfs.img - hdd_dir = get_bitbake_var("HDDDIR") img_iso_dir = get_bitbake_var("ISODIR") - - rootfs_img = "%s/rootfs.img" % hdd_dir - if not os.path.isfile(rootfs_img): - rootfs_img = "%s/rootfs.img" % img_iso_dir + rootfs_img = "%s/rootfs.img" % img_iso_dir if not os.path.isfile(rootfs_img): # check if rootfs.img is in deploydir deploy_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
@@ -332,9 +328,7 @@ class IsoImagePlugin(SourcePlugin): os.remove(part.source_file) # Prepare initial ramdisk - initrd = "%s/initrd" % hdd_dir - if not os.path.isfile(initrd): - initrd = "%s/initrd" % img_iso_dir + initrd = "%s/initrd" % img_iso_dir if not os.path.isfile(initrd): initrd = cls._build_initramfs_path(rootfs_dir, cr_workdir)
Signature · 1 line
2.1.4
PATCH 11/14 image-wic: remove HDDDIR from WICVARS
In reply to Ed BartoshRemoved HDDDIR as it's not used by wic anymore.
Stopped usage of HDDDIR in wic test suite.
--- meta/classes/image-wic.bbclass | 2 +- meta/lib/oeqa/selftest/wic.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
meta/classes/image-wic.bbclass +1 -1
@@ -5,7 +5,7 @@ WKS_FULL_PATH = "${@wks_search('${WKS_FILES}'.split(), '${WKS_SEARCH_PATH}') or # The WICVARS variable is used to define list of bitbake variables used in wic code # variables from this list is written to <image>.env file -WICVARS ?= "BBLAYERS IMGDEPLOYDIR DEPLOY_DIR_IMAGE HDDDIR IMAGE_BASENAME IMAGE_BOOT_FILES IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD INITRD_LIVE ISODIR MACHINE_ARCH ROOTFS_SIZE STAGING_DATADIR STAGING_DIR_NATIVE STAGING_LIBDIR TARGET_SYS WORKDIR" +WICVARS ?= "BBLAYERS IMGDEPLOYDIR DEPLOY_DIR_IMAGE IMAGE_BASENAME IMAGE_BOOT_FILES IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD INITRD_LIVE ISODIR MACHINE_ARCH ROOTFS_SIZE STAGING_DATADIR STAGING_DIR_NATIVE STAGING_LIBDIR TARGET_SYS WORKDIR" def wks_search(files, search_path): for f in files:
meta/lib/oeqa/selftest/wic.py +2 -2
@@ -350,8 +350,8 @@ class Wic(oeSelfTest): wicvars = set(get_bb_var('WICVARS', image).split()) # filter out optional variables - wicvars = wicvars.difference(('HDDDIR', 'IMAGE_BOOT_FILES', - 'INITRD', 'INITRD_LIVE', 'ISODIR')) + wicvars = wicvars.difference(('IMAGE_BOOT_FILES', 'INITRD', + 'INITRD_LIVE', 'ISODIR')) with open(path) as envfile: content = dict(line.split("=", 1) for line in envfile) # test if variables used by wic present in the .env file
Signature · 1 line
2.1.4
PATCH 12/14 isoimage-isohybrid: use TRANSLATED_TARGET_ARCH instead of MACHINE_ARCH
In reply to Ed Bartoshisoimage-sihybrid plugin uses MACHINE_ARCH to get the name of initrd image. It doesn't work for all machines, for example for quemux86-64 machine MACHINE_ARCH is quemux86_64 and initrd name is core-image-minimal-initramfs-qemux86-64.cpio.gz
Used TRANSLATED_TARGET_ARCH variable to get the initrd image name. Replaced MACHINE_ARCH->TRANSLATED_TARGET_ARCH in WICVARS variable to make it available from <image>.env file.
--- meta/classes/image-wic.bbclass | 2 +- scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
meta/classes/image-wic.bbclass +1 -1
@@ -5,7 +5,7 @@ WKS_FULL_PATH = "${@wks_search('${WKS_FILES}'.split(), '${WKS_SEARCH_PATH}') or # The WICVARS variable is used to define list of bitbake variables used in wic code # variables from this list is written to <image>.env file -WICVARS ?= "BBLAYERS IMGDEPLOYDIR DEPLOY_DIR_IMAGE IMAGE_BASENAME IMAGE_BOOT_FILES IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD INITRD_LIVE ISODIR MACHINE_ARCH ROOTFS_SIZE STAGING_DATADIR STAGING_DIR_NATIVE STAGING_LIBDIR TARGET_SYS WORKDIR" +WICVARS ?= "BBLAYERS IMGDEPLOYDIR DEPLOY_DIR_IMAGE IMAGE_BASENAME IMAGE_BOOT_FILES IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD INITRD_LIVE ISODIR ROOTFS_SIZE STAGING_DATADIR STAGING_DIR_NATIVE STAGING_LIBDIR TARGET_SYS TRANSLATED_TARGET_ARCH WORKDIR" def wks_search(files, search_path): for f in files:
scripts/lib/wic/plugins/source/isoimage-isohybrid.py +4 -4
@@ -158,11 +158,11 @@ class IsoImagePlugin(SourcePlugin): if not image_type: msger.error("Couldn't find INITRAMFS_FSTYPES, exiting.\n") - machine_arch = get_bitbake_var("MACHINE_ARCH") - if not machine_arch: - msger.error("Couldn't find MACHINE_ARCH, exiting.\n") + target_arch = get_bitbake_var("TRANSLATED_TARGET_ARCH") + if not target_arch: + msger.error("Couldn't find TRANSLATED_TARGET_ARCH, exiting.\n") - initrd = glob.glob('%s/%s*%s.%s' % (initrd_dir, image_name, machine_arch, image_type))[0] + initrd = glob.glob('%s/%s*%s.%s' % (initrd_dir, image_name, target_arch, image_type))[0] if not os.path.exists(initrd): # Create initrd from rootfs directory
Signature · 1 line
2.1.4
PATCH 13/14 selftest: stop using hddimg in the wic test suite
In reply to Ed BartoshRemoved hddimg from IMAGE_FEATURES as wic code doesn't use hddimg anymore.
[YOCTO #10835]
--- meta/lib/oeqa/selftest/wic.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
meta/lib/oeqa/selftest/wic.py +1 -2
@@ -43,8 +43,7 @@ class Wic(oeSelfTest): def setUpLocal(self): """This code is executed before each test method.""" - self.write_config('IMAGE_FSTYPES += " hddimg"\n' - 'MACHINE_FEATURES_append = " efi"\n' + self.write_config('MACHINE_FEATURES_append = " efi"\n' 'WKS_FILE = "wic-image-minimal"\n') # Do this here instead of in setUpClass as the base setUp does some
Signature · 1 line
2.1.4
PATCH 14/14 selftest: wic: fix test_iso_image test case
In reply to Ed BartoshAdded "iso" to IMAGE_FSTYPES to build iso artifacts required to fix test of isoimage-isohybrid wic plugin.
--- meta/lib/oeqa/selftest/wic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/wic.py +2 -1
@@ -43,7 +43,8 @@ class Wic(oeSelfTest): def setUpLocal(self): """This code is executed before each test method.""" - self.write_config('MACHINE_FEATURES_append = " efi"\n' + self.write_config('IMAGE_FSTYPES = "iso"\n' + 'MACHINE_FEATURES_append = " efi"\n' 'WKS_FILE = "wic-image-minimal"\n') # Do this here instead of in setUpClass as the base setUp does some
Signature · 1 line
2.1.4