All of lore.kernel.org
 help / color / mirror / Atom feed
* [poky] bug #8729 grub bootloader
@ 2018-11-06 15:12 Dimitris Tassopoulos
  2018-11-07  0:58 ` Mittal, Anuj
  0 siblings, 1 reply; 3+ messages in thread
From: Dimitris Tassopoulos @ 2018-11-06 15:12 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1484 bytes --]

Hi all.

I'm working on bug #8729 and I'm trying to implement the multi-boot
functionality for grub.

I've partially done and I've created a virtual/grub-bootconf that can be
used like that:
PREFERRED_RPROVIDER_virtual/grub-bootconf = "grub-multibootconf"

That's working ok and installs the proper grub cfg script and the
environment files used for
the boot counter and other stuff.

The problem is that I've just hit the wall because it seems there are two
different facilities that
create the grub config file. One is the grub-efi & virtual/grub-bootconf.
But when an wic image is
build then this is overridden and a new partition is created which is also
mounted in the /boot
when the OS boots. The second facility is triggered by setting this in the
wks file:

--source bootimg-efi --sourceparams="loader=grub-efi"

In this case the bootimg-efi.py script creates the extra partition, a
different grub.cfg and also
edits the /etc/fstab and mounts this partition over /boot and therefore
virtual/grub-bootconf
becomes unused.

This raises the following questions:
- Why there are two different facilities to achieve the same thing?
- Why the second overrides the first one, instead of sharing the same files?
- How to proceed from now on?

In my opinion there should be only one facility that creates this and there
should be a common shared way for all the use cases.

I have a working example if anyone is interested.

Regards,
Dimitris

[-- Attachment #2: Type: text/html, Size: 1954 bytes --]

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

* Re: [poky] bug #8729 grub bootloader
  2018-11-06 15:12 [poky] bug #8729 grub bootloader Dimitris Tassopoulos
@ 2018-11-07  0:58 ` Mittal, Anuj
  2018-11-07  9:18   ` Dimitris Tassopoulos
  0 siblings, 1 reply; 3+ messages in thread
From: Mittal, Anuj @ 2018-11-07  0:58 UTC (permalink / raw)
  To: dimtass, yocto

Hi Dimitris

On Tue, 2018-11-06 at 16:12 +0100, Dimitris Tassopoulos wrote:
> 
> In this case the bootimg-efi.py script creates the extra partition, a
> different grub.cfg and also
> edits the /etc/fstab and mounts this partition over /boot and
> therefore virtual/grub-bootconf
> becomes unused.
> 
> This raises the following questions:
> - Why there are two different facilities to achieve the same thing?
> - Why the second overrides the first one, instead of sharing the same
> files?
> - How to proceed from now on?
> 

I think this needed --exclude-path in wks to be used to take effect.
Please see:


http://lists.openembedded.org/pipermail/openembedded-core/2018-February/147837.html

and bug:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=10073

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

* Re: [poky] bug #8729 grub bootloader
  2018-11-07  0:58 ` Mittal, Anuj
@ 2018-11-07  9:18   ` Dimitris Tassopoulos
  0 siblings, 0 replies; 3+ messages in thread
From: Dimitris Tassopoulos @ 2018-11-07  9:18 UTC (permalink / raw)
  To: anuj.mittal; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 2275 bytes --]

Hi Anuj,

thanks for the reply. First I need to say that it was insightful from your
side to use virtual/grub-bootconf
and this made things much easier. I only had to add `BBCLASSEXTEND =
"native"` in the grub-efi in
order to get `grub-editconf` for the host and create environment files on
the fly.

I had a look in your recommendation and it works after some tweaking. The `
efi-bootdisk.wks.im` file
has an example of this case, as your links suggested. It seems though that
the environment variable
`${IMAGE_ROOTFS}` in the file is not translated correctly during the
bitbake build and it fails with an
error. For example in my case the error was:

Couldn't get bitbake variable from
/rnd/yocto/grub-dev/build/tmp/sysroots/qemux86/imgdata/${IMAGE_ROOTFS}/boot.env.

After I changed the `${ROOTFS}` in `--rootfs-dir=${IMAGE_ROOTFS}/boot` with
the absolute path
then it worked. For me it's nor an issue but it's good for you to know.
Without someone pointing this
out it would be very difficult to discover the above use-case as it's not
clearly documented.

Also, it would be nice when bitbake detects that both `loader=grub-efi` and
`grub-efi_%.bb` are used
to print a warning about this overlapping and suggest the use of
`--rootfs-dir` and `--exclude-path`.

I'll continue from this point now.

Thanks again,
Dimitris

On Wed, Nov 7, 2018 at 1:58 AM Mittal, Anuj <anuj.mittal@intel.com> wrote:

> Hi Dimitris
>
> On Tue, 2018-11-06 at 16:12 +0100, Dimitris Tassopoulos wrote:
> >
> > In this case the bootimg-efi.py script creates the extra partition, a
> > different grub.cfg and also
> > edits the /etc/fstab and mounts this partition over /boot and
> > therefore virtual/grub-bootconf
> > becomes unused.
> >
> > This raises the following questions:
> > - Why there are two different facilities to achieve the same thing?
> > - Why the second overrides the first one, instead of sharing the same
> > files?
> > - How to proceed from now on?
> >
>
> I think this needed --exclude-path in wks to be used to take effect.
> Please see:
>
>
>
> http://lists.openembedded.org/pipermail/openembedded-core/2018-February/147837.html
>
> and bug:
>
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=10073
>

[-- Attachment #2: Type: text/html, Size: 3244 bytes --]

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

end of thread, other threads:[~2018-11-07  9:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-06 15:12 [poky] bug #8729 grub bootloader Dimitris Tassopoulos
2018-11-07  0:58 ` Mittal, Anuj
2018-11-07  9:18   ` Dimitris Tassopoulos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.