From patchwork Fri Jul 31 15:28:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 94062 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40646C5516F for ; Fri, 31 Jul 2026 15:28:19 +0000 (UTC) Received: from mail-ua1-f53.google.com (mail-ua1-f53.google.com [209.85.222.53]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.12.1785511696488408591 for ; Fri, 31 Jul 2026 08:28:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=F5SFPVOo; spf=pass (domain: gmail.com, ip: 209.85.222.53, mailfrom: twoerner@gmail.com) Received: by mail-ua1-f53.google.com with SMTP id a1e0cc1a2514c-96723c7151eso273373241.2 for ; Fri, 31 Jul 2026 08:28:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785511695; x=1786116495; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=0zJjBb6df65zdd6rH3XQfHwC7WrqgvpRMiWDyR8oMjw=; b=F5SFPVOoufw3ghwsS7U5RQ8GUmpgOvg6vH3/rJHcIZxEKHYLtjUoQM9gTei2E35EtZ N8Ww0KswoTZZfvX3m6nHSwC0jYZ9CFFPO8WGEPu18ZwgMPa/EmdCeF+yL1FN1NWRlWSt JNrul97VivfhoGe9Pwd58WhbR77SUIRdxwCPwcndS2ezH9aaB3mo6blrNI1Rj+5cqzYd PxAu3dObGb4p8WmXf1XcgUBZjrut9pVSI2W3/JPS3mDFwT5htIwahJ+qwvKWcmZnHsIR qNF+7tye6zCt2BvP8eIE91/q4XojIKpAWEOekNK/pnf4+VhxYxXN+jtHMnlKZPcGsaNf 6mBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785511695; x=1786116495; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=0zJjBb6df65zdd6rH3XQfHwC7WrqgvpRMiWDyR8oMjw=; b=VGMbNiSfYjXVVZwgM/2Kw8wU3qH+NjQ9dTpevTu+E/PRF12jA2mEc5v+Ac+eSPDEPD Adjn3VrjGmOPDJaTu/RlrWpMrVIEQF3ktT0CZvJcBpmayGNuqm9GT/ilS7X1OCdedNsM 9vWCYDx1YAy8/vej73J7ldLIYfz6l+eKwmcbqlzbulGmCh4zEc6FKUR842Fh83Q8iHmX UinYowZEnvdVWXBlKM95DleqtoLgR4otuPGeX18ZlWvBVKtkinHnrUeB8r3ybAll2vCJ htU8NlbLgFe5dFaKJinxiWuQd0p4pDtpa4XH9YlJXDSJD/kHb2hFF6Lr2J86RedQZJIz AnBA== X-Gm-Message-State: AOJu0YytTrMUSe6vfgPcqZIRsoWxmx0l+3zt3671RapWIdGQp2hIgQaW fcKaxNCbnguEO/38LG5jpQxBQl7mIg2jSfqAQ7q+3+5e04dLLzialZ65Byxdqg== X-Gm-Gg: AR+sD12yXgZ+3CNghJxZNfxSUcKJHNlEZUkuxxnY/DbUhd9WAnOJCV9U4LS2uNWBJSa jrP9CL0c7/PW9KPbn0cfsBczJseGcNRHCQRfDg1in+W7JU6BfTxy1qdkiCDW5ScMNkabEmO9tX0 SA32PrH66n+fr7xVmLhpFO5leaTtv1DiBjYwQMYeKsF5Gh0un0OeePsm0bFu+H7PpEqdJuu8T60 l2ypucnTA/JdsCU1kY7KUuDEF0RQ68+lzBGbnnxCTOhATMc1B0ahJ3jQVqtWpO82dDuU0MoOcLL gmewiZ9LsY/iATewS4rNdUTVeMAGuc4wcxParPUdt6EvB3DhHgkn0r3CsIg5dW06jUIhgp/2KIE v+QKODWWOaCMDzLKIZ4cVCazf7I8pe5tVxDporuwtC3IE+UV8Z+KReL94WfwWtzIpzDfFLEkbEe 1PjBi4mBhdRRLi6uzclM0ch0Cd06AEAKGBuhK2LxoW39+rARSBhhQ/L+ASFo+ioe9U73JZoONFf W0N2BZlO2Fnz2HptYHaLxpTQ/1o/yE= X-Received: by 2002:a05:6102:809c:b0:74a:992e:84f6 with SMTP id ada2fe7eead31-75b23b6aa90mr542223137.10.1785511695364; Fri, 31 Jul 2026 08:28:15 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-759c9559116sm837007137.11.2026.07.31.08.28.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 08:28:14 -0700 (PDT) From: Trevor Woerner To: openembedded-core@lists.openembedded.org Subject: [PATCH v5 1/6] wic-tools: drop the target bootloader firmware Date: Fri, 31 Jul 2026 11:28:05 -0400 Message-ID: <20260731152810.2641327-2-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260731152810.2641327-1-twoerner@gmail.com> References: <20260731152810.2641327-1-twoerner@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 31 Jul 2026 15:28:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242447 wic-tools should stage only wic's host tools, but its arch-specific appends also depended on target bootloader firmware (syslinux, grub-efi, systemd-boot) solely for the wic oe-selftest. Which firmware is needed depends on the plugins a .wks uses, so that firmware is the responsibility of whoever supplies the .wks, not of wic-tools. Have the oe-selftest bitbake those recipes itself instead. Images already work that way through WKS_FILE_DEPENDS in image_types_wic.bbclass, and the oe-selftest now does the equivalent, adding syslinux to core-image-minimal's DEPENDS where the tests expect it in the recipe sysroot. AI-Generated: codex/claude-opus 5 (xhigh) Signed-off-by: Trevor Woerner --- changes in v5: - trimmed the commit message and in-tree comments changes in v4: - new in v4 --- meta/lib/oeqa/selftest/cases/wic.py | 33 +++++++++++++++++++++++------ meta/recipes-core/meta/wic-tools.bb | 7 +++--- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 4e94f4d39abd..f9b893fc8581 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -72,12 +72,23 @@ class WicTestCase(OESelftestTestCase): if self.td['USE_NLS'] != 'yes': self.skipTest('wic-tools needs USE_NLS=yes') - bitbake('wic-tools core-image-minimal core-image-minimal-mtdutils') + targets = 'wic-tools core-image-minimal core-image-minimal-mtdutils' + targets += ' ' + ' '.join(self._firmware_recipes()) + bitbake(targets) WicTestCase.image_is_ready = True os.environ['PATH'] = self._get_wic_path() rmtree(self.resultdir, ignore_errors=True) + def _firmware_recipes(self): + arch = self.td['HOST_ARCH'] + recipes = [] + if arch in ('i586', 'i686', 'x86_64', 'x86-64'): + recipes += ['syslinux', 'grub-efi', 'systemd-boot'] + elif arch == 'aarch64': + recipes += ['grub-efi', 'systemd-boot'] + return recipes + def tearDownLocal(self): """Remove resultdir as it may contain images.""" if self._old_path is None: @@ -391,9 +402,13 @@ class Wic(WicTestCase): @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_build_artifacts(self): """Test wic create directdisk providing all artifacts.""" - bb_vars = get_bb_vars(['STAGING_DATADIR', 'RECIPE_SYSROOT_NATIVE'], - 'wic-tools') - bb_vars.update(get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'], + # wic expects syslinux in core-image-minimal's recipe sysroot. + config = 'DEPENDS:pn-core-image-minimal += "syslinux"\n' + self.append_config(config) + bitbake('core-image-minimal') + self.remove_config(config) + bb_vars = get_bb_vars(['RECIPE_SYSROOT_NATIVE'], 'wic-tools') + bb_vars.update(get_bb_vars(['STAGING_DATADIR', 'DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'], 'core-image-minimal')) bbvars = {key.lower(): value for key, value in bb_vars.items()} bbvars['resultdir'] = self.resultdir @@ -494,9 +509,13 @@ class Wic(WicTestCase): @skipIfNotArch(['i586', 'i686', 'x86_64']) def test_rootfs_artifacts(self): """Test usage of rootfs plugin with rootfs paths""" - bb_vars = get_bb_vars(['STAGING_DATADIR', 'RECIPE_SYSROOT_NATIVE'], - 'wic-tools') - bb_vars.update(get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'], + # wic expects syslinux in core-image-minimal's recipe sysroot. + config = 'DEPENDS:pn-core-image-minimal += "syslinux"\n' + self.append_config(config) + bitbake('core-image-minimal') + self.remove_config(config) + bb_vars = get_bb_vars(['RECIPE_SYSROOT_NATIVE'], 'wic-tools') + bb_vars.update(get_bb_vars(['STAGING_DATADIR', 'DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'], 'core-image-minimal')) bbvars = {key.lower(): value for key, value in bb_vars.items()} bbvars['wks'] = "directdisk-multi-rootfs" diff --git a/meta/recipes-core/meta/wic-tools.bb b/meta/recipes-core/meta/wic-tools.bb index 823dbe6db643..c6e3d1b419dc 100644 --- a/meta/recipes-core/meta/wic-tools.bb +++ b/meta/recipes-core/meta/wic-tools.bb @@ -10,10 +10,9 @@ DEPENDS = "\ e2fsprogs-native util-linux-native tar-native erofs-utils-native \ virtual/cross-binutils \ " -DEPENDS:append:x86 = " syslinux-native syslinux grub-efi systemd-boot" -DEPENDS:append:x86-64 = " syslinux-native syslinux grub-efi systemd-boot" -DEPENDS:append:x86-x32 = " syslinux-native syslinux grub-efi" -DEPENDS:append:aarch64 = " grub-efi systemd-boot" +DEPENDS:append:x86 = " syslinux-native" +DEPENDS:append:x86-64 = " syslinux-native" +DEPENDS:append:x86-x32 = " syslinux-native" INHIBIT_DEFAULT_DEPS = "1" From patchwork Fri Jul 31 15:28:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 94061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79ED9C54F54 for ; Fri, 31 Jul 2026 15:28:19 +0000 (UTC) Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.9.1785511697979230863 for ; Fri, 31 Jul 2026 08:28:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=RDlY0sZM; spf=pass (domain: gmail.com, ip: 209.85.217.47, mailfrom: twoerner@gmail.com) Received: by mail-vs1-f47.google.com with SMTP id ada2fe7eead31-73791ee3612so588850137.1 for ; Fri, 31 Jul 2026 08:28:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785511697; x=1786116497; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=Y3r22QuEPzkd794+1HOz7ayBUaKrkj3AY/h3uW+txxs=; b=RDlY0sZMlOZ+i1t7Q7aP6pcWo/U2hvRbTjCxZFM3I8pCWiu4kDE55pGXX4etxrvO6x iRjSnMrEIOnHqSIfJ7QAM1Bs/x+fdvzIxuslFsb0T/P3VtJ5f/5hBa0mKbHAJZOwGF07 VMnISlCnOqXAiUgSRUs5UtfJyBIZX7aM4pHCU6iilcqQ8Pg1Zjlagie6IT15RtU4GxX5 mAK4y+aB9tV0+HeRWZpycl5hAn9oyRxFcp1VDKscDgn9m3umtg0yjKMvXNxqKdNnlTw+ x+DqQfMrO2ZUNqVesiR3eflsANeujKsu1IergKG+1DnbG3C/rxbHKuQQVcFgLGEeynzy AWEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785511697; x=1786116497; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=Y3r22QuEPzkd794+1HOz7ayBUaKrkj3AY/h3uW+txxs=; b=ILgFXQNAlxtJgBw/HPAqoOk3yXrJ45r/h8b1pbr0BPaf0Ut7+aUdGaeTO1KnuEd0VO BsQrZmj6V48uca/t7LtE1blEM6FkTKnUgDUaUyXYTINyBYvu/HSggKu8hCNtvoQbTaTN UzpjCfqj7bDlOxPRVuHCn02XU4FEeeBsXAU2x7rcmluQRXcoW19eDOp+17/qLZ8+nR/S x8BUhQ5rSTWT/Rayk4dM1AcqUWq9hZ6ikDFwiZcYrUmWQrDv8OnhPVoWbY+ArOfmrs1N 5WJ7QGghXEuGAvDEL0dUCovfkoS8QYoimuGgfPzRkz/e8kRLpv2y2DkyMKTENNcvWRi+ LIVw== X-Gm-Message-State: AOJu0YwIpco5dpGuU2zGnFz/K5fCpXRORptoq8hGkS4CTqCZlHPOZEDR htqYIRwExqsKClODQsDIXHFhxFZsPX7sUoF5Igt43MMtdoJLeuzbvVsSYeZbBg== X-Gm-Gg: AR+sD1324O92pW5+TD1BlgZP9I+gX9TRRLHX7n06B/KqLyyvt5d1tgVHye6/2C13qnL v7ivWS8lAhkyQraavw2Q/uobG1spj5PuiRSfqENhKo4fxGV9o0U83RYIaHNMpVLRm1ZxGofCa3K /+B1Wzut5prWSxfESA2kH4HCS3aom77mHjjNUjmF3rRr6X/idk3OoatVFB3ZKDuijturC0PGWpi VabNraM5q3uq1aDD6+sg6lsw6PJtzoLA6gHvaL3cqrQyUd4VuX+bfHd0nV4jeCdOLY/91QxCjP2 xTSEAahtAljJgG9YPC3UYOtJotgSsX7V6Hl/HNXCQpQbGdgxtNaNUdUKO6nyHJ6vg922YwuqOUZ XCGlPDoC04wYpF/t/CYzezMLTEgGAUqbKC8C15l5fbfUbUsJInpHCH08d11owdtP3BlNcz5iZbn uWz9dydCO/gxTFXU+cEkrRFzpcM6RnJvfeNyKSV8bttnBLdZPYd3eO33gvXHX+VoSQ4nMZAHbsi rKLA88lGxJ8KoEAhx2CaGFO+w7qVP4= X-Received: by 2002:a05:6102:8096:b0:6c5:d55d:c093 with SMTP id ada2fe7eead31-75b22b672b8mr610613137.8.1785511696841; Fri, 31 Jul 2026 08:28:16 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-759c9559116sm837007137.11.2026.07.31.08.28.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 08:28:15 -0700 (PDT) From: Trevor Woerner To: openembedded-core@lists.openembedded.org Subject: [PATCH v5 2/6] wic: add a shared helper tool list Date: Fri, 31 Jul 2026 11:28:06 -0400 Message-ID: <20260731152810.2641327-3-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260731152810.2641327-1-twoerner@gmail.com> References: <20260731152810.2641327-1-twoerner@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 31 Jul 2026 15:28:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242448 The tools wic shells out to are listed in both wic-tools and image_types_wic.bbclass, and the copies have drifted. Add conf/wic-helper-tools.inc as the single source of truth. Only wic-tools staged tar-native and util-linux-native before; images now get them too. AI-Generated: codex/claude-opus 5 (xhigh) Signed-off-by: Trevor Woerner --- changes in v5: - new in v5 --- meta/classes-recipe/image_types_wic.bbclass | 5 +++-- meta/conf/wic-helper-tools.inc | 16 ++++++++++++++++ meta/recipes-core/meta/wic-tools.bb | 7 +++---- 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 meta/conf/wic-helper-tools.inc diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index ea8c1c94ca2f..3f25b7912b26 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -112,14 +112,15 @@ do_image_wic[cleandirs] = "${WORKDIR}/build-wic" USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${CONVERSIONTYPES}'.split()), '1', '', d)}" WKS_FILE_CHECKSUM = "${@wks_checksums(d.getVar('WKS_FILES').split(), d.getVar('WKS_SEARCH_PATH')) if '${USING_WIC}' else ''}" do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}" -do_image_wic[depends] += "${@' '.join('%s-native:do_populate_sysroot' % r for r in ('wic', 'parted', 'gptfdisk', 'dosfstools', 'mtools'))}" + +require conf/wic-helper-tools.inc +do_image_wic[depends] += "${@' '.join('%s:do_populate_sysroot' % r for r in ('wic-native ' + d.getVar('WIC_HELPER_TOOLS_DEPENDS')).split())}" # We ensure all artfacts are deployed (e.g virtual/bootloader) do_image_wic[recrdeptask] += "do_deploy" do_image_wic[deptask] += "do_image_complete" WKS_FILE_DEPENDS_DEFAULT = '${@bb.utils.contains_any("BUILD_ARCH", [ 'x86_64', 'i686' ], "syslinux-native", "",d)}' -WKS_FILE_DEPENDS_DEFAULT += "wic-native bmaptool-native cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native erofs-utils-native" # Unified kernel images need objcopy WKS_FILE_DEPENDS_DEFAULT += "virtual/cross-binutils" WKS_FILE_DEPENDS_BOOTLOADERS = "" diff --git a/meta/conf/wic-helper-tools.inc b/meta/conf/wic-helper-tools.inc new file mode 100644 index 000000000000..f3b2b698e2df --- /dev/null +++ b/meta/conf/wic-helper-tools.inc @@ -0,0 +1,16 @@ +WIC_HELPER_TOOLS ?= "\ + parted \ + gptfdisk \ + dosfstools \ + mtools \ + bmaptool \ + btrfs-tools \ + squashfs-tools \ + e2fsprogs \ + util-linux \ + tar \ + erofs-utils \ +" + +WIC_HELPER_TOOLS_NATIVE_ONLY ?= "cdrtools" +WIC_HELPER_TOOLS_DEPENDS = "${@' '.join('%s-native' % t for t in (d.getVar('WIC_HELPER_TOOLS') + ' ' + d.getVar('WIC_HELPER_TOOLS_NATIVE_ONLY')).split())}" diff --git a/meta/recipes-core/meta/wic-tools.bb b/meta/recipes-core/meta/wic-tools.bb index c6e3d1b419dc..c3c39cec011d 100644 --- a/meta/recipes-core/meta/wic-tools.bb +++ b/meta/recipes-core/meta/wic-tools.bb @@ -2,12 +2,11 @@ SUMMARY = "A meta recipe to build native tools used by wic." LICENSE = "MIT" +require conf/wic-helper-tools.inc DEPENDS = "\ wic-native \ - parted-native gptfdisk-native dosfstools-native \ - mtools-native bmaptool-native grub-native cdrtools-native \ - btrfs-tools-native squashfs-tools-native pseudo-native \ - e2fsprogs-native util-linux-native tar-native erofs-utils-native \ + ${WIC_HELPER_TOOLS_DEPENDS} \ + grub-native pseudo-native \ virtual/cross-binutils \ " DEPENDS:append:x86 = " syslinux-native" From patchwork Fri Jul 31 15:28:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 94065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1C43C55173 for ; Fri, 31 Jul 2026 15:28:29 +0000 (UTC) Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.11.1785511699264626403 for ; Fri, 31 Jul 2026 08:28:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=YYHdn51t; spf=pass (domain: gmail.com, ip: 209.85.217.48, mailfrom: twoerner@gmail.com) Received: by mail-vs1-f48.google.com with SMTP id ada2fe7eead31-738cdd667ceso272605137.3 for ; Fri, 31 Jul 2026 08:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785511698; x=1786116498; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=aLaYOjkIf8RKBEr2gJQPI9Auqv7PWbYfgX1g0HCOi6A=; b=YYHdn51tM81ahqMw1bVZfVv/Z0NRaBCsbTjbtznWWbd4nbhOcEXLlDAmaiJ4+k25DR 9PxV9+4SoAMIW96x1w5ir2/8O7ZuLfPZsDnMgc3vS4pKbPqynxertM1dR9jrdkIOoCo8 VKzxdSJHWyRKM6lqWsp57sc0AXYQ3gcWZfyAMt7+tA4Z37hQ/WXSz0j54878IhbLWKhk gaQJ/2PlP/KMeWiP7NM+VwBVwyja4n/+x0gu2vkN01320pWHZmhQGaa+glqjxD/c7Lxi LJ4VKptZem5goZwYjlpxmTYCTx3IU9MhxYgrXCjpE0cTPnP6H0xARG+vpJzQNJK4Pogd sRYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785511698; x=1786116498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=aLaYOjkIf8RKBEr2gJQPI9Auqv7PWbYfgX1g0HCOi6A=; b=dNm3KJOPnoP9xrg6kP1MajgrH2GnSt9hHcgQTBDXYAYdN8wtikDY7a5w3MiblBEkYp 3RXjzA1glYTUWkt0ltGiNGEwpbLhpfOsF/phYibKtnZ0jGof5KG+QeBPjTt7VhqTqIE0 2Os4hnnzbbTxNKYaf8bjbtG5wp0TI1hb3HvAJB2V9PFrptOVFN28qD8zCGHc4TGIYg+A 7ifyUl6ingBTpJNuJqoxvCEenPbIkV5uNED+SP6W8ybSDClH/pd8D0F9vLk0tsbtahxv YPI0EabSGT1DH7PQiIjkSddwemOhHFw36HfmOFHSz+B5+ye2rLiQuMr/ISmCdao0dUQm rL4A== X-Gm-Message-State: AOJu0Yxw6VOYxyJxi848c59U5/dsMfzxuWG6a+17pRRnD0sMLNu5H+LS cWNevdmXQK4KfuQxcCHSalj3bOl2Xnsl1LKuOYemXX606zQtCGkJu1hPOn2QMw== X-Gm-Gg: AR+sD12vB8oZ5rxnvVAJYuoshM7N33UpJazYFyJN5PQ6dKU+L+3IsR+Os+gXjTwXMDa D0zC1vgzmHyU0OfUhFD1Ia9TS7DpxeMlG2/WkMbOCwvhDZE7orIh81d/p1Mjzk+K8n+CPzBbEyL gpSfF97ATeCcTsAgXb1aJKrTWzQvHtaJXYJCVn7uwdA0IcGUbFw8ddx2lTqJHw/gkYnVzWLCHs9 B/REOogcAauxBtc853JDaY8wBTbalePYJka6TTiIAEZSsR8Q+o2fdmuNo0etsqcBf3qOTkkrTrK g82k+V+WXRImolcWPUy2FtWzucA4e9O3DhenUgUMsBLqH+W4SpGzKSobjQBhgqBCDR87QMTWp84 7R35X/jxQHaQV/HU0/XyPFOr7q9h1K+bLCt4JBSTEL7EfV4h3A56/dK2lPTqKN9NUKkXOjj0Ipe cU2utNOcljeNXp1XuYJBf55sPBiCB+IQijtHEoWCqycG8xCS5hTx8s+wH0xkeGuQF8AtMf/YcTP BLu1ZMHouvARpTkNCmTHcK4/ETwmc8EVjlphyrRcg== X-Received: by 2002:a05:6102:2d09:b0:737:783d:1900 with SMTP id ada2fe7eead31-75b23356ce8mr470591137.9.1785511698064; Fri, 31 Jul 2026 08:28:18 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-759c9559116sm837007137.11.2026.07.31.08.28.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 08:28:17 -0700 (PDT) From: Trevor Woerner To: openembedded-core@lists.openembedded.org Subject: [PATCH v5 3/6] wic: add runtime dependencies on the tools it invokes Date: Fri, 31 Jul 2026 11:28:07 -0400 Message-ID: <20260731152810.2641327-4-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260731152810.2641327-1-twoerner@gmail.com> References: <20260731152810.2641327-1-twoerner@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 31 Jul 2026 15:28:29 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242449 wic shells out to a range of host tools (parted, mkfs.*, mcopy, sfdisk, and more) but, since the recipe was created, has declared none of them, so an installed wic works only by chance depending on what the host provides. Declare them as RDEPENDS so they are installed with wic. AI-Generated: codex/claude-opus 4.8 (xhigh) Signed-off-by: Trevor Woerner --- changes in v5: - take the tool list from the shared conf/wic-helper-tools.inc - drop the bootloader (grub, syslinux) RDEPENDS entirely; declare only the host tools wic runs - trimmed the commit message; dropped the in-recipe comments changes in v4: - gate grub to x86 and aarch64; move syslinux into the same arch-gated appends - also depend on syslinux-isolinux for isolinux.bin changes in v3: - list the tools on all variants rather than only the nativesdk variant changes in v2: - merge the tool list into the wic recipe as RDEPENDS; drop the separate .inc --- meta/conf/wic-helper-tools.inc | 3 +++ meta/recipes-support/wic/wic_0.3.1.bb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/meta/conf/wic-helper-tools.inc b/meta/conf/wic-helper-tools.inc index f3b2b698e2df..66f2f1b2bddc 100644 --- a/meta/conf/wic-helper-tools.inc +++ b/meta/conf/wic-helper-tools.inc @@ -14,3 +14,6 @@ WIC_HELPER_TOOLS ?= "\ WIC_HELPER_TOOLS_NATIVE_ONLY ?= "cdrtools" WIC_HELPER_TOOLS_DEPENDS = "${@' '.join('%s-native' % t for t in (d.getVar('WIC_HELPER_TOOLS') + ' ' + d.getVar('WIC_HELPER_TOOLS_NATIVE_ONLY')).split())}" + +WIC_HELPER_TOOLS_PACKAGE_ONLY ?= "e2fsprogs-resize2fs" +WIC_HELPER_TOOLS_RDEPENDS = "${WIC_HELPER_TOOLS} ${WIC_HELPER_TOOLS_PACKAGE_ONLY}" diff --git a/meta/recipes-support/wic/wic_0.3.1.bb b/meta/recipes-support/wic/wic_0.3.1.bb index d9b4cc05c4bd..d8b8c6905d87 100644 --- a/meta/recipes-support/wic/wic_0.3.1.bb +++ b/meta/recipes-support/wic/wic_0.3.1.bb @@ -10,11 +10,14 @@ CVE_PRODUCT = "yoctoproject:wic" inherit python_hatchling +require conf/wic-helper-tools.inc + RDEPENDS:${PN} += " \ python3-core \ python3-json \ python3-logging \ python3-misc \ + ${WIC_HELPER_TOOLS_RDEPENDS} \ " BBCLASSEXTEND = "native nativesdk" From patchwork Fri Jul 31 15:28:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 94063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 836F6C55171 for ; Fri, 31 Jul 2026 15:28:29 +0000 (UTC) Received: from mail-vk1-f174.google.com (mail-vk1-f174.google.com [209.85.221.174]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.13.1785511700650695385 for ; Fri, 31 Jul 2026 08:28:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=efgSW/8Z; spf=pass (domain: gmail.com, ip: 209.85.221.174, mailfrom: twoerner@gmail.com) Received: by mail-vk1-f174.google.com with SMTP id 71dfb90a1353d-59b074ec7ceso392521e0c.1 for ; Fri, 31 Jul 2026 08:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785511699; x=1786116499; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=F0Sg/5eEE9YGtEb5/elpzX0ofAgSiKn5ZC6cvlKurlE=; b=efgSW/8ZWLSrU+6QlaunaXafiDVPvQ6bh3ffgje6La+rktkC1I723MuFEAr1t90qaR P6AGrL4iDHRAxzsfKZbIqbItwHIX11LDwrVNQkscIkmjpzr5itFWn7rOAcPzppzxyfQ6 X58meklFGW97Gqb+8axv5DlN5T+KWNwqfLGmaCSEStpJb3tc25QuaNePVGA7WciVcMz+ PCG2RzIG6pN1kzmWOGOSe768NryHc543ASf1q8sO0YwAeateSNrpSSF0ovxfebC14KBG mHDDZBKlwQTULnsLX+NYT/4e+bCxlyPElToXtoD4HV4Vn/vK2IyLJMUHpfRXUK/Ar7F3 OZdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785511699; x=1786116499; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=F0Sg/5eEE9YGtEb5/elpzX0ofAgSiKn5ZC6cvlKurlE=; b=LIIacZZovsAIrJfUJ9+YyNSpzRhl6bo28RqsVeJyk0b5S2ah5XNhgxUDhfg7pZ1bHW AoG1ZKvrVRwMC2lqszV7xLNNP8I09zKeaaJs6IhLpBE4PJk9QP9UsLm/dUcgSkNOSS/M HZTUs3i3EoiWZKF02Svrt9HQzlmi2xm2fkIV9gFI7k5+vzBk45//PT2N3WlIi8yvsAVy saM/OqDZtBj7qFlzkRrHk2f+M2IkdxRqGE9RCidcwUpKmLU8jZCQLpLpXYLzs4Lyy1Pu ql/8jlBq6IwQuI3KRCkgnl67ztD7FamEGJdfgBBm0jXIC3dxr/cBbWYBwc/ujfKg0A2d lu3Q== X-Gm-Message-State: AOJu0Yx1g3VHiPChHC6cAoGodmuJ3ZWh29xc8Oqdl6qfWiy62L3qoNYe hZVM92qZleUEUaEKpvVcr72bqFG9cxp5ekng7rcjru7tFKqIxGpaQWyTp1gujA== X-Gm-Gg: AR+sD12YH5jJO4U3rfjOLTfCaSWDp8d6Jmili1erjsAHMY9sDjMWVfQTpvVvHElVjom j2FO4lWFkFcOI/U2WvbvbP2tf74MYVLrt0n/7lX06vEKTyV/8Wqb9fvfi5QpZud1NlDsdReW08N lqfc/7GiTjHdQIICPLhaan76VJjhvXBPRf4Y/d3nxvWmKruNBmI/g6zc4AAO94AIfbQvMTpK8Gk +/bxS5FM6OXRMv42B6dBu4TDvq69PUUMoBto84Tp0Zpg1hUP3YGJUlfNK57aUiC/z18M1893EAl MqX+s14usMs6ZhH07/RCoQyWg4PxmILEAtFk18VFCUGSAE2zWczlonHixIVFloiESndz3v3o6CK O7exUGa8M06n5yXrSejmxLnpb80yrKJdWKDlKiVvj+sTDF5Mr0WdM53ocwLBgZIMp9NSr9ziBlz 3akTUQKVLZU95bGxtNOEcNYvAmfrhlIDYS3fAe8vr8YLyS/T6EZ/72kNY9xb+G/a6+aGBVyt9nr TZqnB+QNA6SPTXKlr/mFA1Es/2rbyY= X-Received: by 2002:a05:6102:1493:b0:738:84c:6b3 with SMTP id ada2fe7eead31-75b2196462fmr518883137.3.1785511699486; Fri, 31 Jul 2026 08:28:19 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-759c9559116sm837007137.11.2026.07.31.08.28.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 08:28:18 -0700 (PDT) From: Trevor Woerner To: openembedded-core@lists.openembedded.org Subject: [PATCH v5 4/6] oeqa/selftest/wic: drop dead COREBASE/scripts wic lookup Date: Fri, 31 Jul 2026 11:28:08 -0400 Message-ID: <20260731152810.2641327-5-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260731152810.2641327-1-twoerner@gmail.com> References: <20260731152810.2641327-1-twoerner@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 31 Jul 2026 15:28:29 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242450 wic moved to a standalone repository and is no longer shipped in scripts/, so that search path can never match. Look for wic only in the wic-tools native sysroot. AI-Generated: codex/claude-opus 4.8 (xhigh) Signed-off-by: Trevor Woerner --- changes in v5: - trimmed the commit message changes in v4: - new in v4 --- meta/lib/oeqa/selftest/cases/wic.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index f9b893fc8581..8a39a4ddc603 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -100,18 +100,11 @@ class WicTestCase(OESelftestTestCase): def _get_wic_path(self): if WicTestCase.wic_bindir is None: - search_paths = [ - os.path.join(self.td['COREBASE'], 'scripts'), - os.path.join(get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools'), 'usr', 'bin'), - ] - - for bindir in search_paths: - if os.path.exists(os.path.join(bindir, 'wic')): - WicTestCase.wic_bindir = bindir - break - - if WicTestCase.wic_bindir is None: - self.fail("Unable to find the wic binary in %s" % ', '.join(search_paths)) + bindir = os.path.join(get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools'), + 'usr', 'bin') + if not os.path.exists(os.path.join(bindir, 'wic')): + self.fail("Unable to find the wic binary in %s" % bindir) + WicTestCase.wic_bindir = bindir path_entries = [] for path_group in ( From patchwork Fri Jul 31 15:28:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 94066 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 969D3C5516F for ; Fri, 31 Jul 2026 15:28:29 +0000 (UTC) Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com [209.85.222.51]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.15.1785511704671809074 for ; Fri, 31 Jul 2026 08:28:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=kizPPecL; spf=pass (domain: gmail.com, ip: 209.85.222.51, mailfrom: twoerner@gmail.com) Received: by mail-ua1-f51.google.com with SMTP id a1e0cc1a2514c-9618b8bdc51so269530241.1 for ; Fri, 31 Jul 2026 08:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785511703; x=1786116503; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=y5Q7gJXvDV99uZdHnOw2+yMoew8tvXxSovnpkrTqZ3g=; b=kizPPecLnEaUA/AO2eoQC9UaaIHsajyHlTLtzm5Vqp5qHMh3+uHgJpcJLnQqNJDVuv yFj5KOVSEqFzfu2Ng6+JhlPiPGGhmAeUu6yCKK3UYGjGRI577lq6lSCqEwqbXlm2yScZ oxMxtHboXCiCR01x0hSUZohScxiBiTf9dejGgLCHkwD6wg0takh23z5+VPvkAlJNtbRb lChbEZ6zXS9uMOgAwYyQG/Tn1PWbmA7EO3vSYsp/xBhnUf72YoMKzk0PiUn1JtBfD2Yl Zb0BGerA33TebrVH1joQbO+y5tONc5NMXbjTPF7HSUPABwImUfaEyoxbzlj5YU9uOzhn orhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785511703; x=1786116503; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=y5Q7gJXvDV99uZdHnOw2+yMoew8tvXxSovnpkrTqZ3g=; b=Ql7ARgEJ8M/vsaRZ4ypfPu6crqy6vMDjRNAEKwT3NGYVMzC/3lQUb+vO/EECYZMOcT KQZrSpseML4ix8Hcc16uxhzwW7pWofU6Sfahri8TiXKwLdce0ldxQb/JbSuDGZazfhU1 WTYO+J9QpjgfsZxIb1YRQlEn403VCsv9MYVqSg47vDBCr3NhOFOXYJOIgkSQIcii/ueF kYSSFI38KZhNUElSSYBlY7cWbRUmceKzOwVpsX7yBQ556hyB+Q5/aoLKe4XgyvCSLIqs jf+Oxx3xx85tR/PLQUblX5q4cSzzHze59hoG1bylUDmKCk4vGTyGKztNJYw0o0vjm+Vv +OoA== X-Gm-Message-State: AOJu0YyO2vN4x1FjQBvYAiTEGttP3fRzjeyppp+SulaoPR4LIQs+ijjm klUU32X6y7iHck/w89Wn3Xv+r5BefpQnb+yFCHbg4PZa/CG9cg/swE3tB/EhUw== X-Gm-Gg: AR+sD10gxLg6ucXo2UY3ttmCNTipwKAMfKmfXBwqPlXMDz7yKWN3mHuELzGigAhCTFC LwFri3AVnvuLQsancy7dhmf3qAeiCF0/jgXOuEoxIyAPwHBUlwZNbuxei8+x9ybOgmDkBzSW31V PcxIvXqANaiBCzNG5mrcMY5OyHoYw+uYeGRIiVX7Jb9Pn7igaSdDGsdsVI4IPnyK5MFdXcAH6Fz a9h7BwWOq80VoYsLDnBiHnTizIx+pWh5j12kfbjbM3vom5nv0ArBe56rmtHrf9AAUKQjMeJAOZ3 mlHQAUhq3It38jAZ0RjX6BJHVZNKzcTBafHGp6Ite2FqmDzrRUARGh5SJutw4fb3zhg0sj4MsFs bowLRfcpf1d/1x6hwTa/eN3xKzA8l9WK6+xYINsxp9WCAVZRbs+iw3D31ohD43Jp0ySK4Z5uknK 9NWXTcU9QrJg3Hrq6w6x9g6t2ebD2vuyeytzr5vMze5IhRpiehHM1KsQr/8FV+7Zt+7bkwfJZsO 7jSzXctD8kkifxwf61mCm0bdZEAF0SgTmSHZxbigQ== X-Received: by 2002:a05:6102:4403:b0:744:cb59:d6e0 with SMTP id ada2fe7eead31-75b1e73c2d0mr520359137.0.1785511702967; Fri, 31 Jul 2026 08:28:22 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-759c9559116sm837007137.11.2026.07.31.08.28.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 08:28:19 -0700 (PDT) From: Trevor Woerner To: openembedded-core@lists.openembedded.org Subject: [PATCH v5 5/6] oeqa/selftest/wic: drop redundant per-test PATH overrides Date: Fri, 31 Jul 2026 11:28:09 -0400 Message-ID: <20260731152810.2641327-6-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260731152810.2641327-1-twoerner@gmail.com> References: <20260731152810.2641327-1-twoerner@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 31 Jul 2026 15:28:29 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242451 setUpLocal() already puts wic and its tools on PATH for every test, so the per-test "os.environ['PATH'] = get_bb_var('PATH', 'wic-tools')" overrides and their try/finally wrappers add nothing. Drop them; the resulting dedent makes the diff large, so review with git show -w. AI-Generated: codex/claude-opus 4.8 (xhigh) Signed-off-by: Trevor Woerner --- changes in v5: - trimmed the commit message changes in v4: - new in v4 --- meta/lib/oeqa/selftest/cases/wic.py | 792 +++++++++++++--------------- 1 file changed, 362 insertions(+), 430 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 8a39a4ddc603..5b90c64cfd6b 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -525,104 +525,97 @@ class Wic(WicTestCase): def test_exclude_path(self): """Test --exclude-path wks option.""" - oldpath = os.environ['PATH'] - os.environ['PATH'] = get_bb_var("PATH", "wic-tools") - - try: - wks_file = 'temp.wks' - with open(wks_file, 'w') as wks: - rootfs_dir = get_bb_var('IMAGE_ROOTFS', 'core-image-minimal') - wks.write(""" + wks_file = 'temp.wks' + with open(wks_file, 'w') as wks: + rootfs_dir = get_bb_var('IMAGE_ROOTFS', 'core-image-minimal') + wks.write(""" part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path usr part /usr --source rootfs --ondisk mmcblk0 --fstype=ext4 --rootfs-dir %s/usr part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --rootfs-dir %s/usr part /mnt --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/whoami --rootfs-dir %s/usr""" - % (rootfs_dir, rootfs_dir, rootfs_dir)) - runCmd("wic create %s -e core-image-minimal -o %s" \ - % (wks_file, self.resultdir)) - - os.remove(wks_file) - wicout = glob(os.path.join(self.resultdir, "%s-*direct" % 'temp')) - self.assertEqual(1, len(wicout)) + % (rootfs_dir, rootfs_dir, rootfs_dir)) + runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir)) - wicimg = wicout[0] - - # verify partition size with wic - res = runCmd("parted -m %s unit b p" % wicimg, stderr=subprocess.PIPE) - - # parse parted output which looks like this: - # BYT;\n - # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n - # 1:0.00MiB:200MiB:200MiB:ext4::;\n - partlns = res.output.splitlines()[2:] + os.remove(wks_file) + wicout = glob(os.path.join(self.resultdir, "%s-*direct" % 'temp')) + self.assertEqual(1, len(wicout)) - self.assertEqual(4, len(partlns)) + wicimg = wicout[0] - for part in [1, 2, 3, 4]: - part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part) - partln = partlns[part-1].split(":") - self.assertEqual(7, len(partln)) - start = int(partln[1].rstrip("B")) / 512 - length = int(partln[3].rstrip("B")) / 512 - runCmd("dd if=%s of=%s skip=%d count=%d" % - (wicimg, part_file, start, length)) - - # Test partition 1, should contain the normal root directories, except - # /usr. - res = runCmd("debugfs -R 'ls -p' %s" % \ - os.path.join(self.resultdir, "selftest_img.part1"), stderr=subprocess.PIPE) - files = extract_files(res.output) - self.assertIn("etc", files) - self.assertNotIn("usr", files) - - # Partition 2, should contain common directories for /usr, not root - # directories. - res = runCmd("debugfs -R 'ls -p' %s" % \ - os.path.join(self.resultdir, "selftest_img.part2"), stderr=subprocess.PIPE) - files = extract_files(res.output) - self.assertNotIn("etc", files) - self.assertNotIn("usr", files) - self.assertIn("share", files) - - # Partition 3, should contain the same as partition 2, including the bin - # directory, but not the files inside it. - res = runCmd("debugfs -R 'ls -p' %s" % \ - os.path.join(self.resultdir, "selftest_img.part3"), stderr=subprocess.PIPE) - files = extract_files(res.output) - self.assertNotIn("etc", files) - self.assertNotIn("usr", files) - self.assertIn("share", files) - self.assertIn("bin", files) - res = runCmd("debugfs -R 'ls -p bin' %s" % \ - os.path.join(self.resultdir, "selftest_img.part3"), stderr=subprocess.PIPE) - files = extract_files(res.output) - self.assertIn(".", files) - self.assertIn("..", files) - self.assertEqual(2, len(files)) - - # Partition 4, should contain the same as partition 2, including the bin - # directory, but not whoami (a symlink to busybox.nosuid) inside it. - res = runCmd("debugfs -R 'ls -p' %s" % \ - os.path.join(self.resultdir, "selftest_img.part4"), stderr=subprocess.PIPE) - files = extract_files(res.output) - self.assertNotIn("etc", files) - self.assertNotIn("usr", files) - self.assertIn("share", files) - self.assertIn("bin", files) - res = runCmd("debugfs -R 'ls -p bin' %s" % \ - os.path.join(self.resultdir, "selftest_img.part4"), stderr=subprocess.PIPE) - files = extract_files(res.output) - self.assertIn(".", files) - self.assertIn("..", files) - self.assertIn("who", files) - self.assertNotIn("whoami", files) - - for part in [1, 2, 3, 4]: - part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part) - os.remove(part_file) + # verify partition size with wic + res = runCmd("parted -m %s unit b p" % wicimg, stderr=subprocess.PIPE) - finally: - os.environ['PATH'] = oldpath + # parse parted output which looks like this: + # BYT;\n + # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n + # 1:0.00MiB:200MiB:200MiB:ext4::;\n + partlns = res.output.splitlines()[2:] + + self.assertEqual(4, len(partlns)) + + for part in [1, 2, 3, 4]: + part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part) + partln = partlns[part-1].split(":") + self.assertEqual(7, len(partln)) + start = int(partln[1].rstrip("B")) / 512 + length = int(partln[3].rstrip("B")) / 512 + runCmd("dd if=%s of=%s skip=%d count=%d" % + (wicimg, part_file, start, length)) + + # Test partition 1, should contain the normal root directories, except + # /usr. + res = runCmd("debugfs -R 'ls -p' %s" % \ + os.path.join(self.resultdir, "selftest_img.part1"), stderr=subprocess.PIPE) + files = extract_files(res.output) + self.assertIn("etc", files) + self.assertNotIn("usr", files) + + # Partition 2, should contain common directories for /usr, not root + # directories. + res = runCmd("debugfs -R 'ls -p' %s" % \ + os.path.join(self.resultdir, "selftest_img.part2"), stderr=subprocess.PIPE) + files = extract_files(res.output) + self.assertNotIn("etc", files) + self.assertNotIn("usr", files) + self.assertIn("share", files) + + # Partition 3, should contain the same as partition 2, including the bin + # directory, but not the files inside it. + res = runCmd("debugfs -R 'ls -p' %s" % \ + os.path.join(self.resultdir, "selftest_img.part3"), stderr=subprocess.PIPE) + files = extract_files(res.output) + self.assertNotIn("etc", files) + self.assertNotIn("usr", files) + self.assertIn("share", files) + self.assertIn("bin", files) + res = runCmd("debugfs -R 'ls -p bin' %s" % \ + os.path.join(self.resultdir, "selftest_img.part3"), stderr=subprocess.PIPE) + files = extract_files(res.output) + self.assertIn(".", files) + self.assertIn("..", files) + self.assertEqual(2, len(files)) + + # Partition 4, should contain the same as partition 2, including the bin + # directory, but not whoami (a symlink to busybox.nosuid) inside it. + res = runCmd("debugfs -R 'ls -p' %s" % \ + os.path.join(self.resultdir, "selftest_img.part4"), stderr=subprocess.PIPE) + files = extract_files(res.output) + self.assertNotIn("etc", files) + self.assertNotIn("usr", files) + self.assertIn("share", files) + self.assertIn("bin", files) + res = runCmd("debugfs -R 'ls -p bin' %s" % \ + os.path.join(self.resultdir, "selftest_img.part4"), stderr=subprocess.PIPE) + files = extract_files(res.output) + self.assertIn(".", files) + self.assertIn("..", files) + self.assertIn("who", files) + self.assertNotIn("whoami", files) + + for part in [1, 2, 3, 4]: + part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part) + os.remove(part_file) def test_exclude_path_with_extra_space(self): """Test having --exclude-path with IMAGE_ROOTFS_EXTRA_SPACE. [Yocto #15555]""" @@ -661,75 +654,61 @@ part /mnt --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/whoa def test_include_path(self): """Test --include-path wks option.""" - oldpath = os.environ['PATH'] - os.environ['PATH'] = get_bb_var("PATH", "wic-tools") - - try: - include_path = os.path.join(self.resultdir, 'test-include') - os.makedirs(include_path) - with open(os.path.join(include_path, 'test-file'), 'w') as t: - t.write("test\n") - wks_file = os.path.join(include_path, 'temp.wks') - with open(wks_file, 'w') as wks: - rootfs_dir = get_bb_var('IMAGE_ROOTFS', 'core-image-minimal') - wks.write(""" + include_path = os.path.join(self.resultdir, 'test-include') + os.makedirs(include_path) + with open(os.path.join(include_path, 'test-file'), 'w') as t: + t.write("test\n") + wks_file = os.path.join(include_path, 'temp.wks') + with open(wks_file, 'w') as wks: + rootfs_dir = get_bb_var('IMAGE_ROOTFS', 'core-image-minimal') + wks.write(""" part /part1 --source rootfs --ondisk mmcblk0 --fstype=ext4 part /part2 --source rootfs --ondisk mmcblk0 --fstype=ext4 --include-path %s""" - % (include_path)) - runCmd("wic create %s -e core-image-minimal -o %s" \ - % (wks_file, self.resultdir)) - - part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0] - part2 = glob(os.path.join(self.resultdir, 'temp-*.direct.p2'))[0] + % (include_path)) + runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir)) - # Test partition 1, should not contain 'test-file' - res = runCmd("debugfs -R 'ls -p' %s" % (part1), stderr=subprocess.PIPE) - files = extract_files(res.output) - self.assertNotIn('test-file', files) - self.assertEqual(True, files_own_by_root(res.output)) + part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0] + part2 = glob(os.path.join(self.resultdir, 'temp-*.direct.p2'))[0] - # Test partition 2, should contain 'test-file' - res = runCmd("debugfs -R 'ls -p' %s" % (part2), stderr=subprocess.PIPE) - files = extract_files(res.output) - self.assertIn('test-file', files) - self.assertEqual(True, files_own_by_root(res.output)) + # Test partition 1, should not contain 'test-file' + res = runCmd("debugfs -R 'ls -p' %s" % (part1), stderr=subprocess.PIPE) + files = extract_files(res.output) + self.assertNotIn('test-file', files) + self.assertEqual(True, files_own_by_root(res.output)) - finally: - os.environ['PATH'] = oldpath + # Test partition 2, should contain 'test-file' + res = runCmd("debugfs -R 'ls -p' %s" % (part2), stderr=subprocess.PIPE) + files = extract_files(res.output) + self.assertIn('test-file', files) + self.assertEqual(True, files_own_by_root(res.output)) def test_include_path_embeded(self): """Test --include-path wks option.""" - oldpath = os.environ['PATH'] - os.environ['PATH'] = get_bb_var("PATH", "wic-tools") - - try: - include_path = os.path.join(self.resultdir, 'test-include') - os.makedirs(include_path) - with open(os.path.join(include_path, 'test-file'), 'w') as t: - t.write("test\n") - wks_file = os.path.join(include_path, 'temp.wks') - with open(wks_file, 'w') as wks: - wks.write(""" + include_path = os.path.join(self.resultdir, 'test-include') + os.makedirs(include_path) + with open(os.path.join(include_path, 'test-file'), 'w') as t: + t.write("test\n") + wks_file = os.path.join(include_path, 'temp.wks') + with open(wks_file, 'w') as wks: + wks.write(""" part / --source rootfs --fstype=ext4 --include-path %s --include-path core-image-minimal-mtdutils export/""" - % (include_path)) - runCmd("wic create %s -e core-image-minimal -o %s" \ - % (wks_file, self.resultdir)) - - part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0] + % (include_path)) + runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir)) - res = runCmd("debugfs -R 'ls -p' %s" % (part1), stderr=subprocess.PIPE) - files = extract_files(res.output) - self.assertIn('test-file', files) - self.assertEqual(True, files_own_by_root(res.output)) + part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0] - res = runCmd("debugfs -R 'ls -p /export/etc/' %s" % (part1), stderr=subprocess.PIPE) - files = extract_files(res.output) - self.assertIn('passwd', files) - self.assertEqual(True, files_own_by_root(res.output)) + res = runCmd("debugfs -R 'ls -p' %s" % (part1), stderr=subprocess.PIPE) + files = extract_files(res.output) + self.assertIn('test-file', files) + self.assertEqual(True, files_own_by_root(res.output)) - finally: - os.environ['PATH'] = oldpath + res = runCmd("debugfs -R 'ls -p /export/etc/' %s" % (part1), stderr=subprocess.PIPE) + files = extract_files(res.output) + self.assertIn('passwd', files) + self.assertEqual(True, files_own_by_root(res.output)) def test_include_path_errors(self): """Test --include-path wks option error handling.""" @@ -780,9 +759,6 @@ part / --source rootfs --fstype=ext4 --include-path %s --include-path core-imag # prepare wicenv and rootfs bitbake('core-image-minimal core-image-minimal-mtdutils -c do_rootfs_wicenv') - oldpath = os.environ['PATH'] - os.environ['PATH'] = get_bb_var("PATH", "wic-tools") - t_normal = """ part / --source rootfs --fstype=ext4 """ @@ -799,61 +775,50 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc """ tests = [t_normal, t_exclude, t_multi, t_change] - try: - for test in tests: - include_path = os.path.join(self.resultdir, 'test-include') - os.makedirs(include_path) - wks_file = os.path.join(include_path, 'temp.wks') - with open(wks_file, 'w') as wks: - wks.write(test) - runCmd("wic create %s -e core-image-minimal -o %s" \ - % (wks_file, self.resultdir)) - - for part in glob(os.path.join(self.resultdir, 'temp-*.direct.p*')): - res = runCmd("debugfs -R 'ls -p' %s" % (part), stderr=subprocess.PIPE) - self.assertEqual(True, files_own_by_root(res.output)) + for test in tests: + include_path = os.path.join(self.resultdir, 'test-include') + os.makedirs(include_path) + wks_file = os.path.join(include_path, 'temp.wks') + with open(wks_file, 'w') as wks: + wks.write(test) + runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir)) - config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "%s"\n' % wks_file - self.append_config(config) - bitbake('core-image-minimal') - tmpdir = os.path.join(get_bb_var('WORKDIR', 'core-image-minimal'),'build-wic') + for part in glob(os.path.join(self.resultdir, 'temp-*.direct.p*')): + res = runCmd("debugfs -R 'ls -p' %s" % (part), stderr=subprocess.PIPE) + self.assertEqual(True, files_own_by_root(res.output)) - # check each partition for permission - for part in glob(os.path.join(tmpdir, 'temp-*.direct.p*')): - res = runCmd("debugfs -R 'ls -p' %s" % (part), stderr=subprocess.PIPE) - self.assertTrue(files_own_by_root(res.output) - ,msg='Files permission incorrect using wks set "%s"' % test) + config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "%s"\n' % wks_file + self.append_config(config) + bitbake('core-image-minimal') + tmpdir = os.path.join(get_bb_var('WORKDIR', 'core-image-minimal'),'build-wic') - # clean config and result directory for next cases - self.remove_config(config) - rmtree(self.resultdir, ignore_errors=True) + # check each partition for permission + for part in glob(os.path.join(tmpdir, 'temp-*.direct.p*')): + res = runCmd("debugfs -R 'ls -p' %s" % (part), stderr=subprocess.PIPE) + self.assertTrue(files_own_by_root(res.output) + ,msg='Files permission incorrect using wks set "%s"' % test) - finally: - os.environ['PATH'] = oldpath + # clean config and result directory for next cases + self.remove_config(config) + rmtree(self.resultdir, ignore_errors=True) def test_change_directory(self): """Test --change-directory wks option.""" - oldpath = os.environ['PATH'] - os.environ['PATH'] = get_bb_var("PATH", "wic-tools") - - try: - include_path = os.path.join(self.resultdir, 'test-include') - os.makedirs(include_path) - wks_file = os.path.join(include_path, 'temp.wks') - with open(wks_file, 'w') as wks: - wks.write("part /etc --source rootfs --fstype=ext4 --change-directory=etc") - runCmd("wic create %s -e core-image-minimal -o %s" \ - % (wks_file, self.resultdir)) - - part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0] + include_path = os.path.join(self.resultdir, 'test-include') + os.makedirs(include_path) + wks_file = os.path.join(include_path, 'temp.wks') + with open(wks_file, 'w') as wks: + wks.write("part /etc --source rootfs --fstype=ext4 --change-directory=etc") + runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir)) - res = runCmd("debugfs -R 'ls -p' %s" % (part1), stderr=subprocess.PIPE) - files = extract_files(res.output) - self.assertIn('passwd', files) + part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0] - finally: - os.environ['PATH'] = oldpath + res = runCmd("debugfs -R 'ls -p' %s" % (part1), stderr=subprocess.PIPE) + files = extract_files(res.output) + self.assertIn('passwd', files) def test_change_directory_errors(self): """Test --change-directory wks option error handling.""" @@ -876,41 +841,34 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc def test_no_fstab_update(self): """Test --no-fstab-update wks option.""" - oldpath = os.environ['PATH'] - os.environ['PATH'] = get_bb_var("PATH", "wic-tools") - # Get stock fstab from base-files recipe bitbake('base-files -c do_install') bf_fstab = os.path.join(get_bb_var('D', 'base-files'), 'etc', 'fstab') self.assertEqual(True, os.path.exists(bf_fstab)) bf_fstab_md5sum = runCmd('md5sum %s ' % bf_fstab).output.split(" ")[0] - try: - no_fstab_update_path = os.path.join(self.resultdir, 'test-no-fstab-update') - os.makedirs(no_fstab_update_path) - wks_file = os.path.join(no_fstab_update_path, 'temp.wks') - with open(wks_file, 'w') as wks: - wks.writelines(['part / --source rootfs --fstype=ext4 --label rootfs\n', - 'part /mnt/p2 --source rootfs --rootfs-dir=core-image-minimal ', - '--fstype=ext4 --label p2 --no-fstab-update\n']) - runCmd("wic create %s -e core-image-minimal -o %s" \ - % (wks_file, self.resultdir)) - - part_fstab_md5sum = [] - for i in range(1, 3): - part = glob(os.path.join(self.resultdir, 'temp-*.direct.p') + str(i))[0] - part_fstab = runCmd("debugfs -R 'cat etc/fstab' %s" % (part), stderr=subprocess.PIPE) - part_fstab_md5sum.append(hashlib.md5((part_fstab.output + "\n\n").encode('utf-8')).hexdigest()) + no_fstab_update_path = os.path.join(self.resultdir, 'test-no-fstab-update') + os.makedirs(no_fstab_update_path) + wks_file = os.path.join(no_fstab_update_path, 'temp.wks') + with open(wks_file, 'w') as wks: + wks.writelines(['part / --source rootfs --fstype=ext4 --label rootfs\n', + 'part /mnt/p2 --source rootfs --rootfs-dir=core-image-minimal ', + '--fstype=ext4 --label p2 --no-fstab-update\n']) + runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir)) - # '/etc/fstab' in partition 2 should contain the same stock fstab file - # as the one installed by the base-file recipe. - self.assertEqual(bf_fstab_md5sum, part_fstab_md5sum[1]) + part_fstab_md5sum = [] + for i in range(1, 3): + part = glob(os.path.join(self.resultdir, 'temp-*.direct.p') + str(i))[0] + part_fstab = runCmd("debugfs -R 'cat etc/fstab' %s" % (part), stderr=subprocess.PIPE) + part_fstab_md5sum.append(hashlib.md5((part_fstab.output + "\n\n").encode('utf-8')).hexdigest()) - # '/etc/fstab' in partition 1 should contain an updated fstab file. - self.assertNotEqual(bf_fstab_md5sum, part_fstab_md5sum[0]) + # '/etc/fstab' in partition 2 should contain the same stock fstab file + # as the one installed by the base-file recipe. + self.assertEqual(bf_fstab_md5sum, part_fstab_md5sum[1]) - finally: - os.environ['PATH'] = oldpath + # '/etc/fstab' in partition 1 should contain an updated fstab file. + self.assertNotEqual(bf_fstab_md5sum, part_fstab_md5sum[0]) def test_no_fstab_update_errors(self): """Test --no-fstab-update wks option error handling.""" @@ -984,153 +942,139 @@ bootloader --ptable gpt""") def test_wic_sector_size_env(self): """Test generation image sector size via environment (obsolete)""" - oldpath = os.environ['PATH'] - os.environ['PATH'] = get_bb_var("PATH", "wic-tools") + # Add WIC_SECTOR_SIZE into config + config = 'WIC_SECTOR_SIZE = "4096"\n'\ + 'WICVARS:append = " WIC_SECTOR_SIZE"\n' + self.append_config(config) + bitbake('core-image-minimal') - try: - # Add WIC_SECTOR_SIZE into config - config = 'WIC_SECTOR_SIZE = "4096"\n'\ - 'WICVARS:append = " WIC_SECTOR_SIZE"\n' - self.append_config(config) - bitbake('core-image-minimal') + # Check WIC_SECTOR_SIZE apply to bitbake variable + wic_sector_size_str = get_bb_var('WIC_SECTOR_SIZE', 'core-image-minimal') + wic_sector_size = int(wic_sector_size_str) + self.assertEqual(4096, wic_sector_size) - # Check WIC_SECTOR_SIZE apply to bitbake variable - wic_sector_size_str = get_bb_var('WIC_SECTOR_SIZE', 'core-image-minimal') - wic_sector_size = int(wic_sector_size_str) - self.assertEqual(4096, wic_sector_size) - - self.logger.info("Test wic_sector_size: %d \n" % wic_sector_size) - - with NamedTemporaryFile("w", suffix=".wks") as wks: - wks.writelines( - ['bootloader --ptable gpt\n', - 'part --fstype vfat --fstype vfat --label emptyfat --size 1M --mkfs-extraopts "-S 4096"\n', - 'part --fstype ext4 --source rootfs --label rofs-a --mkfs-extraopts "-b 4096"\n', - 'part --fstype ext4 --source rootfs --use-uuid --mkfs-extraopts "-b 4096"\n']) - wks.flush() - cmd = "wic create %s -e core-image-minimal -o %s" % (wks.name, self.resultdir) - runCmd(cmd) - wksname = os.path.splitext(os.path.basename(wks.name))[0] - images = glob(os.path.join(self.resultdir, "%s-*direct" % wksname)) - self.assertEqual(1, len(images)) + self.logger.info("Test wic_sector_size: %d \n" % wic_sector_size) - sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') - # list partitions - result = runCmd("wic ls %s -n %s" % (images[0], sysroot)) - print(result.output) - # Deprecated message + 4 lines of output: header + 3 partitions - self.assertEqual(5, len(result.output.split('\n'))) + with NamedTemporaryFile("w", suffix=".wks") as wks: + wks.writelines( + ['bootloader --ptable gpt\n', + 'part --fstype vfat --fstype vfat --label emptyfat --size 1M --mkfs-extraopts "-S 4096"\n', + 'part --fstype ext4 --source rootfs --label rofs-a --mkfs-extraopts "-b 4096"\n', + 'part --fstype ext4 --source rootfs --use-uuid --mkfs-extraopts "-b 4096"\n']) + wks.flush() + cmd = "wic create %s -e core-image-minimal -o %s" % (wks.name, self.resultdir) + runCmd(cmd) + wksname = os.path.splitext(os.path.basename(wks.name))[0] + images = glob(os.path.join(self.resultdir, "%s-*direct" % wksname)) + self.assertEqual(1, len(images)) - # verify partition size with wic - res = runCmd("export PARTED_SECTOR_SIZE=%d; parted -m %s unit b p" % (wic_sector_size, images[0]), - stderr=subprocess.PIPE) + sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') + # list partitions + result = runCmd("wic ls %s -n %s" % (images[0], sysroot)) + print(result.output) + # Deprecated message + 4 lines of output: header + 3 partitions + self.assertEqual(5, len(result.output.split('\n'))) - print(res.output) - # parse parted output which looks like this: - # BYT;\n - # /var/tmp/wic/build/tmpgjzzefdd-202410281021-sda.direct:78569472B:file:4096:4096:gpt::;\n - # 1:139264B:1187839B:1048576B::emptyfat:msftdata; - # 2:1187840B:149270527B:148082688B:ext4:rofs-a:; - # 3:149270528B:297353215B:148082688B:ext4:primary:; - disk_info = res.output.splitlines()[1] - # Check sector sizes - sector_size_logical = int(disk_info.split(":")[3]) - sector_size_physical = int(disk_info.split(":")[4]) - self.assertEqual(wic_sector_size, sector_size_logical, "Logical sector size is not %d." % wic_sector_size) - self.assertEqual(wic_sector_size, sector_size_physical, "Physical sector size is not %d." % wic_sector_size) - - # It is a known issue with parsed that a 4K FAT partition does - # not have a recognized filesystem type of *fat. - part_info = res.output.splitlines()[2] - partname = part_info.split(":")[5] - parttype = part_info.split(":")[6] - self.assertEqual('emptyfat', partname) - self.assertEqual('msftdata;', parttype) - - part_info = res.output.splitlines()[3] - parttype = part_info.split(":")[4] - partname = part_info.split(":")[5] - self.assertEqual('ext4', parttype) - self.assertEqual('rofs-a', partname) - - part_info = res.output.splitlines()[4] - parttype = part_info.split(":")[4] - partname = part_info.split(":")[5] - self.assertEqual('ext4', parttype) - self.assertEqual('primary', partname) + # verify partition size with wic + res = runCmd("export PARTED_SECTOR_SIZE=%d; parted -m %s unit b p" % (wic_sector_size, images[0]), + stderr=subprocess.PIPE) - finally: - os.environ['PATH'] = oldpath + print(res.output) + # parse parted output which looks like this: + # BYT;\n + # /var/tmp/wic/build/tmpgjzzefdd-202410281021-sda.direct:78569472B:file:4096:4096:gpt::;\n + # 1:139264B:1187839B:1048576B::emptyfat:msftdata; + # 2:1187840B:149270527B:148082688B:ext4:rofs-a:; + # 3:149270528B:297353215B:148082688B:ext4:primary:; + disk_info = res.output.splitlines()[1] + # Check sector sizes + sector_size_logical = int(disk_info.split(":")[3]) + sector_size_physical = int(disk_info.split(":")[4]) + self.assertEqual(wic_sector_size, sector_size_logical, "Logical sector size is not %d." % wic_sector_size) + self.assertEqual(wic_sector_size, sector_size_physical, "Physical sector size is not %d." % wic_sector_size) + + # It is a known issue with parsed that a 4K FAT partition does + # not have a recognized filesystem type of *fat. + part_info = res.output.splitlines()[2] + partname = part_info.split(":")[5] + parttype = part_info.split(":")[6] + self.assertEqual('emptyfat', partname) + self.assertEqual('msftdata;', parttype) + + part_info = res.output.splitlines()[3] + parttype = part_info.split(":")[4] + partname = part_info.split(":")[5] + self.assertEqual('ext4', parttype) + self.assertEqual('rofs-a', partname) + + part_info = res.output.splitlines()[4] + parttype = part_info.split(":")[4] + partname = part_info.split(":")[5] + self.assertEqual('ext4', parttype) + self.assertEqual('primary', partname) def test_wic_sector_size_cli(self): """Test sector size handling via CLI option.""" - oldpath = os.environ['PATH'] - os.environ['PATH'] = get_bb_var("PATH", "wic-tools") - - try: - bitbake('core-image-minimal') - - with NamedTemporaryFile("w", suffix=".wks") as wks: - wks.writelines( - ['bootloader --ptable gpt\n', - 'part --fstype vfat --fstype vfat --label emptyfat --size 1M\n', - 'part --fstype ext4 --source rootfs --label rofs-a\n', - 'part --fstype ext4 --source rootfs --use-uuid\n']) - wks.flush() - cmd = "wic create %s -e core-image-minimal -o %s --sector-size 4096" % (wks.name, self.resultdir) - runCmd(cmd) - wksname = os.path.splitext(os.path.basename(wks.name))[0] - images = glob(os.path.join(self.resultdir, "%s-*direct" % wksname)) - self.assertEqual(1, len(images)) + bitbake('core-image-minimal') - sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') - # list partitions - result = runCmd("wic ls %s -n %s --sector-size 4096" % (images[0], sysroot)) - print(result.output) - # 4 lines of output: header + 3 partitions - self.assertEqual(4, len(result.output.split('\n'))) + with NamedTemporaryFile("w", suffix=".wks") as wks: + wks.writelines( + ['bootloader --ptable gpt\n', + 'part --fstype vfat --fstype vfat --label emptyfat --size 1M\n', + 'part --fstype ext4 --source rootfs --label rofs-a\n', + 'part --fstype ext4 --source rootfs --use-uuid\n']) + wks.flush() + cmd = "wic create %s -e core-image-minimal -o %s --sector-size 4096" % (wks.name, self.resultdir) + runCmd(cmd) + wksname = os.path.splitext(os.path.basename(wks.name))[0] + images = glob(os.path.join(self.resultdir, "%s-*direct" % wksname)) + self.assertEqual(1, len(images)) - # verify partition size with parted output - res = runCmd("export PARTED_SECTOR_SIZE=%d; parted -m %s unit b p" % (4096, images[0]), - stderr=subprocess.PIPE) + sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') + # list partitions + result = runCmd("wic ls %s -n %s --sector-size 4096" % (images[0], sysroot)) + print(result.output) + # 4 lines of output: header + 3 partitions + self.assertEqual(4, len(result.output.split('\n'))) - print(res.output) - # parse parted output which looks like this: - # BYT;\n - # /var/tmp/wic/build/tmpgjzzefdd-202410281021-sda.direct:78569472B:file:4096:4096:gpt::;\n - # 1:139264B:1187839B:1048576B::emptyfat:msftdata; - # 2:1187840B:149270527B:148082688B:ext4:rofs-a:; - # 3:149270528B:297353215B:148082688B:ext4:primary:; - disk_info = res.output.splitlines()[1] - # Check sector sizes - sector_size_logical = int(disk_info.split(":")[3]) - sector_size_physical = int(disk_info.split(":")[4]) - self.assertEqual(4096, sector_size_logical, "Logical sector size is not 4096.") - self.assertEqual(4096, sector_size_physical, "Physical sector size is not 4096.") - - # It is a known issue with parsed that a 4K FAT partition does - # not have a recognized filesystem type of *fat. - part_info = res.output.splitlines()[2] - partname = part_info.split(":")[5] - parttype = part_info.split(":")[6] - self.assertEqual('emptyfat', partname) - self.assertEqual('msftdata;', parttype) - - part_info = res.output.splitlines()[3] - parttype = part_info.split(":")[4] - partname = part_info.split(":")[5] - self.assertEqual('ext4', parttype) - self.assertEqual('rofs-a', partname) - - part_info = res.output.splitlines()[4] - parttype = part_info.split(":")[4] - partname = part_info.split(":")[5] - self.assertEqual('ext4', parttype) - self.assertEqual('primary', partname) + # verify partition size with parted output + res = runCmd("export PARTED_SECTOR_SIZE=%d; parted -m %s unit b p" % (4096, images[0]), + stderr=subprocess.PIPE) - finally: - os.environ['PATH'] = oldpath + print(res.output) + # parse parted output which looks like this: + # BYT;\n + # /var/tmp/wic/build/tmpgjzzefdd-202410281021-sda.direct:78569472B:file:4096:4096:gpt::;\n + # 1:139264B:1187839B:1048576B::emptyfat:msftdata; + # 2:1187840B:149270527B:148082688B:ext4:rofs-a:; + # 3:149270528B:297353215B:148082688B:ext4:primary:; + disk_info = res.output.splitlines()[1] + # Check sector sizes + sector_size_logical = int(disk_info.split(":")[3]) + sector_size_physical = int(disk_info.split(":")[4]) + self.assertEqual(4096, sector_size_logical, "Logical sector size is not 4096.") + self.assertEqual(4096, sector_size_physical, "Physical sector size is not 4096.") + + # It is a known issue with parsed that a 4K FAT partition does + # not have a recognized filesystem type of *fat. + part_info = res.output.splitlines()[2] + partname = part_info.split(":")[5] + parttype = part_info.split(":")[6] + self.assertEqual('emptyfat', partname) + self.assertEqual('msftdata;', parttype) + + part_info = res.output.splitlines()[3] + parttype = part_info.split(":")[4] + partname = part_info.split(":")[5] + self.assertEqual('ext4', parttype) + self.assertEqual('rofs-a', partname) + + part_info = res.output.splitlines()[4] + parttype = part_info.split(":")[4] + partname = part_info.split(":")[5] + self.assertEqual('ext4', parttype) + self.assertEqual('primary', partname) class Wic2(WicTestCase): @@ -1472,47 +1416,41 @@ run_wic_cmd() { def test_extra_partition_space(self): native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "wic-tools") - oldpath = os.environ['PATH'] - os.environ['PATH'] = get_bb_var("PATH", "wic-tools") + with NamedTemporaryFile("w", suffix=".wks") as tempf: + tempf.write("bootloader --ptable gpt\n" \ + "part --ondisk hda --size 10M --extra-partition-space 10M --fstype=ext4\n" \ + "part --ondisk hda --fixed-size 20M --extra-partition-space 10M --fstype=ext4\n" \ + "part --source rootfs --ondisk hda --extra-partition-space 10M --fstype=ext4\n" \ + "part --source rootfs --ondisk hda --fixed-size 200M --extra-partition-space 10M --fstype=ext4\n") + tempf.flush() + + _, wicimg = self._get_wic(tempf.name) - try: - with NamedTemporaryFile("w", suffix=".wks") as tempf: - tempf.write("bootloader --ptable gpt\n" \ - "part --ondisk hda --size 10M --extra-partition-space 10M --fstype=ext4\n" \ - "part --ondisk hda --fixed-size 20M --extra-partition-space 10M --fstype=ext4\n" \ - "part --source rootfs --ondisk hda --extra-partition-space 10M --fstype=ext4\n" \ - "part --source rootfs --ondisk hda --fixed-size 200M --extra-partition-space 10M --fstype=ext4\n") - tempf.flush() - - _, wicimg = self._get_wic(tempf.name) - - res = runCmd("parted -m %s unit b p" % wicimg, - native_sysroot=native_sysroot, stderr=subprocess.PIPE) - - # parse parted output which looks like this: - # BYT;\n - # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n - # 1:0.00MiB:200MiB:200MiB:ext4::;\n - partlns = res.output.splitlines()[2:] - - self.assertEqual(4, len(partlns)) - - # Test for each partitions that the extra part space exists - for part in range(0, len(partlns)): - part_file = os.path.join(self.resultdir, "selftest_img.part%d" % (part + 1)) - partln = partlns[part].split(":") - self.assertEqual(7, len(partln)) - self.assertRegex(partln[3], r'^[0-9]+B$') - part_size = int(partln[3].rstrip("B")) - start = int(partln[1].rstrip("B")) / 512 - length = part_size / 512 - runCmd("dd if=%s of=%s skip=%d count=%d" % - (wicimg, part_file, start, length)) - res = runCmd("dumpe2fs %s -h | grep \"^Block count\"" % part_file) - fs_size = int(res.output.split(":")[1].strip()) * 1024 - self.assertLessEqual(fs_size + 10485760, part_size, "part file: %s" % part_file) - finally: - os.environ['PATH'] = oldpath + res = runCmd("parted -m %s unit b p" % wicimg, + native_sysroot=native_sysroot, stderr=subprocess.PIPE) + + # parse parted output which looks like this: + # BYT;\n + # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n + # 1:0.00MiB:200MiB:200MiB:ext4::;\n + partlns = res.output.splitlines()[2:] + + self.assertEqual(4, len(partlns)) + + # Test for each partitions that the extra part space exists + for part in range(0, len(partlns)): + part_file = os.path.join(self.resultdir, "selftest_img.part%d" % (part + 1)) + partln = partlns[part].split(":") + self.assertEqual(7, len(partln)) + self.assertRegex(partln[3], r'^[0-9]+B$') + part_size = int(partln[3].rstrip("B")) + start = int(partln[1].rstrip("B")) / 512 + length = part_size / 512 + runCmd("dd if=%s of=%s skip=%d count=%d" % + (wicimg, part_file, start, length)) + res = runCmd("dumpe2fs %s -h | grep \"^Block count\"" % part_file) + fs_size = int(res.output.split(":")[1].strip()) * 1024 + self.assertLessEqual(fs_size + 10485760, part_size, "part file: %s" % part_file) # TODO this test could also work on aarch64 @skipIfNotArch(['i586', 'i686', 'x86_64']) @@ -1825,45 +1763,39 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" testfile.write("test %s" % testfilename) testfile.close() - oldpath = os.environ['PATH'] - os.environ['PATH'] = get_bb_var("PATH", "wic-tools") + with NamedTemporaryFile("w", suffix=".wks") as wks: + wks.writelines([ + 'part / --source extra_partition --ondisk sda --sourceparams "name=foo" --align 4 --size 5M\n', + 'part / --source extra_partition --ondisk sda --label foo --align 4 --size 5M\n', + 'part / --source extra_partition --ondisk sda --fstype=vfat --uuid e7d0824e-cda3-4bed-9f54-9ef5312d105d --align 4 --size 5M\n', + 'part / --source extra_partition --ondisk sda --fstype=ext4 --label bar --align 4 --size 5M\n', + 'bootloader --ptable gpt\n', + ]) + wks.flush() + _, wicimg = self._get_wic(wks.name) - try: - with NamedTemporaryFile("w", suffix=".wks") as wks: - wks.writelines([ - 'part / --source extra_partition --ondisk sda --sourceparams "name=foo" --align 4 --size 5M\n', - 'part / --source extra_partition --ondisk sda --label foo --align 4 --size 5M\n', - 'part / --source extra_partition --ondisk sda --fstype=vfat --uuid e7d0824e-cda3-4bed-9f54-9ef5312d105d --align 4 --size 5M\n', - 'part / --source extra_partition --ondisk sda --fstype=ext4 --label bar --align 4 --size 5M\n', - 'bootloader --ptable gpt\n', - ]) - wks.flush() - _, wicimg = self._get_wic(wks.name) - - result = runCmd("wic ls %s -n %s" % (wicimg, sysroot)) - partls = result.output.split('\n')[1:] - - # Assert the number of partitions is correct - self.assertEqual(4, len(partls), msg="Expect 4 partitions, not %s" % result.output) - - # Fstype column from 'wic ls' should be fstype as given in the part command - for part_id, part_fs in enumerate(["fat16", "fat16", "fat16", "ext4"]): - self.assertIn(part_fs, partls[part_id]) - - # For each partition, assert expected files exist - for part, part_glob in enumerate([ - ["bar.conf"], - ["foo.conf"], - ["foobar.conf", "foobar2.conf", "bar3.conf", "bar4.conf"], - ["bar.conf", "bar2.conf"], - ]): - for part_file in part_glob: - result = runCmd("wic ls %s:%d/%s -n %s" % (wicimg, part + 1, part_file, sysroot)) - self.assertEqual(0, result.status, msg="File '%s' not found in the partition #%d" % (part_file, part)) + result = runCmd("wic ls %s -n %s" % (wicimg, sysroot)) + partls = result.output.split('\n')[1:] - self.remove_config(config) - finally: - os.environ['PATH'] = oldpath + # Assert the number of partitions is correct + self.assertEqual(4, len(partls), msg="Expect 4 partitions, not %s" % result.output) + + # Fstype column from 'wic ls' should be fstype as given in the part command + for part_id, part_fs in enumerate(["fat16", "fat16", "fat16", "ext4"]): + self.assertIn(part_fs, partls[part_id]) + + # For each partition, assert expected files exist + for part, part_glob in enumerate([ + ["bar.conf"], + ["foo.conf"], + ["foobar.conf", "foobar2.conf", "bar3.conf", "bar4.conf"], + ["bar.conf", "bar2.conf"], + ]): + for part_file in part_glob: + result = runCmd("wic ls %s:%d/%s -n %s" % (wicimg, part + 1, part_file, sysroot)) + self.assertEqual(0, result.status, msg="File '%s' not found in the partition #%d" % (part_file, part)) + + self.remove_config(config) def test_fs_types(self): """Test filesystem types for empty and not empty partitions""" From patchwork Fri Jul 31 15:28:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 94064 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81DD3C54F54 for ; Fri, 31 Jul 2026 15:28:29 +0000 (UTC) Received: from mail-vk1-f173.google.com (mail-vk1-f173.google.com [209.85.221.173]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.16.1785511705525645863 for ; Fri, 31 Jul 2026 08:28:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=ia6bn+OH; spf=pass (domain: gmail.com, ip: 209.85.221.173, mailfrom: twoerner@gmail.com) Received: by mail-vk1-f173.google.com with SMTP id 71dfb90a1353d-5bf8a2932a3so638332e0c.1 for ; Fri, 31 Jul 2026 08:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785511704; x=1786116504; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=UIeATkx7vW4JBubmI/84KAjWUSOQE7SuKJJafkwiCRg=; b=ia6bn+OHGU1EZuf1o2Vhas6Gc2TYJ0O0kh6yB+NPfNMNNFw4mCCAw7yqgVNn+xKcsz uOpKlVxsFGrjc8mFh90nwQP83Ug4iHyo4n/Kd8nBeQU3/Q8zRGZyWYSZErbCN/D0HMCD a9GE817nAOOHdGgVHZSCRHKPqGDGecq5pwcJ7piBg6HVF0MNuPpbwA87DQlWkZ2NGZ26 0al8ePlTb9pEVs+x2zZnms2YlaySV/Fg68+DSFIK+r2SgUlitAzxNbgeOtyoc2Sm0QjM YjNYcjl31IY0fe2SZ1i+HMIrOItDsm8fLB8iaMW5EvxcF+k0GEVA6hW2HdJDhl50AQZR SGbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785511704; x=1786116504; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=UIeATkx7vW4JBubmI/84KAjWUSOQE7SuKJJafkwiCRg=; b=qzMwVT9O/77NQfUHQOMBTmqoYHr6EAdbAcDoagfR7AhhM9+7kzZgqRKPLGScN4UxVJ +cwyxktG7ZKbIdbaJyifxQjmU+ipEMcR+f2Ppj5lwDXj1vpN68BP0bnNN//NjRv6un24 8DUHSyNdtlj2wDMeCHh7Uy/yVNGKWDGIgw82CoEMdBhh2Nz/UiWKfvhfUvdV5M7DG3mj GSsVkaFd1ZOWzgjMp6CE1ThxIKhT9HmrB8s0K/ESTKGtJApwlt+0qhJxXTeDpVEk2A6g nae9bErasimAkUw0xZIVAx+jvqNHh//J8RFiTCyhCXy4cPA8OvyVGvlor3cn8GCl/KHk Ylwg== X-Gm-Message-State: AOJu0Yw/sFfCU//zLdx3xDxwTgnoUsh9mdDOClxzFArLydo+UJ0lBpuU OJyOL5V9onuTy8caNCPquiHcJQVArItj0Bn6ShqnnV8uSCuyqLXi84PSxA6D5Q== X-Gm-Gg: AR+sD12W1H1vWDzuZjErQ5W/74McBSjucc7+rs7Aesi1NUPBBD4QzaBPHGFpWH763Kj 8VpFptBSnpWPL3Qr5W514CJSbUUSLJ1bKi243xMjkzwwFFfOwwVgB0nC+0t1+qYv6aNgfl+5yxj BszjzqW+h8zY6y72bBw4pZ8CtsnkOpwxuwgeeGnDkfdYJiPC9Q92OSc1ITQR+QZBMXFy0KLziox 9yVoYbo0MgkVU4jK5BWNxpxi7X2mWtDy8qaTdYEnPi7ETFZMEyCu+rARGaveOj+QLwT7sPSm3Bl MSkvIMbtiPRT8ajfOSOiDj61aKbLyQ+Xcvhr6zPEn7xf59kjtzRaEvRZ+NSDwTphrNZ0A4UQyLY An+DsKyCkHwxqNCmsjxEzgBEkdFBpiBg4qfYsZh7k57b7Bt+b+Dp/m4jeJaMU/5Qby5YpOrbrMR mP+9apC6ajgcKXa/PPdhcJRB+si/7/FG4+Rgu0DuKuvygvErfaK5yxDLl0fCSQCJLBXFxfkd34G Em1qss9o8ioUwcW5A7tl3+cEZYLMYo= X-Received: by 2002:a05:6102:6899:b0:726:8813:2085 with SMTP id ada2fe7eead31-75b23d6e2d3mr535449137.13.1785511704327; Fri, 31 Jul 2026 08:28:24 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-759c9559116sm837007137.11.2026.07.31.08.28.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 08:28:23 -0700 (PDT) From: Trevor Woerner To: openembedded-core@lists.openembedded.org Subject: [PATCH v5 6/6] wic: gate syslinux-native on the target, not the build host Date: Fri, 31 Jul 2026 11:28:10 -0400 Message-ID: <20260731152810.2641327-7-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260731152810.2641327-1-twoerner@gmail.com> References: <20260731152810.2641327-1-twoerner@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 31 Jul 2026 15:28:29 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242452 Whether wic needs the syslinux installer is decided by the .wks file, and so by the target: only an x86 image asks for syslinux. Currently image_types_wic.bbclass adds syslinux-native when the BUILD HOST is x86 instead, which is a different question. Does an image depend on syslinux-native today? | x86 target | non-x86 target -------------+------------+---------------- x86 host | yes | yes non-x86 host | no | no The answer varies by row when it should vary by column, and both of the wrong cells cost something. An x86 image built on a non-x86 host gets the target bootloader without the installer that puts it in place. An x86 host builds an installer that a non-x86 image will never use. Gate on the target instead, as wic-tools already does [1]: | x86 target | non-x86 target -------------+------------+---------------- x86 host | yes | no non-x86 host | yes | no Bug 13276 [2] reported the bottom-right cell failing, back when the syslinux recipe was x86-only for every variant, and it was closed in 2019 by gating on BUILD_ARCH [3]. The recipe has since been reworked so that only its target code is x86-specific [4], which leaves that gate unnecessary as well as misdirected. A non-x86 target never asks for syslinux, so 13276's case stays fixed. [YOCTO #16383] [1] https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/meta/wic-tools.bb [2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=13276 [3] https://git.openembedded.org/openembedded-core/commit/?id=7e2ee2b59319 [4] https://git.openembedded.org/openembedded-core/commit/?id=7273e131bfc7 AI-Generated: codex/claude-opus 5 (xhigh) Signed-off-by: Trevor Woerner --- changes in v5: - new in v5 --- meta/classes-recipe/image_types_wic.bbclass | 3 +-- meta/conf/wic-helper-tools.inc | 3 +++ meta/recipes-core/meta/wic-tools.bb | 4 ---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index 3f25b7912b26..b00b5155475d 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -120,9 +120,8 @@ do_image_wic[depends] += "${@' '.join('%s:do_populate_sysroot' % r for r in ('wi do_image_wic[recrdeptask] += "do_deploy" do_image_wic[deptask] += "do_image_complete" -WKS_FILE_DEPENDS_DEFAULT = '${@bb.utils.contains_any("BUILD_ARCH", [ 'x86_64', 'i686' ], "syslinux-native", "",d)}' # Unified kernel images need objcopy -WKS_FILE_DEPENDS_DEFAULT += "virtual/cross-binutils" +WKS_FILE_DEPENDS_DEFAULT = "virtual/cross-binutils" WKS_FILE_DEPENDS_BOOTLOADERS = "" WKS_FILE_DEPENDS_BOOTLOADERS:aarch64 = "grub-efi systemd-boot" WKS_FILE_DEPENDS_BOOTLOADERS:arm = "systemd-boot" diff --git a/meta/conf/wic-helper-tools.inc b/meta/conf/wic-helper-tools.inc index 66f2f1b2bddc..0ee4aaee6a89 100644 --- a/meta/conf/wic-helper-tools.inc +++ b/meta/conf/wic-helper-tools.inc @@ -14,6 +14,9 @@ WIC_HELPER_TOOLS ?= "\ WIC_HELPER_TOOLS_NATIVE_ONLY ?= "cdrtools" WIC_HELPER_TOOLS_DEPENDS = "${@' '.join('%s-native' % t for t in (d.getVar('WIC_HELPER_TOOLS') + ' ' + d.getVar('WIC_HELPER_TOOLS_NATIVE_ONLY')).split())}" +WIC_HELPER_TOOLS_DEPENDS:append:x86 = " syslinux-native" +WIC_HELPER_TOOLS_DEPENDS:append:x86-64 = " syslinux-native" +WIC_HELPER_TOOLS_DEPENDS:append:x86-x32 = " syslinux-native" WIC_HELPER_TOOLS_PACKAGE_ONLY ?= "e2fsprogs-resize2fs" WIC_HELPER_TOOLS_RDEPENDS = "${WIC_HELPER_TOOLS} ${WIC_HELPER_TOOLS_PACKAGE_ONLY}" diff --git a/meta/recipes-core/meta/wic-tools.bb b/meta/recipes-core/meta/wic-tools.bb index c3c39cec011d..22d530e42300 100644 --- a/meta/recipes-core/meta/wic-tools.bb +++ b/meta/recipes-core/meta/wic-tools.bb @@ -9,10 +9,6 @@ DEPENDS = "\ grub-native pseudo-native \ virtual/cross-binutils \ " -DEPENDS:append:x86 = " syslinux-native" -DEPENDS:append:x86-64 = " syslinux-native" -DEPENDS:append:x86-x32 = " syslinux-native" - INHIBIT_DEFAULT_DEPS = "1" PACKAGE_ARCH = "${MACHINE_ARCH}"