From patchwork Tue Jan 13 14:43:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78621 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 1FF69D2D117 for ; Tue, 13 Jan 2026 14:43:23 +0000 (UTC) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.60625.1768315399216616627 for ; Tue, 13 Jan 2026 06:43:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Hn/VI6FN; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.42, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-b86fc3711ddso68099066b.0 for ; Tue, 13 Jan 2026 06:43:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768315397; x=1768920197; 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=Hn/VI6FNk+3X7e1AmikToLMkkfB66sg21QdNHDx/5Xg/O7Z/MVpFr6uwrvBZe7oIAX M04EFD67uOe/H/EoS6TTmBurwzfsv+UR6ADgfnKAKLG3HnmJMJegfcwXz+iJLPZbc405 /zsIXCNKVm9Ufsow3ubIpnU2h6rAAUUHiqvoU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768315397; x=1768920197; 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=hvsM+76fATsMmWk/ZeeP6LNHwEC6JJp1KxiAD6KvzUJdKi9YTUATpJJg8UrjgsK5BP mUzqc/6HnWJZnFs1njRPzuOfqyvCoVANMmeE5HiFcmYP9cdKnx3CspQJCrwqQ6RWfIDV gpeNPOcPqMP+MfJzLBNntxcetWIfck7N96JqBQ8/sc9qp7zbgE/FMMgxrbCH7LINcyxk TD7AWtBEhoEehJCnkws1OLECO6nQikUkmBI3jruSCfR68kBvs2Sr+QSH01nEFKxTOxda DBDr867i8IjY6goXyRbxEabkM1DM1WyVOQjnVubrSaF03VThmi1sYxRSxJG85qhXsgYJ /ePA== X-Gm-Message-State: AOJu0Yz66DKkxnfwkakNEujTczZBaKcuvtAacjgVzsKMqFiUBG7mbFDs YHK955RZSXhzp99RJWOePedU/pKMWfzM7LkC/AV7g+BYYrMylslEty/rAMxTgr7bQJLYPkJz7br rIlIm X-Gm-Gg: AY/fxX5Njg272zy7/bmI7dStbMR7b7zKWLQOG9Z2zlKQ6eou1BxpMyU/rcP2vxXEVr+ SPr8VqD552TJ/0h1KzhwYGF/e+BVTeEnjV7wWkGJ8Rd4Eov5xW+v3b2zmZLHc0vS7MNPGUKvrKB B2QVMKxRgnVFOx5TuwaJmPFMUpKiCDXPbSUf3H1t/uErA5E3Fp6ThJv+R9F2dLaC4wc6JuaI1/g zrXpyzx4UF5M67OwdqZaXgT9NPtOxjMXzsxaS6783BTKlO6BOm/UKtu7ZaDojSlbXgoeXq4GRbI p9LL6+QebixQyyd0q5z38bIdnmcdmpllxN7+KEENFSuVzgl1tZuE0ZsbnqwXHzLxdi8J/nY7fQi S6wUTwb8JnzeB7RnpKoDg1TJThbnXXV9zF+frEVrk9VtRm1w2C37XdFXq8OLNcP/G1yFTfMkdUQ upH5/b7dlebg1hk+jtHizZn5go9TQUNWymviMwwEu3xkgA2xJir+8Wh902obuYK3IBn5O5Nbv/4 M8tyXtMIHkebXGA8Y211gEYfK8sHq0cIaSiBxdw7CZ0ZvbFH7bu X-Google-Smtp-Source: AGHT+IFrCEDIATme6DUMkU4n9Eydh5xmq4TDnfb8hEKhBz4oLotfr6Rco/70+aAjkfjHrR7odeVTgQ== X-Received: by 2002:a17:907:c0e:b0:b87:515e:654a with SMTP id a640c23a62f3a-b87515e9472mr37606366b.2.1768315397483; Tue, 13 Jan 2026 06:43:17 -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-b842a23433asm2244955266b.3.2026.01.13.06.43.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jan 2026 06:43:16 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH 1/6] wic: extra-partition: Small code cleanup Date: Tue, 13 Jan 2026 15:43:08 +0100 Message-ID: <20260113144314.3563680-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 ; Tue, 13 Jan 2026 14:43:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229267 - 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 Tue Jan 13 14:43:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78624 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 3EE04D2D11A for ; Tue, 13 Jan 2026 14:43:23 +0000 (UTC) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.60627.1768315399962877433 for ; Tue, 13 Jan 2026 06:43:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Yvz9ItwP; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.47, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-b8719f5a2b5so36381866b.3 for ; Tue, 13 Jan 2026 06:43:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768315398; x=1768920198; 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=Yvz9ItwPcX4f66SlJdvTZegOHRHkXRDhN0NKJmttzsf6QeXt7tw/K4amqL958MidzY BtAyc9BElOYJT0u03x89X+mZwg3OINu6SICgWGHAgj9jWzv5BQyJp5RTK713QS1/yyGn RYxM0mLNFm1yfER4ihUWaJ3vYFtzbfRwWSC8U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768315398; x=1768920198; 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=B0WPB7WMcBUo58C/qR5FL9nDRDVvnlndmUD6B+DjvmccvFnbLaepkvyzIBnIC4a9Bo 31k6O+tEbcJSqRfJUeJQCNILSoTLugoO52eO/8/mGaVMgVrjQZ8eevM3zJZNKEnl5F4J Z7t7UWi59yoMko11/mt/aGe/8pMySRy825Zv/hTsnE8XKD/8x37y4BoRozM0p+3Zf9rK llXw5DNlprBcdSutAXFE/fq3du5R7t6EbSoPJrlgCzHIvto5iEbbxn30ZGzdSN3cehYi KLB/bK2SsXdgHCUKNMV4ryZLWGhlRHWHY3OfyhebvR3POCloT/dYY5BROnANc6rgLP/l qL8w== X-Gm-Message-State: AOJu0Yy7u4v3nBudQAweptSphUV9ONXFykcpMVoAOc1HCtrfU0q02OJu H2HQoEOM2nqNpdTpVs3G8SnuJQLtozHjNj35/1J92udfpotCTKhljvhBXNwLoM76L5hu2IPbcNg DUU0p X-Gm-Gg: AY/fxX5NVtjp+BUdDI42oayS4GOCslyWaaDHvO0g2HoQ+rRf6yZ8C2oNthkxQ5wMNH0 eLjcnh36PlIDN1QFXnXuf6p8tv1q3VLvgxL+apjDUxOWzA5lVe9puDYtZIVctI2G4Ynxoyg0ymc DaMsZai/bHlPr/LwUv0rYqAWE4tx/jzMlx8X9shC8+QNkz0lDEOgbrZ6XcLESOUQQuVU3ba00k5 htc8PECNBHbwZS0Zn/zr+QHYSNqXdBpqX0zyDWLa4FiwUl5vEcXN4vjBEYaZszG/a6c2IiRRWu3 q1/+PGkooC1S9lWNWyPHl8zPXwGrWcEirbI+pZRmOKsfRm3lE2xPWecJQoXZrQgEt90hL9zZH4/ VBDkxmkj3GzTXoDuixheCupMOhLv5XanZH6PpvrbS7e1scctUFKhRj2baeQGsH3XmeONh+WSf1O Gzj5n7rBho8GnhSWdWCg/QA2GPaBBrs9TQRXfoK3ZKvImyM52w745j+DITQKFKNDc7gYPvq9R6a v5KFMPZNi4U5NIYXk2W2MZk53DZeGm/mVYDYiDxO+ID9BkGxUNz X-Google-Smtp-Source: AGHT+IEQxTVev7tt81Cznq+rElbNfXLGZWC5ggni3pDjr5pxptIXD5mpzsAqh80RZN8mmI+vV6mr8g== X-Received: by 2002:a17:907:1c18:b0:b87:1eaf:3762 with SMTP id a640c23a62f3a-b871eaf3f94mr349398466b.7.1768315398319; Tue, 13 Jan 2026 06:43:18 -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-b842a23433asm2244955266b.3.2026.01.13.06.43.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jan 2026 06:43:17 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH 2/6] wic: extra-partition: Move extra file parsing to a dedicated method Date: Tue, 13 Jan 2026 15:43:09 +0100 Message-ID: <20260113144314.3563680-2-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260113144314.3563680-1-adam.duskett@amarulasolutions.com> References: <20260113144314.3563680-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 ; Tue, 13 Jan 2026 14:43:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229268 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 Tue Jan 13 14:43:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78623 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 35F1CD2D11B for ; Tue, 13 Jan 2026 14:43:23 +0000 (UTC) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.60297.1768315400927274747 for ; Tue, 13 Jan 2026 06:43:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bPPFqpLb; spf=pass (domain: amarulasolutions.com, ip: 209.85.208.48, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-64b7b08fc0eso757768a12.3 for ; Tue, 13 Jan 2026 06:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768315399; x=1768920199; 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=bPPFqpLbUiEb6i6+9tmaqZZxbJqF4L9KSGWyKBCyzuJOXjnDChuZkwLMXYS1zGA/Fh blA8cWPOarFOBa45LC+10y/mfIXK4bxlHpZEjop4MMAq+reRPSAQxy4n0oW9jidZYL36 KjzOKft/0+jauHzPZxt+XYZsFx5oxS7yxG+pg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768315399; x=1768920199; 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=GI7j/jO3rDnIZ4zdFUXlw/exohiSmoI94If09Q26cQNC6mDlKQ8liW5iBNYE6Zu98C T4FrzJt536K0jm9qjlR5y1of0xfj5N8CrfEIuja/lLGWVmjykK45R+CslNTKXdwbIXoA TDsgday5vAWxsjVL1c0GKUhp8TH0HyTfsJBftvW5jzp6iUdU03cmBsKwW+DfhT1KLU7L s1kes95T/fbQ6Vr66gWcdqDeiV5WRA3eS0u8zMhYSiMq4sftBjsvPrqAhEzfbkxUF2lC saas2/Mype2jsrHNQmyD5xz0tzJUSSgQK0PnD/d7XKBKOuBdRxD7qHOAiGV1asZsp2PL Tl/w== X-Gm-Message-State: AOJu0Yyc63nPY3brr1Rppeq1//Tz+dhi9WucCWKnNa9SU0SMu+fdpp3O EuD6TbvONNlgo7A53zPQqLEIFxdgaWf8DbFEtjl/CjBdRqbmvAh+0fxuwjAy3KBc3Tc2yITNSqs I8JFD X-Gm-Gg: AY/fxX6dXjXOFpHMRGRCH6cc/k84BOQ4YgAqCe+3kQvWyo7L7suHRgYWTI49u8CQF8O sdtOPmXjDxLLbNXUC834BxRNhVwkTlyfw4pEu0EuRbgYxwSwfjRxUlr3eg8w6o6Ye+W0nC5pfuj APj/P1+I12guVzEnNbqSzJP370Oepoo5cs8B73U09NpaumWdkce8Hve0IN060GGB/Vdzh8FG7Be mAE6VfclayWVYpZEfD8Klvf6pdvyTSopbm6G5Hji4tnCH6Kd1D4pEUBx9W/vUGk0SvrcHtQB0a4 tVjvJJwPXFOeCpQBAmEx2hyD/U+o+uJ4ZVkeJfKpSGeBSnrXfnBoZGWzCCbdm293hvU7aNBnuJU eT5cw1dogfT6KaLFjWm6SDAc8GjNsDNlEQOjKKgI0ZuXCiXsBYty87ipg2kudwNCB4X5ZGzhErR tjI0d1rtLQzqme6T6R6Uk/GAnRIpHzSoqb7voOIZw9buiHRpyf+oDAjv1SviM/nls4nyZ9J4UXz JaCqnaFiCj92ege4otRr1ffkQcC/Ad+IPWTpcmK7r87QvN8BfSl X-Google-Smtp-Source: AGHT+IE0PKJPV5OHUXkP6LGel7YlbOY3jsFMLFwfzL52L3f/3dF707d70zCNVbdWa2dfm+XUt69m7g== X-Received: by 2002:a17:907:6e8f:b0:b87:17d1:a98f with SMTP id a640c23a62f3a-b8717d1aadbmr434278966b.3.1768315398982; Tue, 13 Jan 2026 06:43:18 -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-b842a23433asm2244955266b.3.2026.01.13.06.43.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jan 2026 06:43:18 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH 3/6] wic: extra-partition: Move extra var handling to a dedicated method Date: Tue, 13 Jan 2026 15:43:10 +0100 Message-ID: <20260113144314.3563680-3-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260113144314.3563680-1-adam.duskett@amarulasolutions.com> References: <20260113144314.3563680-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 ; Tue, 13 Jan 2026 14:43:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229269 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 Tue Jan 13 14:43:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78622 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 1F14AD2D115 for ; Tue, 13 Jan 2026 14:43:23 +0000 (UTC) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.60631.1768315401379821779 for ; Tue, 13 Jan 2026 06:43:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PH4rir8E; spf=pass (domain: amarulasolutions.com, ip: 209.85.208.48, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-64b5b22f723so1063057a12.2 for ; Tue, 13 Jan 2026 06:43:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768315400; x=1768920200; 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=PH4rir8ELtGoJfPxPUq2RHNyG36yIwbX32BhH5+4p3G6YkOOzTqucCsvo5aB3tdsOX X9vrM3MV3gSZth0QUN2ZBU5yRA6wqSTfXg/oaJtiFKHClE2P/bJEiF4R2vmfBEumVh2P r26paUb0VVTVsJ3mEGwxFy9nwPq10Mwi5xgjg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768315400; x=1768920200; 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=EJ/L1tP+L4bZ/xcrVBTHx603cEBlR+HucKLzorSJrpHDcMZTOXDsyoq7Jf808jaWpQ 0aEqHd5o5Rw7wavJZ7XdkCebpamrhA37ROp/hZQhACO3qup1nUI9IMiO1fms1Iq8wcId fQ9T5z/R923Ux2EfBFfi5ZdGccZC42C0wGpCcqAvltoxV4HAxh4QnRvvAybi5JRf9EoL ktz0A9K/U86hKFjyyLlBN31hoAJM4WXufWjlwRBNpGLbXbFPWx5X4ORm8se5PmJAimNo 2iM/md1IArLxBFrGsji5aADWdNIUUykssiWPMksxUJ4p07kCtq+0h6MOpfxZFD6bpeCf hD2w== X-Gm-Message-State: AOJu0YwzEYz1qfLagxu25ArizlIQiFBIl0Uma8syoropfYYaxWN1Kth8 VmatnrjYrCCs/wEfPCev9SNWc94WG1iafa0mmKjST+6PXuP6mCq5rblBlBeEfbA8M4PeVJMGnQ0 /7RBy X-Gm-Gg: AY/fxX6BB0ebUqowV0TNRHQGepASBPgjl6iKN8hDb8vDvNN1LVfCoViYnVz53WQDMMx QZIENZ9x4PsHmUtlOvnL3et6cXr9PetaBZJQvSWxrvqkmUIJVKfgyy2OzG60rZ95y8ln/g2ZMy3 KxC3v30aGDB7+hwOKS+OdPk5r4CofSdGzscXTnS4rmP1GWLStwbDa8x4fuWiiOrnppvbwJ2gHir 0JVpZCzhXwsr3XcgpmkXgvWKo604s3mac1xy1WwuFkWtoIbyr+kD30MBnIng6UGevHfNlLVbhNO 5Ohh4O/7l+2+9j3gJO8JCg/O1bD0fgmEqZU7Y9md++eE+SNfCdJCAOkyInVYnsbKcfmetqteB6/ WuEPMsgathEuu2o/ql+G2xRr084tlDPxBhGofGsWIf0AOgngujnbpzWMguHZFQsnB5cMrbLJI1i aDFt5VtQHCRYbOfjY4r72Ie6epFll0JnqviJlxiOwbOF4IDRdom95b6nh4nueD7u3dsfLnYIFI7 NLQkCLD4eYNTdoG4t4aJntauJqadGmTOFO5GllsHN/szq9PTJZ0 X-Google-Smtp-Source: AGHT+IExzcU4KxYAKo+6QzEegusFqheeXUgfV4mzfHXcZ3exPQAS4Gc5HA+7qc+qrhbcSe6M0i9vCw== X-Received: by 2002:a17:907:d92:b0:b87:3c3a:cb7e with SMTP id a640c23a62f3a-b873c3ae932mr113137266b.6.1768315399726; Tue, 13 Jan 2026 06:43:19 -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-b842a23433asm2244955266b.3.2026.01.13.06.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jan 2026 06:43:19 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH 4/6] wic: extra-partition: Rename install_task to extra_files_task Date: Tue, 13 Jan 2026 15:43:11 +0100 Message-ID: <20260113144314.3563680-4-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260113144314.3563680-1-adam.duskett@amarulasolutions.com> References: <20260113144314.3563680-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 ; Tue, 13 Jan 2026 14:43:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229270 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 Tue Jan 13 14:43:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78625 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 246C1D2D111 for ; Tue, 13 Jan 2026 14:43:23 +0000 (UTC) Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.60298.1768315402115617215 for ; Tue, 13 Jan 2026 06:43:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GYezXHnb; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.43, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-b845e8326acso74616266b.1 for ; Tue, 13 Jan 2026 06:43:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768315400; x=1768920200; 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=Qgulkzg2dmGwiyVMByZiKyc7y9PxnUJfD96yknQZKoQ=; b=GYezXHnbnDyeLtH69MHFQJ+xOI65B5VArg5cFZYzDotCC12drE6qKHxWaI6zvniX95 lJfJs7uABOg7pqgYPejxz+RKkSNovma82VqhyWGRRQgr/aeaHKow+PQxYSOkI2d5qhwG kS5VMPoAwliAtcUSNFx6CYiCxUodsx8BDWmKs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768315400; x=1768920200; 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=Qgulkzg2dmGwiyVMByZiKyc7y9PxnUJfD96yknQZKoQ=; b=q6Y5+GyjN1eH1yIny0ZQ96SFsA0+POCVP3WUD0bDVAYZ2js2tvEM/QxoJZB4KAvzvA 8Rw+7nRmW+9w6I0uX9SeOi11PDf17QhcYW3J8G8lWD+Wtj5gChqd5lQWYmPLsDFD0JN8 9Fhx1eaEUA6loLB+HfE1NdwMfRMfglmhKeG6eJ5MXMRMvXcAyrj2XOVCS/l675JDK1h9 EexTUzrwrMd9Fe2XSB9Rlyr16DQLpVE+BTtAC9yIcODhbLlLh5M66thAVuplaWh49Plg 2zyddMDWilO21hgmCCEc7BY0Mt5P7ouBz87wcP4iQs+Lp9lhUyr4WmPG1Or0qejQ7ePq skRw== X-Gm-Message-State: AOJu0YzLdETfPctjoT5AvSco/sLpV+xf8iNPOa8qks7btZIXvm/+9q/S SqcJahKsKnHVAjDp24NA1K8+nm/w+ogqMXaW23eh0tbZ82iVXMKDlJN+5nzQKN8UXNwkhgctqM8 rlBd7 X-Gm-Gg: AY/fxX5Tdj8s9XoDGtoJ/8J8sS1JfSB1FdoL/QJH6cMvBMiLP1/rDGrOX2M/1b6hru3 fLmYy9KDhZvk3YR7sl60BJSIkmdfRxpAsa9TATZ9TsjK8QOkCvoGa7867ECen5E6kGYh00d+o5m y8OIZz01XM7uzp5HQhusF4wRU6ybAko+OUhwE2+GCKWqbmA8KAW74gQCABXfg+pJo0Wd3BbuXNm 5YcTLzEvQFQQL5qgLniH26RFaLTzSU4T1Z8kiwCd6s7eIxSKaoUVOKiZjXh9QQqBWaVqgbTu8UM 7tt9XqXDlvnYe41v9pllTJLYy04sbLhNoGLCgD7mVvylQQRspCLWRyHW18Q9PsyXDiDp8oruzRe /JhaH2jwOHpvR1S0qmQamK8xOn2AYvOGZfbrIc9qlnX/BFA10Y+cT2fGMBzyCjgfXdj0Z2tm1Ar 42Nn+OZcXrx1DmDybT6bzlec/dnWmoPyWdkFIYZDmOtxaWe6rNlcpbmOuZKAIOcFZonoow6viAz xaQ4gQ0r6nJ5ZUpAOpVX/Pe+oLAAaA55MePZ0hBquE2EA4osdRc X-Google-Smtp-Source: AGHT+IG4+Jw3gxdFqb5dr1YRZG+4E3QDnC/V94PmrgtIlee0qn1FpBZ1kNBIhX1ZC2ueqgJh6eTGMQ== X-Received: by 2002:a17:907:7b8e:b0:b87:2a56:9d6 with SMTP id a640c23a62f3a-b872a56235amr298059466b.2.1768315400473; Tue, 13 Jan 2026 06:43:20 -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-b842a23433asm2244955266b.3.2026.01.13.06.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jan 2026 06:43:20 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH 5/6] wic: extra-partitions: Make extra-files optional Date: Tue, 13 Jan 2026 15:43:12 +0100 Message-ID: <20260113144314.3563680-5-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260113144314.3563680-1-adam.duskett@amarulasolutions.com> References: <20260113144314.3563680-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 ; Tue, 13 Jan 2026 14:43:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229271 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 --- 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..3abd2bfd4c 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.debug('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 Tue Jan 13 14:43:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78626 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 3474ED2D115 for ; Tue, 13 Jan 2026 14:43:33 +0000 (UTC) Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.60299.1768315402854865666 for ; Tue, 13 Jan 2026 06:43:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=eBdA3roa; spf=pass (domain: amarulasolutions.com, ip: 209.85.208.68, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ed1-f68.google.com with SMTP id 4fb4d7f45d1cf-650854d9853so1613947a12.0 for ; Tue, 13 Jan 2026 06:43:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768315401; x=1768920201; 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=iGVM8ia48s6/nP8Bh3waDYobnyidEujwWsPuGyAoAPM=; b=eBdA3roaTaL6mJ6quxtwDH4Mv4xJ+NZs30agfr5gcS5zryoeoG6JBP4gRziB3i7oCG rUbSWWWElE3ivmS/sHkgwn1D6NJ4b0sy12LcUoUx7Ka1nCDVV9ULT9KI87eGbDfZ1KXJ rXChIxT9DjTr0LnqTy3jyiPiDSA2pMasTkDok= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768315401; x=1768920201; 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=iGVM8ia48s6/nP8Bh3waDYobnyidEujwWsPuGyAoAPM=; b=bsB+TUK1FB3cNxGdzYYj7XmSoDppbngHvQ6hfJP3rZ5Rer0rRH87PM1z7Nz9WdAqlu P2u9UOECGsQm3eHcW3rlMbxAsyBYOeXc3L6se2xeC4KWessbx4uwKSuHVSBdgSFl54EW jFX6G09Ct7mUkM155qPGijb130qV1Ri4hvu/LcFf86gKZyCl1wMNesOvEquVHGXDnnpa jIbbb5V4/3CUKfOvuPdnxgKhHucBzBkpND5h+yg+jG/OjnUGrSLgJCQvWmu6ZyQr+2Xs vLfrgQVwV63VXP6s/KuvTV4kTWbAUoeqYv37DDAF6eYWBOhhE5/FADW9mXs1bpAkQFbG ap8Q== X-Gm-Message-State: AOJu0YystnvN3g5RX6IcDaQdwUelWjS+FJww1bo9/x6jUTyG8I5+tolt uYvyL24BSYwwCwK+wO+8UMK8CQSIZEbCUFWnzCLPbaeSJ2HDBxF54gIt1M0LIWQkwfRqKKYKHas k77duNoo= X-Gm-Gg: AY/fxX6Fl1NUPJNgg6XvsQ6lA8UIKor7EnV1tj0PcRPvzKyPVYnrTVNYjyukc2rFcBj 1cElzJGWximkq6XrU20WPjWCK/RU+FuUAmgxM//0dewEjj8UM4xN//d3K+W2HwrkfTbGXj9OuUp Dqok8ye2fPXNhct/64Ca6L2Vg8pTl2pk5/dEXivV8SSwowFgaBW0MofADSlxsVQ0Wu3UsosKo2W 4ZHUVPINSIRdRU9YRXA5OhnVnqf/DayfHsVJyUGV5SJ0P4AsRl3ufkbQbuXPWJxPr0yVE+7frbn +/oBHwPwGYOMsmdjppe1VL7DA2XWyFE0nKQz6at+v/+CWWo+/LR5+IuywaX7GCv6AWkd40q65h9 g37CtSNL9UrPE/G/p51knoJh72fpyHqtRqG3iciH8g+DrO5WonPr5TLmWD9lqJg/tJi11Yv/Gte OC/6IdLn0CQHTj8rDlZbH/94H3w9BZI5Dl8y2xrY4s1KOdvhk5vmVO3rQ0WNhVIkB4fjWxpBEZM Tb+MvG1sGIXyRd/piH/YCzymXRXOM5FY4m/QIaMPx8MzJMG7qpY X-Google-Smtp-Source: AGHT+IEgYu6DPL9K+4v3niHo6063kFzr6DsRILVffT9Hs47ZE8kjrVMOXGLqYVvrT1VP5Mzavwam4A== X-Received: by 2002:a05:6402:348a:b0:649:9fef:48e6 with SMTP id 4fb4d7f45d1cf-65097ec308fmr10825109a12.6.1768315401176; Tue, 13 Jan 2026 06:43:21 -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-b842a23433asm2244955266b.3.2026.01.13.06.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jan 2026 06:43:20 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH 6/6] wic: extra-partitions: extend to support extra directories Date: Tue, 13 Jan 2026 15:43:13 +0100 Message-ID: <20260113144314.3563680-6-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260113144314.3563680-1-adam.duskett@amarulasolutions.com> References: <20260113144314.3563680-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 ; Tue, 13 Jan 2026 14:43:33 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229272 Add the ability to define a semicolon-delminated list of directories to create on the extra partition. Signed-off-by: Adam Duskett --- 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..d365345554 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 3abd2bfd4c..fee72df615 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.debug('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 re.findall(r'[\w;\-./*]+', extra_dirs): + 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