Add some patches to grub.
[people/pmueller/ipfire-2.x.git] / src / patches / grub-0.97-bz429187-cciss.patch
1 diff -up grub-0.97/util/grub-install.in.cciss grub-0.97/util/grub-install.in
2 --- grub-0.97/util/grub-install.in.cciss 2008-02-04 14:30:31.000000000 -0500
3 +++ grub-0.97/util/grub-install.in 2008-02-07 18:34:14.000000000 -0500
4 @@ -100,25 +100,56 @@ convert () {
5 # Break the device name into the disk part and the partition part.
6 case "$host_os" in
7 linux*)
8 + # formats that need to be handled (disk name -> partition name):
9 + # floppies: /dev/fd0
10 + # normal sd/hd devices: /dev/hda -> /dev/hda3
11 + # md: /dev/md0 -> /dev/md0p0
12 + # ide raid devs: /dev/ide/host0/bus0/target0/lun0/disc
13 + # -> /dev/ide/host0/bus0/target0/lun0/part1
14 + # cciss: /dev/cciss/c0d0 -> /dev/cciss/c0d0p1
15 + # mpath devs: /dev/mapper/mpath0 -> /dev/mapper/mpath0p1
16 + # /dev/mapper/lalala -> /dev/mapper/lalalap1
17 + # dmraid devs: /dev/mapper/via_abcdef -> /dev/mapper/via_abcdefp1
18 + # /dev/mapper/isw_Volume0_abcdef -> /dev/mapper/isw_Volume0_abcdefp1
19 + # the known list (to me) is (X means we should handle it):
20 + # X asr_[unfettered crap]
21 + # hpt[0-9]+x_[0-9]+-[0-9]+
22 + # X hpt[0-9]+x_[0-9]+
23 + # hpt[0-9]+x_SPARE
24 + # isw_[a-z]+_[a-z]+[0-9]+
25 + # X isw_[a-z]+
26 + # jm_[0-9]+-[0-9]+
27 + # X jm_[0-9]+
28 + # lsi_[0-9]+-[0-9]+
29 + # X lsi_[0-9]+
30 + # nvidia_[a-z]+-[0-9]+
31 + # X nvidia_[a-z]+
32 + # pdc_[a-z]+-[0-9]+
33 + # X pdc_[a-z]+
34 + # sil_[0-9]+-[0-9]+
35 + # X sil_[0-9]+
36 + # via_[a-z]+-[0-9]+
37 + # X via_[a-z]+
38 + #
39 + # more?
40 tmp_disk=`echo "$1" | grep -v '/mapper/control$' |
41 - grep -v '/mapper/[[:alnum:]]\+-[[:alnum:]]\+$' | uniq |
42 + grep -v '/mapper/[[:alnum:]_]\+-[[:digit:]]\+$' | uniq |
43 sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \
44 - -e 's%\(d[0-9]*\)p[0-9]*$%\1%' \
45 - -e 's%\(fd[0-9]*\)$%\1%' \
46 - -e 's%/part[0-9]*$%/disc%' \
47 - -e 's%\(c[0-7]d[0-9]*\).*$%\1%' \
48 - -e 's%\(/mapper/[[:alpha:]]\+[[:digit:]]\+\)p[[:digit:]]\+$%\1%' \
49 - -e 's%\(/mapper/[[:alpha:]]\+_[[:alpha:]]\+\)[[:digit:]]\+$%\1%'`
50 + -e 's%\(/c[0-9]\+d[0-9]\+\).*$%\1%' \
51 + -e 's%\(fd[0-9]*\)$%\1%' \
52 + -e 's%/part[0-9]*$%/disc%' \
53 + -e 's%\(/mapper/[[:alnum:]_-]\+\)\+p[[:digit:]]\+$%\1%'\
54 + -e 's%\(/mapper/[[:alnum:]]\+\(_[[:alnum:]]\+\)\+\)\p[[:digit:]]\+$%\1%'`
55 tmp_part=`echo "$1" | grep -v '/mapper/control$' |
56 - grep -v '/mapper/[[:alnum:]]\+-[[:alnum:]]\+$' | uniq |
57 + grep -v '/mapper/[[:alnum:]_]\+-[[:digit:]]\+$' | uniq |
58 sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \
59 - -e 's%.*d[0-9]*p%%' \
60 - -e 's%.*/fd[0-9]*$%%' \
61 - -e 's%.*/floppy/[0-9]*$%%' \
62 - -e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%' \
63 - -e 's%.*c[0-7]d[0-9]*p%%' \
64 - -e 's%.*/mapper/[[:alpha:]]\+[[:digit:]]\+p\([[:digit:]]\+\)$%\1%' \
65 - -e 's%.*/mapper/[[:alpha:]]\+_[[:alpha:]]\+\([[:digit:]]\+\)$%\1%' |
66 + -e 's%.*/c[0-9]\+d[0-9]\+p\([[:digit:]]\+\)%\1%' \
67 + -e 's%.*/c[0-9]\+d[0-9]\+$%%' \
68 + -e 's%.*/fd[0-9]\+$%%' \
69 + -e 's%.*/floppy/[0-9]*$%%' \
70 + -e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%' \
71 + -e 's%.*/mapper/[[:alpha:]]\+[[:digit:]]\+p\([[:digit:]]\+\)$%\1%' \
72 + -e 's%.*/mapper/[[:alnum:]]\+\(_[[:alpha:]]\+[[:digit:]]*\)\+p\([[:digit:]]\+\)$%\2%' |
73 grep -v '.*/mapper/.*'`
74 ;;
75 gnu*)