mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-05 05:04:44 +02:00
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:
parent
a65fd2b9d5
commit
d672a6c43f
|
@ -180,6 +180,8 @@ def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir,
|
|||
os.makedirs(options.outdir)
|
||||
|
||||
pname = options.imager
|
||||
# Don't support '-' in plugin names
|
||||
pname = pname.replace("-", "_")
|
||||
plugin_class = PluginMgr.get_plugins('imager').get(pname)
|
||||
if not plugin_class:
|
||||
raise WicError('Unknown plugin: %s' % pname)
|
||||
|
|
|
@ -164,6 +164,9 @@ class Partition():
|
|||
|
||||
plugins = PluginMgr.get_plugins('source')
|
||||
|
||||
# Don't support '-' in plugin names
|
||||
self.source = self.source.replace("-", "_")
|
||||
|
||||
if self.source not in plugins:
|
||||
raise WicError("The '%s' --source specified for %s doesn't exist.\n\t"
|
||||
"See 'wic list source-plugins' for a list of available"
|
||||
|
@ -178,7 +181,7 @@ class Partition():
|
|||
splitted = self.sourceparams.split(',')
|
||||
srcparams_dict = dict((par.split('=', 1) + [None])[:2] for par in splitted if par)
|
||||
|
||||
plugin = PluginMgr.get_plugins('source')[self.source]
|
||||
plugin = plugins[self.source]
|
||||
plugin.do_configure_partition(self, srcparams_dict, creator,
|
||||
cr_workdir, oe_builddir, bootimg_dir,
|
||||
kernel_dir, native_sysroot)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user