X-Git-Url: https://git.tld-linux.org/?p=packages%2Fgrub2.git;a=blobdiff_plain;f=grub-lvmdevice.patch;h=d9b6be7e4abd918224635490f0f752f762d77ddd;hp=53324ec60fb34cdc1f3335c1e3c23ed95ae66103;hb=HEAD;hpb=874c4add0aa91b4d5d5a6665790c95d9f8757d81 diff --git a/grub-lvmdevice.patch b/grub-lvmdevice.patch index 53324ec..85ae596 100644 --- a/grub-lvmdevice.patch +++ b/grub-lvmdevice.patch @@ -1,6 +1,6 @@ ---- grub-1.97.1/util/grub-mkconfig.in~ 2009-11-17 17:02:16.626243372 +0200 -+++ grub-1.97.1/util/grub-mkconfig.in 2009-11-17 17:02:08.346050859 +0200 -@@ -120,6 +120,21 @@ +--- grub-2.02~beta2/util/grub-mkconfig.in~ 2014-01-13 16:12:41.020705075 +0200 ++++ grub-2.02~beta2/util/grub-mkconfig.in 2014-01-13 16:10:42.000000000 +0200 +@@ -131,6 +131,21 @@ # Device containing our userland. Typically used for root= parameter. GRUB_DEVICE="`${grub_probe} --target=device /`" @@ -10,15 +10,15 @@ +# /dev/mapper/blodnatt-blah--bleh -> /dev/blodnatt/blah-bleh +# /dev/mapper/vg--meaw-root -> /dev/vg-meaw/root +case "$GRUB_DEVICE" in -+/dev/mapper/*-*) -+ # change "--" to / (as "/" is impossible in LV name) -+ local dev=$(awk -vdev="${GRUB_DEVICE#/dev/mapper/}" 'BEGIN{gsub(/--/, "/", dev); print dev}') -+ local VG=$(awk -vdev="$dev" 'BEGIN{split(dev, v, "-"); gsub("/", "-", v[1]); print v[1]}') -+ local LV=$(awk -vdev="$dev" 'BEGIN{split(dev, v, "-"); gsub("/", "-", v[2]); print v[2]}') -+ GRUB_DEVICE=/dev/$VG/$LV -+;; ++ /dev/mapper/*-*) ++ LVM2_LV_NAME='' LVM2_VG_NAME='' ++ eval $(lvs --noheadings --nameprefixes "$GRUB_DEVICE" 2>/dev/null) ++ if [ -n "$LVM2_VG_NAME$LVM2_LV_NAME" ]; then ++ GRUB_DEVICE=/dev/$LVM2_VG_NAME/$LVM2_LV_NAME ++ fi ++ ;; +esac + GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true + GRUB_DEVICE_PARTUUID="`${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2> /dev/null`" || true - # Device containing our /boot partition. Usually the same as GRUB_DEVICE.