From patchwork Thu Jan 15 10:14:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78781 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 AB9EBD4115E for ; Thu, 15 Jan 2026 10:14:42 +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.32413.1768472076977659877 for ; Thu, 15 Jan 2026 02:14:37 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lFTAQ2Ae; 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-64d00702990so128989a12.3 for ; Thu, 15 Jan 2026 02:14:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768472075; x=1769076875; 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=lFTAQ2AeayihHhlGZ5zCl/oVExgye5S1uyfAS/F0ypYX62vC2oUCVfLtWoPsvdv1sU OjW9GdnYi+NHYwp1oQO1h06D9KSswjawHjS7wXgV7aS0pFGBr56gI9G9Oe0dt3gRuPxb oKHfuPd2KNS4U0BQVC3McHevM5jpYPRg9A+sA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768472075; x=1769076875; 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=alayJGHTwrH8Eg7mhDOLpD9AAPvsAK+g+Z1cbfFVz6WmvuNt/rlKhj20X34oya5WK7 e1QO9m0qa5HbsDtf9JMrgPEniC2bfjhghbsZgtxjcOpA60JlP0AN8jY85RVMAknriVbv MDhOynKvGN+JjAZJu1No1EFd8lhOHnqt85ql7Ng901Uis8dPnl51P+la6BsxSZuSLSJ2 kzEgWXFGWxIxYPGk90lTmvOidXWaawK7/gPENsg124W9axfIBjamJWeikLzs110h5TjR +xryhxcaltW/cPspF+ggBxlPDSrW35bz4NEVAMRyRHSYhyRyLXxYtMjuPA1dt4yinqNI NTrw== X-Gm-Message-State: AOJu0YwOe/zYLX67uIiBekltiPf3FnppabAoGWthz8Ra235oQpeES9eZ pb42UoWucw0hq2sBhOc7a4bPO2u7dn6Ax9w9OZljZ3rpeI5t1Onkv53oCs9+TJRjBG1bagW3oO3 3zD2s X-Gm-Gg: AY/fxX4OpJHyjlVRLV9J1axDHrYlTs3Jy/BR6yGV/FpOWSX0FpUoK8E0HMLC+LdNqH/ sqZWgiEhwa4qqLGCbypKBXjYpk4lozfdkdl7gdNw2XlFBeT3b3qighrqdFxzC+Ala/D890CpeL8 q0fwC6p4wjLf5qXmsWcwpdHvLJqV0smd2OIpeG2MmJZEokAOy/n4WmJPjYKDnG+QDFcrd2qBUfr OFdMX0Su6h6TwbJQ2qZhve1X3X5j1zK1V7MRWhxGSl1vJsiNSWAlHuXE5CwzAAVC8Cp6+ojzhiP BFyerTeE+hAQPSUMm0MyoA7/DqsGgqyrSfdIRTE4JxNLSQkZuSlbvR3iRVitX4gni6gXTJzvhyf 17/BiZQcQ4g5F4U13FzAQY6s0YYbve9lTdZ6xNCmkbWBHbstnicX5Dzs4FBPI3Sat0rF0MH68sa Jsi87+AJw2fFQVBGTw0sORdguqyukI3vVmjzQQBlIjOWvPNpDlm/ot60eHhaLeGp3RwZza5//9F fFiAN0AFuEJGJQ7dOY7o5IgBIvuNFqlYoOoPJIuLImkn6dfbC8q5Y73ag== X-Received: by 2002:a05:6402:26c7:b0:64b:aac8:4b9b with SMTP id 4fb4d7f45d1cf-653ec4544fdmr2390334a12.4.1768472075194; Thu, 15 Jan 2026 02:14:35 -0800 (PST) Received: from adam.amarulasolutions.com (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 4fb4d7f45d1cf-6541209cd87sm2038643a12.35.2026.01.15.02.14.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jan 2026 02:14:34 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v4 1/6] wic: extra-partition: Small code cleanup Date: Thu, 15 Jan 2026 11:14:27 +0100 Message-ID: <20260115101432.162696-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 ; Thu, 15 Jan 2026 10:14:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229399 - 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 Thu Jan 15 10:14:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78783 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 DF264D41163 for ; Thu, 15 Jan 2026 10:14:42 +0000 (UTC) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.32415.1768472077571564264 for ; Thu, 15 Jan 2026 02:14:37 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Q2nbcKjA; spf=pass (domain: amarulasolutions.com, ip: 209.85.208.46, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-6505d1420daso93067a12.0 for ; Thu, 15 Jan 2026 02:14:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768472076; x=1769076876; 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=Q2nbcKjA6h+Twx3aGqhu8B+vNAHSoWgUjr3XodMXd4CQ8UuDnPetzGfUFAOgzqFkIM ne1T/ZBXnTj1tYnje63LVD1Kfg+/5GKQr863ZA5LxyPoIEBO5ICFnyS8V55ltW7HPuA1 4bK8N7GOCyK+O2mGH3tBzcP1wUA+A+T3Ed19k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768472076; x=1769076876; 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=ZG7aq+5gn0I+HgdwedC+soW+jGpCH7oR3O69UMlE+zSvcyXiCqIcjT7/zSOt+Q7nj9 L/+IgxZ6YRCUvqZMx3vkEEo60lW32a8fb2e4uYsTc6layk0knjuGwC/687M76aRG4b+6 wVFi99v7fLX9Vx0JsnlZm1p3byxaMVW7ks5XhofOMcrf/u4P+E1qUd03c8Bqv8WSFkkJ arbc7YSfUmJs3yunT1ZfTSD4TMCAnCUPzAPTjSCsqsMRzYSVSDq6/9zxq7J+DD/2AcsF ALIcPmsBFdmnl/KPXvyODKhNBg9GxU7dPpPNyGF4Xa4Spe1kJNDp05H/c+HTBs/3eJvS K6lw== X-Gm-Message-State: AOJu0Yz3cWsQfGNt4IJHuY97LDXzrtIqjrabSgf9MsSpKzsxK6a+TQth fP2DR6e+ECxYTAkWwDbkqfj8VLp+z8oriEIPqz/ulu0QxfGvUUSjZFx5yFSUpGSVJuKoSSugcYG UukXZ X-Gm-Gg: AY/fxX5LUcdJKHJDmFZp6RQfsOV9R834QbNwt9e04DBPZVEWipdCjQfZzZuD70veslM C3x6xEkyd1C9EV4bNHfHgwQAmbgDanjqdg/7Ng36Z9G9aYNPfNyQ5d3/PDGzJ1u5u8xCau+bUKH JELqYTBpW83xItyMf8VjGWmHJZm3wmnDJ7ikENQY6PRw8zen8Vd+ZcjnUExUK2LJT4oUNgCDp+X XpDs80f7j4OFNUmPwKOcgCQsZB/SgluGo4JTTQzgWt9ogNkZH5inxDXJDbgakZAFveAgSUfW/6A U2Lw/1QHa51hdPrzDNI55zgBI+vlxnxXv+XPktW6cZb8zv8TQaeXdRz3vebkLP+tuvM6qL392wv Fm6elLcqMhc+KdooE2CNvUYLJTWYVQN6BwGrkDsBDI0i6rzvEttn+GbZCUeHXu4t3hvyOkAvD4y SG3AxvD2mPCyJMhkMsrBaTr1qVKPic9WVW7WLngtL7r/mdNy4sVOcKHtf7ZqAjvtqnX+WB02vs3 Zm01FC1jnribhQhhDQPMa2ylfXR2miLGjPRaT24uEuEqazFZeIA+RFPIeiiSrsqvIva X-Received: by 2002:a05:6402:1ed6:b0:64d:1bbf:9548 with SMTP id 4fb4d7f45d1cf-653ec46eccemr2637656a12.6.1768472075958; Thu, 15 Jan 2026 02:14:35 -0800 (PST) Received: from adam.amarulasolutions.com (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 4fb4d7f45d1cf-6541209cd87sm2038643a12.35.2026.01.15.02.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jan 2026 02:14:35 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v4 2/6] wic: extra-partition: Move extra file parsing to a dedicated method Date: Thu, 15 Jan 2026 11:14:28 +0100 Message-ID: <20260115101432.162696-2-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115101432.162696-1-adam.duskett@amarulasolutions.com> References: <20260115101432.162696-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 ; Thu, 15 Jan 2026 10:14:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229400 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 Thu Jan 15 10:14:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78780 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 AA414D4115D for ; Thu, 15 Jan 2026 10:14:42 +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.32362.1768472078429716682 for ; Thu, 15 Jan 2026 02:14:38 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Zaj+g+KO; 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-64b5b22f723so131122a12.2 for ; Thu, 15 Jan 2026 02:14:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768472077; x=1769076877; 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=Zaj+g+KOwHAtogsnlgMoYbnqWlIkkQOu1KB6Vdd0qu+7VZJj6/IZkPHKRbFxLzTE6Y /y8wdeb3SOdbj1bjptFBxo8F8qyYqZzn4uuw1DmzFwqHbyQbF2HRXlmToaRSTBS3ieWZ matN7aG788ali+heDJvfFf3huKc5SCWbbfAgY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768472077; x=1769076877; 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=Pm0GZM0uyoB7fW3rDYQCytF/9tbM3YuHAIgJOoTSJV2XenFwYChtLxOIEEi/NK9Qle wtx8DnfcoTAcvzNN+RCS6s/bzRQT+DKbN72AppcVu3UgxdZ90b1QTz+F13eAu7pGj40p fU0Kp14aLv3gCY7M20i6NFaTPm8o5jOy3nrXycmmT67OjbbxzbjTKVI9kz1fiz/QXLV8 c1mmTB0J4YC8pbhXJ4yovW4zlEIe0OtX0Gu4cE1EGTLwX0c7c4qEoDJNItrf8J4AUyoR 707wABD6OaawQD2uReV1R0Z/47cndYqadjigcOBr4yedUswyVtV6XRB6eRzW8kaavQCh Jbag== X-Gm-Message-State: AOJu0Yw+pYm6DuYgjleQlGKBdMK0FyuiDAZr+tP8LZLUuwLw+kFB3+SS u6lljpqNPVuUhz2nM0+KA8OmwxArql80wpHQ8JKntqFsvUR2Uc85M5/KIN1WqM0AjOVR502lB1h 5MCKz X-Gm-Gg: AY/fxX7G0psEqnP8EzgHDbWB8OcTig65ZRL9VlDuiQDAJMG0EvA4yIulSc8aqh1D282 8VOm/EbkTTWK7P7wEY6zXyOd4gqOKrGufLi3pCj2+UWmSvXpwgT69uGX03DD43RdoTthL+/bXFD dkSkwiwNNwloSxaErLwwDU/YgV38jFE512xCrVHZcYOQeK4RgMZ4HcpHGn5ZRh/zVgeVIdJYevW MfHvm3qE9v+de77n/dQi+ZggfpmJD4SZIk2utaymYQ8dWuS49gxG/9XT9pgA+IZIBFhHczptsM/ NBsWYvh7Av5kYM0bW3bxTVGxivZiudh1KdsQmUHkPGh3kBOfaJ/xC94AZ2gIv2KKr5N6GfQx7BQ 3gHSwsEOuvhgxwxuRwcEVIT6o2bNIiQ47Wsu1JpB241y6FUu7Ylhiu/1NTHl5E4N3BIH/J9T6Tj 5gljDvexQKUNPTh8k1df+cwRlEs4/LW2Zpb02DtxygFnzxlLKseau84VfQPv1dA82VDyehdaxJ9 +g0XvRBAFqRomf8TjQLb6o4HDLFKSMNIieBQtemFBz8PzN5yBF5kYDpPg== X-Received: by 2002:a05:6402:35ca:b0:64d:2889:cf4e with SMTP id 4fb4d7f45d1cf-653ec47d79emr2639796a12.7.1768472076816; Thu, 15 Jan 2026 02:14:36 -0800 (PST) Received: from adam.amarulasolutions.com (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 4fb4d7f45d1cf-6541209cd87sm2038643a12.35.2026.01.15.02.14.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jan 2026 02:14:36 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v4 3/6] wic: extra-partition: Move extra var handling to a dedicated method Date: Thu, 15 Jan 2026 11:14:29 +0100 Message-ID: <20260115101432.162696-3-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115101432.162696-1-adam.duskett@amarulasolutions.com> References: <20260115101432.162696-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 ; Thu, 15 Jan 2026 10:14:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229401 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 Thu Jan 15 10:14:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78784 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 BCBB5D41161 for ; Thu, 15 Jan 2026 10:14:42 +0000 (UTC) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.32364.1768472079080674019 for ; Thu, 15 Jan 2026 02:14:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SdlaH8M/; spf=pass (domain: amarulasolutions.com, ip: 209.85.208.54, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-64b5b22f723so131123a12.2 for ; Thu, 15 Jan 2026 02:14:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768472077; x=1769076877; 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=SdlaH8M/Ln6+gXRQCCbNpA6Gp+AIaRjLRtn8SFBBKgzMv1wIlSpsJbXH43kxgCNKjS OrVNGD0FNiJnMm1nxOxzD0aSx0/ub5tib1f5ubzX451bSmbDzRXa5EHZVfA6la+ojW6u fgkBvGD04+wUrNjF9SQ2dDHdxIS3AFlFFVyDk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768472077; x=1769076877; 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=I08LES0EyIM64FcXraIwKwmkueb9zorXZPh+yIoxnXqMxnFv99ONyUUeSPhEb7y2jS +oXrsLIuLB9TimsFUZFFkQIHYr1WNXYVkjctzncZfQ46pA/ixDOuI2hp+ZJveA4nqsQA 8svxqFc8jeBflNeCr0OsgDso2ZMh8qOIhjlQcJpr2S+4xyx5Qv+Md4wcU/zea+tyXaym KyXsHX65uOjQFxr/t9XAY64fgaRpKJCcV57h0dRzN/b7MyOAY6mvLhu0UenX/Kaa/mpc WhF6KtAfc9d6UStDrl2bhFscMXdmztt2TTOF2JYKlZ6CmHmejSJQ5k+QBye4FVSz+BBk +LRg== X-Gm-Message-State: AOJu0Yw22sHRnLMrvlV10/x9vVZkIZQKOMIxP8nDeTFddIOQmwSBR/Fx OBqkDlEzfxO7QmJnQp3T86HGL54zVSipcvvxyKxNOdpE4uRrD9jveuba85kHvm2662gRjCpUz2D KCHh3 X-Gm-Gg: AY/fxX72SfNVf4r47lLWaofA1Cl5j5Xxu2c2TAc+VgE0oQkFCKvglemH1Y1SVA9WgfW IuQ09IcZu1CEFDnv/QcdLxbhL78iGpYIJ5qMnV1Ja3WUFi5fvmBAygrakaDLq+lCvnzDCFYHjoq Dba4cwHcgXdQweYUXl1D69ntGnfJ8UC9QpssX8eFul/YJs86z0e6wkf9rTGsTfqS9gUaDrY+sAp LMp4e4rVbIsOnhqBJnD9o5sR3fHlyQkrYiWPyUbDitdcK0XKz/HDqWIUzcANNzJVIV35VNv5m1p QpZQnVZYd8D9Enz7vLkF9nXCHOzxSsoFD4KjwEC1CKu4jVnwz4vpSjHtuiOw7igQsnjQnmmpN7G PznUetlJoWXVZsYUPhVjOe1p5JnwYaZ/VII/LZp+23QoDBk5MrbCogKrjTyWKFbl/tkDGUcT2HB t8bT+CR1kufmUnF5nyIiUrxUy6btU8oYAdbQxRUzPL2i7COI4ROkKluOMgGJRc4P1VerXCVuxj2 u/tcFIyHByGW0QzXUysAL/K6ShXCFBxEKIFxn3qBn36wq929pKUaCjmCg== X-Received: by 2002:a05:6402:40ca:b0:64d:521e:161a with SMTP id 4fb4d7f45d1cf-653ec466877mr2548187a12.5.1768472077499; Thu, 15 Jan 2026 02:14:37 -0800 (PST) Received: from adam.amarulasolutions.com (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 4fb4d7f45d1cf-6541209cd87sm2038643a12.35.2026.01.15.02.14.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jan 2026 02:14:37 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v4 4/6] wic: extra-partition: Rename install_task to extra_files_task Date: Thu, 15 Jan 2026 11:14:30 +0100 Message-ID: <20260115101432.162696-4-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115101432.162696-1-adam.duskett@amarulasolutions.com> References: <20260115101432.162696-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 ; Thu, 15 Jan 2026 10:14:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229402 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 Thu Jan 15 10:14:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78782 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 BD74BD4115F for ; Thu, 15 Jan 2026 10:14:42 +0000 (UTC) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.32416.1768472079875506180 for ; Thu, 15 Jan 2026 02:14:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DaAkI9Df; spf=pass (domain: amarulasolutions.com, ip: 209.85.208.44, mailfrom: adam.duskett@amarulasolutions.com) Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-64d0da6019fso87072a12.2 for ; Thu, 15 Jan 2026 02:14:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768472078; x=1769076878; 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=ayCW3fi/Ht9Rf6CFlDAqN9uPwO2sghnJiPGCCvGi5j4=; b=DaAkI9DfIm/Vt7bHIkJ/Qac8nSkB+pRcL1zPA7ofF4CIXZYk75F2tfPd3OF1+2QEni 1EcCndgSUHxZ+/Y6esW/Vz9HKtGMkrhzX7GIJXVlC1CiV3Ph6CCcpZd14OEzw4o1Iz8M pCNkS1aLbvOQtRYmyxRNmJrDlLFRVl65PJFgY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768472078; x=1769076878; 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=ayCW3fi/Ht9Rf6CFlDAqN9uPwO2sghnJiPGCCvGi5j4=; b=PF3crWayxH/wnQggQ6BcMc1F9DHSv71wlY3rul68qQP/J4iEIk3Vj3KeGYeEKlJa6H g5q1nW/9hy0y0hBjEmOE0LRlxRDngwP+a/oaY6q3M3ilSclUkRnI5x31hNSlPG59Y5ZU aumB9EzQ0FxOmFsStz+oFhjeN6U4uuvPsvRBdwyOOxtoneI2ZyeowMeMDLYv8XueGgFN fyNK8ENDSpTJ0oTzAMefc96MNmVetsPCcvVzUMUtQuCn0+3kOn7uBXmBBQIfkPcBvyvq XPqGPQARneUnAnsFpiDnVYCsrWxx189dI46AW7JDSamHDzd0cGuK9+oD1XAtNk5p5RBq i7LA== X-Gm-Message-State: AOJu0YwvESs7CxsFYKeqPzoKQX/aAKwebWnQIh41ThWv30IIujNPyTRe v+pMbCDq4P0g3JJSrwUkX7bWFtornWURJAiVrhzikvVsthTbDYBj91rBmfNdD8m83SqONTai3o8 Nrkau X-Gm-Gg: AY/fxX7+HrWEmIOhcENrOCxz9kdVa+bklsEbVYAvulD2AMAS349FwAClCKdioFFGVoa o3HBRtlLHc2jBdNMeYKOeVKlqkfzcwZs/G+Z29KKW2ectR9fDOA571a7zVwUfWgE6FkvoWUlLvr mDtWClQ4apVrTtf3LAPpNVdIPrMJk3PqHz+/eG1qH7FiCSWlsn1cuOSHDMqk6XiCaxDAKkBBXNu tba0f3hsi4KgyTIx1Y4M5VegKAa+GnZWr/wL5B83tbVKp592MI7S0/idbMGTnfq//3zOWT8EQvS gAswPF/kWM6IJnY+A5vt2t+//DfR2/O4GKRMqLML288T0aWXIgRlcqb0438rvpKzepcry3jc5bA IUzkb90ldJDizX3FLMftuHdcZfX3MXVuaRF6kpxY7YkshtCDKkJ9ZRRIHuQodtbGV1Jn/DZltU/ sy7E5VTfFNQp+2bjWxc4NNouYAK6oaIVylpTtW3yN5k8Yip3+9AXlPusEv52KLH44iYk7t/XWB3 TwFjcooqO92HtIT/sxZq7apHkxEO2OhOfaZCCloid/jDOGSuQo4JFbeAw== X-Received: by 2002:a05:6402:3581:b0:649:9c37:5d5f with SMTP id 4fb4d7f45d1cf-653ec46b04amr2703051a12.5.1768472078209; Thu, 15 Jan 2026 02:14:38 -0800 (PST) Received: from adam.amarulasolutions.com (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 4fb4d7f45d1cf-6541209cd87sm2038643a12.35.2026.01.15.02.14.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jan 2026 02:14:37 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v4 5/6] wic: extra-partitions: move extra-files WicError to do_prepare_partition Date: Thu, 15 Jan 2026 11:14:31 +0100 Message-ID: <20260115101432.162696-5-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115101432.162696-1-adam.duskett@amarulasolutions.com> References: <20260115101432.162696-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 ; Thu, 15 Jan 2026 10:14:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229403 For organizational purposes, move the raised WicError if extra files isn't provided by a user to the do_prepare_partition method and rewrite the message to be more clear if a user wishes to create an empty partition. The original error is changed to a warning in the event a user has a typo in the variable. For example: IMAGE_EXTRA_PARTITION_FILES_label-fooo = "bar.conf" part --source extra-partition --fstype=ext4 --label foo Signed-off-by: Adam Duskett --- v1 -> v2: If the list is blank, print a warning instead of an info. v2 -> v4: Raise an error in do_prepare_partition instead of making extra files optional. Extend error message. .../lib/wic/plugins/source/extra_partition.py | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/scripts/lib/wic/plugins/source/extra_partition.py b/scripts/lib/wic/plugins/source/extra_partition.py index 25aab06c52..62a7b4b1d3 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: @@ -125,18 +126,25 @@ class ExtraPartitionPlugin(SourcePlugin): """ extradir = "%s/extra.%d" % (cr_workdir, part.lineno) + if not cls.extra_files_task: + raise WicError("Entry #%d does not have a corresponding %s variable set!" + "If you wish to create an empty partition, remove " + "--source extra-partition from the wks file" + % (part.lineno, cls.image_extra_partition_dirs_var_name)) + 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") - 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 Thu Jan 15 10:14:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 78785 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 C96F0D41164 for ; Thu, 15 Jan 2026 10:14:42 +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.32365.1768472081548922783 for ; Thu, 15 Jan 2026 02:14:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PgsYZ2DC; 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-64b6f22bc77so84825a12.1 for ; Thu, 15 Jan 2026 02:14:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1768472080; x=1769076880; 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=DNTCV7/dljVrxCqByE5lmxqCZA5C1/JZqT4yqBF81kg=; b=PgsYZ2DClyr8tvnxcPKTKaI7vhThSFE1mEkqU+ERmWxk4xLHUJmu0DteWL3Sv6oe02 BXBogTKrPkbiiR+XpkH6qhXzss1B5mdSYGnG0AMeELUnOleFRur4O20s3Wdu2Upmgcvi UiOwQEpdmDKWNLKGQJy06wZuZjqdpOxpIxABQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768472080; x=1769076880; 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=DNTCV7/dljVrxCqByE5lmxqCZA5C1/JZqT4yqBF81kg=; b=YRxfCoskKuGxIbyJ3e28pPCOOIy6+sLve8kwS6oUKxwq/vSTzRelB+jK/ZyoiekFF4 8OXVBJ1VO40AjKkmw7Ua07eWZT+yVSKiw+BOb8a/riLmwJs30Is/r1oVMAztwVxy8hn6 S1wGDBXoZ10MRGHpKp9UXDHptMoUPgjS7dA3nxA9Vrp8jT76Y4ddMsqpzVbQ51cLPMPS ol1N/K8BjXrNjHSMb6MxQ4isOe7u1/R7xudiB9K9ZEKTaXq+HM1zpgLtWTKmv0jHsylW cqbHmMcp3TmnqT6L5Avr6nZNCedleBVDG0kAkcxebZrNS4GrPLpmXcMGDKyW+LlJqaPn JhNA== X-Gm-Message-State: AOJu0YyrJhP6H3oqwIqhVT+bYE9mOkbUF5y+IsiH0nWyJe6nXD0+ddaG 6dy98dW7aPT7agYNIG4lxJ6S3Ivcv13/Sdv1K2m968XZ7D8MreoWAcx7VWMDw4yhiWoAqDQeAR3 aVRwEsC8= X-Gm-Gg: AY/fxX7y1TkWzTSBG8iFp8k2wVkBaET9v00CUvmmoUSOlm+ezqABXpA8L9efsRyk6Yg cMRF8T+xnDGlzys5YtGBe2UVhqW9cF5CGJkmesRa6ZNgX4DexLYKqOw6fmt9M3CDCt39x+BnIlc bCD2tSfU2Vy/Sz25jRmOABJbEVEeGj3uv4//KltRJcpjx9ZZvkJn9/llWIHAhWdPHejSloBuKe0 E6B4n8UBx+95momTm3ldNa9lvYs1i1c6qRVQLDbmfdihE2mCH8tbBfG7hq4ubAMwewcBxJRGmK5 Tol+ufqZFFuV7JVsXMah4Uw/V7BZ9BXsZkf1IM/URi8lFkofrkjxw5L76ezbFywl89TOVYI+ATg 8kTmmL0srdyK78VTcFRK4AwP35CFcBXB2yvFWgwMGasjcHcQAa5FS4ufMWxkO+ItPGOz+VzTwes C/k8/MqGqePpCNe6P5wK2aKevyahzJb3qRyr+3x/05/yqTsUBJ7/+S0fclpWfSj2jWBAwCORy51 10bFnvGfCsZWc+GZJdrPzqpO5kqIIfG3YR0Rs24YsATTo9e3L1GW9vgqw== X-Received: by 2002:a05:6402:35d1:b0:64b:4e7a:bbc8 with SMTP id 4fb4d7f45d1cf-653ec461c8emr2515983a12.5.1768472079906; Thu, 15 Jan 2026 02:14:39 -0800 (PST) Received: from adam.amarulasolutions.com (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 4fb4d7f45d1cf-6541209cd87sm2038643a12.35.2026.01.15.02.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jan 2026 02:14:38 -0800 (PST) From: Adam Duskett To: openembedded-core@lists.openembedded.org Cc: Adam Duskett Subject: [PATCH v4 6/6] wic: extra-partitions: extend to support extra directories Date: Thu, 15 Jan 2026 11:14:32 +0100 Message-ID: <20260115101432.162696-6-adam.duskett@amarulasolutions.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115101432.162696-1-adam.duskett@amarulasolutions.com> References: <20260115101432.162696-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 ; Thu, 15 Jan 2026 10:14:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/229404 - Add the ability to define a space-delminated list of directories to create on the extra partition. - Extend the fail condition to fail if both extra directories and extra files is not defined. 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 v3 -> v4: Rework to error if extra directories and files are not set. meta/lib/oeqa/selftest/cases/wic.py | 11 +++++ .../lib/wic/plugins/source/extra_partition.py | 43 +++++++++++++++++-- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index d7a9b14658..83072deaae 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 62a7b4b1d3..185fcab585 100644 --- a/scripts/lib/wic/plugins/source/extra_partition.py +++ b/scripts/lib/wic/plugins/source/extra_partition.py @@ -13,20 +13,29 @@ logger = logging.getLogger('wic') class ExtraPartitionPlugin(SourcePlugin): """ Populates an extra partition with files listed in the IMAGE_EXTRA_PARTITION_FILES - BitBake variable. Files should be deployed to the DEPLOY_DIR_IMAGE directory. + BitBake variable or directories listed in the IMAGE_EXTRA_PARTITION_DIRECTORIES Bitbake variable. + + Directories are created automatically. + Files should be deployed to the DEPLOY_DIR_IMAGE directory. The plugin supports: - Glob pattern matching for file selection. - 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 \ " @@ -34,6 +43,7 @@ class ExtraPartitionPlugin(SourcePlugin): """ name = 'extra_partition' + image_extra_partition_dirs_var_name = 'IMAGE_EXTRA_PARTITION_DIRECTORIES' image_extra_partition_files_var_name = 'IMAGE_EXTRA_PARTITION_FILES' @classmethod @@ -50,6 +60,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 +140,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 @@ -126,17 +154,24 @@ class ExtraPartitionPlugin(SourcePlugin): """ extradir = "%s/extra.%d" % (cr_workdir, part.lineno) - if not cls.extra_files_task: - raise WicError("Entry #%d does not have a corresponding %s variable set!" + if not cls.extra_dirs_task and not cls.extra_files_task: + raise WicError("Entry #%d does not have a corresponding %s or %s variable set!" "If you wish to create an empty partition, remove " "--source extra-partition from the wks file" - % (part.lineno, cls.image_extra_partition_dirs_var_name)) + % (part.lineno, cls.image_extra_partition_dirs_var_name, + cls.image_extra_partition_dirs_var_name)) 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") + 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