Changeset 2329 in MondoRescue for branches/2.2.10/mindi/rootfs/sbin/init
- Timestamp:
- Aug 18, 2009, 3:20:46 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mindi/rootfs/sbin/init
r2286 r2329 5 5 # init script launched during the restore process 6 6 #------------------------------------------------------------ 7 8 if [ -e "/proc/cmdline" ]; then 9 export CMDLINE="/proc/cmdline" 10 elif [ -e "/tmp/cmdline" ]; then 11 export CMDLINE="/tmp/cmdline" 12 else 13 export CMDLINE="/dev/null" 14 fi 15 7 16 8 17 … … 327 336 answer="NO" 328 337 329 grep -q nohw /proc/cmdline338 grep -q nohw $CMDLINE 330 339 if [ "$?" -eq 0 ]; then 331 340 return 332 341 fi 333 342 if [ -x ./mindi-rsthw ]; then 334 grep -q RESTORE /proc/cmdline343 grep -q RESTORE $CMDLINE 335 344 if [ "$?" -ne 0 ]; then 336 345 #clear … … 443 452 444 453 StartMpath() { 445 if [ "`grep -i nompath /proc/cmdline`" ]; then454 if [ "`grep -i nompath $CMDLINE`" ]; then 446 455 return; 447 456 fi … … 496 505 done 497 506 elif which dmraid > /dev/null 2> /dev/null ; then 498 if [ "`grep -i nodmraid /proc/cmdline`" ]; then507 if [ "`grep -i nodmraid $CMDLINE`" ]; then 499 508 return; 500 509 fi … … 661 670 rm -f /foozero 662 671 663 if [ "`grep -i denymods /proc/cmdline`" ]; then664 export DENY_MODS="`cat /proc/cmdline| sed 's~.*denymods=\"\(.*\)\".*~\1~'` mondonone"672 if [ "`grep -i denymods $CMDLINE`" ]; then 673 export DENY_MODS="`cat $CMDLINE | sed 's~.*denymods=\"\(.*\)\".*~\1~'` mondonone" 665 674 else 666 675 export DENY_MODS=" " … … 670 679 export DENY_MODS="usb-storage $DENY_MODS" 671 680 fi 672 if [ "`grep -i forcemods /proc/cmdline`" ]; then673 export FORCE_MODS="`cat /proc/cmdline| sed 's~.*forcemods=\"\(.*\)\".*~\1~'` mondonone"681 if [ "`grep -i forcemods $CMDLINE`" ]; then 682 export FORCE_MODS="`cat $CMDLINE | sed 's~.*forcemods=\"\(.*\)\".*~\1~'` mondonone" 674 683 else 675 684 export FORCE_MODS=" " … … 707 716 LogIt "Warning - /tmp/mondo-restore.cfg not found" 708 717 fi 709 if [ "`grep -i pxe /proc/cmdline`" ] || [ "`grep -i net /proc/cmdline`" ]; then718 if [ "`grep -i pxe $CMDLINE`" ] || [ "`grep -i net $CMDLINE`" ]; then 710 719 # We need to get here exported variables from start-nfs 711 720 . /sbin/start-nfs … … 715 724 HandleTape 716 725 ExtractDataDisksAndLoadModules 717 elif [ "`grep -i pxe /proc/cmdline`" ]; then726 elif [ "`grep -i pxe $CMDLINE`" ]; then 718 727 # Simulate a local CD 719 728 echo "/mnt/cdrom" > /tmp/CDROM-LIVES-HERE … … 722 731 # Fake the conf file to force it to NFS mode, even if we made originally a CD (mandatory for mondorestore to work correctly) 723 732 sed -i "s/backup-media-type.*/backup-media-type nfs/" /tmp/mondo-restore.cfg 724 elif [ "`grep -i usb= /proc/cmdline`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg 2>/dev/null | grep media-type`" ]; then733 elif [ "`grep -i usb= $CMDLINE`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg 2>/dev/null | grep media-type`" ]; then 725 734 . /sbin/start-usb 726 735 … … 764 773 [ -e "/tmp/mountlist.txt" ] && cp -f /tmp/mountlist.txt /tmp/mountlist.original 765 774 766 if ! [ "`grep -i "pxe" /proc/cmdline`" ] ; then775 if ! [ "`grep -i "pxe" $CMDLINE`" ] ; then 767 776 res="`cat /mnt/cdrom/archives/THIS-CD-NUMBER 2> /dev/null`" 768 777 [ "$res" != "1" ] && [ "$res" != "" ] && Die "This is CD #$res in the series. Please insert CD #1." … … 775 784 # Log some useful info 776 785 LogIt "init (from mindi v$MINDI_VER-r${MINDI_REV})" 777 LogIt " /proc/cmdlineis:"778 cat /proc/cmdline>> $LOGFILE786 LogIt "$CMDLINE is:" 787 cat $CMDLINE >> $LOGFILE 779 788 LogIt "df result:" 780 789 LogIt "----------" … … 841 850 LogIt "I think this media has no archives on it." 842 851 fi 843 if [ "`grep -i "post=" /proc/cmdline`" ] ; then844 for i in `cat /proc/cmdline` ; do852 if [ "`grep -i "post=" $CMDLINE`" ] ; then 853 for i in `cat $CMDLINE` ; do 845 854 echo $i | grep -qi post= && post=`echo $i | cut -d= -f2` 846 855 done … … 861 870 fi 862 871 fi 863 if grep "RESTORE" /proc/cmdline> /dev/null 2> /dev/null ; then872 if grep "RESTORE" $CMDLINE > /dev/null 2> /dev/null ; then 864 873 echo "Rebooting in 10 seconds automatically as per reboot order" 865 874 echo -en "Press ^C to interrupt if you have to ..."
Note:
See TracChangeset
for help on using the changeset viewer.