Quote Originally Posted by ChinaJustin View Post
Ran into a problem when I ran ¨sudo update-grub¨. Here´s the outputHere is my current 06_custom file:

Code:
#!/bin/sh
echo 1>&2 "Adding My Custom Menu"
exec tail -n +4 $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.
echo "Lubuntu Precise Pangolin 12.04" >&2 
cat << EOF
menuentry "Lubuntu Precise Pangolin 12.04" {
    set root=(hd0,msdos2)
        linux /vmlinuz root=/dev/sda2 ro quiet splash
        initrd /initrd.img
}
EOF
echo "Lubuntu Precise Pangolin 12.04 (Recovery Mode)" >&2
cat << EOF
menuentry "Lubuntu Precise Pangolin 12.04 (Recovery Mode)" {
    set root=(hd0,msdos2)
        linux /vmlinuz root=/dev/sda2 ro single
        initrd /initrd.img
}
EOF
echo "Windows XP" >&2 
cat << EOF
menuentry "Windows XP" {
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set 9AB84DC1B84D9C9F
    chainloader +1
}
EOF
I haven´t rebooted yet, because I´m afraid of grub not liking the error and having issues. Ideas?
I have edited your file and made the above changes:
  1. Only place the 'echo' command in the top section. Otherwise it's going to be input into the grub.cfg file.
  2. Changed the tail command to 4 since we are adding the 'echo' line to the top.
  3. Remove all CAT / EOF references. The way the GRUB scripts are set up, everything is output to grub.cfg so the CAT/EOF entries are not required.

Here is the new file for you to try:
#!/bin/sh
echo 1>&2 "Adding Lubuntu & Windows XP 06 Custom Menu"
exec tail -n +4 $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 "Lubuntu Precise Pangolin 12.04" {
set root=(hd0,msdos2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}

menuentry "Lubuntu Precise Pangolin 12.04 (Recovery Mode)" {
set root=(hd0,msdos2)
linux /vmlinuz root=/dev/sda2 ro single
initrd /initrd.img
}

menuentry "Windows XP" {
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 9AB84DC1B84D9C9F
chainloader +1
}