Changeset 2095 in MondoRescue
- Timestamp:
- Dec 17, 2008, 5:26:31 PM (16 years ago)
- 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 724 724 } else if (bkpinfo->boot_loader == 'G') { 725 725 strcpy(bootldr_str, "GRUB"); 726 if (!does_file_exist("/ etc/grub.conf")726 if (!does_file_exist("/boot/grub/menu.lst") 727 727 && does_file_exist("/boot/grub/grub.conf")) { 728 728 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")) { 738 732 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?"); 740 734 } 741 735 } else if (bkpinfo->boot_loader == 'E') { -
branches/2.2.8/mondo/src/mondorestore/mondo-rstr-tools.c
r2094 r2095 1395 1395 1396 1396 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"); 1398 1398 backup_crucial_file(MNT_RESTORING, "/etc/lilo.conf"); 1399 1399 backup_crucial_file(MNT_RESTORING, "/etc/elilo.conf"); … … 1530 1530 mvaddstr_and_log_it(g_currentY, 1531 1531 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... "); 1533 1533 for (done = FALSE; !done;) { 1534 1534 popup_and_get_string("Boot device", … … 1547 1547 done = TRUE; 1548 1548 } 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"); 1550 1550 if (!g_text_mode) { 1551 1551 newtSuspend(); … … 1555 1555 sprintf(tmp, "chroot %s %s /etc/mtab", MNT_RESTORING, editor); 1556 1556 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); 1558 1558 paranoid_system(tmp); 1559 1559 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 158 158 # --------------------------------- 159 159 160 echo "Trying to use the existing grub.conffile in batch mode" >> $LOGFILE161 chroot /mnt/RESTORING grub --batch < /mnt/RESTORING/ etc/grub.conf160 echo "Trying to use the existing menu.lst file in batch mode" >> $LOGFILE 161 chroot /mnt/RESTORING grub --batch < /mnt/RESTORING/boot/grub/menu.lst 162 162 res=$? 163 echo " Grub.confapproach returned $res" >> $LOGFILE163 echo "menu.lst approach returned $res" >> $LOGFILE 164 164 [ "$res" -eq "0" ] && exit 0 165 165 -
branches/2.2.8/mondo/src/restore-scripts/mondo/grub-install.patched
r1999 r2095 500 500 rm -f $log_file 501 501 502 if ! test -e ${grubdir}/grub.conf ; then503 test -e ${grubdir}/menu.lst && ln -s ./menu.lst ${grubdir}/grub.conf504 fi505 506 502 # Create a safe temporary file. 507 503 test -n "$mklog" && log_file=`$mklog` -
branches/2.2.8/mondo/src/restore-scripts/mondo/stabgrub-me
r1448 r2095 19 19 LocateOldFstab() { 20 20 old_fstab="" 21 old_grubconf=""22 21 if [ -f "/mnt/RESTORING/etc/fstab" ] ; then 23 22 LogIt "No need for fstab search." 2 24 23 # fstab_list=/mnt/RESTORING/etc/fstab 25 24 old_fstab=/mnt/RESTORING/etc/fstab 26 old_grubconf=/mnt/RESTORING/etc/grub.conf27 # For some distros, e.g. Debian, /etc/grub.conf is a symbolic link28 # which we need to resolve and prepend with /mnt/RESTORING because29 # we run this outside the chroot.30 if [ -L "$old_grubconf" ] ; then31 l=`readlink "$old_grubconf"`32 if [ _"`echo $l | cut -c1`" = _"/" ]; then33 # If readlink gives an absolute path it's related to the chroot34 old_grubconf=/mnt/RESTORING/$l35 else36 # If readlink gives a relative path, it's in the same dir37 old_grubconf=/mnt/RESTORING/etc/$l38 fi39 fi40 25 return 0 41 26 elif [ -f "/mnt/cdrom/archives/CUCKOO" ] ; then … … 65 50 return 1 66 51 fi 67 old_grubconf=$where_they_live/grub.conf68 52 old_fstab=$where_they_live/fstab 69 LogIt " GRUB andfstab found." 253 LogIt "fstab found." 2 70 54 return 0 55 } 56 57 LocateOldGrub() { 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 71 76 } 72 77 … … 106 111 LogIt "stabgrub-me '$1' --- starting" 107 112 LocateOldFstab 113 LocateOldGrub 108 114 old_mountlist=/tmp/mountlist.original 109 115 new_mountlist=/tmp/mountlist.txt … … 114 120 LogIt "OK so far: I've found all the files I need." 2 115 121 new_fstab=/mnt/RESTORING/etc/fstab.NEW 116 new_grubconf=/mnt/RESTORING/ etc/grub.conf.NEW122 new_grubconf=/mnt/RESTORING/boot/grub/menu.lst.NEW 117 123 # change back to /tmp if /mnt/RESTORING/etc be problematic 118 124
Note:
See TracChangeset
for help on using the changeset viewer.