From patchwork Wed Jan 14 16:10:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78727 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 55C95D31A19 for ; Wed, 14 Jan 2026 16:10:46 +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.13885.1768407045784628327 for ; Wed, 14 Jan 2026 08:10:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=S44JVtjI; 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-b801ff00294so335566b.0 for ; Wed, 14 Jan 2026 08:10:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768407044; x=1769011844; 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=S44JVtjITMDzmXKtggqN59Y+IFDWWVCv/MSVR0kCoxT+9b2K14b3v72tZ4EbwoUtk4 rn3MYbOe6t1XPWDOMNF1QznBgwq1Mh3hiOwIGl4xqrrygso8gx7O9Fh7pl/HvgDG3HLI OhRpZyGkXSv61gffTTIJPauiaIASjdIUXMPvA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768407044; x=1769011844; 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=b/trEBJiXaKKY2W6nac4zklgeU90wlABla2a3qkgmR6ECLnwoma2JsXl+wYIdQ57gp yEcJoBV3XUZi/eNAnRn1G0wael5y6U5jTM0+Ve4ntRWv9Gt39z0w1hT4jZx5wRs1gTFj jZdUvG2u7ahdSPyc1HZ7vOt1IEAWVIr27HSpxLoouAp7XLqt/L8C5pAI5tSyPM2+a37l BMPgmOvPsSqtKaNmZ/EhIf79+CJaIrlMpBYuycFqEVrRHsiVwEVltxnrhEfajY6vc2f9 4utYSIMokMMZnN/axYgClNaUTCOA+nLxBbs2UQSgW+9Aa55l7N/2zdCFe/ktVQ5LzaOy 9kbg== X-Gm-Message-State: AOJu0YwqSuEmS2Dc0hmVXXIymAa8ON30bJLOc0RTTkhqAIEVZHw6Z4r0 aP/ZC9Tqp8Ex/ahZMpYIdpFx7xaPyYDsHYiiwivhabqE+sSU9p7hPwjIU0AHj3Uh0fQqrnWusmP +J+7d X-Gm-Gg: AY/fxX5a0I3XxUZeeMzwc4DF89Vk9BTTAfOgEe6h7dZUa+41IG59GLO7SYpX2fbZXBR cC/iaAfhUNvMv6jd3lVmQ43/gugPtHdbs3DqKfy/UY5hUVgBn7s0Jmh57TFWUWkbnry0EDe0PZM V0KjK5hF5EdND9HGzncznf34oK3I1ONsAAqtGWIQNk/3IdpqNtljYgZDHRYJet8Na+EPn+SRI2u hB3szqhC9eH0334ulKXQmaJwFLyjD72R6Lw6IJ4oua9UixGMKPDzlGA6ML2WsNDIdAkzCUoRAhR gHxTiafsb/BsNe/M1R6L63V1qF/h4EBBG/7LZ0f+qzF1aKHHdK2R1sf2ro9Pjb9wKg0hBDW/h35 4oUBG5JDIqLxoLcYuAWBCBd2DqdBQAzOwPHqLW5F0ODm+HHV60i1Hdjh/A1rD6p2mpw8V39psNW KGXTx4q+ydmNP7QFpuyuZz4Hz28gZCIb0DPA1PSTthKrx4HJn0T+S5hStFA4KBMdcR/vIQcJza6 QoE4G33ArdhGzk+VslcbSElFTzLQ8WoMs5W3+eCycdwkcK59ZNP X-Received: by 2002:a17:907:724b:b0:b83:95ca:22e1 with SMTP id a640c23a62f3a-b876103459fmr147653166b.1.1768407044090; Wed, 14 Jan 2026 08:10:44 -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-b86fc303d7esm1449566866b.2.2026.01.14.08.10.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 08:10:43 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v3 1/6] wic: extra-partition: Small code cleanup Date: Wed, 14 Jan 2026 17:10:35 +0100 Message-ID: <20260114161040.941159-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 16:10:46 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229347 - 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 16:10:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78728 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 38D4ED31A38 for ; Wed, 14 Jan 2026 16:10:56 +0000 (UTC) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.13886.1768407046646248476 for ; Wed, 14 Jan 2026 08:10:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ogVqVC0t; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.53, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-b8773fcff60so5021766b.3 for ; Wed, 14 Jan 2026 08:10:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768407045; x=1769011845; 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=s/+AV/zXln/QnECKSwHy4iuUjEmpKREEs/qjLDqP/T0=; b=ogVqVC0txGF553xJtJq8Es5FI+EeWqrB4zoyFILUiYDsri5u9Xb1F6NFQfa6QbEf4B e8ZzxiAgXKx282vvHXfxMR7JgPGJB0FRTzALJ9qoQl9Eqj7dB4JhF0IFc3CjVYwXgcOc pAauuAKuBIMlKUXg0qCDyMGq/mE+id3LsXtrw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768407045; x=1769011845; 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=s/+AV/zXln/QnECKSwHy4iuUjEmpKREEs/qjLDqP/T0=; b=cIrSGTu6C57BMje9Q621DvOMioShyGsqwWP8CH9xO0PwcNg9vtVE7s8KpsYsHjo+Cl 91t+oLHGi8/VdOH8BxntJzxQBlx2NanAM8gRBLeqSwGRLcV2I9hIW/NokihAJnZcfOwX rDo6sIXJ+gqVTdUS7+JQcwjcWSKS4qIxQjiAm/8UMtB6LpnMQCPJoLrJclh0zd1us65d tD8x+rbdRKmcNpylVj1NIsgLvMjVDN9SFHYvnGWgHh67qtIyO7PaITrOl/qqvU0K6W/1 M/r9Wu/HNDi4XDqpdoANXNrdzBDcrWMVOv6iWUtXZFMkrbFoqoUdSrjXkjiYuyTFU7W3 lorQ== X-Gm-Message-State: AOJu0YxqnXJ8kW1PkR40r9HB1xkw1A323OjHy5ueTIalTt7Ao1Or/eOm t0Ha3rGWysDvnLBzZromUcBheddhHYZX4AenrzaGIR6vIzRVxt6wHGMdnnFDTQ85wcAr4+8MsGC NGCqX X-Gm-Gg: AY/fxX7XVHL1DeXAbmMiAvrOUcVFhlwGES8grZVe1HLtonVy37suqR18XI4Xco20Ykd VUYbI9RRzzXQI/JWE1hxHAB3JfmIMd1psAikuIy7FU9UubBnKVCljXEylpWOsrVD5OAKI7adTPC HY80fE7T1wKk5Mis3MgsKsm6aAGn+YZU9dIOgmGxbLDpW2jjG66+FEQhZURU0n7Ow5g4/M7Ptak ZMRCAPckzu8yjuf/AhYrHyeIUvI9tRgMUeh3Fc/1JR8hyFV/9JwytQIcPWecCUXrn1PLheV6h0O /V7sFvHyBa5H0XKroccqxUXz8JHU45l/EXeAKtEMszwfg0JZyl3rY14u67L2sD/57uYFsc7GdVn QDi4oZEd1jDIls2QZqVykgb4mUcFr18DSYj9DryzyqEpbOPHCeZ59fyNs/VSZ7iB9k0fe/1KWFt cJrJxE1SA3nNmnmWo43qtoxtN3kEfjXmFh1VJ09rh42IfvDZkbOgAat0ICRU3tDnkX72XOfJEgF EvHWW0bMDXxMETnSMi0C6Sf3sGgj8Tf10oPjdefshN/3VemzIAcZH2Tk+kailw= X-Received: by 2002:a17:907:e98a:b0:b87:6a6:5fc2 with SMTP id a640c23a62f3a-b87612c8dc2mr141284766b.5.1768407044851; Wed, 14 Jan 2026 08:10:44 -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-b86fc303d7esm1449566866b.2.2026.01.14.08.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 08:10:44 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v3 2/6] wic: extra-partition: Move extra file parsing to a dedicated method Date: Wed, 14 Jan 2026 17:10:36 +0100 Message-ID: <20260114161040.941159-2-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114161040.941159-1-adam.duskett@amarulasolutions.com> References: <20260114161040.941159-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 16:10:56 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229348 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 | 35 +++++++++++-------- 1 file changed, 20 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..aa4fb931c2 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)): @@ -66,9 +57,6 @@ class ExtraPartitionPlugin(SourcePlugin): 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 = [] for src_entry in re.findall(r'[\w;\-./*]+', extra_files): if ';' in src_entry: dst_entry = tuple(src_entry.split(';')) @@ -103,6 +91,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 16:10:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78729 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 3993BD31A3F for ; Wed, 14 Jan 2026 16:10:56 +0000 (UTC) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.13887.1768407047246135559 for ; Wed, 14 Jan 2026 08:10:47 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=eiZS+vfY; spf=pass (domain: amarulasolutions.com, ip: 209.85.208.41, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-64b6f22bc77so1588192a12.1 for ; Wed, 14 Jan 2026 08:10:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768407046; x=1769011846; 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=XS839wYQCt34M6w0vqSouQF8mgM5YG3VWs2swfA2GQA=; b=eiZS+vfYaf8uS/2FCF8+ZxeXfU5oIPVJwAqcg9oHmUwNxmr8jng9u/avUW8GB5E1Sq mZADe7LvYh/1CNpTtWjbjmcvjOytztP0qVP6Emc7Q7DcdPcRmr+7IzhGprk1oSyAV52l ovLO46K3Hpr1d2tpEqxKhNAhH+mfrg1Zw9ZjE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768407046; x=1769011846; 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=XS839wYQCt34M6w0vqSouQF8mgM5YG3VWs2swfA2GQA=; b=MZ9rZPGB2nH6Wis92Jp+F7J8jqRgWbPBbKvLIhUCfCpUsqaZgfaUmC3hwRYDT2DzjU iShpznWKrHcTw2zdEockBox6E4idX/4E5TcDVUHVyvOUDb7b/5WN3by6Z4f0miiXab4W DY871ZwUOkiwrG9KOqsM77n/Zc0VlfZBuGnvxM/CDO2LEDGWy4Vdmju4nn7E62IR1vrg adOe9gutH2m4REA2EghfpXeRzocTgdYTcZRo/XchyxeoqKHc2pOtvf5E/lC7nUvEtDgB MAYiLxj75/VOKnUL0IeQ5xWPciQpausMFm6beJ+r5ugJzWEBduCoBZ9UQZB/fTChSRjY pYyg== X-Gm-Message-State: AOJu0Yx4m4a4efZJ3c/hQuCOxxPJl5eumGcPHIF8XLkfrM8TNNX7vhcB VeOrbNsyOAQRZ2XUMgoImqGSqwAlPbfvHx1vvuykhCFR/ETTKuS9+wwkRBHXTueJGHdAx5INcfH xAvjY X-Gm-Gg: AY/fxX5BB3x38QFCHSfL/a53PKO5kCucOW8/r7c4zV8gUEXtwqHvBSRrlzUNB4Duk9u jddKfGMOK0L2tp3gaxRs5MHAAV8PTB78U+/WlLvtliDRys/K7wbMHUYxjkuU2uPQli79u7cPbjt mX/S6WEXpq5pa7AwzU+7BjyOgM36bdHU9cfpb/itFJ6W+LPpAJ4tN90qnUkKSpkuhqUFri/5Gp/ UN9oqWnuV4F9cdhka46OBShG1ulj6TyqLkU5COP2cVUKLVjxMY+QhkKW2yp4M8P5jDel2w4t3WT sZhZCINL/dYT25Cq3SZh+exfRq9BYnbhGzqfLnfAPiaulYjGBXtRYIrRD+XTSwWrasdcJlUb1eA pm6E7BlTGLDxVpu97RJOfoCF9jfzv92lAvLGEP+NeX9oo1n/+jInaY4dQIa9dYCCIpRlcjycIxR Qd0Ye7bpJbnC4R6hNzCmA3Gs8oWaXOqYxJRJlPN3+Jp9SYWJAmy+n0nWYxjkXG1VkzgZLE9B9XX 54ApyB0bYeOAR1+dj5XzP082kPSxgHvRalqV69fTA6CtJn8+SG1 X-Received: by 2002:a05:6402:35d1:b0:64b:4e7a:bbc8 with SMTP id 4fb4d7f45d1cf-653ec461c8emr1366948a12.5.1768407045592; Wed, 14 Jan 2026 08:10:45 -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-b86fc303d7esm1449566866b.2.2026.01.14.08.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 08:10:45 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v3 3/6] wic: extra-partition: Move extra var handling to a dedicated method Date: Wed, 14 Jan 2026 17:10:37 +0100 Message-ID: <20260114161040.941159-3-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114161040.941159-1-adam.duskett@amarulasolutions.com> References: <20260114161040.941159-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 16:10:56 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229349 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 aa4fb931c2..05b0ace361 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 16:10:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78732 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 459C0D38FE2 for ; Wed, 14 Jan 2026 16:10:56 +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.msgproc02-g2.13865.1768407048058236127 for ; Wed, 14 Jan 2026 08:10:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QALHaEqN; 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-b872cfd35cfso137466b.1 for ; Wed, 14 Jan 2026 08:10:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768407046; x=1769011846; 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=mbqtCxy1aIUAoDNXAqbqLiAPApKlcNCX+JDNcW/83fM=; b=QALHaEqNvpD7yVeF2IXDaNxqgwoeGPZ97k4BIzIBaYqhALyYhq3Ks+bn7T0xMwU7ES etNz2PXqr+P5HBXHwx6xCQCnIZpjU/ZC0kvPFNwSD3xOYIB0/oyiwyJQlecnEl+59N89 6R3nwiYSjPat9m3whgaWh2Oh7mjPoC1U5tBRI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768407046; x=1769011846; 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=mbqtCxy1aIUAoDNXAqbqLiAPApKlcNCX+JDNcW/83fM=; b=ncQ/uMhLkG1x+M8fJCnmPsKA/vDKwm+XASuDVCRtVkJCj4f2I0RGsqAJrnlv4E8iwr tLgtN4IxsfUVCKY+52EuowBpLozEixyl98ZXeA3w8wEhQtgEvirj0usd2Eb9CWm4s1kF oiSUqb0qBSkWiVjCFs4zFE+kXBsRhEx/sywQ8cThPV2DwxoJlYu0FZHcRgIK9BEgD5JX 8jIFfjCdem9E4xB4LHWfCzbZ4DtYLdNDZA1poAL6T2TypHS6m5KHqxvtLfUYwxjdcGet VsVbyO64PBgh/VDWIsbsT/VFJKPE6+Z/P7XHrEswBURSP8OT0+XeLV/53Qn51wUOlbOZ jqEg== X-Gm-Message-State: AOJu0Yx0uBNKWmNbSWTu434hT937MQworXl1MR7wiFM2Yrf26sTkpo21 819yiW+Ct+WHvs1ooXGXlXF+KP6RxrsGNUcwyKXzS/4eJW0aLK63kfsJN5yisINqLtkmYV4kaVi +n0BR X-Gm-Gg: AY/fxX7UNiIWNDvYT32j2uu8LsidTlyiFOlbIVP8VrY4OFUE4wV9d7QvtYQyWCyxh98 fBErtWqOWtK+dsFu8VOAxULlN+lcVYePPJzH13vTmoLRzj0RD0/3xfr8mdFBBqGP/ZB/GmAaYH/ avqsoMNweOvp08oXmQZXGP76TA/IVATLBCrwS/AXS3JG/bughNPrGVHgsN97CRtj8ndOWAKHwFs DpqVWEpI0H5hdIossUgEvSEY8rDRzWhjuWyvRlSCXpA+lcYUK6ff99Nh5u2FoMqJRVQ7zQzcJts Rxj8q7uryTVeVitbrg5hDVrYulrDVvpKtqowu9Ff+XAbwB8uJ/t2ITY/GDXsQFRqOlLloNwEYvK WcXV2y8hZuPjCD+mm/gHrXtBIdLPs+N8aHOzC1qnrhnesQUUPJwp0Zo9rqUiZepmQk2r7lug/ul 8FDRPGNPghwErdb4CX1/WQvETtmNhyLvyNCl4mAbZTBtloC52WMImlafFWWrl935lXuzT8p/l7H SlruC4YgV1RNiPNf9/S91vrcHYnRZDz76qbqTTBP9e9Wm3Hrgov06rsyxm85Ws= X-Received: by 2002:a17:907:948a:b0:b87:2780:1b2b with SMTP id a640c23a62f3a-b87612682fcmr151015966b.4.1768407046499; Wed, 14 Jan 2026 08:10:46 -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-b86fc303d7esm1449566866b.2.2026.01.14.08.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 08:10:46 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v3 4/6] wic: extra-partition: Rename install_task to extra_files_task Date: Wed, 14 Jan 2026 17:10:38 +0100 Message-ID: <20260114161040.941159-4-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114161040.941159-1-adam.duskett@amarulasolutions.com> References: <20260114161040.941159-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 16:10:56 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229350 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 05b0ace361..25aab06c52 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -73,7 +73,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: @@ -92,9 +92,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, @@ -130,7 +130,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 16:10:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78731 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 52223D38FE4 for ; Wed, 14 Jan 2026 16:10:56 +0000 (UTC) Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.13866.1768407048994858587 for ; Wed, 14 Jan 2026 08:10:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=d6lyKF1l; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.49, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-b87174fbacdso67664566b.2 for ; Wed, 14 Jan 2026 08:10:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768407047; x=1769011847; 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=2g1I+HWZAJNoikmyeM5ze9veBb/o99obUBwPzr3ySdI=; b=d6lyKF1lFuXsBdFzDhwlknvsJgf4pbuZdQQl9np8pdeVWSkakLy+sCwSQ710qGKhz3 LjSsN0tjwq58YvY/+FSaEzHa4O0ZZNEvuzebUEYWVzRQYIxCFVFvuBaRTWMAYMJ60Z8F xar0MAa1hcA3fRSmtYebr9YvPZ30MssqUWu7M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768407047; x=1769011847; 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=2g1I+HWZAJNoikmyeM5ze9veBb/o99obUBwPzr3ySdI=; b=Sof+4VvBgOh04wIKXEag6G19pABCjuP9CZ1u9t1xMdMa3JZVz/F4oY70Fx5+tfdPF/ KMNU7c3kLJsbetm2yQaZBD8wPR/V6wkxHNe7VqMibIuuvB/CoTJizYtrWu5pqcUtXNmf Cn32lHENvNFJA/GWfpxZWp0m58eS2gX5hfMZcpw2a0DeXQ8DEd3fJHA1FLcTyV7AKW6s izQSWyEC2gvReKAud3X8j2rBN+GkZC1zY+jwoTjUXaX3s0qpCh15qLh62J6BE86D9XTZ Gz8ZtpV0sqzziST6S6In475ZYdD5iqu5ceECeBDl+24i8u5kZ74TzaCtUlldujn2iANh pemA== X-Gm-Message-State: AOJu0YxQPfccHDjwcLpF9wx8ThvN4QPgFWXpe+mODbN08dAHmU+KpdrY hW56lndKcn2WXY8Wvt4IrSh+Zz0TY+NeHWxF+AQDmhHcfLIP+OJvfbfl0BN7l5akNouvcqymKuA qaUeb X-Gm-Gg: AY/fxX5I3HXdy11xoi+2ZnJ5JcQdKhruhO1o2ajvyk+h08mjro6G5kqaiP6zCloM/bm 3cDIfdN9WuHONkQHcDRs0l57m4gZEzBkFaLFQoWrWa1puj+ZLyhXl/shO+Y152z1uLsgskDYixd QvwkTPvSOzhGtr4CBr380sl49Mn+IEWxjE4GPKQ6TkOULByG3F7r8vIEizN9FmrxtRNK+zZuvXl FAwhGArqAXE3s1SxERsAuqTP30SxllgFrTdt/n3BxNIu5lKPILbRMesXQFhRbIwCBkK0qB3en6h DcDAbEmiGePpzT8yKVk2n0oAnXYz/mpMPGB121iPQJ8irPCicjCA/Jy7l62hQqXpvREFlpY8mze 4tGfkjhhrWzpGHE4JIJJXJ1Z3RKRD3ryzKNbkkcxcBHpyDXnOePioae1ZQkXqnvDz2bWCy+dz+W 60P3Gs+PGQSVbd9SHE8cftq91TOh6dNnf+lRft9Y9jAAmXHRk3cK9J780mKIf2f9Eutixo8pGKJ 41f1V8VVUVNTkt/U5BU5WKOoN4yaU7PYPMVVepiJx2VTGc4WFP8Lnl1vO9LGcc= X-Received: by 2002:a17:906:fd81:b0:b87:1c20:7c5a with SMTP id a640c23a62f3a-b87612d8c3bmr195972866b.8.1768407047266; Wed, 14 Jan 2026 08:10:47 -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-b86fc303d7esm1449566866b.2.2026.01.14.08.10.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 08:10:46 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v3 5/6] wic: extra-partitions: Make extra-files optional Date: Wed, 14 Jan 2026 17:10:39 +0100 Message-ID: <20260114161040.941159-5-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114161040.941159-1-adam.duskett@amarulasolutions.com> References: <20260114161040.941159-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 16:10:56 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229351 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 25aab06c52..3fcf3971a8 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) for src_entry in re.findall(r'[\w;\-./*]+', extra_files): @@ -73,7 +75,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: @@ -130,13 +131,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 16:10:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78730 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 5AD2ED38FE7 for ; Wed, 14 Jan 2026 16:10:56 +0000 (UTC) Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.13889.1768407049843866678 for ; Wed, 14 Jan 2026 08:10:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WeA1cKgu; spf=pass (domain: amarulasolutions.com, ip: 209.85.218.66, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ej1-f66.google.com with SMTP id a640c23a62f3a-b8719f5a2b5so31966b.3 for ; Wed, 14 Jan 2026 08:10:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768407048; x=1769011848; 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=fCrsSPCjpqSneu2kH27tPS7PxKgqwy8LRAPZxMnXR9U=; b=WeA1cKguRZDM/wriT2GBE7uwFYmvQGeuzsrqrZ8rOr88Pb4w86ClRArXxQzkx8Q3pz cJA9Tw6vZlU9P4LvBb4K9g6YBXc5Y41m35OEyieRu2Ro80m3Wp8A6j0DZKRCURMBfFWL WjO0oRD9bGrkunVH+j9TKT9eh2Ep4YVJZp/W0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768407048; x=1769011848; 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=fCrsSPCjpqSneu2kH27tPS7PxKgqwy8LRAPZxMnXR9U=; b=Sge1Voh+YuRLZcrmxWYHkZJI6s0fiJYwQxKLCFMibuzHzqbbn55M4m3VncmGShcMcx /29oonz6D6mz6aNlCSxQTNtAJe7ZPZjDVNS6eFLkOZ6ojieox/Zs3ivgGKgIFtcsGJ0e X9WLcUtZcUIgPkxq30KxyAhRDK+gl38bpzWBja86A6jm4KKIlJwbqzDq6z5Tj7toY30L padO6BkOhhtU8tUE2aw1zJ5sLGRTdmJsHGqK35oFvC4JcTK9KXUa6d3zX/a11FFwfoK5 BCVvE1OrLmE8kH7Ev9ZhCUBQWAYTCZSGP0fvhgwofw3tUxLzb+9nw4yqPKTH1pVwsf3h oC7Q== X-Gm-Message-State: AOJu0YyrDeWZM4edg43lxgadj0hcDPAdkWZArUqFGa+j7/V+FDDIZJlZ 20uDYvm29qos6d1McXIbrcSoNwTjrgJyWIK9RnhFbXorNY2DuPyq5b7KwktSbOMi7eTPPI+wJu9 pdXFoPxM= X-Gm-Gg: AY/fxX6Wc1WmQhrFLH5zxG+yt1lWzcJZWrNYs9/8DlNYx7NeosHFUSLNK/f2AFbBXF9 WSOByE9A4I+BHvXpugqKmhoe0odQ5Frrhr6LSwOdFGEtLBWa4ULSZyCv0pWXGGa1q+rDWuTaLIC JFE8uwF2JOVy4uQp3ZbE0YP8wb68FDRuySHJw5vGkMqtRJ3qHRFoNbuMgpUTLYYpc9Plk6Rwf8n 4yhTO06VSHoMUzcNkdJ20EKo29sn+EObo1nfYRCNyqQitXmH48NmUQL+dhgg9CkrYi/acKvb1yI 9HKY/ecEWG9zJ9hYpR4S5e9l5n1xaUiPuXcQVxobqjNFQXt4f6tQrjuXOKQIZOluDv1PoNnXnLv smHiWij4zdj3ibX0BjzoHw7r3m9aTHEKis8IWio8kBzc+fVtAH+PENbcyni94sdxeKqKymCnAuD MVbSg2mG0Z+/dSAmsBH9b2wjbQfTMYZ9S1sNtYKrs3Z5mZWXAXk2yS8R42jgq+jW5B/skepUYF7 r6QmZwgoAHw/+IUP+H9TaK1r/kZ9/zLkczdllh5WHRVxkCio7iaXxcpYpN19hk= X-Received: by 2002:a17:907:6d17:b0:b76:2667:7736 with SMTP id a640c23a62f3a-b876140b914mr141598466b.4.1768407048145; Wed, 14 Jan 2026 08:10:48 -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-b86fc303d7esm1449566866b.2.2026.01.14.08.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 08:10:47 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v3 6/6] wic: extra-partitions: extend to support extra directories Date: Wed, 14 Jan 2026 17:10:40 +0100 Message-ID: <20260114161040.941159-6-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114161040.941159-1-adam.duskett@amarulasolutions.com> References: <20260114161040.941159-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 16:10:56 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229352 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. v2 -> v3: Remove uneeded logic in _parse_extra_directories meta/lib/oeqa/selftest/cases/wic.py | 11 +++++++ .../lib/wic/plugins/source/extra_partition.py | 31 +++++++++++++++++++ 2 files changed, 42 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 3fcf3971a8..21f8d9e09d 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,23 @@ 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 extra_dirs.strip().split(' '): + cls.extra_dirs_task.append(src_entry) + @classmethod def _parse_extra_files(cls, part, kernel_dir): """ @@ -113,6 +137,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 @@ -131,6 +156,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