[linux-yocto] Custom wic imager plugin

Ed Bartosh ed.bartosh at linux.intel.com
Mon Nov 6 01:53:34 PST 2017


On Sun, Nov 05, 2017 at 11:42:33PM -0500, Paul Knopf wrote:
> This was applied on to the pyro branch.
> 
> From a0257c78cf918b84c7a5eb2730f8f783c175042d Mon Sep 17 00:00:00 2001
> From: Paul Knopf <pauldotknopf at gmail.com>
> Date: Mon, 30 Oct 2017 01:32:15 -0400
> Subject: [PATCH] Added support for customizing the imager plugin to use in
>  wic. It was hard coded to use the 'direct' plugin.
> 
> ---
>  scripts/lib/wic/engine.py | 2 +-
>  scripts/wic               | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
> index f59821fea6..9f95cb64e5 100644
> --- a/scripts/lib/wic/engine.py
> +++ b/scripts/lib/wic/engine.py
> @@ -184,7 +184,7 @@ def wic_create(wks_file, rootfs_dir, bootimg_dir,
> kernel_dir,
>      if not os.path.exists(options.outdir):
>          os.makedirs(options.outdir)
> 
> -    pname = 'direct'
> +    pname = options.imager
>      plugin_class = PluginMgr.get_plugins('imager').get(pname)
>      if not plugin_class:
>          raise WicError('Unknown plugin: %s' % pname)
> diff --git a/scripts/wic b/scripts/wic
> index a5f2dbfc6f..15e23211e5 100755
> --- a/scripts/wic
> +++ b/scripts/wic
> @@ -138,6 +138,7 @@ def wic_create_subcommand(args, usage_str):
>                             "bitbake variables")
>      parser.add_option("-D", "--debug", dest="debug", action="store_true",
>                        default=False, help="output debug information")
> +    parser.add_option("-i", "--imager", dest="imager", default="direct",
> help="The wic imager plugin")
> 
>      (options, args) = parser.parse_args(args)
> 

Thank you for the patch!
+1

> -- 
> 2.14.2
> 
> 
> On Tue, Oct 31, 2017 at 8:32 AM, Ed Bartosh <ed.bartosh at linux.intel.com>
> wrote:
> 
> > On Sun, Oct 29, 2017 at 10:03:46PM -0400, Paul Knopf wrote:
> > > I am able to create and use custom source plugins for wic, all good.
> > >
> > > However, I can't figure out how to use a custom imager plugin. The code
> > has
> > > support for it, but it is hard-coded to use "direct" as the plugin. There
> > > is no way to configure it.
> > >
> > > https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/
> > scripts/lib/wic/engine.py?h=pyro#n187
> > >
> > >     pname = 'direct'
> > >     plugin_class = PluginMgr.get_plugins('imager').get(pname)
> > >     if not plugin_class:
> > >         raise WicError('Unknown plugin: %s' % pname)
> > >
> > > Is this an oversight? Would you guys accept a patch?
> >
> > Looks like it is. Sure, please send a patch. I'll be happy to review it.
> >
> > --
> > Regards,
> > Ed
> >

-- 
--
Regards,
Ed


More information about the linux-yocto mailing list