Bug 8001 - wic: Add bootloader options for multi-rootfs
Summary: wic: Add bootloader options for multi-rootfs
Status: VERIFIED NOTABUG
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: 1.8
Hardware: All Multiple
: Medium enhancement
Target Milestone: 1.9 M3
Assignee: Ed Bartosh
QA Contact: Daniel Istrate
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-07-14 21:54 UTC by Mariano Lopez
Modified: 2015-09-21 11:29 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mariano Lopez 2015-07-14 21:54:33 UTC
For multi-rootfs there is no way to configure the bootloader to boot from more than one partition. This is required for systems that have a primary partition and a maintenance partition or for devices that need to have more than one rootfs.
Comment 1 Ed Bartosh 2015-07-16 14:45:39 UTC
It is possible for EFI I believe.

Can you explain your configuration in more details?
Comment 2 Mariano Lopez 2015-07-16 15:55:02 UTC
For example, using grub-efi loader with a parition scheme like: 

bootloader | maintenance | config_data | rootfs

I want to boot from the 4th partition. It is not possible to change the default boot partiton (or other grub options;  the only option available to change is timeout). Also is not possible to add more menu entries into grub (for other boot partitions).

So the enhancement request is to be able to set more menu entries and to change arbitrary grub options (default and fallback come to mind).
Comment 3 Ed Bartosh 2015-07-16 15:58:21 UTC
It is possible to prepare boot directory by bitbake and put there any bootloader configuration you want and use wic to convert it into partitioned image. Would this way work for you?
Comment 4 Ed Bartosh 2015-07-19 19:37:54 UTC
Igor, can you explain Mariano how did you prepare multiple rootfs dirs in one bitbake recipe?
Comment 5 Igor Stoppa 2015-07-20 07:10:20 UTC
(In reply to comment #4)
> Igor, can you explain Mariano how did you prepare multiple rootfs dirs in
> one bitbake recipe?

No, I cannot, because I haven't done it yet :-)
Comment 6 Igor Stoppa 2015-07-20 07:28:55 UTC
I think this should somehow converge into the work for #bug 7672.
Once it's finally possible to call wic from inside a recipe, this is the obvious follow up, that such recipe must be able to configure which one is the default  partition to boot from.

However this requires that the chosen bootloader is actually capable of doing such feat. So far I know only of grub and uboot that can load a kernel from a partition other than the one where they reside.

I think the simplest way is to use a class/recipe to configure the bootloader, to keep wic ignorant about the details.
Comment 7 Igor Stoppa 2015-07-20 13:11:54 UTC
Btw, I'm looking at the way something very similar was done for Edison.
It also includes dynamically changing boot target (ex: firmware ota vs. normal boot).


https://software.intel.com/iot/hardware/edison/downloads

It's done with u-boot rather than grub, but it meets all the needs listed so far.
Comment 8 Ed Bartosh 2015-07-21 09:17:05 UTC
(In reply to comment #6)
> I think this should somehow converge into the work for #bug 7672.
> Once it's finally possible to call wic from inside a recipe, this is the
> obvious follow up, that such recipe must be able to configure which one is
> the default  partition to boot from.
> 
> However this requires that the chosen bootloader is actually capable of
> doing such feat. So far I know only of grub and uboot that can load a kernel
> from a partition other than the one where they reside.
> 
> I think the simplest way is to use a class/recipe to configure the
> bootloader, to keep wic ignorant about the details.

I thought Mariano is asking for something similar to what we've done for #bug 7854. Can you share your recipe producing bootloader and rootfs dirs and working .wks file to produce an image?

Mariano, in #bug 7854 I showed working example of producing image from 2 rootfses. You might want to look at it too.
Comment 9 Ed Bartosh 2015-07-21 10:06:55 UTC
Here is a comment in #bug 7854 https://bugzilla.yoctoproject.org/show_bug.cgi?id=7854#c11 with the example of producing partitioned image from two rootfs recipes.
So, from my understanding that's the approach you should use.
Please, let me know if you need my help with this.
Comment 10 Mariano Lopez 2015-07-21 14:17:51 UTC
What I need is to have a custom grub.cfg file, is there a way to provide a custom file for the grub-efi loader?
Comment 11 Ed Bartosh 2015-07-22 09:25:50 UTC
Sure. You can prepare your grub configuration in your bitbake recipe. wic will just take whatever is in rootfs dir and put it into partition of the partitioned image.
Comment 12 Ed Bartosh 2015-08-03 14:01:35 UTC
Any progress on this? Does proposed solution suit your needs? Can we close this bug?
Comment 13 Ed Bartosh 2015-08-09 11:55:25 UTC
Any news on this? Please close the bug if proposed solution works for you.
Comment 14 Mariano Lopez 2015-08-10 13:45:23 UTC
I used my own wks to have a custom grub.conf. You can close the bug
Comment 15 Stephen K Jolley 2015-08-10 16:30:48 UTC
It appears the NEEDINFO has been met.  Please put this back into NEEDINFO if anything else is needed.
Comment 16 Ed Bartosh 2015-08-11 07:30:47 UTC
Resolving as not a bug as it didn't require any code changes in wic.
Comment 17 Daniel Istrate 2015-09-21 11:29:55 UTC
Verified: not a bug