Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2] wic/isoimage-isohybrid: check for grub-mkimage
@ 2017-01-04 19:04 Ioan-Adrian Ratiu
  2017-01-04 20:12 ` Ed Bartosh
  0 siblings, 1 reply; 4+ messages in thread
From: Ioan-Adrian Ratiu @ 2017-01-04 19:04 UTC (permalink / raw)
  To: openembedded-core; +Cc: ken.sharp

The isohybrid plugin uses grub-mkimage but doesn't make sure it gets built.
Add a check to avoid the following error:

Error: A native program grub-mkimage required to build the image was not found (see details above).

Wic failed to find a recipe to build native grub-mkimage. Please file a bug against wic.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 849fd8bea3..d616316d61 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -242,6 +242,11 @@ class IsoImagePlugin(SourcePlugin):
             msger.info("Building mtools-native...\n")
             exec_cmd("bitbake mtools-native")
 
+        # Make sure grub-mkimage is available in native sysroot
+        if not os.path.isfile("%s/usr/bin/grub-mkimage" % native_sysroot):
+            msger.info("Building grub-native...\n")
+            exec_cmd("bitbake grub-native")
+
     @classmethod
     def do_configure_partition(cls, part, source_params, creator, cr_workdir,
                                oe_builddir, bootimg_dir, kernel_dir,
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] wic/isoimage-isohybrid: check for grub-mkimage
  2017-01-04 19:04 [PATCH v2] wic/isoimage-isohybrid: check for grub-mkimage Ioan-Adrian Ratiu
@ 2017-01-04 20:12 ` Ed Bartosh
  2017-01-04 20:19   ` Ed Bartosh
  0 siblings, 1 reply; 4+ messages in thread
From: Ed Bartosh @ 2017-01-04 20:12 UTC (permalink / raw)
  To: Ioan-Adrian Ratiu; +Cc: ken.sharp, openembedded-core

On Wed, Jan 04, 2017 at 09:04:43PM +0200, Ioan-Adrian Ratiu wrote:
> The isohybrid plugin uses grub-mkimage but doesn't make sure it gets built.
> Add a check to avoid the following error:
> 
> Error: A native program grub-mkimage required to build the image was not found (see details above).
> 
> Wic failed to find a recipe to build native grub-mkimage. Please file a bug against wic.
> 
> Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
> ---
>  scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> index 849fd8bea3..d616316d61 100644
> --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> @@ -242,6 +242,11 @@ class IsoImagePlugin(SourcePlugin):
>              msger.info("Building mtools-native...\n")
>              exec_cmd("bitbake mtools-native")
>  
> +        # Make sure grub-mkimage is available in native sysroot
> +        if not os.path.isfile("%s/usr/bin/grub-mkimage" % native_sysroot):
> +            msger.info("Building grub-native...\n")
> +            exec_cmd("bitbake grub-native")
> +
>      @classmethod
>      def do_configure_partition(cls, part, source_params, creator, cr_workdir,
>                                 oe_builddir, bootimg_dir, kernel_dir,

Unfortunately this approach will not work if wic is run from bitbake.

I'd suggest to simply add grub-native to NATIVE_RECIPES dictionary in
scripts/lib/wic/utils/oe/misc.py
It will make error message more informative and useful.

--
Regards,
Ed


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] wic/isoimage-isohybrid: check for grub-mkimage
  2017-01-04 20:12 ` Ed Bartosh
@ 2017-01-04 20:19   ` Ed Bartosh
  2017-01-05 10:21     ` Ioan-Adrian Ratiu
  0 siblings, 1 reply; 4+ messages in thread
From: Ed Bartosh @ 2017-01-04 20:19 UTC (permalink / raw)
  To: Ioan-Adrian Ratiu; +Cc: ken.sharp, openembedded-core

