Changeset 2095 in MondoRescue for branches/2.2.8/mondo/src/restore-scripts/mondo/stabgrub-me
- Timestamp:
- Dec 17, 2008, 5:26:31 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.