]> TLD Linux GIT Repositories - packages/grub2.git/blob - grub-lvmdevice.patch
- updated to 2.02-rc1
[packages/grub2.git] / grub-lvmdevice.patch
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
5  
6  # Device containing our userland.  Typically used for root= parameter.
7  GRUB_DEVICE="`${grub_probe} --target=device /`"
8 +
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
14 +       /dev/mapper/*-*)
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
19 +               fi
20 +       ;;
21 +esac
22 +
23  GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
24  
25  # Device containing our /boot partition.  Usually the same as GRUB_DEVICE.