How to update the grub menu configuration (vmware)?

721 views
Skip to first unread message

Bing

unread,
Mar 23, 2015, 11:25:17 AM3/23/15
to coreo...@googlegroups.com

Hello developers,


I'd like to modify grub menu configuration (currently, see below there are three entries for the image/vmware) , is there any way to let me do it like what we do in Ubuntu OS (e.g. type "update-grub" command after modifying the customized grub configuration script/files)?

Grub boot entries:

CoreOS default

CoreOS USR-A

CoreOS USR-B

 

I know that the grub.cfg file is located in partition #1 (see disk layout: https://coreos.com/docs/sdk-distributors/sdk/disk-partitions/), and we probably can modify it directly with sudo privilege by mounting sda1 w/ rw. If yes, is this the only way to do that?

 

If I want to build the modified grub.cfg file directly into system image, could anybody please tell me how to do that?

 

Thank you

Brandon Philips

unread,
Mar 23, 2015, 1:30:06 PM3/23/15
to coreos-dev, Michael Marineau, Alex Crawford
On Mon, Mar 23, 2015 at 8:25 AM, Bing <bing...@intel.com> wrote:
> I know that the grub.cfg file is located in partition #1 (see disk layout:
> https://coreos.com/docs/sdk-distributors/sdk/disk-partitions/), and we
> probably can modify it directly with sudo privilege by mounting sda1 w/ rw.
> If yes, is this the only way to do that?

Yes, you can do this but the update process of CoreOS owns this
configuration file and it will be over-written the next time CoreOS
gets an update.

What are you trying to accomplish with these modifications?

Thanks!

Brandon

Bing

unread,
Mar 23, 2015, 10:14:13 PM3/23/15
to coreo...@googlegroups.com, michael....@coreos.com, alex.c...@coreos.com
Brandon,
Thanks for your quick response. 

So, in order to make the change permanently, I need to upstream our modifications, is it right?  Could you give me some guide (or docs for instructions) on how to build the change to image (if only for grub.cfg changes)? 

Actually, I'm attempting to investigate on making CoreOS work with tboot (http://sourceforge.net/projects/tboot/) or other stuffs, like bare-metal XEN (does it already support booting on top of XEN for both EFI and legacy platform?)

Thank you.

Michael Marineau

unread,
Mar 23, 2015, 10:36:32 PM3/23/15
to Bing, coreos-dev, Alex Crawford
Bit of a correction, grub.cfg is not touched during upgrades. In fact
since 522.x.x nothing in the ESP partition is modified during
upgrades, grub is configured to select the system to boot solely based
on GPT partition attributes and reads the kernel from the selected
partition, USR-A or USR-B. Prior to 522 the update process did copy
some configs and kernels around. This current situation may change
again in the future once we develop a scheme to safely upgrade the
bootloader but we don't have a way to do that right now. There is a
more formal hook point for customizing grub than directly modifying
the main grub.cfg in the ESP. If you look at that file you'll note
that early on it checks for a grub.cfg in the OEM partition to load
extra configuration from. We use this for platforms that need to
switch the default console or other kernel args. For example:
https://github.com/coreos/coreos-overlay/blob/master/coreos-base/oem-gce/files/grub.cfg

The main grub.cfg lives here:
https://github.com/coreos/scripts/blob/master/build_library/grub.cfg

As is our images do boot on Xen PV and Xen HVM+seabios. I have not yet
done any testing with Xen HVM+UEFI which is a pretty new feature, we
do work fine on normal UEFI systems though. If by 'bare metal' you
mean you are trying to boot CoreOS as a dom0 instance, that we don't
do out of the box right now but I've done in special testing images
that used this OEM grub.cfg:
https://github.com/coreos/coreos-overlay/blob/master/coreos-base/oem-xendom0/files/grub.cfg

As for tboot, we have some testing with secure/verified boot in CoreOS
but we are still in early stages of implementing all of the parts
required to have a fully verified system. I would be very curious what
your use case is. :)

Bin

unread,
Mar 25, 2015, 1:57:37 AM3/25/15
to coreo...@googlegroups.com, bing...@intel.com, alex.c...@coreos.com
Thank you Michael, your information is very helpful to me and to save me lots of time for digging them out from source. 

As for usage of tboot, I still don't have clear vision, I'm also just on the early stage of investigation...
Reply all
Reply to author
Forward
0 new messages