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)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.