]> TLD Linux GIT Repositories - packages/grub2.git/blob - grub-lvmdevice.patch
- fix initrd-search patch
[packages/grub2.git] / grub-lvmdevice.patch
1 --- grub-2.02~beta2/util/grub-mkconfig.in~      2014-01-13 16:12:41.020705075 +0200
2 +++ grub-2.02~beta2/util/grub-mkconfig.in       2014-01-13 16:10:42.000000000 +0200
3 @@ -131,6 +131,21 @@
4  
5  # Device containing our userland.  Typically used for root= parameter.
6  GRUB_DEVICE="`${grub_probe} --target=device /`"
7 +
8 +# Rewrite to sane LVM node (Code from PLD Linux geninitrd):
9 +# /dev/mapper/sys-rootfs -> /dev/sys/rootfs
10 +# /dev/mapper/blodnatt-blah--bleh -> /dev/blodnatt/blah-bleh
11 +# /dev/mapper/vg--meaw-root -> /dev/vg-meaw/root
12 +case "$GRUB_DEVICE" in
13 +       /dev/mapper/*-*)
14 +               LVM2_LV_NAME='' LVM2_VG_NAME=''
15 +               eval $(lvs --noheadings --nameprefixes "$GRUB_DEVICE" 2>/dev/null)
16 +               if [ -n "$LVM2_VG_NAME$LVM2_LV_NAME" ]; then
17 +                       GRUB_DEVICE=/dev/$LVM2_VG_NAME/$LVM2_LV_NAME
18 +               fi
19 +       ;;
20 +esac
21 +
22  GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
23  
24  # Device containing our /boot partition.  Usually the same as GRUB_DEVICE.