update-grub skips last line in /etc/fstab when finding boot device
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Intrepid |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: grub
I have a Dell 1420 laptop that shipped with an earlier version of Ubuntu. I upgraded it to Intrepid and noticed (in a failure to reboot) that the grub-update script was not creating my boot entries properly.
After investigation, I found that update-grub uses read to look at the lines in /etc/fstab. This works fine until the last line is either the /boot volume (and maybe / volume also) and isn't trailed by a newline. The read command will not read the line without a newline.
The last line of my /etc/fstab defines my /boot volume and is not trailed by a newline. That line never gets read, and the update-grub script doesn't know about my /boot volume. This causes the script to have "/boot" on all the kernels and initrds in the menu.lst file even though /boot.
Here's an example of a command not working:
echo -n '0 1 2 3' | read A && echo $A
This command outputs nothing in either bash or dash. I will submit a patch to change the read to awk as soon as I can.
I would like to have this fix in for Intrepid since my Dell 1420 laptop shipped with this partition configuration, and this problem could bite all the folks trying with Dell 1420s when upgrading to Intrepid.
Related branches
description: | updated |
Here's the patch.
This adds a dependency of awk. That probably need to be reflected in the debian/control file.