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>
This commit is contained in:
Richard Purdie
2025-06-13 17:20:52 +01:00
parent a65fd2b9d5
commit d672a6c43f
3 changed files with 8 additions and 1 deletions

View File

@@ -203,6 +203,8 @@ class DirectPlugin(ImagerPlugin):
source_plugin = self.ks.bootloader.source
disk_name = self.parts[0].disk
if source_plugin:
# Don't support '-' in plugin names
source_plugin = source_plugin.replace("-", "_")
plugin = PluginMgr.get_plugins('source')[source_plugin]
plugin.do_install_disk(self._image, disk_name, self, self.workdir,
self.oe_builddir, self.bootimg_dir,