On Wed, Jan 04, 2017 at 10:12:55PM +0200, Ed Bartosh wrote:
> On Wed, Jan 04, 2017 at 09:04:43PM +0200, Ioan-Adrian Ratiu wrote:
> > The isohybrid plugin uses grub-mkimage but doesn't make sure it gets built.
> > Add a check to avoid the following error:
> > 
> > Error: A native program grub-mkimage required to build the image was not found (see details above).
> > 
> > Wic failed to find a recipe to build native grub-mkimage. Please file a bug against wic.
> > 
> > Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
> > ---
> >  scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> > index 849fd8bea3..d616316d61 100644
> > --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> > +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
> > @@ -242,6 +242,11 @@ class IsoImagePlugin(SourcePlugin):
> >              msger.info("Building mtools-native...\n")
> >              exec_cmd("bitbake mtools-native")
> >  
> > +        # Make sure grub-mkimage is available in native sysroot
> > +        if not os.path.isfile("%s/usr/bin/grub-mkimage" % native_sysroot):
> > +            msger.info("Building grub-native...\n")
> > +            exec_cmd("bitbake grub-native")
> > +
> >      @classmethod
> >      def do_configure_partition(cls, part, source_params, creator, cr_workdir,
> >                                 oe_builddir, bootimg_dir, kernel_dir,
> 
> Unfortunately this approach will not work if wic is run from bitbake.
> 
> I'd suggest to simply add grub-native to NATIVE_RECIPES dictionary in
> scripts/lib/wic/utils/oe/misc.py
> It will make error message more informative and useful.
> 
The same should probably be done with the rest of native tools called from
this module. It's better to avoid building them implicitly.

--
Regards,
Ed


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] wic/isoimage-isohybrid: check for grub-mkimage
  2017-01-04 20:19   ` Ed Bartosh
@ 2017-01-05 10:21     ` Ioan-Adrian Ratiu
  0 siblings, 0 replies; 4+ messages in thread
From: Ioan-Adrian Ratiu @ 2017-01-05 10:21 UTC (permalink / raw)
  To: ed.bartosh; +Cc: ken.sharp, openembedded-core

Hi

On Wed, 04 Jan 2017, Ed Bartosh <ed.bartosh@linux.intel.com> wrote:
> On Wed, Jan 04, 2017 at 10:12:55PM +0200, Ed Bartosh wrote:
>> On Wed, Jan 04, 2017 at 09:04:43PM +0200, Ioan-Adrian Ratiu wrote:
>> > The isohybrid plugin uses grub-mkimage but doesn't make sure it gets built.
>> > Add a check to avoid the following error:
>> > 
>> > Error: A native program grub-mkimage required to build the image was not found (see details above).
>> > 
>> > Wic failed to find a recipe to build native grub-mkimage. Please file a bug against wic.
>> > 
>> > Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
>> > ---
>> >  scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 5 +++++
>> >  1 file changed, 5 insertions(+)
>> > 
>> > diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
>> > index 849fd8bea3..d616316d61 100644
>> > --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
>> > +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
>> > @@ -242,6 +242,11 @@ class IsoImagePlugin(SourcePlugin):
>> >              msger.info("Building mtools-native...\n")
>> >              exec_cmd("bitbake mtools-native")
>> >  
>> > +        # Make sure grub-mkimage is available in native sysroot
>> > +        if not os.path.isfile("%s/usr/bin/grub-mkimage" % native_sysroot):
>> > +            msger.info("Building grub-native...\n")
>> > +            exec_cmd("bitbake grub-native")
>> > +
>> >      @classmethod
>> >      def do_configure_partition(cls, part, source_params, creator, cr_workdir,
>> >                                 oe_builddir, bootimg_dir, kernel_dir,
>> 
>> Unfortunately this approach will not work if wic is run from bitbake.
>> 
>> I'd suggest to simply add grub-native to NATIVE_RECIPES dictionary in
>> scripts/lib/wic/utils/oe/misc.py
>> It will make error message more informative and useful.
>> 
> The same should probably be done with the rest of native tools called from
> this module. It's better to avoid building them implicitly.

Thank you for the feedback. I agree. I will send another patch.

Ionel

>
> --
> Regards,
> Ed


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-05 10:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-04 19:04 [PATCH v2] wic/isoimage-isohybrid: check for grub-mkimage Ioan-Adrian Ratiu
2017-01-04 20:12 ` Ed Bartosh
2017-01-04 20:19   ` Ed Bartosh
2017-01-05 10:21     ` Ioan-Adrian Ratiu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox