
Originally Posted by
ChinaJustin
OK, so apparently, I forgot to chmod +x my 06_custom file.
That will do it every time! I thought that may be the problem. ChinaJustin if you recall you were the one asking the question about why the exec tail -n +3 $0 line did not work with the echo lines on every entry.
That is when Drs305 stepped in and told us that when grub went to 1.99
This is from Lucid - grub 1.98:
Code:
#!/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.
echo "Lucid Lynx 10.04" >&2
cat << EOF
menuentry "Lucid Lynx 10.04" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}
EOF
Which as Drs305 said changed to this in grub 1.99 and 2.00.
Changing the 3 to 4 and adding the echo line as the 2nd line causes the first executable line to be the 4th line down (the 1st menuentry).
Or you could leave it a 3 and leave out the echo as you stated since you are the only one to see it when you type sudo update-grub in terminal is fine too.
Code:
#!/bin/sh
echo 1>&2 "Adding Ubuntu Lucid Lynx and Windows 7"
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 "Lucid Lynx 10.04" >&2
cat << EOF
menuentry "Lucid Lynx 10.04" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}
EOF
echo "Lucid Lynx 10.04 (Recovery Mode)" >&2
cat << EOF
menuentry "Lucid Lynx 10.04 (Recovery Mode)" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro single
initrd /initrd.img
}
EOF
echo "Windows 7 Loader" >&2
cat << EOF
menuentry "Windows 7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 1cfc7a8dfc7a60c6
chainloader +1
}
EOF
Oldfred, at that time all I had installed was Lucid with grub 1.98 so I was not keeping up with the times like I should have been.
Bogan pointed out that my tutorial was wrong and when that finally got through my thick head, I fixed it.
So, the new wiki is a lot better as it splits it between grub 1.98, 1.99 and 2.00.
I need to update it with the grub versions instead of the Ubuntu versions because they can change but, the grub version is what is important.
But, come April grub 1.98 will be a thing of the past.
The reason I say to save 40_custom as 06_custom is that even when you have 10_linux and 30_os-prober executable, the custom display will be on top and be static.
If you save the 40_custom file, the custom entries will be on the bottom and change when the other 2 files are made executable.
Now I have 4 Ubuntu versions installed so I can at least try to keep up.
Bookmarks