]> git.pld-linux.org Git - packages/grub2.git/blame - grub-lvmdevice.patch
grub-mkconfig: use lvs to expand LVM path. more reliable
[packages/grub2.git] / grub-lvmdevice.patch
CommitLineData
139b6f37
ER
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 @@
f7ae30d0
ER
4
5 # Device containing our userland. Typically used for root= parameter.
b876d99a 6 GRUB_DEVICE="`${grub_probe} --target=device /`"
f7ae30d0
ER
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
5c39b5a7 11+# /dev/mapper/vg--meaw-root -> /dev/vg-meaw/root
f7ae30d0 12+case "$GRUB_DEVICE" in
d889a8f5 13+ /dev/mapper/*-*)
139b6f37
ER
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
d889a8f5 19+ ;;
f7ae30d0
ER
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.
This page took 0.043472 seconds and 4 git commands to generate.