From: Adam Duskett <adam.duskett@amarulasolutions.com>
To: openembedded-core@lists.openembedded.org
Cc: Adam Duskett <adam.duskett@amarulasolutions.com>
Subject: [PATCH v5 2/6] wic: extra-partition: Move extra file parsing to a dedicated method
Date: Fri, 16 Jan 2026 10:32:11 +0100 [thread overview]
Message-ID: <20260116093215.26108-2-adam.duskett@amarulasolutions.com> (raw)
In-Reply-To: <20260116093215.26108-1-adam.duskett@amarulasolutions.com>
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 <adam.duskett@amarulasolutions.com>
---
| 35 +++++++++++--------
1 file changed, 20 insertions(+), 15 deletions(-)
--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,
--
2.52.0
next prev parent reply other threads:[~2026-01-16 9:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-16 9:32 [PATCH v5 1/6] wic: extra-partition: Small code cleanup Adam Duskett
2026-01-16 9:32 ` Adam Duskett [this message]
2026-01-16 9:32 ` [PATCH v5 3/6] wic: extra-partition: Move extra var handling to a dedicated method Adam Duskett
2026-01-16 9:32 ` [PATCH v5 4/6] wic: extra-partition: Rename install_task to extra_files_task Adam Duskett
2026-01-16 9:32 ` [PATCH v5 5/6] wic: extra-partitions: move extra-files WicError to do_prepare_partition Adam Duskett
2026-01-16 9:32 ` [PATCH v5 6/6] wic: extra-partitions: extend to support extra directories Adam Duskett
2026-01-16 10:39 ` [OE-core] " Pierre-loup GOSSE
2026-01-19 8:55 ` [OE-core] [PATCH v5 1/6] wic: extra-partition: Small code cleanup Antonin Godard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260116093215.26108-2-adam.duskett@amarulasolutions.com \
--to=adam.duskett@amarulasolutions.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox