FS#27985 - grub2-bios 1:1.99-6 no longer generating a proper menu for LVM boot
Attached to Project:
Arch Linux
Opened by Brad Laue (brad-x) - Wednesday, 18 January 2012, 19:03 GMT
Last edited by Ronald van Haren (pressh) - Monday, 19 March 2012, 08:30 GMT
Opened by Brad Laue (brad-x) - Wednesday, 18 January 2012, 19:03 GMT
Last edited by Ronald van Haren (pressh) - Monday, 19 March 2012, 08:30 GMT
|
Details
Description:
On my system, after updating to grub2 1.99-6, grub-mkconfig no longer generates a complete configuration file - result attached as grub.cfg.broken. This is obviously incomplete and results in booting to a grub prompt. Downgrading to 1.99-5 fixes the issue, resulting in a proper grub.cfg file (also attached). My filesystems are structured as follows: Device Boot Start End Blocks Id System /dev/sda1 * 2048 625142447 312570200 8e Linux LVM LV Name /dev/70T3HQ1/swap VG Name 70T3HQ1 LV Name /dev/70T3HQ1/root VG Name 70T3HQ1 Where /boot resides on the root LV (ext4). This is a functional setup using grub2 under normal circumstances and I've got multiple systems configured this way. Additional info: * package version(s) 70T3HQ1:~ # pacman -Q | grep grub grub2-bios 1:1.99-6 grub2-common 1:1.99-6 * config and/or log files etc. Steps to reproduce: Install grub2 1.99-6 or install a fresh Arch system and use grub2 as the bootloader (done outside the context of the /arch/setup wizard of course) - result is an unusable grub configuration and an unbootable system (unless one manually specifies the linux/initramfs/kernel parameters at the grub prompt). This is my first Arch bug - please let me know if I've omitted anything. |
This task depends upon
Closed by Ronald van Haren (pressh)
Monday, 19 March 2012, 08:30 GMT
Reason for closing: Fixed
Additional comments about closing: 1:2.00beta2-1
Monday, 19 March 2012, 08:30 GMT
Reason for closing: Fixed
Additional comments about closing: 1:2.00beta2-1
1. grub-mkconfig > /tmp/grub.cfg
2. chmod -x /etc/grub.d/00_header
3. grub-mkconfig >> /tmp/grub.cfg
4. chmod +x /etc/grub.d/00_header
5. mv /tmp/grub.cfg /boot/grub
This gives you a working and complete grub.cfg (the extra comments "do not edit" in the middle of the file are ignored).
Quickfix to get a bootable config:
comment 'hints="`"${grub_probe}" --device "${device}" --target=hints_string 2> /dev/null`"' out and replace it with 'hints=""'
grub-mkconfig returns with returncode 1, so I have tried to debug it a bit. If you prepend line 283 in /usr/sbin/grub-mkconfig with sh -x (so it looks like sh -x "$i") you will get a clue what is wrong there. The problem seems to be that grub-probe isn't happy with something.
What the script calls (for me):
/usr/sbin/grub-probe --device /dev/mapper/archlinux-root --target=hints_string
What it prints out when run:
/usr/sbin/grub-probe: error: cannot get the real path of `(null)'.
Returncode is 1 as expected.
man grub-probe sais:
--target=(fs|fs_uuid|fs_label|drive|device|partmap|abstraction|cryptodisk_uuid)
So officially there is no target "hints_string".
I have spend some time to play with it and got simple fix for /usr/lib/grub/grub-mkconfig_lib:
- hints="`"${grub_probe}" --device "${device}" --target=hints_string 2> /dev/null`"
+ hints="`"${grub_probe}" --device "${device}" --target=hints_string 2> /dev/null || true`"
Patch is attached.
Fixed upstream.
Better to use the src.tar.gz file as is.
@Bevan: x86_64 grub2-{common,bios,efi-x86_64} pkgs http://db.tt/dCpmYL5k (compiled using gcc-multilib). No i686 pkgs.
@Keshav: current builds fail due to the introduced reference to grub-mkconfig_lib in r3826 [1].
[1] https://savannah.gnu.org/bugs/index.php?35452
EDIT: My bad. New tickets/comments filed in the bug tracker are automatically posted to bug-grub ML. We need to wait for the devs to respond.
PKGVER bumped to 2.00beta2 (finally), uses upstream tar.xz src from alpha.gnu.org .
I used pkgver as "2.00beta2" instead of "2.00~beta2" in the PKGBUILDs to avoid incrementing epoch.
Please use the PKGBUILDs as it is.
* Proper lua snapshot. Earlier one was wrong (it didn't contain lua file at all), I have updated the file at https://www.dropbox.com/sh/jth3mchm3hobmfy/mbc1oVB5Sa/grub2_extras_lua_r23.tar.xz .
* Updated 915resolution and ntldr-img snapshots.
* No more grub_bios-install, grub_efi_*-install. grub-install now supports --target and --directory options
* GRUB_PREFIX removed from grub-mkconfig, my patch is obsolete
* all grub-mkconfig_lib issues fixed
* platform specific files inside subdirs. Now possible to have both x86_64-efi and bios under /boot/grub
* grub.cfg updated (actually I generated in my system and deleted unwanted entries) (for 2.00~beta0, 2.00~beta1 added submenu support and I can't make sense of the generated grub.cfg)
* New and first upstream theme - starfield - http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/3962
EDIT: After discussion with Ronald, gdb related files are removed from the package.