]> git.pld-linux.org Git - packages/grub2.git/blame - grub-lvmdevice.patch
- drop invalid comment
[packages/grub2.git] / grub-lvmdevice.patch
CommitLineData
f7ae30d0
ER
1--- grub-1.97.1/util/grub-mkconfig.in~ 2009-11-17 17:02:16.626243372 +0200
2+++ grub-1.97.1/util/grub-mkconfig.in 2009-11-17 17:02:08.346050859 +0200
5c39b5a7 3@@ -120,6 +120,21 @@
f7ae30d0
ER
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
5c39b5a7 11+# /dev/mapper/vg--meaw-root -> /dev/vg-meaw/root
f7ae30d0
ER
12+case "$GRUB_DEVICE" in
13+/dev/mapper/*-*)
5c39b5a7
ER
14+ # change "--" to / (as "/" is impossible in LV name)
15+ local dev=$(awk -vdev="${GRUB_DEVICE#/dev/mapper/}" 'BEGIN{gsub(/--/, "/", dev); print dev}')
16+ local VG=$(awk -vdev="$dev" 'BEGIN{split(dev, v, "-"); gsub("/", "-", v[1]); print v[1]}')
17+ local LV=$(awk -vdev="$dev" 'BEGIN{split(dev, v, "-"); gsub("/", "-", v[2]); print v[2]}')
f7ae30d0
ER
18+ GRUB_DEVICE=/dev/$VG/$LV
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.
This page took 0.036986 seconds and 4 git commands to generate.