From patchwork Sun Aug 2 02:09:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 94175 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 51809C55174 for ; Sun, 2 Aug 2026 02:10:18 +0000 (UTC) Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.16979.1785636610798485460 for ; Sat, 01 Aug 2026 19:10:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=c5MAcygE; spf=pass (domain: gmail.com, ip: 209.85.219.48, mailfrom: twoerner@gmail.com) Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-8f1e274ccb9so11657516d6.2 for ; Sat, 01 Aug 2026 19:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785636610; x=1786241410; 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=UgWPidXP74zQ5n0m5hKJytlokF9xszWvyTo8UlW48bU=; b=c5MAcygEak08Z2yx8UXkcEN6mcSUs9kMw/FH0iNyo0yag7sugNwQzdp2LXdTXyQt9a Zpxi147/F1CNuSLkx2WWXjxQs0ezr1PJaiDi7WINLsw1IaHRdP7eIT+sW0gnxEGW6Ldz mIP+qiTbmO5RuV+VsI+nc2kWq3WHoqnfAWBPh/vpIrSvgs+qRQT20HGA6bTc3poZS1CG w52Hdl310sIAhNhsB7duD4XmithXV1r9uKHz/BfepA0wjU7sGCAmUq9cs18hF8di9yF/ VI4ijZIeM0fzIiFt9cnEUplJ/iDp+j16Sknt7OIWszC0Ywqa8RGFrkxvxaSSl3IduUc5 Z5bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785636610; x=1786241410; 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=UgWPidXP74zQ5n0m5hKJytlokF9xszWvyTo8UlW48bU=; b=LmucjFVPZumBgQnB9VElXuoRKfnRi3gzTSCj3RVlbEVDcPFZiCCFUhz9TsE1o3SphX 7N0ICHRQKqTViQp5BGYm7ZPp3yk8gnZKgyt12LCGV+W3KW9TTGIiFqV4sLySVYdBq5VS vKDR9KxyX3dv0hYNmGB8hqS/v9aybqZzXi7LIpDTWMS1CQZmC6N2EGxHu8M1nbOvClxU 3heUxZwveodAUxgPVa9DH3P93BC+WYLQpCoWr2dE6T7cCaVYtgNAO2Tp9DcHg3o93wNv iEw2NIHYO/rsEt07LYZZvCvG+pEIcNfck2jon/XWWVtdwHl9awORDF6F7zXTewcAbAL7 r/Hg== X-Gm-Message-State: AOJu0YzavDlmyLsyuEa3tl1Ebz7yKWwl2OEj8XcoCuekv32I3ZdqAq/B Kvw3UlBk6ZZzBdK2SUPzpWc6srBF98H1zB2MeZgKbUnic0uupQ2UZAVRmtKEyg== X-Gm-Gg: AR+sD11M1wfBigUrOqHgm9zDRIPdEVrwu51/fF0ycsaf4VqHESlR75Y4Hro+bovegtw cMbYfEdlZt0MrbQrznfd92zXkAZt1ze/bq93ix/AvtJMFSPiCpq07w0GD6RHIGNBFSojLb+zl5x kPvHfZimtmGIUGwOVR0T41Uv8JUdnk3APkgqihdt0S3tfPyzpEPLvPOfOy/O5xhi4TyI8QPEH0g 4b1FCW3ka+KwKKTy7nev9fS9B/pOSoYodWX/G6S6K7FXfzslKEYO80dnjaosDEeTUE/Xr5F/bPU kfOZIYbO0kO5l1zVtJhftraaYf/6vP3odzIRFk7g3RDGz87tW5yXzaW2iK5LXYP8zofqtLGQ/jc ZhDDcUpHqINF0ePEBmr1o2z8tvYnAUymlVFpdOxJ3q+2k8cU2d7h9sHKCXj650EkUiSKfteTk8T dipCjEUqPSZjdHwBF+vxEA9Hesbuz6VuLYHL8AINp19+SQr9cFKMdSqmAa1VeVJBFPKaLFY4RfU p/1L6DH2JurciJJh8NhSFZc35S8OnzHz+ioQcWLEw== X-Received: by 2002:a05:6214:3d9d:b0:8f1:505c:1d3b with SMTP id 6a1803df08f44-9084966fdd1mr118307436d6.26.1785636609535; Sat, 01 Aug 2026 19:10:09 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-908434a26basm44733566d6.12.2026.08.01.19.10.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2026 19:10:07 -0700 (PDT) From: Trevor Woerner To: openembedded-core@lists.openembedded.org Subject: [PATCH v6 1/6] wic-tools: drop the target bootloader firmware Date: Sat, 1 Aug 2026 22:09:55 -0400 Message-ID: <20260802021000.2886095-2-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260802021000.2886095-1-twoerner@gmail.com> References: <20260802021000.2886095-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 ; Sun, 02 Aug 2026 02:10:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242510 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 v6: - none 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 Sun Aug 2 02:09:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 94176 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 5C4E0C55172 for ; Sun, 2 Aug 2026 02:10:18 +0000 (UTC) Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.16891.1785636612166138399 for ; Sat, 01 Aug 2026 19:10:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=MXxLPa5j; spf=pass (domain: gmail.com, ip: 209.85.219.46, mailfrom: twoerner@gmail.com) Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-9034b6b7674so14305646d6.0 for ; Sat, 01 Aug 2026 19:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785636611; x=1786241411; 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=838qkd/Mf2WKEgQ+wPTZG9iCzI5IeeXQVImQE7C1e7I=; b=MXxLPa5js1q87X2lIYQ8EJgn7PA45TtJuGpgfMpVF+viW9cYGn2okPjAnYakH4RiMP do8+m6n63ekLdycW9h3m9CqpQ9PopeHTkviHKOeQMqGcRcFpp/Pkpys9XkGklgBkpYZR zK1z+rbvVdUIZ+ne4FLbBuhRKT5OhgAohNfjYrud++Pui59GndEDV40H6gAidZlVP/tH NVyUW3SWQwAoPCS5cpS1MyBcJYT5r6cK0b4mBP6r6CyfJql+TQvfp5H164uBJ2hqCrqx 1l4//FaaBR5tV81Lc07xQ5j9XTP0F3pt5GoJ1sOdk1Q61V4Jm2EdHR3xeeybGAvDGIEY OmCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785636611; x=1786241411; 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=838qkd/Mf2WKEgQ+wPTZG9iCzI5IeeXQVImQE7C1e7I=; b=FHFJ55Op1wIC/zY3bGNXDeUmS+k2BeealgoVjbgmsafkjbd7LcXkovcueAXbbJ/GQM p8lTr8U/5EJGI9ZUubXc1l0yze6nZbD4KEvQse2QY1NIo41q2qN3akwg50pYaJITTMCf hrIXbVjCttNcb8cwAKCiZX0EDQSmPJ9QjN3boF7fk/ML3TkztGRqHQu3Yq25ZB1IM9Qi NE678TKJVVm6EcrpdGrOcfMTO/UFL1WgEiORSFgJxJxxgSTlqHIDah6bVEA4CNuHFUuN Mu73PbPAynxQBKa8/xHy6eeYLdZx0AvjRF10snnqGa+tluxeoOJQY/UCVvWZk5hehl5D xM+Q== X-Gm-Message-State: AOJu0YyOTwuyHLDXQBR2EVASsccKwOWvXsSCOwv4dzdV5ar3oagUKp8f SPAYpPi+XCJA5lJcb1GeVVe6unFJ5X556RTlKVQC3e4jrkx5HENN4lvK9ojpTg== X-Gm-Gg: AR+sD11CsIb35YEJYV9B4C9H0Hd2yqH0NMxKI4KKQY7Z8DgP6Zpz0mUSStAAIIFbKf6 bKXqK24Lf/uymL9CZG1aC1SHnFRAuk5nGcDv5oFdO6AktHvojw6OytsPb4d4jbk+ZO5CO3+MjGI kwQogxWVfiEdFnwcFVbYlEpf4lpM8Ix1z4NZYaRCD7eYURUFPH6RkMeu8iSkvl3vtEIS1kG02ql +Djtne2Szv/UtH1TwiZztFXPMTeNqJd4iHwuesvT2zcgRedjbL930sA3Q9F7NIY6++gCUUIgN26 OwzHMZO7hQ+Bnn+D8e8MY7z5ljD0h4R976/Y/Jpxu2i5K8KFmSYVinofXmKoc98MM+hvGfy2inG PApcnUcgcXxfKDQGPHYJ+729wVtyoVgxW90dWXScGdWm/+hUALck7Y0yoaDILgUstcwAfgR0pQx gPvAiaMi8qea/AgXPXn755HsZTVei3632ONU038VAar5Ku2ultrSPN8j3I4pfc/RQFVmsIncc/x 3gkHD8XNRTuJOIZVfFcSI0eTuG+08c= X-Received: by 2002:ad4:5965:0:b0:906:f225:c16f with SMTP id 6a1803df08f44-908495fbfa7mr123183486d6.19.1785636611050; Sat, 01 Aug 2026 19:10:11 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-908434a26basm44733566d6.12.2026.08.01.19.10.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2026 19:10:10 -0700 (PDT) From: Trevor Woerner To: openembedded-core@lists.openembedded.org Subject: [PATCH v6 2/6] image_types_wic, wic-tools: drop the obsolete cross-binutils dependency Date: Sat, 1 Aug 2026 22:09:56 -0400 Message-ID: <20260802021000.2886095-3-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260802021000.2886095-1-twoerner@gmail.com> References: <20260802021000.2886095-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 ; Sun, 02 Aug 2026 02:10:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242511 wic depends on virtual/cross-binutils because its EFI boot image plugin once assembled unified kernel images and needed cross-objcopy for it. That plugin no longer builds them: it refuses and points at uki.bbclass, which declares virtual/cross-binutils itself. No code wic runs invokes objcopy any more, so drop the dependency from the two places still carrying it. AI-Generated: codex/claude-opus 5 (xhigh) Signed-off-by: Trevor Woerner --- changes in v6: - new patch --- meta/classes-recipe/image_types_wic.bbclass | 2 -- meta/recipes-core/meta/wic-tools.bb | 1 - 2 files changed, 3 deletions(-) diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index ea8c1c94ca2f..671577cc062b 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -120,8 +120,6 @@ 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 = "" WKS_FILE_DEPENDS_BOOTLOADERS:aarch64 = "grub-efi systemd-boot" WKS_FILE_DEPENDS_BOOTLOADERS:arm = "systemd-boot" diff --git a/meta/recipes-core/meta/wic-tools.bb b/meta/recipes-core/meta/wic-tools.bb index c6e3d1b419dc..a4b7669137dd 100644 --- a/meta/recipes-core/meta/wic-tools.bb +++ b/meta/recipes-core/meta/wic-tools.bb @@ -8,7 +8,6 @@ DEPENDS = "\ 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 \ - virtual/cross-binutils \ " DEPENDS:append:x86 = " syslinux-native" DEPENDS:append:x86-64 = " syslinux-native" From patchwork Sun Aug 2 02:09:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 94177 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 5D8C9C55179 for ; Sun, 2 Aug 2026 02:10:18 +0000 (UTC) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.16892.1785636614994945816 for ; Sat, 01 Aug 2026 19:10:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=IEZFfZmX; spf=pass (domain: gmail.com, ip: 209.85.219.54, mailfrom: twoerner@gmail.com) Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-8f0e5e36912so11780496d6.2 for ; Sat, 01 Aug 2026 19:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785636614; x=1786241414; 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=O/o1w8OdqvAPx0+WW4szcBt8Y+yToWX/tEWSeBPDADY=; b=IEZFfZmXVINmbowV1Fh+5ux94Z6xDv1lKVQdh3k8Y4n0ExIoRgvdfGTIGlLZ3t5u+7 eUBQl4DID3dw307i8LrCofwv4K+VpM53B/OteS7n7rcWZDQtQOv9ONWxuQGgV9Diso/I Q0qhuh0EbCK5VaimpolecGQxDjEOAV8ouBpYa08oRmCFItEEX8Y5Xrth/50xXOYsPbjp pMLz1jbsShQ1XTxSs1NLUy4GVn8gk31a4c6oBgYTj1nl/+7uXontydthdjuU/FS3A99O O6yLQDM5nilatqjMzTNw+Kw2tg5fzJSeNjs+BhoIPCqf8yRo7N4BJvZXO4LyBwu3fH+d 8ctQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785636614; x=1786241414; 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=O/o1w8OdqvAPx0+WW4szcBt8Y+yToWX/tEWSeBPDADY=; b=iaXxXCAMskogZc/RRjiVcUv8qEfPuOJcjfuIHpwsgTH5JkcBOIZhuFqL8sHqj4oe5q jD/Mqg9PUqlMR6c7NPUM78oGfRf55H8Zu74QyHa5XaxyUcodMzWxn/MmHuGnXL++IASN 36G/i1hj5h3MvcZpBnbOs3N2GtPz2h6xe+96g6RNMOBgg8HSDaYdO88PE0vVcAVZl+S0 8NF/+nOOJTAldpW6Q4quzeng4O6OMMuw8/HHSjRbm1zig710hVi9Y01M/iZ+28KV0giI R5l7D7iAyUqlPP5mDo3bZjhBBPQA/4lSd9y9guiBYVe9WZ+o/zBk+XY6bQHeEIXVVBe4 XbxQ== X-Gm-Message-State: AOJu0YxdoTkIlXE+g/9NHRHmeI9K93214v30NLKdZ1HkISq8rJA5ZAJb bK4MysmVtdDqz/fNbhrXFE4nTrm9d7ZjQ1IFWKCx0CSZoCAh2JouPT/FNpirAQ== X-Gm-Gg: AR+sD13jbiwAXTKMf/stk1vAe5GyR68QOVfRpkozl6EExdQWBJP9M+w1lVJ8ZuJhqkf NO9AAzXe4mVreuncgTz137uDNrgBq4la9EL5rRg4Z1/KeRfXAy7apYMJ1pY+/Z1shWZ2XqwIEqc z0UeQAaVbwAveIyTN5KZ132XD0LYFWCLmr4PbloW36FDFi2GGdYJhq/2Jtzfgi2ud8hP5EzD30/ 8/1/PBq+50wi7oP8dFd5nwMP2DfOOdEbwO/84PP4pdiQp6EezSlEk1u1AikJa6btFxbNmwskznh TyS49ZWXk+TDIDU2x68t7eMtsEPV+0ZaUdKHQlJAkAUUbuK1A1f7+R1xCDWZdZAXQzcw4PauIH5 XLO/mK9MwlzZFfKnLMdqX3t1fpEFtN0D8FcE+uLNIHSnmwOFg8NYTLsAvEuzEHJI9x1wpvP7YNO rWpKXcEBVFl5c9Qkz+Q3Sm45EQot2wdUHpLcN/gJoC/eTN7Hll5eaM2hUrWfWSQfdwMS+BfQCoH w4oYas2h4gMTk8Suvk6KWGzzu3ujsw= X-Received: by 2002:a05:6214:5015:b0:8e7:8d53:2417 with SMTP id 6a1803df08f44-908496389f6mr98245806d6.27.1785636613828; Sat, 01 Aug 2026 19:10:13 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-908434a26basm44733566d6.12.2026.08.01.19.10.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2026 19:10:11 -0700 (PDT) From: Trevor Woerner To: openembedded-core@lists.openembedded.org Subject: [PATCH v6 3/6] wic: add runtime dependencies on the tools it invokes Date: Sat, 1 Aug 2026 22:09:57 -0400 Message-ID: <20260802021000.2886095-4-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260802021000.2886095-1-twoerner@gmail.com> References: <20260802021000.2886095-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 ; Sun, 02 Aug 2026 02:10:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242512 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. The wic image type and wic-tools each carried a copy of that same list, and the copies had drifted: only wic-tools staged tar-native and util-linux-native. Neither needs a list of its own now. native.bbclass makes a native recipe's do_populate_sysroot depend on its RDEPENDS, so depending on wic-native stages the lot. Three entries stay written out. cdrtools has only a native recipe, so there is no package a target or nativesdk wic could name, even though wic does run mkisofs. grub is bootloader territory and belongs to whatever drives wic. pseudo is wic-tools staging what the oe-selftest needs. AI-Generated: codex/claude-opus 5 (xhigh) Signed-off-by: Trevor Woerner --- changes in v6: - carry the tool list here directly; the shared conf/wic-helper-tools.inc that v5 added is gone - fold the image_types_wic.bbclass and wic-tools change into this patch, so the one list is defined and used in the same place: both now take the tools from wic-native instead of repeating them 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/classes-recipe/image_types_wic.bbclass | 4 ++-- meta/recipes-core/meta/wic-tools.bb | 5 +---- meta/recipes-support/wic/wic_0.3.1.bb | 12 ++++++++++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index 671577cc062b..2dbe89fd899a 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -112,14 +112,14 @@ 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'))}" +do_image_wic[depends] += "wic-native:do_populate_sysroot" # 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" +WKS_FILE_DEPENDS_DEFAULT += "cdrtools-native" WKS_FILE_DEPENDS_BOOTLOADERS = "" WKS_FILE_DEPENDS_BOOTLOADERS:aarch64 = "grub-efi systemd-boot" WKS_FILE_DEPENDS_BOOTLOADERS:arm = "systemd-boot" diff --git a/meta/recipes-core/meta/wic-tools.bb b/meta/recipes-core/meta/wic-tools.bb index a4b7669137dd..4a4473469b7f 100644 --- a/meta/recipes-core/meta/wic-tools.bb +++ b/meta/recipes-core/meta/wic-tools.bb @@ -4,10 +4,7 @@ LICENSE = "MIT" 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 \ + cdrtools-native grub-native pseudo-native \ " DEPENDS:append:x86 = " syslinux-native" DEPENDS:append:x86-64 = " syslinux-native" diff --git a/meta/recipes-support/wic/wic_0.3.1.bb b/meta/recipes-support/wic/wic_0.3.1.bb index d9b4cc05c4bd..116b0a2cd292 100644 --- a/meta/recipes-support/wic/wic_0.3.1.bb +++ b/meta/recipes-support/wic/wic_0.3.1.bb @@ -15,6 +15,18 @@ RDEPENDS:${PN} += " \ python3-json \ python3-logging \ python3-misc \ + parted \ + gptfdisk \ + dosfstools \ + mtools \ + bmaptool \ + btrfs-tools \ + squashfs-tools \ + e2fsprogs \ + e2fsprogs-resize2fs \ + util-linux \ + tar \ + erofs-utils \ " BBCLASSEXTEND = "native nativesdk" From patchwork Sun Aug 2 02:09:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 94174 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 446C8C5516F for ; Sun, 2 Aug 2026 02:10:18 +0000 (UTC) Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.16980.1785636617782174396 for ; Sat, 01 Aug 2026 19:10:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=TSi93I7b; spf=pass (domain: gmail.com, ip: 209.85.160.181, mailfrom: twoerner@gmail.com) Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-51c0cea8883so15985701cf.1 for ; Sat, 01 Aug 2026 19:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785636617; x=1786241417; 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=eA0D/NHq0eran3XhzlFG832gCbRpxTG//sPCBC1+yrQ=; b=TSi93I7bLI/TnV2S/ux3J0fDgyQKJBashSe44ud/qs8g0UEdsWsa3BC70L4sp1NsYk lnq1PblYkr4YnDdWi9zUWeoQvlMEW65PFKIXrEclpnzWutdXgb+gDxa5ejrYPagbKbnE J0VmgvEdyD30FhxZg5/xkceavvoGRCMJsvi9xxfQ4CzSvC2QkrPXGrU9auWMw+f2kaa6 LcpIOkdKHz2Qhc7G5prBo5+nZLZR2Ixjsz4OxGKvXtREoQ7iStD8JwKlzOxsxqtIBJaH C83F8Kegfm0Vb+IQL77w7I2voQepCmdkCESz6xuXXu+b2VzlUWO+P3tIXpuYss992uBW yncg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785636617; x=1786241417; 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=eA0D/NHq0eran3XhzlFG832gCbRpxTG//sPCBC1+yrQ=; b=YlzdTsPoHHMc6vzE26QLKfTi8hhKjBNvGAdRVUjL9GzRBdCjEYbG7A7XLbPd1H6MB0 dI5QlxQ0gz+jB1oqsD/EGJldLC4pybkYj7KMzSwDkm42CuzugF9jnIXW4Q0H64CeNgy2 RuVM1vcSOfi7YmbTpQYwPcFpwkUbAM1tGFzxtqoY6GHUvi53Bh4+o3xgbGhAD2ZWt4FX XiRmnB87sLZ7l5I4lZfvo1Nd8h3vtoNKmT7ixfIJHea7xfFX9u16Qjfe3WBSMcjXjNVd jUJ59bPARStXeDhDHijuAQGBHHcyFL6Z5gJEM3s9XKIIHGn7rDZgrhTVy05w/8T3maVX JohA== X-Gm-Message-State: AOJu0Yy3vMbzlM26uo31z1e+jzYQd62JYy1rPWnRvsHreE9+AVqCdNWX 1QJE2Zh4hNrLY3BoLUlfZR3qeyHoTFaey9n3IeqadUHwJ0eJcVVDND3siXImYQ== X-Gm-Gg: AR+sD1104goFJ1O32/wDO+nSl93iWzlDUV/t+vQI4TZltCQxlrjnqOkwYl30aR97epP XnwF+CKLzLiTBpfhW1Qz2++cKVuROoPbOTHyuxvJ+bOe45FubFCDJxrCY9FqeOd5p/B8SuD0ycK EUZTsm/fWtKvEwKZ41fn4uBbxXzm1ZZ5ceHatix3u4sgijsbz/OvKmTgNoVZjIL9hQZmbvxKWen B2x1RHYxEn5Gtp7cAPCTx07gwjph+lrl4QnfTJS6JEOqb7073LnmRr2fUyPAXhRSODP93Ex13SJ JtPv4CDUR+bbrZL+s+dQjb6Jdt0dsVqnE2oJDgjHytSN87WqQ3DfNbvT4BALCpVf7OttyedRVnE 8htNb6NeN4bWGIkSyUHLbL9natrGXnV3F8LUmJP4RjY1dz/9VBfdum8GqgwQMbN4/IGCg4OzgNJ UWN7+buO4SeUYJ/nAT36HfkY+gBN4xT91CfFRFqVmTWNK3/wVNZjt9ia0+fR2V7Q3mQBgZe9XTf Ez4pVEEq84hElqtCDiuNQDFuPrnkPU= X-Received: by 2002:a05:622a:1194:b0:528:38b1:b550 with SMTP id d75a77b69052e-52b4c58ecc9mr119229221cf.16.1785636616714; Sat, 01 Aug 2026 19:10: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 6a1803df08f44-908434a26basm44733566d6.12.2026.08.01.19.10.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2026 19:10:15 -0700 (PDT) From: Trevor Woerner To: openembedded-core@lists.openembedded.org Subject: [PATCH v6 4/6] oeqa/selftest/wic: drop dead COREBASE/scripts wic lookup Date: Sat, 1 Aug 2026 22:09:58 -0400 Message-ID: <20260802021000.2886095-5-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260802021000.2886095-1-twoerner@gmail.com> References: <20260802021000.2886095-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 ; Sun, 02 Aug 2026 02:10:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242513 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 v6: - none 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 Sun Aug 2 02:09:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 94179 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 7757AC55172 for ; Sun, 2 Aug 2026 02:10:28 +0000 (UTC) Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.16981.1785636620993166412 for ; Sat, 01 Aug 2026 19:10:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=nO9zcxsr; spf=pass (domain: gmail.com, ip: 209.85.219.50, mailfrom: twoerner@gmail.com) Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-9063b380982so22115496d6.0 for ; Sat, 01 Aug 2026 19:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785636620; x=1786241420; 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=kiLjBTuYE0/qfveMD7KMbyrFt3hwAsUxf6IdzmPCCpI=; b=nO9zcxsrzyMbB/WmH52zFcTvJpfsp9X22BaFX0obLt9q4XJ0XJzBt1kce1n8Oxzh9j cIzS8jRqB3a5CoTBckyU76Tac62fxUfRSmdAlybyFC7K2aoKxhMt+PG3MVkeX6fJs/Hh 5w510ySuTCB3zjJQBzG/f2D+P1tKshu96Le28RNXS3nvZSDizA/06IZVHyRhg+peLysr RC5W6DwRauqaaiLtuazdPWolJX764yqxmcJeT6uPbBRag5Zp5fxzUDmUypiPvRY1tzxS qfVrej4L8oPqRBTk+xth32jqbs8Bo8aIz0fNwP5HOyTQ79LY1goarxQPRsKdov64xxM7 TL1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785636620; x=1786241420; 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=kiLjBTuYE0/qfveMD7KMbyrFt3hwAsUxf6IdzmPCCpI=; b=YYhsVA2MD3ID4/x5io17bID8Vr9eoI7I05QpQI1026O4pkgJouwKpFpxHQk3U3x8z9 FFw0Esuf0uqyYXKshTLPDaaOJ9pPYFVjNt6SfHvnOcTrnEsB69BJ5UjiCxst+HUKt+jZ JQmzUgkigpziElDfL9KAROdGhUGyOoWgMj169aD8TRc7tASu5pZFp+T4eXeaKv+W+OjD 8Y0pFTsx6lgNN4B4SBlgv/Ys5Xjzztm+Qs3eUaZLCvYVIKYb/Y3g1uXJ+oHAm+KPmIP1 suaNSkdoppT2QGb2QF+OTTT4h9FWABCg/3zlUQXUOSmJKZg729d8/kqDYKepEnUJ4oGX XXsQ== X-Gm-Message-State: AOJu0YzjY4D0leBLN8AI5BS0yQU+mbjmoYMIH67M/ZKzTP/jV2cwurW4 lt+JU4tXl52TpfkV/SqRj+VqEkXZeEd0Rxc7K74YxxyqjZ8AAj4noI+qgsuJcA== X-Gm-Gg: AR+sD11BMGqZ+AmueNFLANeFAM68UObbFPlFxgKxdii9kDrD3WW2ZjGsCcPwMqaBPQg wyjd+vr1Wb5YTbjBamuS7nxAtiqZ0dGlCu0moJpJ//PFMMas2D2Bj2E6mpRQc0yv+zoGFPa2mRa mfP6wGcvPAs9VcGc8LyAPukWpFPPeVpixSuJ/WDzDMLRzpA9n/6Un4FPDgPlmj3v47VtXTEH5aq cRiFZUYxSk2eVLOSqZfg2UQFJctYHLFTHsHeQImnQoI76f9l6ML8MB0J5PsIG4StFXjOpLL6KfH XKOaifINGKNA/fDwLBTwM6C7je1HJ57QTtdAa77jUzWBGOdCS8f3uMaqF8BnNPndreOWMOd74AT eXyENN1t4OF8yZNx5H0v5n2OP8VutJ4jlmVtoJ58JZEhlHSEB0umxfwZb3YRpSLNctUlqBC8aaJ LnezcXUv5p+pm+wwg7V42co9IhdMUrXOR9djLZ/s+zCY13rnkR1QU6slmzCTx8dwb/Xplsa2zZo TD4RvIii5NZO39tL6mS1jKzGJnedts= X-Received: by 2002:a05:6214:5b08:b0:8eb:326f:9515 with SMTP id 6a1803df08f44-908495c7c99mr122711976d6.8.1785636619407; Sat, 01 Aug 2026 19:10: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 6a1803df08f44-908434a26basm44733566d6.12.2026.08.01.19.10.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2026 19:10:18 -0700 (PDT) From: Trevor Woerner To: openembedded-core@lists.openembedded.org Subject: [PATCH v6 5/6] oeqa/selftest/wic: drop redundant per-test PATH overrides Date: Sat, 1 Aug 2026 22:09:59 -0400 Message-ID: <20260802021000.2886095-6-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260802021000.2886095-1-twoerner@gmail.com> References: <20260802021000.2886095-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 ; Sun, 02 Aug 2026 02:10:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242514 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 v6: - none 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 Sun Aug 2 02:10:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 94178 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 7D980C55174 for ; Sun, 2 Aug 2026 02:10:28 +0000 (UTC) Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.16894.1785636623995436146 for ; Sat, 01 Aug 2026 19:10:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=F6C9FOBx; spf=pass (domain: gmail.com, ip: 209.85.160.181, mailfrom: twoerner@gmail.com) Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-51a868b6962so22378121cf.2 for ; Sat, 01 Aug 2026 19:10:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785636623; x=1786241423; 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=DsZj0FkXJPtw6CIMHenGAk34t3AkhsbX6gEF2E2gu0U=; b=F6C9FOBxgwNLWpKesiOAY34jI0jyuQnJFOU4U85vHhKhVQ6tk9r+sbl/rJZ/6Zcs1Q 0Zfs1SJprgIUOrMd3kz4piW8YOVEsRIqfYMflEJxPdTVScHY69Kf1Hny3FYZe/U8MqJ4 ywcQUs2++9ypRKEuDVtV6V5DjxpCRqRpAhryObeQxexUy8c816S0o4EL57maRipnxrlR Ga9IBYaX3sCK31AocqwfXv/QILMi5yW6966e7T+xidtPWoKcflYxzd5FhD8FoxiRkECU PAiblva52h5yZwaH9I2+fVaexNAckSznMCbxy0uTUyMRbyfSMuhCSNiMIj6pUfxNlXBX OJ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785636623; x=1786241423; 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=DsZj0FkXJPtw6CIMHenGAk34t3AkhsbX6gEF2E2gu0U=; b=MsY3BJsEgaAVghFP8Rkas7bNFcnh40Sw94tdiyzy0zjo6qGUQ1HzvIXvN+ZKTHguho mZZJsk+jH+i1+7IHdNbNIUUystzTPElHWmDwFILJCdJi61d8YvOu31ycrn0K3LIh0KJ8 Zg78VWk2gA9gmGMcjZzmYO8eFFA55bERm2ob1zK81wNBmV2frIH0wBqq7V5ydFG+LejH jKsMCgOBKHDX255eZihjvd2j3VFPIIEoyt7a/fAYYWabBRHJZj5sg+IlT7tEfsf4QxeU Nt6Cs0WxD+lwUlPALhdVcxw+qUHisTYgmyDAUGm2keRfe6IRZ190wk69ODyvOIGVsw9J w8rA== X-Gm-Message-State: AOJu0YwfaVbmVTC+fxAj1FaG7SrsC7RfOKjssZLKAdrXZRHxHBUZ2kFi IMxAfl6Rk/Ygl7azOHQYU5UVSFUxrspBmaFvJbjdc/28vIh8R+Y+HePpeSN7ww== X-Gm-Gg: AR+sD10gpG8f+XmxFhmm2NR5ILOgxETrJeQR5i2aj9gdFZK151vEY0qctEGK3o1HQH0 PHvdqL765LTXi4nqAtJbuZER847/B7L1u9IOmWXAqVpXCiJAV0zj4Gjt5eh+ZtR4pvVQN+Um1Ak ExakKyXFCfY2TmtNYM/3s6dSJXiuFOkW+5mOzHOvUuRi9xE+SKpau+QkHGqiIy0elA+ybkug5tm q98nZiPNgkzA65N/pR4Kb7+NP6c8hY6aHebFOb4KHPaquE4AjbyjGMrptvLEGEunPOt5X8n6amG I+dCNh9MwO+cXCoK/n4xU+xpTbR8pIbKKm0biEkjYgqvgaOACKYdiB9MKf9aUJbQGY5Bs0Lbzsz TPcaf7JUrPP8hqvahBpJQYxmjKzZYaq5WHbcc31jXVovV1sXxqHDjVWWcc68g/2wn7CuktKW14h iBKJI7/O1jg9s8n15Zj+3Y6wRxgT3vFar/OknmPLdT1hTEBzqcFhpIuXL0mrTzKOh5OKaGwUYUt /umdrnYGDgqgZy2NuNWciVgIhrB4jrW X-Received: by 2002:a05:622a:11d3:b0:516:e10f:7140 with SMTP id d75a77b69052e-52b5678f1e2mr94254421cf.35.1785636622894; Sat, 01 Aug 2026 19:10: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 6a1803df08f44-908434a26basm44733566d6.12.2026.08.01.19.10.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2026 19:10:19 -0700 (PDT) From: Trevor Woerner To: openembedded-core@lists.openembedded.org Subject: [PATCH v6 6/6] image_types_wic: gate syslinux-native on the target, not the build host Date: Sat, 1 Aug 2026 22:10:00 -0400 Message-ID: <20260802021000.2886095-7-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260802021000.2886095-1-twoerner@gmail.com> References: <20260802021000.2886095-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 ; Sun, 02 Aug 2026 02:10:28 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242515 A .wks needs the syslinux installer only when the target is x86. image_types_wic.bbclass selects syslinux-native on the build host architecture instead, so the dependency lands like this: | x86 target | non-x86 target -------------+------------+---------------- x86 host | yes | yes non-x86 host | no | no Two of those cells are wrong. An x86 image cross-built on a non-x86 host gets the target bootloader without the installer that writes it, and an x86 host building a non-x86 image builds an installer nothing uses. Gate on the target, as wic-tools does [1]: | x86 target | non-x86 target -------------+------------+---------------- x86 host | yes | no non-x86 host | yes | no Bug 13276 [2] was an aarch64 host failing to build syslinux-native for an ARM target, at a time when syslinux was x86-only in every variant. It was closed in 2019 by gating on BUILD_ARCH [3]. Since 7273e131bfc7 [4] only syslinux's target code is x86-specific, so a host gate is no longer needed, and gating on the target keeps 13276's case 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 v6: - retitled with an image_types_wic prefix, which is now the only file it touches - gate WKS_FILE_DEPENDS_DEFAULT with target-arch appends instead of the removed shared variable; wic-tools keeps the arch-gated DEPENDS it already had changes in v5: - new in v5 --- meta/classes-recipe/image_types_wic.bbclass | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass index 2dbe89fd899a..cc7cf69edb74 100644 --- a/meta/classes-recipe/image_types_wic.bbclass +++ b/meta/classes-recipe/image_types_wic.bbclass @@ -118,8 +118,10 @@ do_image_wic[depends] += "wic-native:do_populate_sysroot" 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 += "cdrtools-native" +WKS_FILE_DEPENDS_DEFAULT = "cdrtools-native" +WKS_FILE_DEPENDS_DEFAULT:append:x86 = " syslinux-native" +WKS_FILE_DEPENDS_DEFAULT:append:x86-64 = " syslinux-native" +WKS_FILE_DEPENDS_DEFAULT:append:x86-x32 = " syslinux-native" WKS_FILE_DEPENDS_BOOTLOADERS = "" WKS_FILE_DEPENDS_BOOTLOADERS:aarch64 = "grub-efi systemd-boot" WKS_FILE_DEPENDS_BOOTLOADERS:arm = "systemd-boot"