Changeset 2449


Ignore:
Timestamp:
Oct 6, 2009, 1:10:35 AM (9 years ago)
Author:
bruno
Message:
  • Adds support for grub2 conf file grub.cfg in addition to menu.lst
Location:
branches/2.2.9/mondo/src
Files:
4 edited

Legend:

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

    r2427 r2449  
    699699                ("ln -sf /boot/grub/grub.conf /boot/grub/menu.lst", 5);
    700700        }
    701         if (!does_file_exist("/boot/grub/menu.lst")) {
     701        if ((!does_file_exist("/boot/grub/menu.lst")) || (!does_file_exist("/boot/grub/grub.cfg"))) {
    702702            fatal_error
    703                 ("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst but I cannot find it there. What is wrong with your Linux distribution?");
     703                ("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst /boot/grub/grub.cfg or but I cannot find it there. What is wrong with your Linux distribution?");
    704704        }
    705705    } else if (bkpinfo->boot_loader == 'E') {
  • branches/2.2.9/mondo/src/mondorestore/mondo-rstr-tools.c

    r2403 r2449  
    14041404    backup_crucial_file(MNT_RESTORING, "/etc/fstab");
    14051405    backup_crucial_file(MNT_RESTORING, "/boot/grub/menu.lst");
     1406    backup_crucial_file(MNT_RESTORING, "/boot/grub/grub.cfg");
    14061407    backup_crucial_file(MNT_RESTORING, "/etc/lilo.conf");
    14071408    backup_crucial_file(MNT_RESTORING, "/etc/elilo.conf");
     
    15381539        mvaddstr_and_log_it(g_currentY,
    15391540                            0,
    1540                             "Modifying fstab, mtab, device.map and menu.lst, and running GRUB...                             ");
     1541                            "Modifying fstab, mtab, device.map and menu.lst/grub.cfg, and running GRUB...                             ");
    15411542        for (done = FALSE; !done;) {
    15421543            popup_and_get_string("Boot device",
     
    15551556                done = TRUE;
    15561557            }
    1557             popup_and_OK("You will now edit fstab, mtab, device.map and menu.lst");
     1558            popup_and_OK("You will now edit fstab, mtab, device.map and menu.lst/grub.cfg");
    15581559            if (!g_text_mode) {
    15591560                newtSuspend();
     
    15631564            sprintf(tmp, "chroot %s %s /etc/mtab", MNT_RESTORING, editor);
    15641565            paranoid_system(tmp);
    1565             sprintf(tmp, "chroot %s %s /boot/grub/menu.lst", MNT_RESTORING, editor);
     1566            if (does_file_exist(MNT_RESTORING"/boot/grub/menu.lst")) {
     1567                sprintf(tmp, "chroot %s %s /boot/grub/menu.lst", MNT_RESTORING, editor);
     1568            } else if (does_file_exist(MNT_RESTORING"/boot/grub/grub.cfg")) {
     1569                sprintf(tmp, "chroot %s %s /boot/grub/grub.cfg", MNT_RESTORING, editor);
     1570            }
    15661571            paranoid_system(tmp);
    15671572            sprintf(tmp, "chroot %s %s /boot/grub/device.map", MNT_RESTORING, editor);
  • branches/2.2.9/mondo/src/restore-scripts/mondo/grub-MR

    r2185 r2449  
    159159# ---------------------------------
    160160
    161 echo "Trying to use the existing menu.lst file in batch mode" >> $LOGFILE
    162 chroot /mnt/RESTORING grub --batch < /mnt/RESTORING/boot/grub/menu.lst
     161if [ -f "/mnt/RESTORING/boot/grub/menu.lst" ]; then
     162    GRUBCFGFILE=/boot/grub/menu.lst
     163elif [ -f "/mnt/RESTORING/boot/grub/grub.cfg" ]; then
     164    GRUBCFGFILE=/boot/grub/grub.cfg
     165else
     166    echo "Unable to find Grub conf file"
     167    exit -1
     168fi
     169echo "Trying to use the existing $GRUBCFGFILE file in batch mode" >> $LOGFILE
     170chroot /mnt/RESTORING grub --batch < /mnt/RESTORING$GRUBCFGFILE
    163171res=$?
    164 echo "menu.lst approach returned $res" >> $LOGFILE
     172echo "$GRUBCFGFILE approach returned $res" >> $LOGFILE
    165173[ "$res" -eq "0" ] && exit 0
    166174
  • branches/2.2.9/mondo/src/restore-scripts/mondo/stabgrub-me

    r2095 r2449  
    5757LocateOldGrub() {
    5858    old_grubconf=""
    59     if [ -f "/mnt/RESTORING/boot/grub/menu.lst" ] ; then
    60         LogIt "No need for menu.lst search." 2
    61         old_grubconf=/mnt/RESTORING/boot/grub/menu.lst
     59    if [ -f "/mnt/RESTORING/boot/grub/menu.lst" ] || [ -f "/mnt/RESTORING/boot/grub/grub.cfg" ] ; then
     60        LogIt "No need for menu.lst/grub.cfg search." 2
     61        if [ -f "/mnt/RESTORING/boot/grub/menu.lst" ]; then
     62            old_grubconf=/mnt/RESTORING/boot/grub/menu.lst
     63        elif [ -f "/mnt/RESTORING/boot/grub/grub.cfg" ]; then
     64            old_grubconf=/mnt/RESTORING/boot/grub/grub.cfg
     65        fi
    6266        if [ -L "$old_grubconf" ] ; then
    6367            l=`readlink "$old_grubconf"`
     
    120124LogIt "OK so far: I've found all the files I need." 2
    121125new_fstab=/mnt/RESTORING/etc/fstab.NEW
    122 new_grubconf=/mnt/RESTORING/boot/grub/menu.lst.NEW
     126if [ -f /mnt/RESTORING/boot/grub/menu.lst ]; then
     127    new_grubconf=/mnt/RESTORING/boot/grub/menu.lst.NEW
     128elif [ -f /mnt/RESTORING/boot/grub/grub.cfg ]; then
     129    new_grubconf=/mnt/RESTORING/boot/grub/grub.cfg.NEW
     130fi
    123131# change back to /tmp if /mnt/RESTORING/etc be problematic
    124132
Note: See TracChangeset for help on using the changeset viewer.