Changeset 2944 in MondoRescue for branches/3.0/mondo/src/restore-scripts


Ignore:
Timestamp:
Feb 3, 2012, 2:12:47 AM (12 years ago)
Author:
Bruno Cornec
Message:
  • Adds grub2 support (Michael Caerwyn mcaerwyn_at_gmail.com)
Location:
branches/3.0/mondo/src/restore-scripts/mondo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/restore-scripts/mondo/grub-MR

    r2920 r2944  
    133133[ "$res" -eq "0" ] && exit 0
    134134
     135
     136echo "Now I'll use grub2-install" >> $LOGFILE
     137if [ "$MNT_RESTORING" ] ; then
     138    chroot $MNT_RESTORING grub2-install $1 >> $LOGFILE 2>> $LOGFILE
     139    res=$?
     140else
     141    grub2-install $1 >> $LOGFILE 2>> $LOGFILE
     142    res=$?
     143fi
     144echo "grub2-install returned $res" >> $LOGFILE
     145[ "$res" -eq "0" ] && exit 0
     146
    135147echo "Trying a hack" >> $LOGFILE
    136148FindBootPart $1 $2 2>&1 | tee -a $LOGFILE
  • branches/3.0/mondo/src/restore-scripts/mondo/stabgrub-me

    r2449 r2944  
    5757LocateOldGrub() {
    5858    old_grubconf=""
    59     if [ -f "/mnt/RESTORING/boot/grub/menu.lst" ] || [ -f "/mnt/RESTORING/boot/grub/grub.cfg" ] ; then
     59    if [ -f "/mnt/RESTORING/boot/grub/menu.lst" ] || [ -f "/mnt/RESTORING/boot/grub/grub.cfg" ] || [ -f "/mnt/RESTORING/boot/grub2/grub.cfg" ] ; then
    6060        LogIt "No need for menu.lst/grub.cfg search." 2
    6161        if [ -f "/mnt/RESTORING/boot/grub/menu.lst" ]; then
     
    6363        elif [ -f "/mnt/RESTORING/boot/grub/grub.cfg" ]; then
    6464            old_grubconf=/mnt/RESTORING/boot/grub/grub.cfg
     65        elif [ -f "/mnt/RESTORING/boot/grub2/grub.cfg" ]; then
     66            old_grubconf=/mnt/RESTORING/boot/grub2/grub.cfg
    6567        fi
    6668        if [ -L "$old_grubconf" ] ; then
     
    6870            if [ _"`echo $l | cut -c1`" = _"/" ]; then
    6971                # If readlink gives an absolute path it's related to the chroot
    70                 old_grubconf=/mnt/RESTORING/$l
     72                        old_grubconf=/mnt/RESTORING/$l
    7173            else
    7274                # If readlink gives a relative path, it's in the same dir
    73                 old_grubconf=/mnt/RESTORING/boot/grub/$l
     75                    d=`dirname "$old_grubconf"`
     76                        old_grubconf=$d/$l
    7477            fi
    75         fi 
     78        fi
    7679        return 0
    7780    fi
     
    128131elif [ -f /mnt/RESTORING/boot/grub/grub.cfg ]; then
    129132    new_grubconf=/mnt/RESTORING/boot/grub/grub.cfg.NEW
     133elif [ -f /mnt/RESTORING/boot/grub2/grub.cfg ]; then
     134    new_grubconf=/mnt/RESTORING/boot/grub2/grub.cfg.NEW
    130135fi
    131136# change back to /tmp if /mnt/RESTORING/etc be problematic
Note: See TracChangeset for help on using the changeset viewer.