- Timestamp:
- Apr 8, 2010, 4:16:04 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/restore-scripts/mondo/grub-MR
r2615 r2619 105 105 echo "Now I'll use grub-install" >> $LOGFILE 106 106 if [ "$MNT_RESTORING" ] ; then 107 chroot $MNT_RESTORING grub-install $1 >>$LOGFILE107 chroot $MNT_RESTORING grub-install $1 2>&1 | tee -a $LOGFILE 108 108 res=$? 109 109 else 110 grub-install $1 >>$LOGFILE110 grub-install $1 2>&1 | tee -a $LOGFILE 111 111 res=$? 112 112 fi … … 117 117 echo "Now I'll use grub-install.unsupported" >> $LOGFILE 118 118 if [ "$MNT_RESTORING" ] ; then 119 chroot $MNT_RESTORING grub-install.unsupported $1 >>$LOGFILE119 chroot $MNT_RESTORING grub-install.unsupported $1 2>&1 | tee -a $LOGFILE 120 120 res=$? 121 121 else 122 grub-install.unsupported $1 >>$LOGFILE122 grub-install.unsupported $1 2>&1 | tee -a $LOGFILE 123 123 res=$? 124 124 fi … … 128 128 echo "Trying a hack" >> $LOGFILE 129 129 FindBootPart $1 $2 2>&1 | tee -a $LOGFILE 130 mbrdev=`echo $1 | sed 's/ [^0-9]*\([0-9]*\)$/\1/'`130 mbrdev=`echo $1 | sed 's/\([^0-9]*\)[0-9]*$/\1/'` 131 131 if echo $bootpart | grep "/cciss/" > /dev/null ; then 132 132 partno=`basename $bootpart | cut -d'p' -f2` 133 mbrdev=`echo $mbrdev | cut -d'p' -f1` 133 134 elif echo $bootpart | grep "/mapper/mpath" > /dev/null ; then 134 135 partno=`basename $bootpart | cut -d'p' -f3` 136 mbrdev=`echo $mbrdev | cut -d'p' -f1` 135 137 else 136 138 partno=`basename $bootpart | sed 's/[a-z]*//'` … … 160 162 for driveno in 0 1 2 ; do 161 163 try_grub_hack $driveno $partno "" >> $LOGFILE 2>> $LOGFILE && break 162 try_grub_ Hack $driveno $partno "find $BOOTPATHNAME/stage1" >> $LOGFILE 2>> $LOGFILE && break164 try_grub_hack $driveno $partno "find $BOOTPATHNAME/stage1" >> $LOGFILE 2>> $LOGFILE && break 163 165 done 164 166 res=$? … … 170 172 echo "Now I'll use grub-install.patched" >> $LOGFILE 171 173 cp -f `which grub-install.patched` /mnt/RESTORING/sbin 172 chroot /mnt/RESTORING grub-install.patched $1 >>$LOGFILE174 chroot /mnt/RESTORING grub-install.patched $1 2>&1 | tee -a $LOGFILE 173 175 res=$? 174 176 echo "grub-install.patched returned $res" >> $LOGFILE … … 178 180 179 181 if [ -f "/mnt/RESTORING/boot/grub/menu.lst" ]; then 180 GRUBCFGFILE=/boot/grub/menu.lst182 grep -vE '^#' /boot/grub/menu.lst > /mnt/RESTORING/tmp/grub.conf 181 183 elif [ -f "/mnt/RESTORING/boot/grub/grub.cfg" ]; then 182 GRUBCFGFILE=/boot/grub/grub.cfg184 grep -vE '^#' /boot/grub/grub.cfg > /mnt/RESTORING/tmp/grub.conf 183 185 else 184 echo "Unable to find Grub conf file" 186 echo "Unable to find Grub conf file" | tee -a $LOGFILE 185 187 exit -1 186 188 fi 187 echo "Trying to use the existing $GRUBCFGFILE file in batch mode" >> $LOGFILE 188 chroot /mnt/RESTORING grub --batch < /mnt/RESTORING$GRUBCFGFILE 189 echo "Trying to use the existing grub conf file in batch mode" >> $LOGFILE 190 cat /mnt/RESTORING/tmp/grub.conf >> $LOGFILE 191 chroot /mnt/RESTORING grub --batch < /mnt/RESTORING/tmp/grub.conf 189 192 res=$? 190 echo "$GRUBCFGFILE approach returned $res" >> $LOGFILE 193 echo "grub conf file approach returned $res" >> $LOGFILE 194 rm -f /mnt/RESTORING/tmp/grub.conf 191 195 [ "$res" -eq "0" ] && exit 0 192 196
Note:
See TracChangeset
for help on using the changeset viewer.