From patchwork Fri Apr 3 18:36:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 85227 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 850B9E85398 for ; Fri, 3 Apr 2026 18:37:06 +0000 (UTC) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2222.1775241418722233852 for ; Fri, 03 Apr 2026 11:36:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=eCKq7cTt; spf=pass (domain: gmail.com, ip: 209.85.222.169, mailfrom: twoerner@gmail.com) Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-8cfc497a604so247417585a.3 for ; Fri, 03 Apr 2026 11:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775241417; x=1775846217; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9x9jOo5gg9/yUB0n46hVXNpm0ppxkpPClIg/kzzfCCI=; b=eCKq7cTtpE3FTpx4caiJfAawCRc19Xsq9OUjv8/dn5DbDQiZUh2D+LmgfWbrV3wBph pe0bNgfZciJ7HowZ0d6/84Z4KBs14c4AZAKkkBcBRYY5UzDYxK4K/Wd3CCWCyEWUi6dc K4yRRVtZ2BMJtxTrdMEQpJATn9ebUlZnoOv1ZYvJwcW2O7Q8oJi5Lul+Pw14nDSKxxYi FH6F4MrlgjCxB5VCyoNruJy98RtFS55ac+znBov9TE78jN2gkPMVCyTv2yQVYK4Fk9N/ MEMPFOiHlIFFmSd3ey2HJ3250VfZfaJBwu/f8g97y5KZkfRexwhbrcmibiL74CtP7uvJ zb/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775241417; x=1775846217; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=9x9jOo5gg9/yUB0n46hVXNpm0ppxkpPClIg/kzzfCCI=; b=M0cllqVv6/Go6OhH4bLuus4mVXwnWX9LjZ1aM7LE93tAMIos28WV7gJabA+W0AoaSc ScblhAzq7PJvOKGCZ0UUb9kEf0hFnhIgx+g4wf0ck2aI9DWevX39DjIO+i2V+XIRiEm5 DTz3jPeU3KCb5f324nW8/SkP7k+xXXB8NC7n30akdHZslxhjDcsZtIu66mQGieBciqnn S1usRCALunVgNERBpepUugFe2Jk8oXylg7KIdunC+eMlEutq1x/TaGC/ORXDODS/jzRM Kawa1Qcbt4b5Kg/xi9hEqmuDf9LhDmBnz+SSdESM/3r1wOzH2dL9EA6yLnMgNE2pvtGp ULZQ== X-Gm-Message-State: AOJu0YyL8wf6WDxPPPtzT4P1MtGEHVQuzak/4JMl2OuhbyTGHe5yu/ZS W7Gb9mvXS4PqmJjf6G6FKGAqiZC0XK9zpADMkg5eqqpWGtCeycvs5HeO0U1FCztK X-Gm-Gg: ATEYQzzvFmxNyQk2cO6Y2FQ4s9+O6YQfJfGlyb/piHEeeMAc6v7bvHgNROQhZvjcqyX yqpkKG3L8cjll4QUuXsk9yf1A8zGpTHe3arHfjH6Rpi+A+9LRgY+tbbaNqreb97Str+ZcidaWNY GUNUpeK2t0AumQHD9OPC+eILVQS537VuA1rgEcNeAXVVbIwcl/DnVgwnwojKkwGJkc51JyApNVu 6yknUlaHlQhQQeNFWcBy9PBWpmBxMtRNRlYLNEFgKkinP02F3rI4Zf7NosG/wra0kLQPSp75RlI +CS5y2sRHKQUcuXtILdxrP9i8JCa/fyQacn/nvLSECjVXIdymGXK2yHuQk5P44i8pQiuQf6IFzO n6CP38gaMHi8AauEOgK0iitZnzMvcjCzidkEBV6WfhWtTY/u/ErceLkPAg3qdHj6jHyACYfMbex ED+aXTLBB7nZ8eIuwFf7Mct9fTpj88j65EyHWzJkYp6mgbIXSNcNRE16cPdRZWxibPgw== X-Received: by 2002:a05:620a:472a:b0:8cd:8fe4:537b with SMTP id af79cd13be357-8d41d961e4bmr566017185a.37.1775241417050; Fri, 03 Apr 2026 11:36:57 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d2a874459asm472401785a.39.2026.04.03.11.36.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 11:36:56 -0700 (PDT) From: Trevor Woerner To: yocto-patches@lists.yoctoproject.org Cc: Bruce Ashfield , Mark Hatle Subject: [wic][PATCH 1/9] re-organize for python src layout packaging Date: Fri, 3 Apr 2026 14:36:36 -0400 Message-ID: <20260403183644.2783267-2-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260403183644.2783267-1-twoerner@gmail.com> References: <20260403183644.2783267-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, 03 Apr 2026 18:37:06 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3627 The git-filter-repo tool was used to take OpenEmbedded's wic utility and import it (without any modification whatsoever) into its own source code repository while preserving the entire git history, removing any files and git history not related to wic. The specific command used to perform this conversion on a clean checkout of the OpenEmbedded repository was: $ git-filter-repo --force --path scripts/wic --path scripts/lib/wic/ The goal of this conversion process is to end up with an independent Python package for wic. This commit moves the wic components into the Python de facto standard packaging "src layout" order. All components are moved as they are; the main wic program is moved and renamed to `src/wic/cli.py`. NOTE: this commit does not work as-is, but is being provided in order to explicitly show a clean transition from oe-core Reviewed-by: Bruce Ashfield Reviewed-by: Mark Hatle Signed-off-by: Trevor Woerner --- {scripts/lib => src}/wic/__init__.py | 0 {scripts/lib => src}/wic/canned-wks/common.wks.inc | 0 .../lib => src}/wic/canned-wks/directdisk-bootloader-config.cfg | 0 .../lib => src}/wic/canned-wks/directdisk-bootloader-config.wks | 0 {scripts/lib => src}/wic/canned-wks/directdisk-gpt.wks | 0 {scripts/lib => src}/wic/canned-wks/directdisk-multi-rootfs.wks | 0 {scripts/lib => src}/wic/canned-wks/directdisk.wks | 0 {scripts/lib => src}/wic/canned-wks/efi-bootdisk.wks.in | 0 {scripts/lib => src}/wic/canned-wks/efi-uki-bootdisk.wks.in | 0 {scripts/lib => src}/wic/canned-wks/mkefidisk.wks | 0 {scripts/lib => src}/wic/canned-wks/mkhybridiso.wks | 0 {scripts/lib => src}/wic/canned-wks/qemuloongarch.wks | 0 {scripts/lib => src}/wic/canned-wks/qemuriscv.wks | 0 {scripts/lib => src}/wic/canned-wks/qemux86-directdisk.wks | 0 {scripts/lib => src}/wic/canned-wks/sdimage-bootpart.wks | 0 {scripts/lib => src}/wic/canned-wks/systemd-bootdisk.wks | 0 scripts/wic => src/wic/cli.py | 0 {scripts/lib => src}/wic/engine.py | 0 {scripts/lib => src}/wic/filemap.py | 0 {scripts/lib => src}/wic/help.py | 0 {scripts/lib => src}/wic/ksparser.py | 0 {scripts/lib => src}/wic/misc.py | 0 {scripts/lib => src}/wic/partition.py | 0 {scripts/lib => src}/wic/pluginbase.py | 0 {scripts/lib => src}/wic/plugins/imager/direct.py | 0 {scripts/lib => src}/wic/plugins/source/bootimg_biosplusefi.py | 0 {scripts/lib => src}/wic/plugins/source/bootimg_efi.py | 0 {scripts/lib => src}/wic/plugins/source/bootimg_partition.py | 0 {scripts/lib => src}/wic/plugins/source/bootimg_pcbios.py | 0 {scripts/lib => src}/wic/plugins/source/empty.py | 0 {scripts/lib => src}/wic/plugins/source/extra_partition.py | 0 {scripts/lib => src}/wic/plugins/source/isoimage_isohybrid.py | 0 {scripts/lib => src}/wic/plugins/source/rawcopy.py | 0 {scripts/lib => src}/wic/plugins/source/rootfs.py | 0 34 files changed, 0 insertions(+), 0 deletions(-) rename {scripts/lib => src}/wic/__init__.py (100%) rename {scripts/lib => src}/wic/canned-wks/common.wks.inc (100%) rename {scripts/lib => src}/wic/canned-wks/directdisk-bootloader-config.cfg (100%) rename {scripts/lib => src}/wic/canned-wks/directdisk-bootloader-config.wks (100%) rename {scripts/lib => src}/wic/canned-wks/directdisk-gpt.wks (100%) rename {scripts/lib => src}/wic/canned-wks/directdisk-multi-rootfs.wks (100%) rename {scripts/lib => src}/wic/canned-wks/directdisk.wks (100%) rename {scripts/lib => src}/wic/canned-wks/efi-bootdisk.wks.in (100%) rename {scripts/lib => src}/wic/canned-wks/efi-uki-bootdisk.wks.in (100%) rename {scripts/lib => src}/wic/canned-wks/mkefidisk.wks (100%) rename {scripts/lib => src}/wic/canned-wks/mkhybridiso.wks (100%) rename {scripts/lib => src}/wic/canned-wks/qemuloongarch.wks (100%) rename {scripts/lib => src}/wic/canned-wks/qemuriscv.wks (100%) rename {scripts/lib => src}/wic/canned-wks/qemux86-directdisk.wks (100%) rename {scripts/lib => src}/wic/canned-wks/sdimage-bootpart.wks (100%) rename {scripts/lib => src}/wic/canned-wks/systemd-bootdisk.wks (100%) rename scripts/wic => src/wic/cli.py (100%) rename {scripts/lib => src}/wic/engine.py (100%) rename {scripts/lib => src}/wic/filemap.py (100%) rename {scripts/lib => src}/wic/help.py (100%) rename {scripts/lib => src}/wic/ksparser.py (100%) rename {scripts/lib => src}/wic/misc.py (100%) rename {scripts/lib => src}/wic/partition.py (100%) rename {scripts/lib => src}/wic/pluginbase.py (100%) rename {scripts/lib => src}/wic/plugins/imager/direct.py (100%) rename {scripts/lib => src}/wic/plugins/source/bootimg_biosplusefi.py (100%) rename {scripts/lib => src}/wic/plugins/source/bootimg_efi.py (100%) rename {scripts/lib => src}/wic/plugins/source/bootimg_partition.py (100%) rename {scripts/lib => src}/wic/plugins/source/bootimg_pcbios.py (100%) rename {scripts/lib => src}/wic/plugins/source/empty.py (100%) rename {scripts/lib => src}/wic/plugins/source/extra_partition.py (100%) rename {scripts/lib => src}/wic/plugins/source/isoimage_isohybrid.py (100%) rename {scripts/lib => src}/wic/plugins/source/rawcopy.py (100%) rename {scripts/lib => src}/wic/plugins/source/rootfs.py (100%) diff --git a/scripts/lib/wic/__init__.py b/src/wic/__init__.py similarity index 100% rename from scripts/lib/wic/__init__.py rename to src/wic/__init__.py diff --git a/scripts/lib/wic/canned-wks/common.wks.inc b/src/wic/canned-wks/common.wks.inc similarity index 100% rename from scripts/lib/wic/canned-wks/common.wks.inc rename to src/wic/canned-wks/common.wks.inc diff --git a/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg b/src/wic/canned-wks/directdisk-bootloader-config.cfg similarity index 100% rename from scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg rename to src/wic/canned-wks/directdisk-bootloader-config.cfg diff --git a/scripts/lib/wic/canned-wks/directdisk-bootloader-config.wks b/src/wic/canned-wks/directdisk-bootloader-config.wks similarity index 100% rename from scripts/lib/wic/canned-wks/directdisk-bootloader-config.wks rename to src/wic/canned-wks/directdisk-bootloader-config.wks diff --git a/scripts/lib/wic/canned-wks/directdisk-gpt.wks b/src/wic/canned-wks/directdisk-gpt.wks similarity index 100% rename from scripts/lib/wic/canned-wks/directdisk-gpt.wks rename to src/wic/canned-wks/directdisk-gpt.wks diff --git a/scripts/lib/wic/canned-wks/directdisk-multi-rootfs.wks b/src/wic/canned-wks/directdisk-multi-rootfs.wks similarity index 100% rename from scripts/lib/wic/canned-wks/directdisk-multi-rootfs.wks rename to src/wic/canned-wks/directdisk-multi-rootfs.wks diff --git a/scripts/lib/wic/canned-wks/directdisk.wks b/src/wic/canned-wks/directdisk.wks similarity index 100% rename from scripts/lib/wic/canned-wks/directdisk.wks rename to src/wic/canned-wks/directdisk.wks diff --git a/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in b/src/wic/canned-wks/efi-bootdisk.wks.in similarity index 100% rename from scripts/lib/wic/canned-wks/efi-bootdisk.wks.in rename to src/wic/canned-wks/efi-bootdisk.wks.in diff --git a/scripts/lib/wic/canned-wks/efi-uki-bootdisk.wks.in b/src/wic/canned-wks/efi-uki-bootdisk.wks.in similarity index 100% rename from scripts/lib/wic/canned-wks/efi-uki-bootdisk.wks.in rename to src/wic/canned-wks/efi-uki-bootdisk.wks.in diff --git a/scripts/lib/wic/canned-wks/mkefidisk.wks b/src/wic/canned-wks/mkefidisk.wks similarity index 100% rename from scripts/lib/wic/canned-wks/mkefidisk.wks rename to src/wic/canned-wks/mkefidisk.wks diff --git a/scripts/lib/wic/canned-wks/mkhybridiso.wks b/src/wic/canned-wks/mkhybridiso.wks similarity index 100% rename from scripts/lib/wic/canned-wks/mkhybridiso.wks rename to src/wic/canned-wks/mkhybridiso.wks diff --git a/scripts/lib/wic/canned-wks/qemuloongarch.wks b/src/wic/canned-wks/qemuloongarch.wks similarity index 100% rename from scripts/lib/wic/canned-wks/qemuloongarch.wks rename to src/wic/canned-wks/qemuloongarch.wks diff --git a/scripts/lib/wic/canned-wks/qemuriscv.wks b/src/wic/canned-wks/qemuriscv.wks similarity index 100% rename from scripts/lib/wic/canned-wks/qemuriscv.wks rename to src/wic/canned-wks/qemuriscv.wks diff --git a/scripts/lib/wic/canned-wks/qemux86-directdisk.wks b/src/wic/canned-wks/qemux86-directdisk.wks similarity index 100% rename from scripts/lib/wic/canned-wks/qemux86-directdisk.wks rename to src/wic/canned-wks/qemux86-directdisk.wks diff --git a/scripts/lib/wic/canned-wks/sdimage-bootpart.wks b/src/wic/canned-wks/sdimage-bootpart.wks similarity index 100% rename from scripts/lib/wic/canned-wks/sdimage-bootpart.wks rename to src/wic/canned-wks/sdimage-bootpart.wks diff --git a/scripts/lib/wic/canned-wks/systemd-bootdisk.wks b/src/wic/canned-wks/systemd-bootdisk.wks similarity index 100% rename from scripts/lib/wic/canned-wks/systemd-bootdisk.wks rename to src/wic/canned-wks/systemd-bootdisk.wks diff --git a/scripts/wic b/src/wic/cli.py similarity index 100% rename from scripts/wic rename to src/wic/cli.py diff --git a/scripts/lib/wic/engine.py b/src/wic/engine.py similarity index 100% rename from scripts/lib/wic/engine.py rename to src/wic/engine.py diff --git a/scripts/lib/wic/filemap.py b/src/wic/filemap.py similarity index 100% rename from scripts/lib/wic/filemap.py rename to src/wic/filemap.py diff --git a/scripts/lib/wic/help.py b/src/wic/help.py similarity index 100% rename from scripts/lib/wic/help.py rename to src/wic/help.py diff --git a/scripts/lib/wic/ksparser.py b/src/wic/ksparser.py similarity index 100% rename from scripts/lib/wic/ksparser.py rename to src/wic/ksparser.py diff --git a/scripts/lib/wic/misc.py b/src/wic/misc.py similarity index 100% rename from scripts/lib/wic/misc.py rename to src/wic/misc.py diff --git a/scripts/lib/wic/partition.py b/src/wic/partition.py similarity index 100% rename from scripts/lib/wic/partition.py rename to src/wic/partition.py diff --git a/scripts/lib/wic/pluginbase.py b/src/wic/pluginbase.py similarity index 100% rename from scripts/lib/wic/pluginbase.py rename to src/wic/pluginbase.py diff --git a/scripts/lib/wic/plugins/imager/direct.py b/src/wic/plugins/imager/direct.py similarity index 100% rename from scripts/lib/wic/plugins/imager/direct.py rename to src/wic/plugins/imager/direct.py diff --git a/scripts/lib/wic/plugins/source/bootimg_biosplusefi.py b/src/wic/plugins/source/bootimg_biosplusefi.py similarity index 100% rename from scripts/lib/wic/plugins/source/bootimg_biosplusefi.py rename to src/wic/plugins/source/bootimg_biosplusefi.py diff --git a/scripts/lib/wic/plugins/source/bootimg_efi.py b/src/wic/plugins/source/bootimg_efi.py similarity index 100% rename from scripts/lib/wic/plugins/source/bootimg_efi.py rename to src/wic/plugins/source/bootimg_efi.py diff --git a/scripts/lib/wic/plugins/source/bootimg_partition.py b/src/wic/plugins/source/bootimg_partition.py similarity index 100% rename from scripts/lib/wic/plugins/source/bootimg_partition.py rename to src/wic/plugins/source/bootimg_partition.py diff --git a/scripts/lib/wic/plugins/source/bootimg_pcbios.py b/src/wic/plugins/source/bootimg_pcbios.py similarity index 100% rename from scripts/lib/wic/plugins/source/bootimg_pcbios.py rename to src/wic/plugins/source/bootimg_pcbios.py diff --git a/scripts/lib/wic/plugins/source/empty.py b/src/wic/plugins/source/empty.py similarity index 100% rename from scripts/lib/wic/plugins/source/empty.py rename to src/wic/plugins/source/empty.py diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/src/wic/plugins/source/extra_partition.py similarity index 100% rename from scripts/lib/wic/plugins/source/extra_partition.py rename to src/wic/plugins/source/extra_partition.py diff --git a/scripts/lib/wic/plugins/source/isoimage_isohybrid.py b/src/wic/plugins/source/isoimage_isohybrid.py similarity index 100% rename from scripts/lib/wic/plugins/source/isoimage_isohybrid.py rename to src/wic/plugins/source/isoimage_isohybrid.py diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/src/wic/plugins/source/rawcopy.py similarity index 100% rename from scripts/lib/wic/plugins/source/rawcopy.py rename to src/wic/plugins/source/rawcopy.py diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/src/wic/plugins/source/rootfs.py similarity index 100% rename from scripts/lib/wic/plugins/source/rootfs.py rename to src/wic/plugins/source/rootfs.py From patchwork Fri Apr 3 18:36:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 85228 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 BB405E85399 for ; Fri, 3 Apr 2026 18:37:06 +0000 (UTC) Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.2216.1775241420962391587 for ; Fri, 03 Apr 2026 11:37:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=iza418Jb; spf=pass (domain: gmail.com, ip: 209.85.222.174, mailfrom: twoerner@gmail.com) Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-8cd71fb9f06so137900185a.2 for ; Fri, 03 Apr 2026 11:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775241419; x=1775846219; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ara3uTTvGb8FLGFq2Jd/5TwmPU+UAuG5QxJWZbybs8w=; b=iza418JbvTslNvg+MBGLCTJ3QwgQ7LuzvgtKiYqgJmsbr3p5vjJZwY2gS9vcR3Tgvr 1et5gGZewI+73LOqblAKKTfNFSoHWt3jvLxJEMwqduuBlpBjqFNlK2fCk9utSMmOPym/ 2sCh8qSi5oEMFJCEqIA49UP1JCAGXcfgDiY4VmJkOSLWgb1kpml+FUglrTlEsZTIiYKa ejBMm6AhBb59UyjOoz5KTQBvtOLWBGzrUN9Ea5AizT0D4LPFVeIBBWZzrEqIb5lWmHCC UDQ+cC+hfbhirJX0lUtzJUD29+0LWRvRRJPg7V4AGkhv1pn0lG8m3Tv2dJrs3l4x0CaG Ditg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775241419; x=1775846219; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ara3uTTvGb8FLGFq2Jd/5TwmPU+UAuG5QxJWZbybs8w=; b=PA9kVVUuEPPTJxvuFxPzU4cFPqv2v+UOcRHUIqPHWfH2immsHbWurwKBf0epfWXerB eHN3xWF3IkiKjBD40FBYhSUOwTXnS3fXUOtkheqW1XZf4VKpVMiUnglPMYObsHTQ6g2o JX/dQc63/r4Tk4zeUYmdS0rHdvTEFWKXtXv9+6yeydNyTINv4oTZ1QcvEXgTm3YuPLNE ds0xhPeGaadr+kX3eD7Gyi/bdMsQ6txrAlU0gLl6dBc7glGQAv3vevmehyjGHFnnee3V MQw380D03KqPR0WCYVhJZU/bYObsIVHzVE6qNBr+Ku99KNfTtEBiK5NaMzXoEWgoiKuI tGVw== X-Gm-Message-State: AOJu0YyEWDoQuy4BcguqLl5Pej4KCgKjmZk2/1QbGZRuzTbvcf2qJiV8 ubDZ+dfnuKkzCxlHaxRjN8Hc/YS7amuoaAAUwmTr9htY5DYbt3ofzwtBcDFa+mkP X-Gm-Gg: ATEYQzylv1qLOFOUXJpIn8F9UOS13GwqEQyaxtJ0sLdU9tzZpBNWfCEpzroGN4+9FRM c3Itdx4QJNY+Y+yxgwtvRIjdGPbhfy/sRb/JQf5o4YMM4MLAS6KptVui+IdghD64GW8hHqNTyK8 cjkgobcugNMVwmHq05IdQO++U0t0RsIuM1DJeey+u4L4fHMRHWQl54XS0mPNLCgh2qJ7F/hO4Ok kPZrAOrlfuH5t1Q1zKSNB0hT4INDP2h5cUBm1vxE4MDZxTvtZA0NjMf/a3i+MyOMYuFqkkvkxwG ixoNGY6nMPI6P9eIEk1Z5cl5La+V+1pSrI0PShyNBvNkWs97X51MWjF68QtKo2KQlGO3JYuddvR be5lHJorrFjgSwqeONpq3SmNIyWNtQLNJS01J0bIFDfRBslCuDL3kU9KCWijDqGOGBaOIIb4Hsi Lga1E9DHSGQsVTsnsq8x4FSaepgyD5JA1WOjsJdDIRyRED7aNysCoFB29UIzcYMX/66w== X-Received: by 2002:a05:620a:7112:b0:8cd:8635:c031 with SMTP id af79cd13be357-8d41919026cmr592919485a.20.1775241418496; Fri, 03 Apr 2026 11:36:58 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d2a874459asm472401785a.39.2026.04.03.11.36.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 11:36:57 -0700 (PDT) From: Trevor Woerner To: yocto-patches@lists.yoctoproject.org Cc: Bruce Ashfield , Mark Hatle Subject: [wic][PATCH 2/9] move example *wks files Date: Fri, 3 Apr 2026 14:36:37 -0400 Message-ID: <20260403183644.2783267-3-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260403183644.2783267-1-twoerner@gmail.com> References: <20260403183644.2783267-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, 03 Apr 2026 18:37:06 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3628 These canned *wks files come directly from the OpenEmbedded project, are only relevant to that project, and therefore should be preserved there. Instead of removing them, keep them around as example *wks files for this project. However, move them away from a location (relative to the wic invoking script itself, cli.py) so they do not accidentally interfere with any usage of this tool. NOTE: this commit does not work as-is, but is being provided in order to explicitly show a clean transition from oe-core Reviewed-by: Bruce Ashfield Reviewed-by: Mark Hatle Signed-off-by: Trevor Woerner --- {src/wic/canned-wks => example-wks}/common.wks.inc | 0 .../canned-wks => example-wks}/directdisk-bootloader-config.cfg | 0 .../canned-wks => example-wks}/directdisk-bootloader-config.wks | 0 {src/wic/canned-wks => example-wks}/directdisk-gpt.wks | 0 {src/wic/canned-wks => example-wks}/directdisk-multi-rootfs.wks | 0 {src/wic/canned-wks => example-wks}/directdisk.wks | 0 {src/wic/canned-wks => example-wks}/efi-bootdisk.wks.in | 0 {src/wic/canned-wks => example-wks}/efi-uki-bootdisk.wks.in | 0 {src/wic/canned-wks => example-wks}/mkefidisk.wks | 0 {src/wic/canned-wks => example-wks}/mkhybridiso.wks | 0 {src/wic/canned-wks => example-wks}/qemuloongarch.wks | 0 {src/wic/canned-wks => example-wks}/qemuriscv.wks | 0 {src/wic/canned-wks => example-wks}/qemux86-directdisk.wks | 0 {src/wic/canned-wks => example-wks}/sdimage-bootpart.wks | 0 {src/wic/canned-wks => example-wks}/systemd-bootdisk.wks | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename {src/wic/canned-wks => example-wks}/common.wks.inc (100%) rename {src/wic/canned-wks => example-wks}/directdisk-bootloader-config.cfg (100%) rename {src/wic/canned-wks => example-wks}/directdisk-bootloader-config.wks (100%) rename {src/wic/canned-wks => example-wks}/directdisk-gpt.wks (100%) rename {src/wic/canned-wks => example-wks}/directdisk-multi-rootfs.wks (100%) rename {src/wic/canned-wks => example-wks}/directdisk.wks (100%) rename {src/wic/canned-wks => example-wks}/efi-bootdisk.wks.in (100%) rename {src/wic/canned-wks => example-wks}/efi-uki-bootdisk.wks.in (100%) rename {src/wic/canned-wks => example-wks}/mkefidisk.wks (100%) rename {src/wic/canned-wks => example-wks}/mkhybridiso.wks (100%) rename {src/wic/canned-wks => example-wks}/qemuloongarch.wks (100%) rename {src/wic/canned-wks => example-wks}/qemuriscv.wks (100%) rename {src/wic/canned-wks => example-wks}/qemux86-directdisk.wks (100%) rename {src/wic/canned-wks => example-wks}/sdimage-bootpart.wks (100%) rename {src/wic/canned-wks => example-wks}/systemd-bootdisk.wks (100%) diff --git a/src/wic/canned-wks/common.wks.inc b/example-wks/common.wks.inc similarity index 100% rename from src/wic/canned-wks/common.wks.inc rename to example-wks/common.wks.inc diff --git a/src/wic/canned-wks/directdisk-bootloader-config.cfg b/example-wks/directdisk-bootloader-config.cfg similarity index 100% rename from src/wic/canned-wks/directdisk-bootloader-config.cfg rename to example-wks/directdisk-bootloader-config.cfg diff --git a/src/wic/canned-wks/directdisk-bootloader-config.wks b/example-wks/directdisk-bootloader-config.wks similarity index 100% rename from src/wic/canned-wks/directdisk-bootloader-config.wks rename to example-wks/directdisk-bootloader-config.wks diff --git a/src/wic/canned-wks/directdisk-gpt.wks b/example-wks/directdisk-gpt.wks similarity index 100% rename from src/wic/canned-wks/directdisk-gpt.wks rename to example-wks/directdisk-gpt.wks diff --git a/src/wic/canned-wks/directdisk-multi-rootfs.wks b/example-wks/directdisk-multi-rootfs.wks similarity index 100% rename from src/wic/canned-wks/directdisk-multi-rootfs.wks rename to example-wks/directdisk-multi-rootfs.wks diff --git a/src/wic/canned-wks/directdisk.wks b/example-wks/directdisk.wks similarity index 100% rename from src/wic/canned-wks/directdisk.wks rename to example-wks/directdisk.wks diff --git a/src/wic/canned-wks/efi-bootdisk.wks.in b/example-wks/efi-bootdisk.wks.in similarity index 100% rename from src/wic/canned-wks/efi-bootdisk.wks.in rename to example-wks/efi-bootdisk.wks.in diff --git a/src/wic/canned-wks/efi-uki-bootdisk.wks.in b/example-wks/efi-uki-bootdisk.wks.in similarity index 100% rename from src/wic/canned-wks/efi-uki-bootdisk.wks.in rename to example-wks/efi-uki-bootdisk.wks.in diff --git a/src/wic/canned-wks/mkefidisk.wks b/example-wks/mkefidisk.wks similarity index 100% rename from src/wic/canned-wks/mkefidisk.wks rename to example-wks/mkefidisk.wks diff --git a/src/wic/canned-wks/mkhybridiso.wks b/example-wks/mkhybridiso.wks similarity index 100% rename from src/wic/canned-wks/mkhybridiso.wks rename to example-wks/mkhybridiso.wks diff --git a/src/wic/canned-wks/qemuloongarch.wks b/example-wks/qemuloongarch.wks similarity index 100% rename from src/wic/canned-wks/qemuloongarch.wks rename to example-wks/qemuloongarch.wks diff --git a/src/wic/canned-wks/qemuriscv.wks b/example-wks/qemuriscv.wks similarity index 100% rename from src/wic/canned-wks/qemuriscv.wks rename to example-wks/qemuriscv.wks diff --git a/src/wic/canned-wks/qemux86-directdisk.wks b/example-wks/qemux86-directdisk.wks similarity index 100% rename from src/wic/canned-wks/qemux86-directdisk.wks rename to example-wks/qemux86-directdisk.wks diff --git a/src/wic/canned-wks/sdimage-bootpart.wks b/example-wks/sdimage-bootpart.wks similarity index 100% rename from src/wic/canned-wks/sdimage-bootpart.wks rename to example-wks/sdimage-bootpart.wks diff --git a/src/wic/canned-wks/systemd-bootdisk.wks b/example-wks/systemd-bootdisk.wks similarity index 100% rename from src/wic/canned-wks/systemd-bootdisk.wks rename to example-wks/systemd-bootdisk.wks From patchwork Fri Apr 3 18:36:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 85229 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 D29E8E8539C for ; Fri, 3 Apr 2026 18:37:06 +0000 (UTC) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2224.1775241421732221663 for ; Fri, 03 Apr 2026 11:37:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=ZhRhUS/7; spf=pass (domain: gmail.com, ip: 209.85.222.177, mailfrom: twoerner@gmail.com) Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-8cb40149037so249130985a.2 for ; Fri, 03 Apr 2026 11:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775241420; x=1775846220; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YvIzeK+Q0TjrqF2DnXAmJL/sIx/KZGF+I3wDLt06Doo=; b=ZhRhUS/7IUCjfGTa/l1Ak+fGByEj/pQThYxm+/x/p8TCndX+SWNImjCi3OvEvsx3bo Bskgpw3kVb9YM5Gey1ysqF5EKNy5ulLXTx5qrku6B6+z60vwm12twKxNu0B3DokG2MI4 ldZcvIWnLLS02DMjqzz8L+eT4YNnTKD/V8NmuyQBwh2e6ToxSMscONIKnWGUrwOzBc22 R4GIBdYBhZ09dwwoWoYmswXC45swkDkhjKMGmdkhXzvB7Q+DkGRg1QYO969iU98pXlIF QK7DKaSiGGYYc+BWfhCM8rZTcx3h+mglymxiqsAfoUKuqyBsCZ3iPCkBD1Wr9kaOa+kQ fjFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775241420; x=1775846220; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YvIzeK+Q0TjrqF2DnXAmJL/sIx/KZGF+I3wDLt06Doo=; b=oSm/v8ARTWZHoOrq812fr/5/hoMlEJ6ZswznG77EoZ5lkHk52pIzFGnIiW3Y2dzXIY 3ouEDwZwhKtZAh90ywK8TZOWM2bUC/q/zB4zlFlakQfF4wqY1GSbO/xyTeQWHm01QiyZ eL80ZVLejvYpLWN9jaiCn6E1W0Z5M5UFGCNrnklIqiPljlpKpMxM1FN8AIuXF+fc8Mjt mAnSnCsvQ2ckHjhvLoApT5YFaIH6p0fPlDWIWB0Mo3MiQWriDhn5oiznVIOYmnYU8o+b 8VUuW4pD/cFIZqDdd6kItSF73vASTkgggoVRq16R09m+pGG5yl9qMGQQJVICeGH4aQqZ HXwg== X-Gm-Message-State: AOJu0YzoSZ6aWBm4xumHgZ4VPoO70sfC3WYU7HeKvGYh2/UD8W6+zgsR dL9UCvu3jQXFuHGgEj++31lmHR5DPbxGeGC0/VrEreWJVhO4BsvNQRcDdwl8nk3V X-Gm-Gg: ATEYQzxb/8F2PfK6xSYdoX0cFLWG+XHhb61AgTMLsELc2TnolYLzGvj9hYH1JeF2wR4 TLwA8Ce3MN05407QoMBIAVeTMDc9FQx5fxODP3a7BMEZSEIocEaZj66/jAW8j13aVh6QoMq3YAk WgoewNgKFwMZqQYBmey6zoWLmeTj0ZDtvgLLmSXrHfCSnmOTLLqiP5ANQTnWqPVf9viF51TVvmg Naidtk/Y5s5l8jAAR7F77z3KF77AF5SXUOlecP4NJW1PwpaoSaa/f6eFGRtEp28JkqpqlLvNte+ SCF6mRxYC1qcEOZgIBxuG7yzpNtKcUB7NaNVk7GP5CeQykRc5vHOM0XEXcrAVifbpxs4wJi/CAS N+Rq4p+pkSrEnc84yO1pOi/BIRq9ZF+1d218rAY+mr2eTAJwamufm6p5lS0UgWpp/NbMhfJ9u0w UzyGlwQa76613LhPZNp7GQ8I2xImvTwrnGhzyP6haf1cJ5hMHRf+mL8wdQDG/Apsacqg== X-Received: by 2002:a05:620a:2981:b0:8cd:9322:d449 with SMTP id af79cd13be357-8d41e340605mr577805885a.56.1775241419624; Fri, 03 Apr 2026 11:36:59 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d2a874459asm472401785a.39.2026.04.03.11.36.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 11:36:59 -0700 (PDT) From: Trevor Woerner To: yocto-patches@lists.yoctoproject.org Cc: Bruce Ashfield , Mark Hatle Subject: [wic][PATCH 3/9] create python hatch project Date: Fri, 3 Apr 2026 14:36:38 -0400 Message-ID: <20260403183644.2783267-4-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260403183644.2783267-1-twoerner@gmail.com> References: <20260403183644.2783267-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, 03 Apr 2026 18:37:06 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3629 Add the pieces necessary to convert this project into a standard Python hatch package. NOTE: this commit does not work as-is, but is being provided in order to explicitly show a clean transition from oe-core Reviewed-by: Bruce Ashfield Reviewed-by: Mark Hatle Signed-off-by: Trevor Woerner --- .gitignore | 1 + LICENSE | 288 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 51 +++++++++ pyproject.toml | 38 +++++++ 4 files changed, 378 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..eeb8a6ec4087 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +**/__pycache__ diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..5db3c0a21cdb --- /dev/null +++ b/LICENSE @@ -0,0 +1,288 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Note: +Individual files contain the following tag instead of the full license text. + + SPDX-License-Identifier: GPL-2.0-only + +This enables machine processing of license information based on the SPDX +License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/README.md b/README.md new file mode 100644 index 000000000000..8ee02d89738b --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# WIC Standalone + +This packages the OpenEmbedded Image Creator (`wic`) as an installable +Python CLI using Hatch. It either consumes BitBake-exported environment +files (generated via `bitbake -c rootfs_wicenv `) or will invoke +BitBake directly (if available on the PATH). + +## Quick start + +### Using wicenv +1. Ensure you have a BitBake-generated `.env` file (from `rootfs_wicenv`). +2. Install locally for development: + ```bash + hatch shell + ``` +3. Run the CLI: + ```bash + hatch run wic --vars /path/to/.env --help + ``` + +### With bitbake +1. Ensure you have bitbake available in your PATH. +2. Install locally for development: + ```bash + hatch shell + ``` +3. Run the CLI: + ```bash + hatch run wic --help + ``` + +## Project layout + +- `src/wic/cli.py`: CLI entrypoint (formerly `scripts/wic`). +- `src/wic/*`: core engine, plugins, and helpers. +- `src/bb/*`: various bitbake helpers that were brought along and used in other parts of wic. +- `src/oe/*`: various oe-core helpers that were brought along and used in other parts of wic. + +## Contributing + +Please send all patches, comments, or questions to the yocto-patches +mailing list (yocto-patches@lists.yoctoproject.org). +See https://lists.yoctoproject.org/g/yocto-patches + +When sending patches, please make sure the email subject line includes +"[wic][PATCH]" and follow The Yocto Project community's patch submission +guidelines. + +## Licensing + +GPL-2.0-only to match the original OpenEmbedded wic tooling. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000000..fdc1ce0f5ece --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[project] +name = "wic" +description = "OpenEmbedded Image Creator (wic) packaged as a standalone CLI" +dynamic = ["version"] +readme = "README.md" +license = { text = "GPL-2.0-only" } +maintainers = [ + { name = "Trevor Woerner", email = "twoerner@gmail.com" }, +] +requires-python = ">=3.8" +classifiers = [ + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", + "Topic :: Software Development :: Embedded Systems", + "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", + "Programming Language :: Python", + "Programming Language :: Python :: 3", +] + +[project.urls] +Homepage = "https://git.yoctoproject.org/wic" +Repository = "https://git.yoctoproject.org/wic" + +[project.scripts] +wic = "wic.cli:main" + +[tool.hatch.build] +packages = ["src/wic"] + +[tool.hatch.build.targets.wheel] +packages = ["src/wic"] + +[build-system] +requires = ["hatchling>=1.21"] +build-backend = "hatchling.build" + +[tool.hatch.version] +path = "src/wic/cli.py" From patchwork Fri Apr 3 18:36:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 85231 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 EE005D6AB19 for ; Fri, 3 Apr 2026 18:37:06 +0000 (UTC) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2225.1775241422655042257 for ; Fri, 03 Apr 2026 11:37:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=Rz6oxtYN; spf=pass (domain: gmail.com, ip: 209.85.222.178, mailfrom: twoerner@gmail.com) Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-8cfc085395fso194858485a.2 for ; Fri, 03 Apr 2026 11:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775241421; x=1775846221; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6Zu3hTZCarzyag0CM/ZvohYsdYYjcb+jdjJM64+Y/rU=; b=Rz6oxtYNg1Yi3kvGn+zk0dLwoqMOi5Rtf5sTxVR98DWRf7fV4Sed+iiYoULVPlrt7e +3ZSdKb8IZcOLnRtg+cGxP2V/tpA2ahbSIwUpzwiw3zngcHqcGl7jvgs1a7vlgZpv5k9 tDR67xGJZhyWteLo2eLRnQnwqwgMf8LEZiGmW2903HaCwTYUYSGumcga3keCfK004+zR f02IM8m1LI3DdQkRfw7Ve+7qF0V8e76WOomjqgxuDF7nBjp3xC2hVledtowHaaJ+wAon E5bHY16W8+gybHvWWlNsl+qIYxO+0lfbwA3Lx2+HXaLRDGy1VPu1tMCnox9Y7emzA/W3 5kAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775241421; x=1775846221; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=6Zu3hTZCarzyag0CM/ZvohYsdYYjcb+jdjJM64+Y/rU=; b=bBMu0hZ77SoIBpG7m8F1ii7R64ajJlqUeTQDeGaS81jwi/tiZ1sULKxsxQe14JUeMG /U1AWJuMKeR9zqqSa2GmGXsdlLGQDQtssX7FIYOcJNeEmyZuX2jepjc6jA4U7POuJqK2 d4iSSBkWoxHqs3neJMR20pMcurARLbLX/4+EH9jogVwgtvc8KEbVBgmk8pRp5ieox50V gzsj+ITSKbmR5T6jXtCdW0SJPvQ3jifUl7WpcUSGAhcsXsSa6AnGnt97lZnfr3vPdsfr wc/SbhxhNpz1LRTPfC1aOBsYjgFeYPZuNyQ124KYdOE3BMtdfuib4x0cHcFXB8jKkItt iSQg== X-Gm-Message-State: AOJu0YxWrcA0reSm6CsezTkopIXaPhez5ELgHMJFwFVSCY7YCmN2atrH mh7J2chsH3XsyWSXBONqSUu42tBonkyuEyKKTp9k/aaSRxkN+0Zha1NEgjqKmgQo X-Gm-Gg: ATEYQzx8VYZXUj24rP0Us+L7+i5N9Ll7hhf/N8uPEHYbFiC4Ch2MQis8K4ccgEV8wYa LPSd9cR97wN1oLRsbG1mv1TnNJnCXW6wIfZTWtfrBCDOC3jFyGdwcRBANW5XyuQwJ4vbu6La/mT uJvYp33YJTHCLGbCjE8WC/r7UxFi/pzSfFo0/ToONJuGGN1uBSlI1F1DZRiteTL/I9cdTX2uLLe bv7rOVas/C4GtY0cq1kcLqGufQrBSpzPEMEI0WZ2lRkG2JLFOiARqmpVYLMlosavdwgWK+Yb0Ld GtZ+PP4OeQL1vOSw84VSw0v1ZYMsPMhyMZvZBxpHbJYYoCy4jPcZtcsrNOoyVUXI9cbE35QTOnt NDR0ZwN8zavTp0i7r1m9sAbsA0QsNCnJyDtbUU2R1S4A1fd8eHkWR8W7HgDnEMoCGVtYl2detXC rjkE5c2v+1boN2BvUtkV1AHpTKYzTEwgOLy6JIoW72V64D3yAy5V/0itjN04qk+BKvYA== X-Received: by 2002:a05:620a:294d:b0:8cf:de1c:edd6 with SMTP id af79cd13be357-8d419c563c4mr613542785a.28.1775241420770; Fri, 03 Apr 2026 11:37:00 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d2a874459asm472401785a.39.2026.04.03.11.36.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 11:37:00 -0700 (PDT) From: Trevor Woerner To: yocto-patches@lists.yoctoproject.org Cc: Bruce Ashfield , Mark Hatle Subject: [wic][PATCH 4/9] add oe-core and bitbake helper packages Date: Fri, 3 Apr 2026 14:36:39 -0400 Message-ID: <20260403183644.2783267-5-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260403183644.2783267-1-twoerner@gmail.com> References: <20260403183644.2783267-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, 03 Apr 2026 18:37:06 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3630 When it was part of oe-core, wic used a couple packages from bitbake and oe-core. Import those packages, with minor tweaks, so that the independent wic will be able to function. NOTE: this commit does not work as-is, but is being provided in order to explicitly show a clean transition from oe-core Reviewed-by: Bruce Ashfield Reviewed-by: Mark Hatle Signed-off-by: Trevor Woerner --- pyproject.toml | 4 +- src/bb/__init__.py | 14 ++ src/bb/utils.py | 23 +++ src/oe/__init__.py | 1 + src/oe/bootfiles.py | 58 ++++++++ src/oe/path.py | 351 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 449 insertions(+), 2 deletions(-) create mode 100644 src/bb/__init__.py create mode 100644 src/bb/utils.py create mode 100644 src/oe/__init__.py create mode 100644 src/oe/bootfiles.py create mode 100644 src/oe/path.py diff --git a/pyproject.toml b/pyproject.toml index fdc1ce0f5ece..6ef29462f3f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,10 +25,10 @@ Repository = "https://git.yoctoproject.org/wic" wic = "wic.cli:main" [tool.hatch.build] -packages = ["src/wic"] +packages = ["src/wic", "src/oe", "src/bb"] [tool.hatch.build.targets.wheel] -packages = ["src/wic"] +packages = ["src/wic", "src/oe", "src/bb"] [build-system] requires = ["hatchling>=1.21"] diff --git a/src/bb/__init__.py b/src/bb/__init__.py new file mode 100644 index 000000000000..d83315486080 --- /dev/null +++ b/src/bb/__init__.py @@ -0,0 +1,14 @@ +""" +Minimal stub of BitBake's bb module for standalone wic. +Provides debug logging used by vendored oe helpers. +""" +import logging + +def debug(level, msg): + """ + Mirror bb.debug signature but route to standard logging. + """ + logging.getLogger("bb").debug(msg) + +# Expose utils so callers can access bb.utils.mkdirhier +from . import utils diff --git a/src/bb/utils.py b/src/bb/utils.py new file mode 100644 index 000000000000..3750056ba563 --- /dev/null +++ b/src/bb/utils.py @@ -0,0 +1,23 @@ +""" +Minimal subset of BitBake's bb.utils used by standalone wic. +""" +import os + +# from bitbake/lib/bb/utils.py +def mkdirhier(directory): + """Create a directory like 'mkdir -p', but does not complain if + directory already exists list ``os.makedirs()``. + + Arguments: + + - ``directory``: path to the directory. + + No return value. + """ + if '${' in str(directory): + raise Exception("Directory name {} contains unexpanded bitbake variable. This may cause build failures and WORKDIR polution.".format(directory)) + try: + os.makedirs(directory, exist_ok=True) + except OSError as e: + if e.errno != errno.EEXIST or not os.path.isdir(directory): + raise e diff --git a/src/oe/__init__.py b/src/oe/__init__.py new file mode 100644 index 000000000000..abefaa7a8f58 --- /dev/null +++ b/src/oe/__init__.py @@ -0,0 +1 @@ +# Minimal vendored OpenEmbedded helpers used by wic. diff --git a/src/oe/bootfiles.py b/src/oe/bootfiles.py new file mode 100644 index 000000000000..b67bb0fe9814 --- /dev/null +++ b/src/oe/bootfiles.py @@ -0,0 +1,58 @@ +# +# SPDX-License-Identifier: MIT +# +# Copyright (C) 2024 Marcus Folkesson +# Author: Marcus Folkesson +# +# Utility functions handling boot files +# +# Look into deploy_dir and search for boot_files. +# Returns a list of tuples with (original filepath relative to +# deploy_dir, desired filepath renaming) +# +# Heavily inspired of bootimg_partition.py +# +# from oe-core/meta/lib/oe/bootfiles.py +def get_boot_files(deploy_dir, boot_files): + import re + import os + from glob import glob + + if boot_files is None: + return None + + # list of tuples (src_name, dst_name) + deploy_files = [] + for src_entry in re.findall(r'[\w;\-\./\*]+', boot_files): + if ';' in src_entry: + dst_entry = tuple(src_entry.split(';')) + if not dst_entry[0] or not dst_entry[1]: + raise ValueError('Malformed boot file entry: %s' % src_entry) + else: + dst_entry = (src_entry, src_entry) + + deploy_files.append(dst_entry) + + install_files = [] + for deploy_entry in deploy_files: + src, dst = deploy_entry + if '*' in src: + # by default install files under their basename + entry_name_fn = os.path.basename + if dst != src: + # unless a target name was given, then treat name + # as a directory and append a basename + entry_name_fn = lambda name: \ + os.path.join(dst, + os.path.basename(name)) + + srcs = glob(os.path.join(deploy_dir, src)) + + for entry in srcs: + src = os.path.relpath(entry, deploy_dir) + entry_dst_name = entry_name_fn(entry) + install_files.append((src, entry_dst_name)) + else: + install_files.append((src, dst)) + + return install_files diff --git a/src/oe/path.py b/src/oe/path.py new file mode 100644 index 000000000000..47b0c1347b61 --- /dev/null +++ b/src/oe/path.py @@ -0,0 +1,351 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: GPL-2.0-only +# + +import errno +import glob +import shutil +import subprocess +import os.path + +import bb + +def join(*paths): + """Like os.path.join but doesn't treat absolute RHS specially""" + return os.path.normpath("/".join(paths)) + +def relative(src, dest): + """ Return a relative path from src to dest. + + >>> relative("/usr/bin", "/tmp/foo/bar") + ../../tmp/foo/bar + + >>> relative("/usr/bin", "/usr/lib") + ../lib + + >>> relative("/tmp", "/tmp/foo/bar") + foo/bar + """ + + return os.path.relpath(dest, src) + +def make_relative_symlink(path): + """ Convert an absolute symlink to a relative one """ + if not os.path.islink(path): + return + link = os.readlink(path) + if not os.path.isabs(link): + return + + # find the common ancestor directory + ancestor = path + depth = 0 + while ancestor and not link.startswith(ancestor): + ancestor = ancestor.rpartition('/')[0] + depth += 1 + + if not ancestor: + print("make_relative_symlink() Error: unable to find the common ancestor of %s and its target" % path) + return + + base = link.partition(ancestor)[2].strip('/') + while depth > 1: + base = "../" + base + depth -= 1 + + os.remove(path) + os.symlink(base, path) + +def replace_absolute_symlinks(basedir, d): + """ + Walk basedir looking for absolute symlinks and replacing them with relative ones. + The absolute links are assumed to be relative to basedir + (compared to make_relative_symlink above which tries to compute common ancestors + using pattern matching instead) + """ + for walkroot, dirs, files in os.walk(basedir): + for file in files + dirs: + path = os.path.join(walkroot, file) + if not os.path.islink(path): + continue + link = os.readlink(path) + if not os.path.isabs(link): + continue + walkdir = os.path.dirname(path.rpartition(basedir)[2]) + base = os.path.relpath(link, walkdir) + bb.debug(2, "Replacing absolute path %s with relative path %s" % (link, base)) + os.remove(path) + os.symlink(base, path) + +def format_display(path, metadata): + """ Prepare a path for display to the user. """ + rel = relative(metadata.getVar("TOPDIR"), path) + if len(rel) > len(path): + return path + else: + return rel + +def copytree(src, dst): + # We could use something like shutil.copytree here but it turns out to + # to be slow. It takes twice as long copying to an empty directory. + # If dst already has contents performance can be 15 time slower + # This way we also preserve hardlinks between files in the tree. + + bb.utils.mkdirhier(dst) + cmd = "tar --xattrs --xattrs-include='*' -cf - -S -C %s -p . | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst) + subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) + +def copyhardlinktree(src, dst): + """Make a tree of hard links when possible, otherwise copy.""" + bb.utils.mkdirhier(dst) + if os.path.isdir(src) and not len(os.listdir(src)): + return + + canhard = False + testfile = None + for root, dirs, files in os.walk(src): + if len(files): + testfile = os.path.join(root, files[0]) + break + + if testfile is not None: + try: + os.link(testfile, os.path.join(dst, 'testfile')) + os.unlink(os.path.join(dst, 'testfile')) + canhard = True + except Exception as e: + bb.debug(2, "Hardlink test failed with " + str(e)) + + if (canhard): + # Need to copy directories only with tar first since cp will error if two + # writers try and create a directory at the same time + cmd = "cd %s; find . -type d -print | tar --xattrs --xattrs-include='*' -cf - -S -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst) + subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) + source = '' + if os.path.isdir(src): + if len(glob.glob('%s/.??*' % src)) > 0: + source = './.??* ' + if len(glob.glob('%s/**' % src)) > 0: + source += './*' + s_dir = src + else: + source = src + s_dir = os.getcwd() + cmd = 'cp -afl --preserve=xattr %s %s' % (source, os.path.realpath(dst)) + subprocess.check_output(cmd, shell=True, cwd=s_dir, stderr=subprocess.STDOUT) + else: + copytree(src, dst) + +def copyhardlink(src, dst): + """Make a hard link when possible, otherwise copy.""" + + try: + os.link(src, dst) + except OSError: + shutil.copy(src, dst) + +def remove(path, recurse=True): + """ + Equivalent to rm -f or rm -rf + NOTE: be careful about passing paths that may contain filenames with + wildcards in them (as opposed to passing an actual wildcarded path) - + since we use glob.glob() to expand the path. Filenames containing + square brackets are particularly problematic since the they may not + actually expand to match the original filename. + """ + for name in glob.glob(path): + try: + os.unlink(name) + except OSError as exc: + if recurse and exc.errno == errno.EISDIR: + shutil.rmtree(name) + elif exc.errno != errno.ENOENT: + raise + +def symlink(source, destination, force=False): + """Create a symbolic link""" + try: + if force: + remove(destination) + os.symlink(source, destination) + except OSError as e: + if e.errno != errno.EEXIST or os.readlink(destination) != source: + raise + +def relsymlink(target, name, force=False): + symlink(os.path.relpath(target, os.path.dirname(name)), name, force=force) + +def find(dir, **walkoptions): + """ Given a directory, recurses into that directory, + returning all files as absolute paths. """ + + for root, dirs, files in os.walk(dir, **walkoptions): + for file in files: + yield os.path.join(root, file) + + +## realpath() related functions +def __is_path_below(file, root): + return (file + os.path.sep).startswith(root) + +def __realpath_rel(start, rel_path, root, loop_cnt, assume_dir): + """Calculates real path of symlink 'start' + 'rel_path' below + 'root'; no part of 'start' below 'root' must contain symlinks. """ + have_dir = True + + for d in rel_path.split(os.path.sep): + if not have_dir and not assume_dir: + raise OSError(errno.ENOENT, "no such directory %s" % start) + + if d == os.path.pardir: # '..' + if len(start) >= len(root): + # do not follow '..' before root + start = os.path.dirname(start) + else: + # emit warning? + pass + else: + (start, have_dir) = __realpath(os.path.join(start, d), + root, loop_cnt, assume_dir) + + assert(__is_path_below(start, root)) + + return start + +def __realpath(file, root, loop_cnt, assume_dir): + while os.path.islink(file) and len(file) >= len(root): + if loop_cnt == 0: + raise OSError(errno.ELOOP, file) + + loop_cnt -= 1 + target = os.path.normpath(os.readlink(file)) + + if not os.path.isabs(target): + tdir = os.path.dirname(file) + assert(__is_path_below(tdir, root)) + else: + tdir = root + + file = __realpath_rel(tdir, target, root, loop_cnt, assume_dir) + + try: + is_dir = os.path.isdir(file) + except: + is_dir = false + + return (file, is_dir) + +def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False): + """ Returns the canonical path of 'file' with assuming a + toplevel 'root' directory. When 'use_physdir' is set, all + preceding path components of 'file' will be resolved first; + this flag should be set unless it is guaranteed that there is + no symlink in the path. When 'assume_dir' is not set, missing + path components will raise an ENOENT error""" + + root = os.path.normpath(root) + file = os.path.normpath(file) + + if not root.endswith(os.path.sep): + # letting root end with '/' makes some things easier + root = root + os.path.sep + + if not __is_path_below(file, root): + raise OSError(errno.EINVAL, "file '%s' is not below root" % file) + + try: + if use_physdir: + file = __realpath_rel(root, file[(len(root) - 1):], root, loop_cnt, assume_dir) + else: + file = __realpath(file, root, loop_cnt, assume_dir)[0] + except OSError as e: + if e.errno == errno.ELOOP: + # make ELOOP more readable; without catching it, there will + # be printed a backtrace with 100s of OSError exceptions + # else + raise OSError(errno.ELOOP, + "too much recursions while resolving '%s'; loop in '%s'" % + (file, e.strerror)) + + raise + + return file + +def is_path_parent(possible_parent, *paths): + """ + Return True if a path is the parent of another, False otherwise. + Multiple paths to test can be specified in which case all + specified test paths must be under the parent in order to + return True. + """ + def abs_path_trailing(pth): + pth_abs = os.path.abspath(pth) + if not pth_abs.endswith(os.sep): + pth_abs += os.sep + return pth_abs + + possible_parent_abs = abs_path_trailing(possible_parent) + if not paths: + return False + for path in paths: + path_abs = abs_path_trailing(path) + if not path_abs.startswith(possible_parent_abs): + return False + return True + +def which_wild(pathname, path=None, mode=os.F_OK, *, reverse=False, candidates=False): + """Search a search path for pathname, supporting wildcards. + + Return all paths in the specific search path matching the wildcard pattern + in pathname, returning only the first encountered for each file. If + candidates is True, information on all potential candidate paths are + included. + """ + paths = (path or os.environ.get('PATH', os.defpath)).split(':') + if reverse: + paths.reverse() + + seen, files = set(), [] + for index, element in enumerate(paths): + if not os.path.isabs(element): + element = os.path.abspath(element) + + candidate = os.path.join(element, pathname) + globbed = glob.glob(candidate) + if globbed: + for found_path in sorted(globbed): + if not os.access(found_path, mode): + continue + rel = os.path.relpath(found_path, element) + if rel not in seen: + seen.add(rel) + if candidates: + files.append((found_path, [os.path.join(p, rel) for p in paths[:index+1]])) + else: + files.append(found_path) + + return files + +def canonicalize(paths, sep=','): + """Given a string with paths (separated by commas by default), expand + each path using os.path.realpath() and return the resulting paths as a + string (separated using the same separator a the original string). + """ + # Ignore paths containing "$" as they are assumed to be unexpanded bitbake + # variables. Normally they would be ignored, e.g., when passing the paths + # through the shell they would expand to empty strings. However, when they + # are passed through os.path.realpath(), it will cause them to be prefixed + # with the absolute path to the current directory and thus not be empty + # anymore. + # + # Also maintain trailing slashes, as the paths may actually be used as + # prefixes in sting compares later on, where the slashes then are important. + canonical_paths = [] + for path in (paths or '').split(sep): + if '$' not in path: + trailing_slash = path.endswith('/') and '/' or '' + canonical_paths.append(os.path.realpath(path) + trailing_slash) + + return sep.join(canonical_paths) From patchwork Fri Apr 3 18:36:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 85230 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 17325D730AD for ; Fri, 3 Apr 2026 18:37:07 +0000 (UTC) Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.2217.1775241423887200807 for ; Fri, 03 Apr 2026 11:37:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=rSpPJWMq; spf=pass (domain: gmail.com, ip: 209.85.222.171, mailfrom: twoerner@gmail.com) Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-8cbb6d5f780so228364785a.1 for ; Fri, 03 Apr 2026 11:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775241422; x=1775846222; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=njwyAlZ/LQHHKKCqNdpb0gRV6wtLxhps+ypqRcrg1/k=; b=rSpPJWMqaHP4Vq4nsTdEaJOVeoQ6urXFTC6KmiLSIZKTlsLByU/UuUYkqWnE4/F8jr Td5D7jHRwEhzGNFFqPiGzWGx/33k+2QFRYJvMy2xVQN1cw3iPZTNszUqEw0v2PD1qd6h CfCLhry/Yn+j9EWAT3pjivDlS5aCjR42uYtuxVOO9DtnCGf706axcGEptHpdMVByzRV4 e4osiUGjMNWwCz+cwy+1c6SXbt0S6lUnuh0O+r+KMEFjr0T2bCoOEN4rB052Uxd3ce2L iaASqKeMTjV3XDLPTEmCe39ol2u1m7EFWst/9odD83LqKtFkDWLQ/7IlusxxJ/OuOURD AEPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775241422; x=1775846222; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=njwyAlZ/LQHHKKCqNdpb0gRV6wtLxhps+ypqRcrg1/k=; b=EC1sZEMxBSoxt3lx01q9XwlcuHAdPpx9K6Oy307IW/NQ87N2bcnMMLwcN0kDOL+++t R8voGnSZX0rCxFzLLfzzTU+HexCT4+6TbiMiBclVwL80ywbdtoRb5wN+mVwwIbK1BL4V KlDF8Ns7BySGVmQJfUmzp4tLZuIVkFlG1Uk0RHuuK1XpY6MdzYmWEB5MUw9NxGemc/3g vNZxVepydzqQTbt1VAufBLhutdrSPo03hJsTvkP3SWJYalQ+vUJAe/z8LbuIXv1BsaO7 q0c5CT+LR4k5Shr6JU7YAPYjkwimg9LJUL+N2GCWCiJFvFAdWye7lVIc5kdxoao3KpQj LZtA== X-Gm-Message-State: AOJu0YwNYa5zW5nRaW/9G8cS1XC/jcIRy5WEQ6MbMmPu5gwIDGvrcR20 p4CjQq/ASxENbLLzaB/PQBdKkakllF9jJNL7zq6KikjrzWdocrmKseT848wWRnnF X-Gm-Gg: ATEYQzz7397rwiWOLitiprOvTBGfpnoaNVR0ejX9l4wkqamH/DKhGdyY9SI4Vv5Kx7y 9kjaJf/W7o2uS4aYa7VWOCqftvMvJK6QYMEDwsU9vckwRCfROEQojy2EtkYcnqE4JnzXVJ826G5 JMoHJGlml3N+zYfGrHyGJ1/YnhaO0GKfStol0nRCtgFd07iwuhtQDMWA4m2yokKWaIyL7v/a79/ B71XbGjJkbFLH4AD/5lBC4LLHBpY79a17Co/mk6/7PQ1TR34SIfGOAnk99E3wr7Bo2nvnBD02S0 MBM/XXg13NwduElw+66jvotHQfuyn/IGjyJTlaKkS+CpsN6g/KXqA7aFtwnvCLFDoSgE2VXMgys 6gW1jrRV5YFW8WZSu18OL09a79scZl5LArU2QdsB9YdU/LtEnURU2Ut53L2Kbk7S35D6+UsFLV3 18DVj9GTn9WyVF0JNfnI9tAWsL1frUAzdjo/wRIw9SUBIU232mjXG/swROqJmFF5AvYQ== X-Received: by 2002:a05:620a:3715:b0:8cd:bff9:67ed with SMTP id af79cd13be357-8d4151e4697mr590567485a.0.1775241422438; Fri, 03 Apr 2026 11:37:02 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d2a874459asm472401785a.39.2026.04.03.11.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 11:37:01 -0700 (PDT) From: Trevor Woerner To: yocto-patches@lists.yoctoproject.org Cc: Bruce Ashfield , Mark Hatle Subject: [wic][PATCH 5/9] bump version: 0.2.0 -> 0.3.0 Date: Fri, 3 Apr 2026 14:36:40 -0400 Message-ID: <20260403183644.2783267-6-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260403183644.2783267-1-twoerner@gmail.com> References: <20260403183644.2783267-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, 03 Apr 2026 18:37:07 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3631 Now that wic is its own standalone tool, bump the version to make the change explicit. NOTE: this commit does not work as-is, but is being provided in order to explicitly show a clean transition from oe-core Reviewed-by: Bruce Ashfield Reviewed-by: Mark Hatle Signed-off-by: Trevor Woerner --- src/wic/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wic/cli.py b/src/wic/cli.py index a3402bffcc63..9de5efbb5aec 100755 --- a/src/wic/cli.py +++ b/src/wic/cli.py @@ -14,7 +14,7 @@ # AUTHORS # Tom Zanussi # -__version__ = "0.2.0" +__version__ = "0.3.0" # Python Standard Library modules import os From patchwork Fri Apr 3 18:36:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 85226 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 83514E85397 for ; Fri, 3 Apr 2026 18:37:06 +0000 (UTC) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.2219.1775241425311318703 for ; Fri, 03 Apr 2026 11:37:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=QcNgbDd7; spf=pass (domain: gmail.com, ip: 209.85.222.178, mailfrom: twoerner@gmail.com) Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-8d1b746f522so249005485a.0 for ; Fri, 03 Apr 2026 11:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775241424; x=1775846224; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=udBvFrM9zqiSWuKj8GsYYdaVTL93eR8UGvYeG61dTus=; b=QcNgbDd7IJaTOd7EkWhD8eiCITQPjRAUPW6/2QrXoJwoTLd26d00Y/3ImBBad0x+Pv k1HRn4wtzGzZn4EMlqnN7cD/t/E0xkGh2h087D2a9pj2hCkr2H5wRxm5CQCV12/zDbLg rNz6CqCfBEqf2LQRivVZK9ECDLUuUQ+B6zUdERoyQrDgClgT54tthyFaTEOTdCXd4y1C y2lCT+P1Ikh4N4RiyK6YDhuo3QWI+efOgwT8GA/oLWFk0NwyKHAiR2HWFb198KY9oONp QmJrciyE/mWsP64DClainZl0nIbpiU/7YnlvbI41g3OFO9Yds92fO2ifqEl5c/hFXewl kaWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775241424; x=1775846224; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=udBvFrM9zqiSWuKj8GsYYdaVTL93eR8UGvYeG61dTus=; b=SATb8Ro7gHeWHbO7SYPIBNnK++nRkGxNl6vVy+ElEk6lGp++CQFb0ZpLs9TuacLJop nMz+6VvUbkAlIv/1hMIuCKsxC+lBOXD+khS0tlYluyQ5iHL6QXnN603sWDNlSE8WlL1t b4RTCKvHsdL+OZsyYP9dSuK0WOGp4pnPvWg9vEOC+Vbbtt8KmT9rOV1lEZw9FQyp1n4Q 626oY4ML+RvlLHughGT1bFbvLTv5L65O6jCjPhdqCZND6LnECgA5w2QinffLMC5L7hW1 YeJvvbOgFUm6xBbcBsPRM/8Xqcwwqew9BVJFUsOkwvLVhKKsG5ctPU0UQN+L2vuawKl9 08Kg== X-Gm-Message-State: AOJu0YwIVJ50uhjveKWb534aOuG62eShy6Eo5Ttmtir++vHbHWUCTely QsQcpQ9mt4RYLbEBD+zrWGkNYOLEO+STsRAd6jDUt33EflQpDZtTsVveFj5SMKUN X-Gm-Gg: ATEYQzwOkxQTBBkrF6uMJoZoMd+FG5dJPfMxdT7j86FTlZ2erUpNjVAJvsj6gEn2LBa aLS9pxPl9IWkkjKBKoynmqAcCokhcrGC8iBrDhR5HAKMff0YC3rNEMF8D0Jh2nTMi+x38hBpI+S E69UXYaCDnm7D0wE+d/lNlUXPtzLdu0iaI0Nq/ciTZiY+kA+EH7c8J2k2TrxKz8WrIORBhWiH/q ef5YR6Hevq5N9h0JIWdN/bwXDxIInaC9eCd/TbE5gyTzceJpu06KYh5lbuPrutzucSY0embC/9X GKzOFPTHuY1w2noVRIjYnBf4Wpt+OMVE9PAocJf0ErsFfr14dbdLJdzfDmncfEv+dpO9oekyzNH nM9ZyuW/Pj9S+bDr7E+463jHa2cUBIOXkNhPkqWd3Z6DnBGvGVBHbZ+Rz+y1QWhBjv12dwaUOBq RKL6bBmxlvojznBVJqspBrs/WCkIZVCW57gKHmu/jbFRiu0YNeNk/hE5gSYPuiOro7jA== X-Received: by 2002:a05:620a:440a:b0:8c7:13b8:8b55 with SMTP id af79cd13be357-8d41e2413d7mr583867285a.46.1775241423687; Fri, 03 Apr 2026 11:37:03 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d2a874459asm472401785a.39.2026.04.03.11.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 11:37:02 -0700 (PDT) From: Trevor Woerner To: yocto-patches@lists.yoctoproject.org Cc: Bruce Ashfield , Mark Hatle Subject: [wic][PATCH 6/9] cli.py: remove bitbake coupling Date: Fri, 3 Apr 2026 14:36:41 -0400 Message-ID: <20260403183644.2783267-7-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260403183644.2783267-1-twoerner@gmail.com> References: <20260403183644.2783267-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, 03 Apr 2026 18:37:06 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3632 The code that is being removed in this commit uses the scriptpath module to add more paths to sys.path in order to find oe-core-specific and bitbake-specific modules by using relative paths. In other words, this code assumes it is located within oe-core or bitbake. By splitting out wic, it is no longer located where these relative searches have any chance of working, therefore remove this coupling. Additionally, the bitbake_path variable does not appear to be used anywhere, so it is removed as well. NOTE: this commit does not work as-is, but is being provided in order to explicitly show a clean transition from oe-core Reviewed-by: Bruce Ashfield Reviewed-by: Mark Hatle Signed-off-by: Trevor Woerner --- src/wic/cli.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/wic/cli.py b/src/wic/cli.py index 9de5efbb5aec..04b2ad25cac5 100755 --- a/src/wic/cli.py +++ b/src/wic/cli.py @@ -28,10 +28,6 @@ from collections import namedtuple # External modules scripts_path = os.path.dirname(os.path.realpath(__file__)) -lib_path = scripts_path + '/lib' -sys.path.insert(0, lib_path) -import scriptpath -scriptpath.add_oe_lib_path() # Check whether wic is running within eSDK environment sdkroot = scripts_path @@ -48,9 +44,6 @@ if os.environ.get('SDKTARGETSYSROOT'): sdkroot = os.path.dirname(sdkroot) bitbake_exe = shutil.which('bitbake') -if bitbake_exe: - bitbake_path = scriptpath.add_bitbake_lib_path() - import bb from wic import WicError from wic.misc import get_bitbake_var, BB_VARS From patchwork Fri Apr 3 18:36:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 85234 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 1D151D73094 for ; Fri, 3 Apr 2026 18:37:17 +0000 (UTC) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2229.1775241427038947269 for ; Fri, 03 Apr 2026 11:37:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=SqXcRewo; spf=pass (domain: gmail.com, ip: 209.85.222.170, mailfrom: twoerner@gmail.com) Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-8d00cf835b7so280060585a.1 for ; Fri, 03 Apr 2026 11:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775241425; x=1775846225; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i68CMJ/r48OkCGm9ByfM55xhCEziPkDtNTzDoKQwgDo=; b=SqXcRewoVwZua8MdYQ8rECsrkroCa/BS5PHWANzrADKRMY4/fp1FguWM3sIbCc4sTn 8qOZGFer4QsdIxzgo6q9lKQDZN7zkNr+d3AJhwVp4ciDnqCq1EQP5kuATvuKnNBzADB+ 4I6tWDQwDXXNTWmRlWhgNXyLNcROQajXzx+p0CHMieYtVyLWNp6FMnqUof7yQS2I3H3s aRn2epltTCM3P0GwBZ51uJHJ8Q9s5KBk5X9Z+1oq68wJXHeGVWjhkBD63jfXEascX4le Sw+xhkjvudHakFRcaB9sHKz1OWDXKhUB3Q6fqatzIaLXajS4hlAqUINOmJBKD9cwmfls pwGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775241425; x=1775846225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=i68CMJ/r48OkCGm9ByfM55xhCEziPkDtNTzDoKQwgDo=; b=tHu2VVa+tIMIVjJap5X0NtPnhvojs0n64hWUCogRjXlpAG9Z5EBBd1ye9MfiEz5PJF bzsE6AGRyP1/LP5+VmRS0U3dMXBgo/47/M24giSmUbrgaio9FV6Hpw9vIEh0ZhkFycHk mLSy0Hvmz1k8X39EuBGYe7PHFvBDM2+4kLSsPMHOalPBaUbQ2d9dpxif8auCZEDNNAp/ jilvPk86tD09ZHU0N1Sb71BS9ih2eag0WrqGFyCTaKlCN2Fh+WaZQ9B+UY7DrbpIC8+r 4OHua0kOn76gi7QfO3eySCL0p79jdZEpbu4HWymsC/Uy4bT0wYH2QGn/6dbh9RV100Nn EFjg== X-Gm-Message-State: AOJu0Yy/XF6jB9p1yh396DpT8A15iOjc8L6GwSP/tnD6w+eIerNxJC8q 3onsBk4sFJMYSKE2kcG7D0SrFlJqMu5jNsMoLux6zfjjp9gVkNgGfwAdZfueSti8 X-Gm-Gg: ATEYQzzEiZRaNt3IC1YPJtFsQImy+uuc69RtO+e0LZOiJ0MR0JwaaJNUrN4yZEB6F1Z wmc/4m+PFci0STGd5qf8TApyInfZQJKuV4ILl9mNuNAddFVvLLbgszSJ/Xrh+5jqE8SG62kKUYZ Epqpe3RDDYJCwHFleC5hWQn37mQ9Y5Kn4ue7kXomsBd8HkIPeTTi4lIMi9ppr2zY/TGz1l9hYTa oI/9ADwfo28YUa521jG44daeaTVVKPe5b7oyUeYfFkPQK8+Y2swDDZ7r6NAIGv0hs82yWj+LH2C GjawirevgtURfkA90TvhlSoKD5IcRjyajTECVV3jdya6/bojcRT2PzygLLG4/aFgZ2zKMcCgSIk en0obPyR9dNhGfQVr2dFuRz91nY61Nw8CdsWV7C9o7VtqOMR5PZMdvI+aaDjTPORfCLht9SDlIs 7/K/S73YEEWauuL+TBz2LHPuamyxYmBcc/TNeTdVfDFbL4cKoR14voUHPWYZsNlJf1eg== X-Received: by 2002:a05:620a:4442:b0:8b2:ea5a:4149 with SMTP id af79cd13be357-8d41ec08f6cmr540410385a.65.1775241425096; Fri, 03 Apr 2026 11:37:05 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d2a874459asm472401785a.39.2026.04.03.11.37.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 11:37:04 -0700 (PDT) From: Trevor Woerner To: yocto-patches@lists.yoctoproject.org Cc: Bruce Ashfield , Mark Hatle Subject: [wic][PATCH 7/9] plugins/source/bootimg_biosplusefi.py: add import os Date: Fri, 3 Apr 2026 14:36:42 -0400 Message-ID: <20260403183644.2783267-8-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260403183644.2783267-1-twoerner@gmail.com> References: <20260403183644.2783267-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, 03 Apr 2026 18:37:17 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3633 BitBake's bb/build.py:55 deliberately injects os (and bb) into Python's __builtins__ at the module level: # When we execute a Python function, we'd like certain things # in all namespaces, hence we add them to __builtins__. # If we do not do this and use the exec globals, they will # not be available to subfunctions. if hasattr(__builtins__, '__setitem__'): builtins = __builtins__ else: builtins = __builtins__.__dict__ builtins['bb'] = bb builtins['os'] = os When wic was part of oe-core this injection would occur, and once os is in __builtins__, Python's name resolution (locals -> globals -> builtins) finds it for any code in the process, even modules that never explicitly import os. So when bootimg_biosplusefi.py's __instanciateSubClasses referenced os.path.join(...), Python resolved os from builtins rather than the module's own globals. Since wic is now split out from oe-core (and bitbake) this plugin fails with: NameError: name 'os' is not defined. Therefore, add "import os" to bootimg_biosplusefi.py. NOTE: this commit does not work as-is, but is being provided in order to explicitly show a clean transition from oe-core AI-Generated: codex/claude-opus-4-6 (xhigh) Reviewed-by: Bruce Ashfield Reviewed-by: Mark Hatle Signed-off-by: Trevor Woerner --- src/wic/plugins/source/bootimg_biosplusefi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wic/plugins/source/bootimg_biosplusefi.py b/src/wic/plugins/source/bootimg_biosplusefi.py index 4279ddded83a..cd7cd270a970 100644 --- a/src/wic/plugins/source/bootimg_biosplusefi.py +++ b/src/wic/plugins/source/bootimg_biosplusefi.py @@ -19,6 +19,7 @@ # William Bourque import types +import os from wic.pluginbase import SourcePlugin from importlib.machinery import SourceFileLoader From patchwork Fri Apr 3 18:36:43 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 85233 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 03667E85399 for ; Fri, 3 Apr 2026 18:37:17 +0000 (UTC) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.2220.1775241428609077688 for ; Fri, 03 Apr 2026 11:37:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=CazRYbDJ; spf=pass (domain: gmail.com, ip: 209.85.222.176, mailfrom: twoerner@gmail.com) Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-8d583bfc415so7437085a.2 for ; Fri, 03 Apr 2026 11:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775241427; x=1775846227; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rVlXJdTy+svRvIiWFlY0lVUTfly3eo0gZhZ3HhtXLLs=; b=CazRYbDJgt83qVlfUzFiYuNFNcpXT+7AeXXZv8ir5wrbbB6sGm8oh5IuJISpw8VMSp mngGQ1uUB7AyofoAHDuvW8AUlsFggZ7nmnik6FzREmqv21S173JGGOpwbhvnT2NizULs nxrHxz6AAHruq9+zi1SCSDVqLyjN2Fy3tpITg0iIKPI7eC2xVElG7DcQlkbZZw/RsEYI vz8rkAXYiRDJ+OjklFHc+w+47Ew0LRdboO1lq57gKnVuBPZnggfF9vpjIgsLRpujUKyF U7UE1qaADDy0Az4CiMYtUvKLkqp5K+TxA7PGG8abG9Fvl/fQskQZIaZ2X3Df409pxG0N 1GgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775241427; x=1775846227; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rVlXJdTy+svRvIiWFlY0lVUTfly3eo0gZhZ3HhtXLLs=; b=K/04+S7Ckmhzu+eDeNd6qvLpdyqZHpU0idlDe+/cQi7nSTJ9qdKJqOpHYl38NAeqxg uEbwMyO3Kv1Ucjh82nWzg+MzUE4JONZ+TNkp2uFAHDmhKHw5foE9KdIBatHxEFFusFFo E/kjtTPeJ9ufUnAZQtigqZtFORtqdWet7TdKcokvA9+8n2JqhH8laWELbXfxCdonGucN BVHTE70R+py3wmfhztnyNAcZ4Ykg2wHBa8cuvgoaKkOfcqKC0SvPmihPKUU/DCUKxE3D uUhV4Uv5gj6tUFmypSIdf56ePl6GSZWhghekfbdMc9hrJRIRYjJUWx5YISIx4vObJJ9w PXgA== X-Gm-Message-State: AOJu0Ywwl3B0iqxqxeVfbhxLi7XfDpmDCfOAQGkLjVkeGnCQUK8kpsYe 37QkNmBX30tP2u2y3BpSlKdymyffx/CiYP81CsFTSwQVdFKHjGZy5bW2XgzWdnH3 X-Gm-Gg: ATEYQzyx3i+HH0NkTtonhbtsNlZbLZoHpujCqMp0FSbFfHhvTFFMLVThD1DcrZIppDv ma4obqgn6VSPgiU0EMN1vf+lbsoo9pl5Ommi7+7S0YYCD+91Lep6eSBdu6Evb7PDADfaV6qBnPb s/El6ZfaZ85z31q/D/Sv6aVV7fWgyUKcH1DrYKxQ+25uOUZVVT7uOg6pz4kUwtsTiR3nsJTHsdT uGhS7edKcbJAFRTTS81/fLyVv5OSaMV0EYHT6n2OJm41IvByvMJUyZ2+EfXkMKIhDTP44pTsI0N FcTAiqptplAIKvgmRhuMPy7UtliuyJq08VNoOp5n/Klld7wERtcev2vKU4JcLSjFRciLarsnxXL eNHgb3MYS81yyHISscNbNZirxjmpaiqWbpydfPy7d5AOP2yQCwCbOfXvU0bAqKLVSOahUpF4YM4 AV0boC0axT2pEsRrsgyBr8SvbPIkgujrliihy9nmc/+SAkAXXCKweOllfygi8NtEyxiiqC6/zzL sTj X-Received: by 2002:a05:620a:1788:b0:8cf:d3a9:60d4 with SMTP id af79cd13be357-8d4188c2077mr563797585a.5.1775241427149; Fri, 03 Apr 2026 11:37:07 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d2a874459asm472401785a.39.2026.04.03.11.37.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 11:37:05 -0700 (PDT) From: Trevor Woerner To: yocto-patches@lists.yoctoproject.org Cc: Bruce Ashfield , Mark Hatle Subject: [wic][PATCH 8/9] ksparser.py: search for *inc files Date: Fri, 3 Apr 2026 14:36:43 -0400 Message-ID: <20260403183644.2783267-9-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260403183644.2783267-1-twoerner@gmail.com> References: <20260403183644.2783267-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, 03 Apr 2026 18:37:17 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3634 If a *wks file has an "include" directive, try looking for the include file at the path where the *wks file was found. NOTE: this commit does not work as-is, but is being provided in order to explicitly show a clean transition from oe-core AI-Generated: codex/gpt-5.4 (high) Reviewed-by: Bruce Ashfield Reviewed-by: Mark Hatle Signed-off-by: Trevor Woerner --- src/wic/ksparser.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/wic/ksparser.py b/src/wic/ksparser.py index 4ccd70dc555a..8e5fbfadd81f 100644 --- a/src/wic/ksparser.py +++ b/src/wic/ksparser.py @@ -101,6 +101,15 @@ def overheadtype(arg): return result +def resolve_canned_path(arg, current_confpath=None): + if current_confpath: + current_dir = os.path.dirname(os.path.abspath(current_confpath)) + relative_path = os.path.join(current_dir, arg) + if os.path.exists(relative_path): + return relative_path + + return None + def cannedpathtype(arg): """ Custom type for ArgumentParser @@ -202,7 +211,7 @@ class KickStart(): bootloader.add_argument('--source') include = subparsers.add_parser('include') - include.add_argument('path', type=cannedpathtype) + include.add_argument('path') self._parse(parser, confpath) if not self.bootloader: @@ -289,7 +298,12 @@ class KickStart(): self.partnum += 1 self.partitions.append(Partition(parsed, self.partnum)) elif line.startswith('include'): - self._parse(parser, parsed.path) + include_path = resolve_canned_path(parsed.path, confpath) + if not include_path: + err = "%s:%d: argument path: file not found: %s" % \ + (confpath, lineno, parsed.path) + raise KickStartError(err) + self._parse(parser, include_path) elif line.startswith('bootloader'): if not self.bootloader: self.bootloader = parsed From patchwork Fri Apr 3 18:36:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 85232 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 0FEF1E8539C for ; Fri, 3 Apr 2026 18:37:17 +0000 (UTC) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2232.1775241430390047976 for ; Fri, 03 Apr 2026 11:37:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=n5mI1A3q; spf=pass (domain: gmail.com, ip: 209.85.222.180, mailfrom: twoerner@gmail.com) Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-8cd71fb9f06so137908685a.2 for ; Fri, 03 Apr 2026 11:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775241429; x=1775846229; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8fslr0ZTOSbC0GhFETUH0C3icsmKy2xY7g02WdO6Qqc=; b=n5mI1A3qBEMKz+rQCeXHD3em1QpdIS+jVotEkdDgzBlwQ7Qak92ygWZZo5WyevQ89F UqN5k8RjniBzUtPk3Y4QDHWhTlimw8h/9HLv3kv8t69gveSrY35E2Kn3THBW8PzJBcl0 Pf7ihTEAuqI94pcFQeLe7XtzpvKy5nLhJhxm0AwaEPcgpQ6oQVzbvgoGjTJyEQ1J49SJ QABGIQvrctp4eQu1ncHQwOyXJ3QpYwRW7rwpU5Da1Zc5u2F/Vld1GAj8zT4bHZWKvDvp GlDz5MoizfAV649YDk17EQ543qybo/GtPd6yMgHqk7UOz5njN0m94Sdn4lNqXkRu2Kxp 9eFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775241429; x=1775846229; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8fslr0ZTOSbC0GhFETUH0C3icsmKy2xY7g02WdO6Qqc=; b=gyMW03N94PjOR02r47S/w5DQzVj4PZRHDrlt00tBDvNCm3NntiFv1Gpd+jF1wIeBgS 1Bd/jYa5lc1pUxBRSmYwcl6pU/zNqQogVtVfwxvKfSssk1UnI9OHg1FEsn5vBRLQ9HsT 1jGAhQNgB9xFK7TTds0LMzWQVybq+VlsxyFSVMtQDfDJBUa4Oj8DGkKiWJI9APScdP8U 8Jv8NMK+/uxIOs99x0ExZvG+Y3051tVA6gwfNqqm7k/E71BNy2Q+e73IUePog4hDfA7A fc5UBL/E5m4ZKIJtvYC2shfQ6k2ininV2MpMGFDKnzv88nScJpY79Wi4b0UCgXlaQamr 11bg== X-Gm-Message-State: AOJu0Yx0d2Uy3UM5QwOuYhIJm416qtAPybdLWvM3sCeDTRQvyYe+oCJe hlTBYKfkpJp7oU5nHUsUOwleEZIPOdqYUtpOwk4G2HLC49UX1zY37AruIvPPHPpY X-Gm-Gg: ATEYQzzHi6F6dAO+hjFBk4JJoFkSmScNO1kv/t67QuXUlzB/0VrBGmIOn2PlWTsljkP jjUvyXvUVf+qbB1w+AnY1oMhcokDyU4WI7XnT8hm2tRQraaAzjCMW+f7PHx4F9GY9l5Dr9adDiL o9hKefQLW6Gq48wssSN3ug9xUshdg6Gsq5SZtOPo04YbDqGNfRGDL0YyB77n+aLOlNXzLy2R/wY I1QjSMnmkzO/jqcTrrsK2rvcY+oEEYMGf4Zbez0mpL49bZ3N/awHOY2gK83DUxQscBtOQixt0Jo 7y0PAfW8ZzcAZD1kOOBmG6FuLvQ/Max3x+OgEO2huskEK8mbd3tXJwCLosqAfjB/JIy2pGkleld 1tmX+FUR4Stk6PjmNGdG1YwelrmqDLE8ZxgKuORKh6eMwGWOd2ViAs1671EJifFLx0tVf0xibjY x3CtjZNDYhexbBjHe0+bfAE+C9nTfmTD8BoS3cKp1CdGjtyMwubauBllfqKDe0hzRnXQ== X-Received: by 2002:a05:620a:4890:b0:8cf:d88d:c46e with SMTP id af79cd13be357-8d41b3e9eebmr598305885a.48.1775241428786; Fri, 03 Apr 2026 11:37:08 -0700 (PDT) Received: from localhost.localdomain (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d2a874459asm472401785a.39.2026.04.03.11.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 11:37:07 -0700 (PDT) From: Trevor Woerner To: yocto-patches@lists.yoctoproject.org Cc: Bruce Ashfield , Mark Hatle Subject: [wic][PATCH 9/9] cli.py: fix main() for standalone mode Date: Fri, 3 Apr 2026 14:36:44 -0400 Message-ID: <20260403183644.2783267-10-twoerner@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260403183644.2783267-1-twoerner@gmail.com> References: <20260403183644.2783267-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, 03 Apr 2026 18:37:17 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/3635 The generated hatch launcher calls wic.cli.main() with no arguments, but wic defines main(argv). Update main() handling to match. AI-Generated: codex/gpt-5.4 (high) Reviewed-by: Bruce Ashfield Reviewed-by: Mark Hatle Signed-off-by: Trevor Woerner --- src/wic/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wic/cli.py b/src/wic/cli.py index 04b2ad25cac5..cf3e51e3afad 100755 --- a/src/wic/cli.py +++ b/src/wic/cli.py @@ -590,7 +590,10 @@ class WicArgumentParser(argparse.ArgumentParser): def format_help(self): return hlp.wic_help -def main(argv): +def main(argv=None): + if argv is None: + argv = sys.argv[1:] + parser = WicArgumentParser( description="wic version %s" % __version__)