Fix grub installation on virtio hdd.
[people/pmueller/ipfire-2.x.git] / src / patches / grub-0.97_grub-install_virtio.patch
1 --- grub-0.97/util/grub-install.in 2010-06-24 08:47:23.000000000 +0200
2 +++ grub-0.97/util/grub-install.in 2010-06-24 09:20:42.000000000 +0200
3 @@ -102,7 +102,7 @@
4 linux*)
5 # formats that need to be handled (disk name -> partition name):
6 # floppies: /dev/fd0
7 - # normal sd/hd devices: /dev/hda -> /dev/hda3
8 + # normal sd/hd/vd devices: /dev/hda -> /dev/hda3
9 # md: /dev/md0 -> /dev/md0p0
10 # ide raid devs: /dev/ide/host0/bus0/target0/lun0/disc
11 # -> /dev/ide/host0/bus0/target0/lun0/part1
12 @@ -134,7 +134,7 @@
13 # more?
14 tmp_disk=`echo "$1" | grep -v '/mapper/control$' |
15 grep -v '/mapper/[[:alnum:]_]\+-[[:digit:]]\+$' | uniq |
16 - sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \
17 + sed -e 's%\([shv]d[a-z]\)[0-9]*$%\1%' \
18 -e 's%\(/c[0-9]\+d[0-9]\+\).*$%\1%' \
19 -e 's%\(fd[0-9]*\)$%\1%' \
20 -e 's%/part[0-9]*$%/disc%' \
21 @@ -142,7 +142,7 @@
22 -e 's%\(/mapper/[[:alnum:]]\+\(_[[:alnum:]]\+\)\+\)\p[[:digit:]]\+$%\1%'`
23 tmp_part=`echo "$1" | grep -v '/mapper/control$' |
24 grep -v '/mapper/[[:alnum:]_]\+-[[:digit:]]\+$' | uniq |
25 - sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \
26 + sed -e 's%.*/[shv]d[a-z]\([0-9]*\)$%\1%' \
27 -e 's%.*/c[0-9]\+d[0-9]\+p\([[:digit:]]\+\)%\1%' \
28 -e 's%.*/c[0-9]\+d[0-9]\+$%%' \
29 -e 's%.*/fd[0-9]\+$%%' \
30 @@ -509,6 +509,10 @@
31 if test -f "$device_map"; then
32 :
33 else
34 +
35 + tmp_disk=`echo "$install_device" | grep "/dev/vd"`
36 + if test "x$tmp_disk" = x; then
37 +
38 # Create a safe temporary file.
39 test -n "$mklog" && log_file=`$mklog`
40
41 @@ -525,6 +529,11 @@
42 fi
43
44 rm -f $log_file
45 +
46 + else
47 + echo "Create fake device.map for virtio device $1" 1>&2
48 + echo "(hd0) $install_device" > $device_map
49 + fi
50 fi
51
52 # Make sure that there is no duplicated entry.