Booting and Shutting Down Oracle® Solaris 11.2 Systems

Exit Print View

Updated: July 2014
 
 

x86: Customizing the GRUB Configuration

The grub.cfg file contains most of the GRUB configuration. An additional, editable file named custom.cfg can be used if you want to add more complex constructs, for example, menu entries or other scripting, to the GRUB configuration. This file does not exist on the system by default. You must create the file, and it must reside in the same location as the grub.cfg and menu.conf files, which is in /pool-name/boot/grub/.

GRUB processes the commands and any customizations that are in the custom.cfg file through the following code that is located at the end of the grub.cfg file:

if [ -f  $prefix/custom.cfg ]; then
			source $prefix/custom.cfg;
fi

These instructions direct GRUB to check for the existence of a custom.cfg file in the top-level dataset of the root pool, in the boot/grub subdirectory. If a custom.cfg file exists, GRUB sources the file and processes any commands that are in the file, as if the contents were textually inserted in the grub.cfg file.

On a system with 64-bit UEFI firmware, entries in this file might look like the following:

menuentry "Windows (64-bit UEFI)" {
   insmod part_gpt
   insmod fat
   insmod search_fs_uuid
   insmod chain
   search --fs-uuid --no-floppy --set=root cafe-f4ee
   chainloader /efi/Microsoft/Boot/bootmgfw.efi
}

On a system with BIOS firmware, entries in this file might look like the following:

menuentry "Windows" {
   insmod chain
   set root=(hd0,msdos1)
   chainloader --force +1
}