diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-06-13 17:20:52 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-06-16 17:57:30 +0100 |
commit | d672a6c43f1791dc5e99305c3c028f1e206e6d2e (patch) | |
tree | 3d6f85e01bbd339d38a77df3954290170a4d6526 /scripts/lib/wic/partition.py | |
parent | a65fd2b9d58a9b7dc4c17a557eee555356334c2c (diff) | |
download | poky-d672a6c43f1791dc5e99305c3c028f1e206e6d2e.tar.gz |
wic: Avoid problems with "-" characters in plugin names
Remap "-" characters in plugin names to "_" so wic plugins
can be extended using standard python class inheritance.
This change means wic files can be incrementally updated over time
to the correct name rather than breaking everything. Actual plugin
module files will need to be renamed as done in previous patches.
Also remove a double call to get_plugins() which isn't needed.
(From OE-Core rev: 6d9c76196ffad39e628aff76d53d6ecbb517cfa1)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/partition.py')
-rw-r--r-- | scripts/lib/wic/partition.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index 5b51ab214f..b34691d313 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py | |||
@@ -164,6 +164,9 @@ class Partition(): | |||
164 | 164 | ||
165 | plugins = PluginMgr.get_plugins('source') | 165 | plugins = PluginMgr.get_plugins('source') |
166 | 166 | ||
167 | # Don't support '-' in plugin names | ||
168 | self.source = self.source.replace("-", "_") | ||
169 | |||
167 | if self.source not in plugins: | 170 | if self.source not in plugins: |
168 | raise WicError("The '%s' --source specified for %s doesn't exist.\n\t" | 171 | raise WicError("The '%s' --source specified for %s doesn't exist.\n\t" |
169 | "See 'wic list source-plugins' for a list of available" | 172 | "See 'wic list source-plugins' for a list of available" |
@@ -178,7 +181,7 @@ class Partition(): | |||
178 | splitted = self.sourceparams.split(',') | 181 | splitted = self.sourceparams.split(',') |
179 | srcparams_dict = dict((par.split('=', 1) + [None])[:2] for par in splitted if par) | 182 | srcparams_dict = dict((par.split('=', 1) + [None])[:2] for par in splitted if par) |
180 | 183 | ||
181 | plugin = PluginMgr.get_plugins('source')[self.source] | 184 | plugin = plugins[self.source] |
182 | plugin.do_configure_partition(self, srcparams_dict, creator, | 185 | plugin.do_configure_partition(self, srcparams_dict, creator, |
183 | cr_workdir, oe_builddir, bootimg_dir, | 186 | cr_workdir, oe_builddir, bootimg_dir, |
184 | kernel_dir, native_sysroot) | 187 | kernel_dir, native_sysroot) |