From patchwork Wed Jan 14 15:48:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78721 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 13368D37E58 for ; Wed, 14 Jan 2026 15:48:36 +0000 (UTC) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.13359.1768405712866447163 for ; Wed, 14 Jan 2026 07:48:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RDPPEpP+; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.44, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-b876b5c69baso13340666b.0 for ; Wed, 14 Jan 2026 07:48:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768405711; x=1769010511; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QzRIDMqUJl+hD74DDhM01pKGrpdlHt8Cj43+PhA6ebE=; b=RDPPEpP+DBsZRtp1eI1gj9RBllqcg9KUJufloSkuRIrYnRH3f3MphK6Ig6bs/22TAW tANCg1QleLH6OdPKzEr93UQVIB9M9IWM2ZOpm2Fffj2e17e0/9uDIhm37ZHXRrVqmNS6 s75yAb97bpo+7LeRpUVUubTtLUj99Qnc3kcKY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768405711; x=1769010511; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QzRIDMqUJl+hD74DDhM01pKGrpdlHt8Cj43+PhA6ebE=; b=BRjhNl6JbH5KeFU8w6EME9Vh1o2gSGDSxIHgwvqNmhOHz0ny25u0kj04PKRKHR5uyx OZxrZ0u1bX8iGoEpe4lhx0fXg9MaP5kot34y7FK8KG+Tdd3sPST17Mk12FdPqdBPrAV6 /SHTFB/vBCaTNzNFKZlf/uQu4QKrl5DXUVilErUMxmGWsfVMf7Uos9CZbSOn9WSJEush dwyt2xutyiokIilVWtkaylAaapY6eh0mqmsdQVNtPL4Zhzb5ZSbENN1adxXkDY3IKQiO 3tI+0dtI8UX1+HPcPcqROKaUdVCnnit44CG5CMcPBqVvUHW79GwqRToAElyek7pv9115 RXuQ== X-Gm-Message-State: AOJu0Yzt0stMQ8PYIH+76dWmS3n+YJ/HoOgd61kNUN2KK1RXaChsemrI kF6fv3Pj3XHnD7DfJDxIKJ+q/SuP3ZTO2P5A9HTW43xW23MZHlbasEp9gbrggrCIAxsrm2lAQl9 Qqzq1 X-Gm-Gg: AY/fxX4PJzuQqUy5juYjgTFSACSgQjs9U3fM1b+s/So70F4oA8P26b0ChAxjpg8eqUI parCqIShKRis6Z8K5mFnyQmWMndAEpQKof+J5rcB+Rde+Rc5tuSB59NUoBkT+6JIn/67xxhjc6Y tAmfsWu+viHWArEXc+JlnivTmuJsKu6rollEf0R0tj7JVLVO/zg1ElPBUCFqYpaHDpIuMssqLxk JIbzVi0NKfUrd2JMprKIbcEM3sXxPSWCNMdsarktPB9+QosXOm9GWMw7jFrhKYm5wnyZN1OL0Fh su7zGhuM99fiuFSM2yWXn4groxl816bll3eR5xdeYVTGWsYXH18yz7UJkL4J4CGAObKakyfdR1p 6D0F1FQBvO380kEE8ysEa6JuqzndRio2Pk3swYZza/xx2wj6QvL03POITAZjsVqcitfwOg8eHwE 5t+20Wc2BeT3uj8NlkG4RCCXSd6DozuBMsWG85jKLdGKTken1xtSmypzdd2Noo+Jkc+1UwZbWe2 umcCx39oowObc2X0KfuqxOavGqObTYIycqCR/Gsx42wmxrKJbnQ X-Received: by 2002:a17:907:70b:b0:b7d:3c0d:96ef with SMTP id a640c23a62f3a-b87612ca8a2mr171094966b.7.1768405711141; Wed, 14 Jan 2026 07:48:31 -0800 (PST) Received: from adam.arnhem.chello.nl (2001-1c00-8101-1200-3ddc-5bb8-0efa-16f1.cable.dynamic.v6.ziggo.nl. [2001:1c00:8101:1200:3ddc:5bb8:efa:16f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b876e9ac655sm135616466b.6.2026.01.14.07.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 07:48:30 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v2 1/6] wic: extra-partition: Small code cleanup Date: Wed, 14 Jan 2026 16:48:20 +0100 Message-ID: <20260114154825.4043483-1-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 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 ; Wed, 14 Jan 2026 15:48:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229338 - Remove redundant charachter escaped in the src_entry regex call. - Remove an uneeded semicolon for cls.install_task. - we copies -> we copy Signed-off-by: Adam Duskett --- scripts/lib/wic/plugins/source/extra_partition.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index d370b0107e..a1d9aa9a7b 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -69,7 +69,7 @@ class ExtraPartitionPlugin(SourcePlugin): # list of tuples (src_name, dst_name) deploy_files = [] - for src_entry in re.findall(r'[\w;\-\./\*]+', extra_files): + for src_entry in re.findall(r'[\w;\-./*]+', extra_files): if ';' in src_entry: dst_entry = tuple(src_entry.split(';')) if not dst_entry[0] or not dst_entry[1]: @@ -80,7 +80,7 @@ class ExtraPartitionPlugin(SourcePlugin): logger.debug('Destination entry: %r', dst_entry) deploy_files.append(dst_entry) - cls.install_task = []; + cls.install_task = [] for deploy_entry in deploy_files: src, dst = deploy_entry if '*' in src: @@ -111,7 +111,7 @@ class ExtraPartitionPlugin(SourcePlugin): """ Called to do the actual content population for a partition i.e. it 'prepares' the partition to be incorporated into the image. - In this case, we copies all files listed in IMAGE_EXTRA_PARTITION_FILES variable. + In this case, we copy all files listed in IMAGE_EXTRA_PARTITION_FILES variable. """ extradir = "%s/extra.%d" % (cr_workdir, part.lineno) From patchwork Wed Jan 14 15:48:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78722 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 1339ED37E59 for ; Wed, 14 Jan 2026 15:48:36 +0000 (UTC) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.13326.1768405714093357514 for ; Wed, 14 Jan 2026 07:48:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gzivaLR4; spf=pass (domain: amarulasolutions.com, ip: 209.85.208.50, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-64b5eb14e88so1531589a12.2 for ; Wed, 14 Jan 2026 07:48:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768405712; x=1769010512; darn=lists.openembedded.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=rclxTIKzc1P/UiHbYYifeNn0ElbsZ3DBTx6SpHk68K0=; b=gzivaLR4yDHfrGgI4nsuh991SxSW5xrjApFR+mDZae3eqGLq+NxDOCq24BwIIkYQkX Skd+LJ6iWhIWRq8JWI64Qlr8ChpZTOLQO5rifMh7njAV6e/n8oWPT7DTC71ZTQrzup8D W4eBW//41M2qQ2AwSXQXOxQs0ann56K4pllw0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768405712; x=1769010512; 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=rclxTIKzc1P/UiHbYYifeNn0ElbsZ3DBTx6SpHk68K0=; b=KvlcznKzGQu5e73Bk6H1vgNVwbg42Lsj9xbE3DQnTEHGW4Ginbda9DlTLleEil101S MN6HUshNPaP/8OzjAWe/317uJtWwdCjncBaO2GfphwJmRCgl5fXOnKsb934TGrxpuBM1 1Is1OE+rkgpRiE7BkpCYEHYWhL5EnsovBE+MGDFkK0N1BRgfMJsfIHW6wQ/mRLalQkax Yg40zgFz+IGyvUfstGKUZPE2IxwgnPuE7Zp/a3u+wIs4GfjTqv9zn7KlsXoaec/UQloq 6dRwi4jshTZgzUoQeRxzXIfdlbcWKmfzcO9TiWOFePQHmWZBlXU5EXIkAdswktcsAB8B JYlg== X-Gm-Message-State: AOJu0YxBItRlpdHtfafH7OpxJapxgxE9fDypBrie/yFhoXypHCd3J662 bq5aqKczjg+c+ho/93Pb9HDQOdE9cvBv22vF7A1IEF2utfM0T89Dcz58WBsK2su5HqN/Nd7p8oE Z6oF7 X-Gm-Gg: AY/fxX4L3AcWKo1IlRJVGmukLUfAESDDkeibLbYremnK45UGGSJSAEYXx83W5WL2vAa Q3OmQdVgIblWZvSiQoacSmAi9HaKMeNak++EGYbcKMpqHZu2+YVAJyBy03ixDQWbbhg1Yzv+UpC fiI6/ADDwo1h4xSIf0xTXEmMN7AkLrkJg7LmLQw9QupMk9Nqud1Ob0iRnEyHBqbqRMszaDsCCHw Vs2jlfRhI4cvmm0BZqmDNwhIQACyX7BHCJwmyQO+6cv6Nveztrnyzq5CRXCyZZ6mOmIzLaoFw68 hux/2fjoNf67seDs0PpX+wiHqI/ePWQb5Icy5YWCB9DRQV2+0RifRlY2tuDwV80IYLD05WPB0rW KnmQWk8gq/F7qaFewKa6KCiJAIYXsQytRRSvs2wHGw7LaRZcNi3aPFDmUu/VDbd8aus8rnAZdJF GrW6Ua2fMv9UxoySWRxH/6aePYA73a0NVEslqACZH+Okf0lk12qJnlTO3QlQUyZ+lCrEcqWQFhH dCwyxrFB/LDiAxq8pE6t1NyJ4AfboB1eWJYdwtOQOQwhHxOm2Ef X-Received: by 2002:a05:6402:26d1:b0:649:9aff:9f42 with SMTP id 4fb4d7f45d1cf-653ebf7deb2mr1455424a12.0.1768405711907; Wed, 14 Jan 2026 07:48:31 -0800 (PST) Received: from adam.arnhem.chello.nl (2001-1c00-8101-1200-3ddc-5bb8-0efa-16f1.cable.dynamic.v6.ziggo.nl. [2001:1c00:8101:1200:3ddc:5bb8:efa:16f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b876e9ac655sm135616466b.6.2026.01.14.07.48.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 07:48:31 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v2 2/6] wic: extra-partition: Move extra file parsing to a dedicated method Date: Wed, 14 Jan 2026 16:48:21 +0100 Message-ID: <20260114154825.4043483-2-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114154825.4043483-1-adam.duskett@amarulasolutions.com> References: <20260114154825.4043483-1-adam.duskett@amarulasolutions.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 ; Wed, 14 Jan 2026 15:48:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229339 For organizational purposes, and to make the following patches easier to follow, move the extra file parsing to a dedicated method. Signed-off-by: Adam Duskett --- .../lib/wic/plugins/source/extra_partition.py | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index a1d9aa9a7b..040b6d22ad 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -37,20 +37,11 @@ class ExtraPartitionPlugin(SourcePlugin): image_extra_partition_files_var_name = 'IMAGE_EXTRA_PARTITION_FILES' @classmethod - def do_configure_partition(cls, part, source_params, cr, cr_workdir, - oe_builddir, bootimg_dir, kernel_dir, - native_sysroot): + def _parse_extra_files(cls, part, kernel_dir): """ - Called before do_prepare_partition(), list the files to copy + Parse the files of which to copy. """ - extradir = "%s/extra.%d" % (cr_workdir, part.lineno) - install_cmd = "install -d %s" % extradir - exec_cmd(install_cmd) - - if not kernel_dir: - kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") - if not kernel_dir: - raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") + deploy_files = [] extra_files = None for (fmt, id) in (("_uuid-%s", part.uuid), ("_label-%s", part.label), ("_part-name-%s", part.part_name), (None, None)): @@ -65,10 +56,8 @@ class ExtraPartitionPlugin(SourcePlugin): if extra_files is None: raise WicError('No extra files defined, %s unset for entry #%d' % (cls.image_extra_partition_files_var_name, part.lineno)) - logger.info('Extra files: %s', extra_files) - # list of tuples (src_name, dst_name) - deploy_files = [] + logger.info('Extra files: %s', extra_files) for src_entry in re.findall(r'[\w;\-./*]+', extra_files): if ';' in src_entry: dst_entry = tuple(src_entry.split(';')) @@ -103,6 +92,23 @@ class ExtraPartitionPlugin(SourcePlugin): else: cls.install_task.append((src, dst)) + @classmethod + def do_configure_partition(cls, part, source_params, cr, cr_workdir, + oe_builddir, bootimg_dir, kernel_dir, + native_sysroot): + """ + Called before do_prepare_partition(), list the files to copy + """ + extradir = "%s/extra.%d" % (cr_workdir, part.lineno) + install_cmd = "install -d %s" % extradir + exec_cmd(install_cmd) + + if not kernel_dir: + kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") + if not kernel_dir: + raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") + + cls._parse_extra_files(part, kernel_dir) @classmethod def do_prepare_partition(cls, part, source_params, cr, cr_workdir, From patchwork Wed Jan 14 15:48:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78724 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 19D73D37E57 for ; Wed, 14 Jan 2026 15:48:36 +0000 (UTC) Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.13327.1768405714359970734 for ; Wed, 14 Jan 2026 07:48:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Qo9rD8oq; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.45, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-b876b5c69baso13340866b.0 for ; Wed, 14 Jan 2026 07:48:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768405713; x=1769010513; darn=lists.openembedded.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=4eT8KLyj8aBeK85Nv0/NPb72uftcbknaGlPN/NVWkcI=; b=Qo9rD8oq4nQ/pumighJT3hGk4J0z0Gs90ULm+VoXnNCtq+8svcnin0I4XhZv0/741G Xuzl6xPZ7A4teC9zLpXc1T/cD7NlQOWHdHATt+WBu3j1eHDOihRC77qXjaByxDz/tl8F EyxfbydM3ziau9n7X0xr1JmyzPmwaEyPUr4mo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768405713; x=1769010513; 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=4eT8KLyj8aBeK85Nv0/NPb72uftcbknaGlPN/NVWkcI=; b=QS66ylZzSouPbjT7N1QGyOTVXCQT8EZMviWDAJo5Afylwi6Db4euwDimMuxv7r25rg KeppEkqEzyOLDw7LIjnUJdM5VtxHCYgcdnC0b3wGN/3vXJ2YO7xWUgB4JPxuyEkucY20 OPmFPmYvkZx3gaVJptmULLpHpBuaCnsrU7k+0Nwx8lR0tjzr6kYFRb/xHe/D21K6eyOz yeIUQlhcfHSPO3rg0/hGPrizIdKc5P0Sl5XJOpnChX0aKdK8pCsT7VH2HjSUyTezPZYB U1NFUBqABA1qWv52JOzugLw9YAo0lV5ghsjIz6PdDouQ19AiF9MsVb8PERFLwr5HKGRC lK3w== X-Gm-Message-State: AOJu0Yy8UaYgmGhjMNYjskug9TdlCx5hPFx0wH7eauS5cRJyfxL+RUiK HczZy170QOLrqnRuCj+ggbYPPb3j6kbFurRtXkxxV80trF2ZSDseheHp4PXBQ1xMWux8gA2QIVk 6cb34 X-Gm-Gg: AY/fxX7xivlcN2x+CS8zbwCqcsNgENxt9Y6iiSa/NHL5lMZnWDQiBYCp0zXRX3PMxTH R2haTSJssMSDhOoASvgnQvVs0REK154WsDxjB13VOddMREBlWqNLZQreNEvdzfx3W1js7OHCFAU Us9XINMn0hEfGFQiOROXiOetAkApx8rZfNDluqCJKB8QTSNql1l03BZa2rkDyrkqmQED+JroTbt IMx//mLjXi5cOLZ2UKN7UCh3QnVBDgYHFxBPOYoiOmFKfO3kXL6dWnDDutHiWqgqplB08h1Hjw/ 0kOSEbIDDQelLYq5DckYHw5s4lRr0v7yk1cSrYU14Fk/XT/NQUg8afpcUave3aAUrnodLqtcyZV MU0fUZa/a+I9S193/FcUbJF2MT0gSqfsfHmOwL4s7IacNhMsoKPgFH1Gw2QM/ZP7IzvueR2VcKj ar40Xs65pvZfuiRQG93KPvKZjMj1tHQHhlciboyIyO53n2H1U2kSA8Djs/fE+6YmXLOwTMNha8T Em01M/MMJz9hlAA/G62EzrN1oC+NQu0jMx+dInhGk7TDSdZCFwR X-Received: by 2002:a17:906:6a25:b0:b87:20c2:e837 with SMTP id a640c23a62f3a-b8761293471mr153477866b.5.1768405712796; Wed, 14 Jan 2026 07:48:32 -0800 (PST) Received: from adam.arnhem.chello.nl (2001-1c00-8101-1200-3ddc-5bb8-0efa-16f1.cable.dynamic.v6.ziggo.nl. [2001:1c00:8101:1200:3ddc:5bb8:efa:16f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b876e9ac655sm135616466b.6.2026.01.14.07.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 07:48:32 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v2 3/6] wic: extra-partition: Move extra var handling to a dedicated method Date: Wed, 14 Jan 2026 16:48:22 +0100 Message-ID: <20260114154825.4043483-3-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114154825.4043483-1-adam.duskett@amarulasolutions.com> References: <20260114154825.4043483-1-adam.duskett@amarulasolutions.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 ; Wed, 14 Jan 2026 15:48:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229340 For organizational purposes, and to make the following patches easier to follow, move the extra file parsing to a dedicated method. Signed-off-by: Adam Duskett --- .../lib/wic/plugins/source/extra_partition.py | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index 040b6d22ad..d41743ec40 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -36,6 +36,20 @@ class ExtraPartitionPlugin(SourcePlugin): name = 'extra_partition' image_extra_partition_files_var_name = 'IMAGE_EXTRA_PARTITION_FILES' + @classmethod + def _get_extra_vars(cls, part, var_name): + """Get extra partition directory or file variables""" + extra_vars = None + for (fmt, id) in (("_uuid-%s", part.uuid), ("_label-%s", part.label), ("_part-name-%s", part.part_name), (None, None)): + var = "" + if fmt: + var = fmt % id + thing = var_name + var + extra_vars = get_bitbake_var(thing) + if extra_vars is not None: + break + return extra_vars + @classmethod def _parse_extra_files(cls, part, kernel_dir): """ @@ -43,16 +57,7 @@ class ExtraPartitionPlugin(SourcePlugin): """ deploy_files = [] - extra_files = None - for (fmt, id) in (("_uuid-%s", part.uuid), ("_label-%s", part.label), ("_part-name-%s", part.part_name), (None, None)): - if fmt: - var = fmt % id - else: - var = "" - extra_files = get_bitbake_var(cls.image_extra_partition_files_var_name + var) - if extra_files is not None: - break - + extra_files = cls._get_extra_vars(part, cls.image_extra_partition_files_var_name) if extra_files is None: raise WicError('No extra files defined, %s unset for entry #%d' % (cls.image_extra_partition_files_var_name, part.lineno)) From patchwork Wed Jan 14 15:48:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78723 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 1FB35D37E5D for ; Wed, 14 Jan 2026 15:48:36 +0000 (UTC) Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.13360.1768405715096498507 for ; Wed, 14 Jan 2026 07:48:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kwsgFLSX; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.54, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-b8718294331so57379166b.3 for ; Wed, 14 Jan 2026 07:48:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768405713; x=1769010513; darn=lists.openembedded.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=ipED3fNgHaVDGE8D18j6ZhsWqER2VovFS/DiYGRdJic=; b=kwsgFLSXdsG+qRQUd9m0jALQ/syrzSLyCsFEouyGceWUZbw1BcWximhqD4Kt7OtvVk AIlgrmznRnbDVcar4f3dAcf8DIN67bMbEYTaIsLTKq0LcORNYCvchFEJr1IhoPJ/PWY8 jknqMEKTrATGONXp58jbxT3pahOQ2YUN9Td5o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768405713; x=1769010513; 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=ipED3fNgHaVDGE8D18j6ZhsWqER2VovFS/DiYGRdJic=; b=KpfeZCCVfxwsCLK5mQgVFhUsuYRQn/Lqh61YMUobk/0xk8Xw8Ex1fz6s5p34pnqbpC mn1RCENF8jakKKUh1oalqPNFsEq3Q3dlV8tkYwxmIPhmmMmZKW+PketCmeMmtcLyG84a 1IRduI+zATjJUf8orx3bwX8yZdilMhjcTlipiXqeOfTiMu/4TqC8QTfh8zR+CQviyVuK LEpDU0otNYtSCRadepls59kbhMTCyJGOomJPsWAUD6nCiGo567fKmG1ja+J9X1LMGsC7 Hp/KyAl83zFJmLact0jsTfNixitExgghqD3vaTI+GN5AYCjv746MGWDkLraXnzE1Frft BNrw== X-Gm-Message-State: AOJu0YxL4/TSf3UzywYLTVY3TgYgnMIApWGVR3IPEf9hJgd/cJRiwFRd 8f2Iz8n+xOZdF34wRGgpZh9ZG9ahJRF+N43JphHidqviVzDC/W4gFGEPiVO/4YoMR9wi+u7qM0W wyj9a X-Gm-Gg: AY/fxX7nlLdE5xayBiuFW1lg30LRNdOBj5Zwjvl4DLPcIPpBe6CoCEOR15RevhOyYYL Ex6FN9JuJoTRUiBiI1OTLWXXX29eu3x1yZYekczPYSEijCNGGjXQ7pq9+ZY34HxIF7uCPgBsdv7 QEiif9s9uz6qgVesg+EzJoEjwpA/TeBdK7ypKIa6DzmnTdNzw+gRngIm24bRfsGxo0Erxnqw3sN Ch0UfiTqsKae9Yy2WDDSui+AhqthHD7fJRdevsXJpCAXWWmwlOrWwmlFE1JloEj1VjBzjV4+F89 ULU8LpYPVvNgj9SaBbqIZaPeORpxnSB1pWCFYfMB0UP44oooml9ayYtpokiF+/Wk7y8fCsq8e96 e7qVv+Je2x5GwkF8xkNvjzFLmToAKH+7ePJ+6i55YhLmLX1MoO/SUaYkhdvsjffcaxGHFDpND0n ViSlvxK5T+0rojQ5K1HXGyN+DAwSQnMiyyiAGh7FBabL4F/Lk7txG4qsX5BRGLx5NGMtfNJjK4o B7a4DN9ulCvl+Ia0W5Emjb7/knvn3FdG045HA+83rYDLdIejF1W X-Received: by 2002:a17:907:c22:b0:b86:f194:9ed5 with SMTP id a640c23a62f3a-b8760fce9a9mr154022766b.1.1768405713355; Wed, 14 Jan 2026 07:48:33 -0800 (PST) Received: from adam.arnhem.chello.nl (2001-1c00-8101-1200-3ddc-5bb8-0efa-16f1.cable.dynamic.v6.ziggo.nl. [2001:1c00:8101:1200:3ddc:5bb8:efa:16f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b876e9ac655sm135616466b.6.2026.01.14.07.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 07:48:33 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v2 4/6] wic: extra-partition: Rename install_task to extra_files_task Date: Wed, 14 Jan 2026 16:48:23 +0100 Message-ID: <20260114154825.4043483-4-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114154825.4043483-1-adam.duskett@amarulasolutions.com> References: <20260114154825.4043483-1-adam.duskett@amarulasolutions.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 ; Wed, 14 Jan 2026 15:48:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229341 Rename install_task to extra_files_task for clarity Signed-off-by: Adam Duskett --- scripts/lib/wic/plugins/source/extra_partition.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index d41743ec40..efe15a4d15 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -74,7 +74,7 @@ class ExtraPartitionPlugin(SourcePlugin): logger.debug('Destination entry: %r', dst_entry) deploy_files.append(dst_entry) - cls.install_task = [] + cls.extra_files_task = [] for deploy_entry in deploy_files: src, dst = deploy_entry if '*' in src: @@ -93,9 +93,9 @@ class ExtraPartitionPlugin(SourcePlugin): for entry in srcs: src = os.path.relpath(entry, kernel_dir) entry_dst_name = entry_name_fn(entry) - cls.install_task.append((src, entry_dst_name)) + cls.extra_files_task.append((src, entry_dst_name)) else: - cls.install_task.append((src, dst)) + cls.extra_files_task.append((src, dst)) @classmethod def do_configure_partition(cls, part, source_params, cr, cr_workdir, @@ -131,7 +131,7 @@ class ExtraPartitionPlugin(SourcePlugin): if not kernel_dir: raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") - for task in cls.install_task: + for task in cls.extra_files_task: src_path, dst_path = task logger.debug('Install %s as %s', src_path, dst_path) install_cmd = "install -m 0644 -D %s %s" \ From patchwork Wed Jan 14 15:48:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78726 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 21C38D37E5C for ; Wed, 14 Jan 2026 15:48:46 +0000 (UTC) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.13361.1768405715846604380 for ; Wed, 14 Jan 2026 07:48:36 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PByyYSzS; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.50, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-b845e8326acso93597966b.1 for ; Wed, 14 Jan 2026 07:48:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768405714; x=1769010514; darn=lists.openembedded.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=/nURO7gkYhhX17UIXFhiK2Bi6Jmp+Hl1waoIN5DOt2M=; b=PByyYSzSqPEqzI9XP2dS/Nk68vKQyB14VOsmoj9I0L39rPbJOWLU9d7KClHpV6CSyO GYqJf9V06bjqfwUslpwXUGLFUJX/fBeT8J9fJ+m9zKl2po2ZuEXXE1KwamrEo1v+6Kyp DyrfEzrahpXZZ0dzI4uaZ1r2P7U6K636CK5S0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768405714; x=1769010514; 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=/nURO7gkYhhX17UIXFhiK2Bi6Jmp+Hl1waoIN5DOt2M=; b=bs6W2+YzKQvGs6YfxNbY1BfoMPcs8ZMYICmwubxjbo8LRQLcVEe2YbypkYKIZT4Ndi WQ9v13r1NmDO3zeC6cLhnR9xPnAJK7nsJg8mKOhc+F0dXksZXfrq4GA9ztXqyf+fTBBH PjYLXYluwf0jvKGxfcNiHiFKw5tMD50T+Amnnk81hWqDIky7g3VvleS3cfWHhM+XhrYZ Nm6oYA0H6e1pVyO3X03pOhz5+YMbwkzRW50959kexbwnCF3EoqT21J9SuwoXmDBGDQ/v 1pCCO/N+W0QfiMI7EJcCua9LKg4mH2InK93n5rz3DHE9HiZ95vXE/wDZVQKT1+IwIbPn q3OQ== X-Gm-Message-State: AOJu0YwOMjBbtC5uQfP5duOVmeGgTeQ0G+MEevQ/qJW6OKLS8ToOyq5Y idcEvikiPj+C6imhV7xC8GAyI8NHV17aU5AxG1CTnjDsoGAyKqSs+EV8AGCi3/jrtrBVwLe9Gg5 2gVug X-Gm-Gg: AY/fxX5o5qmS4LIFSbYide8MsACsCtcggmD6b8tD2as8ijbj42Q01EV39/eeckKVI9/ Rha4oSyKVmJlECqcPSYcCpA+onmj1ywyAYSi8Rf4FB6o1uc/van+ZGoVCMkzNpOYF+ZzqoCX8so fPWg1Wd2Sx4PC8azdJfLNGiRZzejIgjrxd7J03NMgpgd1RwiZUKfdYYOpc24J1kxh/vTQD28arL WhyLHtlxdWXTwD1e4KVp7lltwThYKqhqank6cGxEDpGsC6x9ueajsc4AMQtSM9ACsqy0fZIbWXM orTjG7LUxFHbXESRCkE+7SNboy+5G8nI+MgmUR5L+YI8S7Fuj3AQ09gzqaoIlgkSGoc7pewEnMt jF+IxOmy8Vc7kulbX5NRMZeJ+Q3wibn4grVw4rTejJkSuT/UEts34e9Wm+JdezhmFRQOMo0ZwU2 2TWnLZJen490OD5zjed8Ze3Oc41s7qUC1jnQGJCAYqwfMzEgnudaG7TxPRtStYy/SsbcPWS2u0t zLDwlZBi1vsjYS/f00o88g6O+W5h9v9dSRh7IFCe9iTFsixWVdh X-Received: by 2002:a17:907:d8f:b0:b87:2476:5e23 with SMTP id a640c23a62f3a-b8760fe1010mr158381066b.1.1768405714043; Wed, 14 Jan 2026 07:48:34 -0800 (PST) Received: from adam.arnhem.chello.nl (2001-1c00-8101-1200-3ddc-5bb8-0efa-16f1.cable.dynamic.v6.ziggo.nl. [2001:1c00:8101:1200:3ddc:5bb8:efa:16f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b876e9ac655sm135616466b.6.2026.01.14.07.48.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 07:48:33 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v2 5/6] wic: extra-partitions: Make extra-files optional Date: Wed, 14 Jan 2026 16:48:24 +0100 Message-ID: <20260114154825.4043483-5-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114154825.4043483-1-adam.duskett@amarulasolutions.com> References: <20260114154825.4043483-1-adam.duskett@amarulasolutions.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 ; Wed, 14 Jan 2026 15:48:46 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229342 There are many use cases where a user may need a blank partition of a given size and format with no extra files added. Such as an empty data partition. Signed-off-by: Adam Duskett --- v1 -> v2: If the list is blank, print a warning instead of an info. meta/lib/oeqa/selftest/cases/wic.py | 10 ++++++++++ .../lib/wic/plugins/source/extra_partition.py | 20 ++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index d7a9b14658..33a6460677 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -1698,6 +1698,16 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" self.remove_config(config) + # Test with a blank formatted partition of 5M with no extra files + with NamedTemporaryFile("w", suffix=".wks") as wks: + wks.writelines(['part / --source extra_partition --ondisk sda --fstype=ext4 --label foo --align 4 --size 5M\n']) + wks.flush() + _, wicimg = self._get_wic(wks.name) + + cmd = "wic ls %s | wc -l" % wicimg + result = runCmd(cmd) + self.assertEqual('2', result.output, msg="Expect 1 partition, not %s" % result.output) + finally: os.environ['PATH'] = oldpath diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index efe15a4d15..1963a27d78 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -55,11 +55,13 @@ class ExtraPartitionPlugin(SourcePlugin): """ Parse the files of which to copy. """ + cls.extra_files_task = [] deploy_files = [] extra_files = cls._get_extra_vars(part, cls.image_extra_partition_files_var_name) if extra_files is None: - raise WicError('No extra files defined, %s unset for entry #%d' % (cls.image_extra_partition_files_var_name, part.lineno)) + logger.warning('No extra files defined, %s unset for entry #%d' % (cls.image_extra_partition_files_var_name, part.lineno)) + return logger.info('Extra files: %s', extra_files) @@ -74,7 +76,6 @@ class ExtraPartitionPlugin(SourcePlugin): logger.debug('Destination entry: %r', dst_entry) deploy_files.append(dst_entry) - cls.extra_files_task = [] for deploy_entry in deploy_files: src, dst = deploy_entry if '*' in src: @@ -131,13 +132,14 @@ class ExtraPartitionPlugin(SourcePlugin): if not kernel_dir: raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") - for task in cls.extra_files_task: - src_path, dst_path = task - logger.debug('Install %s as %s', src_path, dst_path) - install_cmd = "install -m 0644 -D %s %s" \ - % (os.path.join(kernel_dir, src_path), - os.path.join(extradir, dst_path)) - exec_cmd(install_cmd) + if cls.extra_files_task: + for task in cls.extra_files_task: + src_path, dst_path = task + logger.debug('Install %s as %s', src_path, dst_path) + install_cmd = "install -m 0644 -D %s %s" \ + % (os.path.join(kernel_dir, src_path), + os.path.join(extradir, dst_path)) + exec_cmd(install_cmd) logger.debug('Prepare extra partition using rootfs in %s', extradir) part.prepare_rootfs(cr_workdir, oe_builddir, extradir, From patchwork Wed Jan 14 15:48:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78725 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 21C88D37E5D for ; Wed, 14 Jan 2026 15:48:46 +0000 (UTC) Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.13329.1768405716409332866 for ; Wed, 14 Jan 2026 07:48:36 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Tbs5mbKy; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.68, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f68.google.com with SMTP id a640c23a62f3a-b8773fcff60so4592666b.3 for ; Wed, 14 Jan 2026 07:48:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768405715; x=1769010515; darn=lists.openembedded.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=lT03Olx6mkX495cdefv+gWSXW/Urln8BKw81JYENDH4=; b=Tbs5mbKyL2Bju7BxMh2ISKMlAqVKtv9QrJcDkwYODlxouozx7nAQrTuBUbeGFUrU+Z SJzxny7+dEY4fGNyFnOIxj6SYkP5ovpKQeGV6k5RSipi7UQLraFrsj1UzDafo6J0DC4G hYoMm9KGxaijY9MEr5vOVC9SgTPCb1z/5IqUM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768405715; x=1769010515; 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=lT03Olx6mkX495cdefv+gWSXW/Urln8BKw81JYENDH4=; b=UaWubXutildtoeIh/n1tlo+7J+Qmc1MljiqqnyqmLqYjEwyA/dQ9ZOyNdcn2cYmg9X 1n7x6WqpqUzIk6JkRTSGbIsdIwVVCrVyBKLs7kv6mcEmC9TORAnnLLJtls0p1Z8IGti5 WPLBJJ0FGA7UG23/XCtKgAnDPUHzP+Sk0bqWg13M0EaaNgQtH3k8XVLU6ASQMGEheFa6 ZjthjW9w0pgmzyalbCkv91c5yiSXBFeqz07guR1ze/ONqgXeb8D0A9/WXs2GAOg57am4 j2hF/1A1javoqhugsuE8RTvQBgvb3P8b59mumAnn0cJ5TpU0mS4ijUvtXD6ct5k7qMVZ dF4g== X-Gm-Message-State: AOJu0YxqmRdEZkWFkRRn+rYkAdJ3/lfcDedb2+zrmzWM01rQkU0P9Dw2 7e3xBSBIstiKho7xCV4dTiBccQzbRP3+I8IwaN5YhKSMi5f/DxvxQDVIW3L/Pi8K71xr5Udgq9p oUw+9fEM= X-Gm-Gg: AY/fxX6b6Wlpxdv5hEkR4VlSEfZ/WHSkGF/UNcAbrBDy6TBhe7PzrqcX1Pg9t40L7rT iIqTnTMxOp8Oxtm3RenYKH1iqh6rD6gZ21fmyfTzXX4X3I1lv9xP4SSWBXirG1FervOg7ja3laf vhf8ndZJOR/7h184WrtWFKyNrYhaF0ZTt/423okXCLFPWjT7YitmlCke0fSR1DUaZCxYoDUtscE Z14S2bs4EiXbbfvzb6xUfAEvom7iqWw724UAa6AuLIp6XhVvQQjo0MYa/LJ5d5nBVO1e6xIRoh+ eujaN4jEgmIAEtYaN429SsPjWOg80oOhY5Hc/9XRHsWmepdFjJ+Nkf6pofZ6V976ktTu5MOT2MQ dcnGktZ3yEdye/ZOoiASmNHNdUzwzHnXt9AzYEjFzmdEW7BUwoY7SE6CoBvSAzi4AIYhWRLEOGp bU/I0ZsK58bliLgRhVIjcA+rux+mak7YiEWhTB1czIsToG5Aht0IWLY4uerq2kzOVsFX093ZsFh HPxeS8Fm+msShugM52a0r1zKU6j3hnkwd1EADFjlluKp2tbzkvnae+dZwmSbTY= X-Received: by 2002:a17:907:e98a:b0:b87:6a6:5fc2 with SMTP id a640c23a62f3a-b87612c8dc2mr138175466b.5.1768405714674; Wed, 14 Jan 2026 07:48:34 -0800 (PST) Received: from adam.arnhem.chello.nl (2001-1c00-8101-1200-3ddc-5bb8-0efa-16f1.cable.dynamic.v6.ziggo.nl. [2001:1c00:8101:1200:3ddc:5bb8:efa:16f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b876e9ac655sm135616466b.6.2026.01.14.07.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 07:48:34 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v2 6/6] wic: extra-partitions: extend to support extra directories Date: Wed, 14 Jan 2026 16:48:25 +0100 Message-ID: <20260114154825.4043483-6-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114154825.4043483-1-adam.duskett@amarulasolutions.com> References: <20260114154825.4043483-1-adam.duskett@amarulasolutions.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 ; Wed, 14 Jan 2026 15:48:46 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229343 Add the ability to define a space-delminated list of directories to create on the extra partition. Signed-off-by: Adam Duskett --- v1 -> v2: Make the list space deliminated instead of semicolon deliminated. If the list is blank, print a warning instead of an info. meta/lib/oeqa/selftest/cases/wic.py | 11 ++++++ .../lib/wic/plugins/source/extra_partition.py | 38 +++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 33a6460677..3aab6a52b8 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -1657,10 +1657,14 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" def test_extra_partition_plugin(self): """Test extra partition plugin""" config = dedent("""\ + IMAGE_EXTRA_PARTITION_DIRECTORIES_label-foo = "/test1 /test2/test3" + IMAGE_EXTRA_PARTITION_DIRECTORIES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d = "/test1 /test2/test3" IMAGE_EXTRA_PARTITION_FILES_label-foo = "bar.conf;foo.conf" IMAGE_EXTRA_PARTITION_FILES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d = "bar.conf;foobar.conf" IMAGE_EXTRA_PARTITION_FILES = "foo/*" WICVARS:append = "\ + IMAGE_EXTRA_PARTITION_DIRECTORIES_label-foo \ + IMAGE_EXTRA_PARTITION_DIRECTORIES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d \ IMAGE_EXTRA_PARTITION_FILES_label-foo \ IMAGE_EXTRA_PARTITION_FILES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d \ " @@ -1692,6 +1696,13 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot" result = runCmd("wic ls %s | wc -l" % wicimg) self.assertEqual('4', result.output, msg="Expect 3 partitions, not %s" % result.output) + for part, extra_dir in enumerate(["test1", "test2"]): + result = runCmd("wic ls %s:%d | grep -q \"%s\"" % (wicimg, part + 1, extra_dir)) + self.assertEqual(0, result.status, msg="Directory '%s' not found in the partition #%d" % (extra_dir, part)) + + result = runCmd("wic ls %s:%d/test2 | grep -q \"test3\"" % (wicimg, part + 1)) + self.assertEqual(0, result.status, msg="Directory test2/test3 not found in the partition #%d" % part) + for part, file in enumerate(["foo.conf", "foobar.conf", "bar.conf"]): result = runCmd("wic ls %s:%d | grep -q \"%s\"" % (wicimg, part + 1, file)) self.assertEqual(0, result.status, msg="File '%s' not found in the partition #%d" % (file, part)) diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index 1963a27d78..5626aa336a 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -20,13 +20,19 @@ class ExtraPartitionPlugin(SourcePlugin): - File renaming. - Suffixes to specify the target partition (by label, UUID, or partname), enabling multiple extra partitions to coexist. + - Extra directories. For example: + IMAGE_EXTRA_PARTITION_DIRECTORIES_label-foo = "/foo /bar/baz" + IMAGE_EXTRA_PARTITION_DIRECTORIES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d = "/foo /bar/baz" + IMAGE_EXTRA_PARTITION_FILES_label-foo = "bar.conf;foo.conf" IMAGE_EXTRA_PARTITION_FILES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d = "bar.conf;foobar.conf" IMAGE_EXTRA_PARTITION_FILES = "foo/*" WICVARS:append = "\ + IMAGE_EXTRA_PARTITION_DIRECTORIES_label-foo \ + IMAGE_EXTRA_PARTITION_DIRECTORIES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d \ IMAGE_EXTRA_PARTITION_FILES_label-foo \ IMAGE_EXTRA_PARTITION_FILES_uuid-e7d0824e-cda3-4bed-9f54-9ef5312d105d \ " @@ -35,6 +41,7 @@ class ExtraPartitionPlugin(SourcePlugin): name = 'extra_partition' image_extra_partition_files_var_name = 'IMAGE_EXTRA_PARTITION_FILES' + image_extra_partition_dirs_var_name = 'IMAGE_EXTRA_PARTITION_DIRECTORIES' @classmethod def _get_extra_vars(cls, part, var_name): @@ -50,6 +57,30 @@ class ExtraPartitionPlugin(SourcePlugin): break return extra_vars + + @classmethod + def _parse_extra_directories(cls, part): + """ + Parse the directories of which to copy. + """ + cls.extra_dirs_task = [] + + extra_dirs = cls._get_extra_vars(part, cls.image_extra_partition_dirs_var_name) + if extra_dirs is None: + logger.warning('No extra directories defined, %s unset for entry #%d' % (cls.image_extra_partition_dirs_var_name, part.lineno)) + return + + logger.info('Extra dirs: %s', extra_dirs) + for src_entry in tuple(extra_dirs.strip().split(' ')): + if ' ' in src_entry: + dst_entries = src_entry.split(' ') + if not dst_entries[0] or not dst_entries[1]: + raise WicError('Malformed extra dir entry: %s' % src_entry) + for dst_entry in dst_entries: + cls.extra_dirs_task.append(dst_entry) + else: + cls.extra_dirs_task.append(src_entry) + @classmethod def _parse_extra_files(cls, part, kernel_dir): """ @@ -114,6 +145,7 @@ class ExtraPartitionPlugin(SourcePlugin): if not kernel_dir: raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") + cls._parse_extra_directories(part) cls._parse_extra_files(part, kernel_dir) @classmethod @@ -132,6 +164,12 @@ class ExtraPartitionPlugin(SourcePlugin): if not kernel_dir: raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") + if cls.extra_dirs_task: + for task in cls.extra_dirs_task: + mkdir_cmd = "mkdir -p %s/%s" % (extradir, task) + logger.debug(mkdir_cmd) + exec_cmd(mkdir_cmd) + if cls.extra_files_task: for task in cls.extra_files_task: src_path, dst_path = task