NOTE: you can use the update-grub utility to generate a grub.cfg file for you
GRUB 2 uses new bashish scripting language that is used to build menus. At startup file grub.cfg will be read and executed.
Please note that partition numbering has been changed to start from 1 (in grub legacy it started from 0).
Here is an simple example:
# Timeout for menu
set timeout=10
# Set default boot entry as Entry 0
set default=0
# Entry 0 - Load Linux kernel
menuentry "My Linux Kernel on (hd0,1)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/hda1
initrd /initrd
}
# Entry 1 - Chainload another bootloader
menuentry "Chainload my OS" {
set root=(hd0,3)
chainloader +1
}