help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using conditionals in embedded config?


From: Shea Levy
Subject: Re: Using conditionals in embedded config?
Date: Sun, 07 Feb 2016 10:35:51 -0500
User-agent: Roundcube Webmail/0.8.2

On 2016-02-06 13:13, Andrei Borzenkov wrote:
06.02.2016 17:07, Shea Levy пишет:
I'm setting up an unassisted android boot process, where I first check to see if the system has requested boot into recovery and boot from the recovery bootimg if so (booting from the normal bootimg otherwise). None of the traditional android partitions are appropriate for a grub config.

You can build standalone image with GRUB on internal memory disk that is embedded into core.img. That memory disk may then contain grub.cfg with
full scripting capabilities.


Ah, I didn't know about the memory disk option, that solves this.


OTOH it just another argument in favor of dedicated android loader that handles all this logic internally. From what you said so far it does not
look like there is much flexibility in boot process anyway.


I still stand by leaving this up to the grub config. Suppose I want to add an option to my grub menu to do a factory reset. With my patches as-is, this is easy. With a dedicated loader, someone would have to modify grub itself to make the loader accept an option to set up the BCB and boot into recovery appropriately.


I can just add an extra partition (which I'm doing for now), but a) this
is not supported by official flashing/update mechanisms and b) this
increases the window during an update to the bootloader where loss of power would result in a corrupt system (with embedded config doing all of the work, I only need to update boot.img and core.img, with a config
on a separate partition I also need to update that partition.


This is rather orthogonal, but yes, having better support for alternate
install location would indeed reduce risk of unbootable system.

~Shea

On 2016-02-06 08:59, Andrei Borzenkov wrote:
06.02.2016 15:28, Shea Levy пишет:
I see. This seems to severely limit the possible use cases of embedded configs; it also contradicts the example in the manual [1]. Is there

Yes, someone already complained about manual. Patches are welcome.

really no way to branch in embedded configs? Would it be possible to enable branching by including some optional module in the core img?


Why do you need to do it in the first place? What is your use case?

~Shea

[1]


https://www.gnu.org/software/grub/manual/html_node/Embedded-configuration.html#Embedded-configuration


On 2016-02-06 00:42, Andrei Borzenkov wrote:
06.02.2016 06:24, Shea Levy пишет:
Hi all,

How can I use if statements in an embedded config? When I try, I get

You can't. embedded config is processed early using rescue mode parser which is very simple. Embedded config exists to locate device where
grub
is installed in case this information is not available from firmware.
Everything else cam be done using grub.cfg in this location.

"unknown command "if"", "unknown command "fi"", etc. I'm including
normal, part_gpt, android_bootimg, android_bcb, linux, test, and
biosdisk in the core.img (the android_* modules are local
modifications,
see the grub-devel list for their details but they shouldn't matter).

Thanks,
Shea

_______________________________________________
Help-grub mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-grub


_______________________________________________
Help-grub mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-grub


_______________________________________________
Help-grub mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-grub


_______________________________________________
Help-grub mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-grub


_______________________________________________
Help-grub mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-grub


_______________________________________________
Help-grub mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-grub




reply via email to

[Prev in Thread] Current Thread [Next in Thread]