1 --- grub-0.95/util/grub-install.in.md2 2005-01-03 14:49:18.133866107 -0500
2 +++ grub-0.95/util/grub-install.in 2005-01-03 16:35:44.923732271 -0500
18 + $grub_shell --batch $no_floppy --device-map=$device_map <<EOF >$log_file
19 +dump ${root_drive}${tmp} ${img_file}
25 +install_boot_block () {
26 + # Before all invocations of the grub shell, call sync to make sure
27 + # the raw device is in sync with any bufferring in filesystems.
30 + # Now perform the installation.
31 + $grub_shell --batch $no_floppy --device-map=$device_map <<EOF >>$log_file
33 +setup $force_lba --stage2=$grubdir/stage2 --prefix=$grub_prefix $2
39 # Check the arguments.
40 for option in "$@"; do
43 # Check for INSTALL_DEVICE.
44 case "$install_device" in
46 - # If we are running md on a Linux box, just use the first physical device
48 install_device=`resolve_symlink "$install_device"`
49 - install_device=`find_real_devs $install_device | awk '{print $1}'`
51 - install_drive=`convert "$install_device"`
52 - # I don't know why, but some shells wouldn't die if exit is
53 - # called in a function.
54 - if test "x$install_drive" = x; then
55 + for install_drive in `find_real_devs $install_device` ; do
56 + install_drive=`convert $install_drive`
57 + if [ "x$install_drive" = "x" ]; then
60 + install_drives="${install_drives} ${install_drive}"
64 + if test "x$install_drives" = x ; then
68 - install_drive="$install_device" ;;
69 + install_drives="$install_device" ;;
71 # The GRUB format with no parenthesis.
72 - install_drive="($install_device)" ;;
73 + install_drives="($install_device)" ;;
75 echo "Format of install_device not recognized." 1>&2
83 root_device=`find_device ${rootdir}`
84 bootdir_device=`find_device ${bootdir}`
86 test -n "$mkimg" && img_file=`$mkimg`
87 test -n "$mklog" && log_file=`$mklog`
89 -for real_device in `find_real_devs $root_device`; do
90 - # Convert the root deviceto a GRUB drive.
91 - root_drive=`convert "$real_device"`
92 - if [ "x$root_drive" = x ]; then
95 +# There's not a real root device, so just pick the first
96 +if is_raid1_device $root_device ; then
97 + root_device=`find_real_devs $root_device | awk '{print $1}'`
100 - for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
102 - tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"`
103 - while test $count -gt 0; do
105 - $grub_shell --batch $no_floppy --device-map=$device_map \
107 -dump ${root_drive}${tmp} ${img_file}
110 - if grep "Error [0-9]*: " $log_file >/dev/null; then
112 - elif cmp $file $img_file >/dev/null; then
116 - count=`expr $count - 1`
118 - if test $count -eq 0; then
119 - echo "The file $file not read correctly." 1>&2
123 +# Convert the root deviceto a GRUB drive.
124 +root_drive=`convert "$root_device"`
125 +if [ "x$root_drive" = x ]; then
131 +for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
133 + tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"`
134 + while test $count -gt 0; do
135 + dump_boot_block $root_drive $img_file
136 + if grep "Error [0-9]*: " $log_file >/dev/null; then
138 + elif cmp $file $img_file >/dev/null; then
142 + count=`expr $count - 1`
144 + if test $count -eq 0; then
145 + echo "The file $file not read correctly." 1>&2
153 if ! test -e ${grubdir}/grub.conf ; then
154 test -e ${grubdir}/menu.lst && ln -s ./menu.lst ${grubdir}/grub.conf
156 @@ -507,24 +534,13 @@
157 # Create a safe temporary file.
158 test -n "$mklog" && log_file=`$mklog`
160 -for real_device in `find_real_devs $root_device`; do
161 +for install_drive in $install_drives; do
162 # Convert the root deviceto a GRUB drive.
163 - root_drive=`convert "$real_device"`
164 + root_drive=`convert "$root_device"`
165 if [ "x$root_drive" = x ]; then
169 - # Before all invocations of the grub shell, call sync to make sure
170 - # the raw device is in sync with any bufferring in filesystems.
173 - # Now perform the installation.
174 - $grub_shell --batch $no_floppy --device-map=$device_map <<EOF >>$log_file
176 -setup $force_lba --stage2=$grubdir/stage2 --prefix=$grub_prefix $root_drive
180 + install_boot_block $root_drive $install_drive
183 if grep "Error [0-9]*: " $log_file >/dev/null ; then