Adding custom entries to GRUB 2
From froelix.com - Wiki
Revision as of 00:06, 29 August 2010 by Froelix (Talk | contribs) (Created page with 'The configuration files of the bootloader ''GRUB 2'' are located in the folder ''/etc/grub.d/''. To add custom entries to the bootloader, the file ''40_custom'' has to be modifie…')
The configuration files of the bootloader GRUB 2 are located in the folder /etc/grub.d/. To add custom entries to the bootloader, the file 40_custom has to be modified. Following the unmodified version of this file is shown.
#!/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above.
Custom menu entries can be added to the end of this file. An examplary modification of the file 40_custom, with two entries to reboot or halt the system, is shown below.
#!/bin/sh
echo "Adding custom menu entries." >&2
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Reboot System" {
reboot
}
menuentry "Halt System" {
halt
}
To take effect the changes you have to run the command update-grub as root.