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
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Ronald van Haren (pressh)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

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
Comment by Steffen (MadEagle) - Friday, 20 January 2012, 10:21 GMT
I can confirm this. Apparently this is a problem related to /etc/grub.d/00_header. A workaround for this is

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).
Comment by Simon Brakhane (Luminger) - Friday, 20 January 2012, 19:58 GMT
I can also confirm this. My /boot is sitting in a separated logical volume.

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.
Comment by Michael Laß (Bevan) - Sunday, 22 January 2012, 14:44 GMT
Simons workaround helped me. Because he didn't mention: You have to do the replacement in /usr/lib/grub/grub-mkconfig_lib.

man grub-probe sais:
--target=(fs|fs_uuid|fs_label|drive|device|partmap|abstraction|cryptodisk_uuid)

So officially there is no target "hints_string".
Comment by Yuri Bushmelev (jay7) - Sunday, 29 January 2012, 19:53 GMT
My system is affected too because of root on LVM.

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.
Comment by Bernhard Dunkl (bernhard_dunkl) - Wednesday, 01 February 2012, 21:09 GMT
Same issure here with root on software raid1 and no seperate boot partition. Yuris solution worked for me.
Comment by Keshav Amburay (the.ridikulus.rat) - Thursday, 02 February 2012, 06:27 GMT
Please post this issue in bug-grub ML or #grub irc.
Comment by Michael Laß (Bevan) - Friday, 03 February 2012, 21:26 GMT
I filed a bug upstream: https://savannah.gnu.org/bugs/index.php?35444

Fixed upstream.
Comment by Ronald van Haren (pressh) - Friday, 03 February 2012, 23:10 GMT
I'll take a new snapshot tomorrow.
Comment by Keshav Amburay (the.ridikulus.rat) - Saturday, 04 February 2012, 10:41 GMT
@pressh: Src pkg for r3844 http://db.tt/Q4rNaEHg (no need for automake patch now, and no major changes to PKGBUILD, just rebased patches). Removed --datadir configure option, Re-enabled ntldr-img (updated) and updated lua snapshots.

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.
Comment by Michael Laß (Bevan) - Saturday, 04 February 2012, 10:50 GMT
I can confirm that the problem is fixed in that version of grub2-common. Thanks :)
Comment by Ronald van Haren (pressh) - Sunday, 05 February 2012, 09:20 GMT

@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
Comment by Keshav Amburay (the.ridikulus.rat) - Sunday, 05 February 2012, 09:41 GMT
@Ronald: I didn't try building in chroot. Upstream respond faster to ML posts (bug-grub or grub-devel) rather than their bug tracker. Do not update to newer snapshot just yet. There are few major changes to grub2 like http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/3849. I will ask about the issue in irc.

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.
Comment by Keshav Amburay (the.ridikulus.rat) - Sunday, 05 February 2012, 10:05 GMT
@Ronald: Upstream is working on it. Maybe we can update to a newer snapshot when both the grub-mkconfig_lib issue and prefix/platform subdir issues are sorted out.
Comment by Ronald van Haren (pressh) - Monday, 06 February 2012, 07:05 GMT
Sure thing. Let me know when is a good time if they forget to close the report I opened.
Comment by Keshav Amburay (the.ridikulus.rat) - Monday, 06 February 2012, 07:30 GMT
--REMOVED--
Comment by Keshav Amburay (the.ridikulus.rat) - Friday, 10 February 2012, 17:21 GMT
--REMOVED--
Comment by Keshav Amburay (the.ridikulus.rat) - Tuesday, 28 February 2012, 11:04 GMT
Updated PKGBUILDs and pacthes at https://www.dropbox.com/s/jth3mchm3hobmfy .
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.
Comment by Keshav Amburay (the.ridikulus.rat) - Saturday, 10 March 2012, 18:50 GMT
@Ronald: extra/grub2-* packages not yet updated?

Loading...