1 diff -urNp grub-2.02-rc1.orig/util/grub-mkconfig.in grub-2.02-rc1/util/grub-mkconfig.in
2 --- grub-2.02-rc1.orig/util/grub-mkconfig.in 2017-02-08 15:00:50.000000000 +0000
3 +++ grub-2.02-rc1/util/grub-mkconfig.in 2017-02-08 15:02:35.564319810 +0000
4 @@ -133,6 +133,21 @@ fi
6 # Device containing our userland. Typically used for root= parameter.
7 GRUB_DEVICE="`${grub_probe} --target=device /`"
9 +# Rewrite to sane LVM node (Code from PLD Linux geninitrd):
10 +# /dev/mapper/sys-rootfs -> /dev/sys/rootfs
11 +# /dev/mapper/blodnatt-blah--bleh -> /dev/blodnatt/blah-bleh
12 +# /dev/mapper/vg--meaw-root -> /dev/vg-meaw/root
13 +case "$GRUB_DEVICE" in
15 + LVM2_LV_NAME='' LVM2_VG_NAME=''
16 + eval $(lvs --noheadings --nameprefixes "$GRUB_DEVICE" 2>/dev/null)
17 + if [ -n "$LVM2_VG_NAME$LVM2_LV_NAME" ]; then
18 + GRUB_DEVICE=/dev/$LVM2_VG_NAME/$LVM2_LV_NAME
23 GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
25 # Device containing our /boot partition. Usually the same as GRUB_DEVICE.