Hi,
I'm currently busy making cb+grub running. While I can boot successfully (qemu) using the grub-shell I of course want to automatize this process.
But how and where do I have to put the grub.cfg file? The wiki doesn't include much informations about this.
I would appreciate if someone could help me :)
Hi Philipp,
On 09.11.2016 09:46, Philipp Stanner wrote:
Hi,
I'm currently busy making cb+grub running. While I can boot successfully (qemu) using the grub-shell I of course want to automatize this process.
But how and where do I have to put the grub.cfg file? The wiki doesn't include much informations about this.
I would appreciate if someone could help me :)
it's indeed not very obvious. There should be a grub.cfg in the grub image, that just points to the next in cbfs at "/etc/grub.cfg". That's where you should put yours, like that:
build/cbfstool build/coreboot.rom add -t raw -n etc/grub.cfg -f your-grub.cfg
Nico
PS. My (cbfs)/etc/grub.cfg contains just another pointer:
configfile (ahci0,1)/grub/grub.cfg
Hi Nico,
thanks so far.
Using your own pointer to the HDD serves to purpose of being able to change the cfg-file without flashing the ROM, I presume?
Anyhow using grub you'd have to use the Shell to start an OS from an external drive - in an emergency for example, correct?
Am 09.11.2016 um 10:19 schrieb Nico Huber:
Hi Philipp,
On 09.11.2016 09:46, Philipp Stanner wrote:
Hi,
I'm currently busy making cb+grub running. While I can boot successfully (qemu) using the grub-shell I of course want to automatize this process.
But how and where do I have to put the grub.cfg file? The wiki doesn't include much informations about this.
I would appreciate if someone could help me :)
it's indeed not very obvious. There should be a grub.cfg in the grub image, that just points to the next in cbfs at "/etc/grub.cfg". That's where you should put yours, like that:
build/cbfstool build/coreboot.rom add -t raw -n etc/grub.cfg -f your-grub.cfg
Nico
PS. My (cbfs)/etc/grub.cfg contains just another pointer:
configfile (ahci0,1)/grub/grub.cfg
On 09.11.2016 22:03, Philipp Stanner wrote:
Hi Nico,
thanks so far.
Using your own pointer to the HDD serves to purpose of being able to change the cfg-file without flashing the ROM, I presume?
Yep.
Anyhow using grub you'd have to use the Shell to start an OS from an external drive - in an emergency for example, correct?
You can also load SeaBIOS from GRUB, I suppose.
Nico
Am 09.11.2016 um 10:19 schrieb Nico Huber:
Hi Philipp,
On 09.11.2016 09:46, Philipp Stanner wrote:
Hi,
I'm currently busy making cb+grub running. While I can boot successfully (qemu) using the grub-shell I of course want to automatize this process.
But how and where do I have to put the grub.cfg file? The wiki doesn't include much informations about this.
I would appreciate if someone could help me :)
it's indeed not very obvious. There should be a grub.cfg in the grub image, that just points to the next in cbfs at "/etc/grub.cfg". That's where you should put yours, like that:
build/cbfstool build/coreboot.rom add -t raw -n etc/grub.cfg -f your-grub.cfg
Nico
PS. My (cbfs)/etc/grub.cfg contains just another pointer:
configfile (ahci0,1)/grub/grub.cfg
Hey Philipp,
On Wed, Nov 09, 2016 at 10:03:56PM +0100, Philipp Stanner wrote:
Hi Nico,
thanks so far.
Using your own pointer to the HDD serves to purpose of being able to change the cfg-file without flashing the ROM, I presume?
Anyhow using grub you'd have to use the Shell to start an OS from an external drive - in an emergency for example, correct?
Both CBFS and boot media configuration may contain arbitrary menu entries, you're free to write small ones to boot a kernel from your disk, search for (iso|sys)linux installations on external media such as USB sticks and much more.
Putting such configuration into your disk's grub.cfg has the advantage of being flexible since you don't need to reflash your chip every time. Depending on your menu configuration however, it might be a good idea to place generic entries such as 'Load MemTest86+', 'Chainload into USB', etc. into your CBFS as it will allow you to boot automatically/without manually using GRUB2's shell whether you attached some hard disk or not.
Have a look at [1] as an example for a relatively simple grub.cfg that can boot most of today's linux distributions automatically incl. live USB sticks and (fully) encrypted disks.
Best regards, Klemens
[1]: https://notabug.org/vimuser/libreboot/raw/master/resources/grub/config/menue...