Changeset 2462 in MondoRescue for branches/2.2.10/mindi/rootfs/sbin/init
- Timestamp:
- Oct 20, 2009, 4:07:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mindi/rootfs/sbin/init
r2445 r2462 5 5 # init script launched during the restore process 6 6 #------------------------------------------------------------ 7 8 export MINDI_CACHE=CCC 7 9 8 10 if [ -e "/proc/cmdline" ]; then … … 117 119 cd $GROOVY 118 120 [ "$1" != "" ] && tapedev=$1 119 [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg 2>/dev/null | tr -s ' ' ' ' | cut -d' ' -f2`121 [ ! "$tapedev" ] && tapedev=`grep media-dev $MINDI_CACHE/mondorestore.cfg 2>/dev/null | tr -s ' ' ' ' | cut -d' ' -f2` 120 122 mt -f $tapedev rewind 121 123 mt -f $tapedev fsf 2 … … 124 126 if [ "$res" -eq "0" ] ; then 125 127 # Store the dev name in case we changed it interactively 126 if [ -f " /tmp/mondo-restore.cfg" ]; then127 sed -i "s/^media-dev .*$/media-dev $tapedev/" /tmp/mondo-restore.cfg128 if [ -f "$MINDI_CACHE/mondorestore.cfg" ]; then 129 sed -i "s/^media-dev .*$/media-dev $tapedev/" $MINDI_CACHE/mondorestore.cfg 128 130 fi 129 131 fi … … 340 342 return 341 343 fi 342 if [ -x ./mindi-rsthw ]; then344 if [ -x $MINDI_CACHE/mindi-rsthw ]; then 343 345 grep -q RESTORE $CMDLINE 344 346 if [ "$?" -ne 0 ]; then … … 354 356 fi 355 357 if [ "$answer" = "YES" ] ; then 356 ./mindi-rsthw358 $MINDI_CACHE/mindi-rsthw 357 359 fi 358 360 fi … … 454 456 return; 455 457 fi 456 if [ "`grep mpath /tmp/mountlist.txt`" ]; then458 if [ "`grep mpath $MINDI_CACHE/mountlist.txt`" ]; then 457 459 if [ -x /sbin/multipath ]; then 458 460 echo "Starting Mpath..." … … 478 480 fi 479 481 480 raid_devices=`grep /dev/md /tmp/mountlist.txt | cut -d' ' -f1`482 raid_devices=`grep /dev/md $MINDI_CACHE/mountlist.txt | cut -d' ' -f1` 481 483 if which raidstart > /dev/null 2> /dev/null ; then 482 484 for i in $raid_devices ; do … … 537 539 local res 538 540 mount | grep /mnt/cdrom && return 0 539 [ "`grep "backup_media_type" /tmp/mondo-restore.cfg 2> /dev/null | grep "cdstream"`" ] && return541 [ "`grep "backup_media_type" $MINDI_CACHE/mondorestore.cfg 2> /dev/null | grep "cdstream"`" ] && return 540 542 LogIt "Trying to mount CD-ROM a 2nd time..." 541 543 find-and-mount-cdrom --second-try … … 641 643 # Retry failed udev events now that local filesystems are mounted read-write 642 644 # (useful for rules creating network ifcfg files) 643 if [ -e " /tmp/USE-UDEV" ] ; then645 if [ -e "$MINDI_CACHE/USE-UDEV" ] ; then 644 646 if [ -x /sbin/udevadm ]; then 645 647 /sbin/udevadm trigger --retry-failed … … 681 683 export DENY_MODS=" " 682 684 fi 683 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2> /dev/null`" ]; then685 if [ "`grep -i 'obdr ' $MINDI_CACHE/mondorestore.cfg 2> /dev/null`" ]; then 684 686 # Do not try to load usb storage when dealing with OBDR it makes the modprobe hang :-( 685 687 export DENY_MODS="usb-storage $DENY_MODS" … … 702 704 fi 703 705 704 if [ -e " /tmp/USE-UDEV" ] ; then706 if [ -e "$MINDI_CACHE/USE-UDEV" ] ; then 705 707 RunUdevd 706 708 fi … … 719 721 #------------------------------- 720 722 UseTmpfs 721 if [ ! -e " /tmp/mondo-restore.cfg" ] ; then722 LogIt "Warning - /tmp/mondo-restore.cfg not found"723 if [ ! -e "$MINDI_CACHE/mondorestore.cfg" ] ; then 724 LogIt "Warning - $MINDI_CACHE/mondorestore.cfg not found" 723 725 fi 724 726 if [ "`grep -i pxe $CMDLINE`" ] || [ "`grep -i net $CMDLINE`" ]; then … … 727 729 fi 728 730 729 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2>/dev/null`" ] || [ "`grep -i ' udev' /tmp/mondo-restore.cfg 2>/dev/null`" ]; then731 if [ "`grep -i 'obdr ' $MINDI_CACHE/mondorestore.cfg 2>/dev/null`" ] || [ "`grep -i ' udev' $MINDI_CACHE/mondorestore.cfg 2>/dev/null`" ]; then 730 732 HandleTape 731 733 ExtractDataDisksAndLoadModules … … 736 738 ExtractDataDisksAndLoadModules 737 739 # Fake the conf file to force it to NFS mode, even if we made originally a CD (mandatory for mondorestore to work correctly) 738 sed -i "s/backup-media-type.*/backup-media-type netfs/" /tmp/mondo-restore.cfg739 elif [ "`grep -i usb= $CMDLINE`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg 2>/dev/null | grep media-type`" ]; then740 sed -i "s/backup-media-type.*/backup-media-type netfs/" $MINDI_CACHE/mondorestore.cfg 741 elif [ "`grep -i usb= $CMDLINE`" ] || [ "`grep -i usb $MINDI_CACHE/mondorestore.cfg 2>/dev/null | grep media-type`" ]; then 740 742 . /sbin/start-usb 741 743 … … 752 754 res=$? 753 755 ConfigureLoggingDaemons 754 if [ -e " /tmp/USE-DEVFS" ] ; then756 if [ -e "$MINDI_CACHE/USE-DEVFS" ] ; then 755 757 umount /mnt/cdrom 2> /dev/null 756 758 mv /dev/cdrom /cdrom.lnk 2> /dev/null … … 769 771 mkdir -p /tmp/tmpfs 770 772 sleep 2 771 if [ -e "/dev/md0" ] && [ ! -e "/dev/md/0" ] && [ "`grep /dev/md/ /tmp/mountlist.txt`" != "" ] ; then773 if [ -e "/dev/md0" ] && [ ! -e "/dev/md/0" ] && [ "`grep /dev/md/ $MINDI_CACHE/mountlist.txt`" != "" ] ; then 772 774 LogIt "Creating /dev/md/* softlinks just in case." 1 773 775 mkdir -p /dev/md … … 776 778 cp -af /dev/md2 /dev/md/2 2> /dev/null 777 779 fi 778 [ -e " /tmp/mountlist.txt" ] && cp -f /tmp/mountlist.txt /tmp/mountlist.original780 [ -e "$MINDI_CACHE/mountlist.txt" ] && cp -f $MINDI_CACHE/mountlist.txt $MINDI_CACHE/mountlist.original 779 781 780 782 if ! [ "`grep -i "pxe" $CMDLINE`" ] ; then … … 843 845 fi 844 846 fi 845 if grep "backup-media-type" /tmp/mondo-restore.cfg > /dev/null 2> /dev/null ; then847 if grep "backup-media-type" $MINDI_CACHE/mondorestore.cfg > /dev/null 2> /dev/null ; then 846 848 LogIt "backup-media-type is specified in config file - great." 847 849 LogIt "Calling post-init"
Note:
See TracChangeset
for help on using the changeset viewer.