Changeset 2944


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

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/common/libmondo-archive.c

    r2931 r2944  
    701701                ("ln -sf /boot/grub/grub.conf /boot/grub/menu.lst", 5);
    702702        }
    703         if ((!does_file_exist("/boot/grub/menu.lst")) && (!does_file_exist("/boot/grub/grub.cfg"))) {
     703        if ((!does_file_exist("/boot/grub/menu.lst")) && (!does_file_exist("/boot/grub/grub.cfg")) && (!does_file_exist("/boot/grub2/grub.cfg"))) {
    704704            fatal_error
    705                 ("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst or /boot/grub/grub.cfg but I cannot find it there. What is wrong with your Linux distribution?");
     705                ("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst, /boot/grub/grub.cfg, or /boot/grub2/grub.cfg but I cannot find it there. What is wrong with your Linux distribution?");
    706706        }
    707707    } else if (bkpinfo->boot_loader == 'E') {
  • branches/3.0/mondo/src/common/libmondo-mountlist.c

    r2918 r2944  
    949949    }
    950950    paranoid_fclose(fout);
     951    if (!(fout = fopen(MONDO_MNTLISTCHG, "w"))) {
     952        log_OS_error("WMTD - Cannot openout "MONDO_MNTLISTCHG);
     953        return (1);
     954    }
     955    fprintf(fout, "the mountlist was changed by mondorestore\n");
     956    paranoid_fclose(fout);
    951957    return (0);
    952958}
  • branches/3.0/mondo/src/mondorestore/mondo-rstr-tools.c

    r2904 r2944  
    13011301    backup_crucial_file(MNT_RESTORING, "/boot/grub/menu.lst");
    13021302    backup_crucial_file(MNT_RESTORING, "/boot/grub/grub.cfg");
     1303    backup_crucial_file(MNT_RESTORING, "/boot/grub2/grub.cfg");
    13031304    backup_crucial_file(MNT_RESTORING, "/etc/lilo.conf");
    13041305    backup_crucial_file(MNT_RESTORING, "/etc/elilo.conf");
    13051306    backup_crucial_file(MNT_RESTORING, "/boot/grub/device.map");
     1307    backup_crucial_file(MNT_RESTORING, "/boot/grub2/device.map");
    13061308    backup_crucial_file(MNT_RESTORING, "/etc/mtab");
    13071309    read_cfg_var(g_mondo_cfg_file, "bootloader.device", device);
     
    14561458                } else if (does_file_exist(MNT_RESTORING"/boot/grub/grub.cfg")) {
    14571459                    sprintf(tmp, "chroot %s %s /boot/grub/grub.cfg", MNT_RESTORING, editor);
     1460                } else if (does_file_exist(MNT_RESTORING"/boot/grub2/grub.cfg")) {
     1461                    sprintf(tmp, "chroot %s %s /boot/grub2/grub.cfg", MNT_RESTORING, editor);
    14581462                }
    14591463                paranoid_system(tmp);
    1460                 sprintf(tmp, "chroot %s %s /boot/grub/device.map", MNT_RESTORING, editor);
     1464                if (does_file_exist(MNT_RESTORING"/boot/grub/device.map")) {
     1465                    sprintf(tmp, "chroot %s %s /boot/grub/device.map", MNT_RESTORING, editor);
     1466                } else if (does_file_exist(MNT_RESTORING"/boot/grub2/device.map")) {
     1467                    sprintf(tmp, "chroot %s %s /boot/grub2/device.map", MNT_RESTORING, editor);
     1468                                }
    14611469                paranoid_system(tmp);
    14621470                if (!g_text_mode) {
  • 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.