1 diff -ur grub-2.04.orig/util/grub-mkconfig.in grub-2.04/util/grub-mkconfig.in
2 --- grub-2.04.orig/util/grub-mkconfig.in 2019-08-18 15:43:15.196000000 +0200
3 +++ grub-2.04/util/grub-mkconfig.in 2019-08-18 15:43:33.498000000 +0200
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
24 GRUB_DEVICE_PARTUUID="`${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2> /dev/null`" || true