How to add custom grub2 menu entry?

Edit /etc/grub.d/40_custom file to add a custom entry in grub2 menu.

$ sudo vim /etc/grub.d/40_custom
[...]
menuentry "Live" {
 set root='(hd0,1)'
 linux /boot/vmlinuz-3.2.0-24-generic boot=live toram=fs.squashfs
 initrd /boot/initrd.img-3.2.0-24-generic
}
[...]

Update grub configuration to apply changes.

# update-grub

Use uname command to print kernel release.

$ uname -r
3.2.0-24-generic