Menuentry

GRUB scripting script has this special menuentry keyword based on menuentry command.

Menuentry

Menuentry creates a selective item in the GRUB menu. Within the selection, it contains the GRUB instructions for booting up a particular entry. Here's an example from the specification:

menuentry "OS using grub2" {
          insmod xfs
          search --set=root --label OS1 --hint hd0,msdos8
          configfile /boot/grub/grub.cfg
}

menuentry "OS using grub2-legacy" {
          insmod ext2
          search --set=root --label OS2 --hint hd0,msdos6
          legacy_configfile /boot/grub/menu.lst
}

menuentry "Windows XP" {
          insmod ntfs
          search --set=root --label WINDOWS_XP --hint hd0,msdos1
          ntldr /ntldr
}

menuentry "Windows 7" {
          insmod ntfs
          search --set=root --label WINDOWS_7 --hint hd0,msdos2
          ntldr /bootmgr
}

menuentry "FreeBSD" {
          insmod zfs
          search --set=root --label freepool --hint hd0,msdos7
          kfreebsd /freebsd@/boot/kernel/kernel
          kfreebsd_module_elf /freebsd@/boot/kernel/opensolaris.ko
          kfreebsd_module_elf /freebsd@/boot/kernel/zfs.ko
          kfreebsd_module /freebsd@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
          set kFreeBSD.vfs.root.mountfrom=zfs:freepool/freebsd
          set kFreeBSD.hw.psm.synaptics_support=1
}

menuentry "experimental GRUB" {
          search --set=root --label GRUB --hint hd0,msdos5
          multiboot /experimental/grub/i386-pc/core.img
}

menuentry "Fedora 16 installer" {
          search --set=root --label GRUB --hint hd0,msdos5
          linux /fedora/vmlinuz lang=en_US keymap=sg resolution=1280x800
          initrd /fedora/initrd.img
}

menuentry "Fedora rawhide installer" {
          search --set=root --label GRUB --hint hd0,msdos5
          linux /fedora/vmlinuz repo=ftp://mirror.switch.ch/mirror/fedora/linux/development/rawhide/x86_64 lang=en_US keymap=sg resolution=1280x800
          initrd /fedora/initrd.img
}

menuentry "Debian sid installer" {
          search --set=root --label GRUB --hint hd0,msdos5
          linux /debian/dists/sid/main/installer-amd64/current/images/hd-media/vmlinuz
          initrd /debian/dists/sid/main/installer-amd64/current/images/hd-media/initrd.gz
}

Advanced Customization

Menuentry has a list of customization in its command. Most of them are already obsoletes but it is worth while mentioning.

menuentry title [--class=class …] [--users=users] [--unrestricted] [--hotkey=key] [--id=id] [arg …] {
        command
}


--class - Usually for theme and display different classes using different styles.

--users - Grant specific users to use that menu entry.

--unrestricted - Grant all users to use that menu entry.

--hotkey - bind a key to that entry.

--id - [DEPRECATED] provide an ID for quick configuration call like setting GRUB_DEFAULT. This ID is a string but it cannot start with number or underscore. Space should be replaced with hyphen or underscore.

That's all about menuentry.