Changeset 2095 in MondoRescue


Ignore:
Timestamp:
Dec 17, 2008, 5:26:31 PM (12 years ago)
Author:
Bruno Cornec
Message:

Use /boot/grub/menu.lst everywhere instead of meesing up with /etc/grub.conf

Location:
branches/2.2.8/mondo/src
Files:
5 edited

Legend:

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

    r2030 r2095  
    724724    } else if (bkpinfo->boot_loader == 'G') {
    725725        strcpy(bootldr_str, "GRUB");
    726         if (!does_file_exist("/etc/grub.conf")
     726        if (!does_file_exist("/boot/grub/menu.lst")
    727727            && does_file_exist("/boot/grub/grub.conf")) {
    728728            run_program_and_log_output
    729                 ("ln -sf /boot/grub/grub.conf /etc/grub.conf", 5);
    730         }
    731         /* Detect Debian's grub config file */
    732         else if (!does_file_exist("/etc/grub.conf")
    733                  && does_file_exist("/boot/grub/menu.lst")) {
    734             run_program_and_log_output
    735                 ("ln -s /boot/grub/menu.lst /etc/grub.conf", 5);
    736         }
    737         if (!does_file_exist("/etc/grub.conf")) {
     729                ("ln -sf /boot/grub/grub.conf /boot/grub/menu.lst", 5);
     730        }
     731        if (!does_file_exist("/boot/grub/menu.lst")) {
    738732            fatal_error
    739                 ("The de facto standard location for your boot loader's config file is /etc/grub.conf but I cannot find it there. What is wrong with your Linux distribution? Try 'ln -s /boot/grub/menu.lst /etc/grub.conf'...");
     733                ("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?");
    740734        }
    741735    } else if (bkpinfo->boot_loader == 'E') {
  • branches/2.2.8/mondo/src/mondorestore/mondo-rstr-tools.c

    r2094 r2095  
    13951395
    13961396    backup_crucial_file(MNT_RESTORING, "/etc/fstab");
    1397     backup_crucial_file(MNT_RESTORING, "/etc/grub.conf");
     1397    backup_crucial_file(MNT_RESTORING, "/boot/grub/menu.lst");
    13981398    backup_crucial_file(MNT_RESTORING, "/etc/lilo.conf");
    13991399    backup_crucial_file(MNT_RESTORING, "/etc/elilo.conf");
     
    15301530        mvaddstr_and_log_it(g_currentY,
    15311531                            0,
    1532                             "Modifying fstab, mtab, device.map and grub.conf, and running GRUB...                             ");
     1532                            "Modifying fstab, mtab, device.map and menu.lst, and running GRUB...                             ");
    15331533        for (done = FALSE; !done;) {
    15341534            popup_and_get_string("Boot device",
     
    15471547                done = TRUE;
    15481548            }
    1549             popup_and_OK("You will now edit fstab, mtab, device.map and grub.conf");
     1549            popup_and_OK("You will now edit fstab, mtab, device.map and menu.lst");
    15501550            if (!g_text_mode) {
    15511551                newtSuspend();
     
    15551555            sprintf(tmp, "chroot %s %s /etc/mtab", MNT_RESTORING, editor);
    15561556            paranoid_system(tmp);
    1557             sprintf(tmp, "chroot %s %s /etc/grub.conf", MNT_RESTORING, editor);
     1557            sprintf(tmp, "chroot %s %s /boot/grub/menu.lst", MNT_RESTORING, editor);
    15581558            paranoid_system(tmp);
    15591559            sprintf(tmp, "chroot %s %s /boot/grub/device.map", MNT_RESTORING, editor);
  • branches/2.2.8/mondo/src/restore-scripts/mondo/grub-MR

    r1315 r2095  
    158158# ---------------------------------
    159159
    160 echo "Trying to use the existing grub.conf file in batch mode" >> $LOGFILE
    161 chroot /mnt/RESTORING grub --batch < /mnt/RESTORING/etc/grub.conf
     160echo "Trying to use the existing menu.lst file in batch mode" >> $LOGFILE
     161chroot /mnt/RESTORING grub --batch < /mnt/RESTORING/boot/grub/menu.lst
    162162res=$?
    163 echo "Grub.conf approach returned $res" >> $LOGFILE
     163echo "menu.lst approach returned $res" >> $LOGFILE
    164164[ "$res" -eq "0" ] && exit 0
    165165
  • branches/2.2.8/mondo/src/restore-scripts/mondo/grub-install.patched

    r1999 r2095  
    500500rm -f $log_file
    501501
    502 if ! test -e ${grubdir}/grub.conf ; then
    503     test -e ${grubdir}/menu.lst && ln -s ./menu.lst ${grubdir}/grub.conf
    504 fi
    505 
    506502# Create a safe temporary file.
    507503test -n "$mklog" && log_file=`$mklog`
  • branches/2.2.8/mondo/src/restore-scripts/mondo/stabgrub-me

    r1448 r2095  
    1919LocateOldFstab() {
    2020    old_fstab=""
    21     old_grubconf=""
    2221    if [ -f "/mnt/RESTORING/etc/fstab" ] ; then
    2322        LogIt "No need for fstab search." 2
    2423#        fstab_list=/mnt/RESTORING/etc/fstab
    2524        old_fstab=/mnt/RESTORING/etc/fstab
    26         old_grubconf=/mnt/RESTORING/etc/grub.conf
    27         # For some distros, e.g. Debian, /etc/grub.conf is a symbolic link
    28         # which we need to resolve and prepend with /mnt/RESTORING because
    29         # we run this outside the chroot.
    30         if [ -L "$old_grubconf" ] ; then
    31             l=`readlink "$old_grubconf"`
    32             if [ _"`echo $l | cut -c1`" = _"/" ]; then
    33                 # If readlink gives an absolute path it's related to the chroot
    34                 old_grubconf=/mnt/RESTORING/$l
    35             else
    36                 # If readlink gives a relative path, it's in the same dir
    37                 old_grubconf=/mnt/RESTORING/etc/$l
    38             fi
    39         fi 
    4025        return 0
    4126    elif [ -f "/mnt/cdrom/archives/CUCKOO" ] ; then
     
    6550        return 1
    6651    fi
    67     old_grubconf=$where_they_live/grub.conf
    6852    old_fstab=$where_they_live/fstab
    69     LogIt "GRUB and fstab found." 2
     53    LogIt "fstab found." 2
    7054    return 0
     55}
     56
     57LocateOldGrub() {
     58    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
     62        if [ -L "$old_grubconf" ] ; then
     63            l=`readlink "$old_grubconf"`
     64            if [ _"`echo $l | cut -c1`" = _"/" ]; then
     65                # If readlink gives an absolute path it's related to the chroot
     66                old_grubconf=/mnt/RESTORING/$l
     67            else
     68                # If readlink gives a relative path, it's in the same dir
     69                old_grubconf=/mnt/RESTORING/boot/grub/$l
     70            fi
     71        fi 
     72        return 0
     73    fi
     74    LogIt "GRUB not found." 2
     75    return 1
    7176}
    7277
     
    106111LogIt "stabgrub-me '$1' --- starting"
    107112LocateOldFstab
     113LocateOldGrub
    108114old_mountlist=/tmp/mountlist.original
    109115new_mountlist=/tmp/mountlist.txt
     
    114120LogIt "OK so far: I've found all the files I need." 2
    115121new_fstab=/mnt/RESTORING/etc/fstab.NEW
    116 new_grubconf=/mnt/RESTORING/etc/grub.conf.NEW
     122new_grubconf=/mnt/RESTORING/boot/grub/menu.lst.NEW
    117123# change back to /tmp if /mnt/RESTORING/etc be problematic
    118124
Note: See TracChangeset for help on using the changeset viewer.