Changeset 2329 in MondoRescue
- Timestamp:
- Aug 18, 2009, 3:20:46 PM (16 years ago)
- Location:
- branches/2.2.10
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mindi/mindi
r2312 r2329 2561 2561 LVM="false" 2562 2562 fi 2563 2564 if [ -e "/proc/cmdline" ]; then 2565 CMDLINE="/proc/cmdline" 2566 elif [ -e "/tmp/cmdline" ]; then 2567 CMDLINE="/tmp/cmdline" 2568 else 2569 CMDLINE="/dev/null" 2570 fi 2571 2563 2572 echo "LVM set to $LVM" >> $LOGFILE 2564 2573 echo "----------" >> $LOGFILE … … 2574 2583 fi 2575 2584 echo "-------------" >> $LOGFILE 2576 echo "cat /proc/cmdline:" >> $LOGFILE2585 echo "cat $CMDLINE" >> $LOGFILE 2577 2586 echo "-------------" >> $LOGFILE 2578 cat /proc/cmdline>> $LOGFILE2587 cat $CMDLINE >> $LOGFILE 2579 2588 echo "-------------" >> $LOGFILE 2580 2589 echo "cat /proc/swaps:" >> $LOGFILE -
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 ..." -
branches/2.2.10/mindi/rootfs/sbin/post-init
r2098 r2329 5 5 #------------------------------------------------------------ 6 6 7 8 7 sleep 1 9 8 … … 11 10 cat /tmp/mountlist.txt >> $LOGFILE 12 11 13 iso=`grep iso /proc/cmdline`14 nuke=`grep nuke /proc/cmdline`12 iso=`grep iso $CMDLINE` 13 nuke=`grep nuke $CMDLINE` 15 14 if [ "$nuke" = "" ] ; then 16 nuke=`grep -i "RESTORE " /proc/cmdline`15 nuke=`grep -i "RESTORE " $CMDLINE` 17 16 fi 18 expert=`grep expert /proc/cmdline`19 compare=`grep compare /proc/cmdline`20 interactive=`grep interactive /proc/cmdline`21 pxe=`grep pxe /proc/cmdline`17 expert=`grep expert $CMDLINE` 18 compare=`grep compare $CMDLINE` 19 interactive=`grep interactive $CMDLINE` 20 pxe=`grep pxe $CMDLINE` 22 21 [ "$interactive" ] && expert=""; # in case 'expert' crops up somewhere 23 22 if which mondorestore > /dev/null 2> /dev/null ; then … … 62 61 fi 63 62 64 if [ "`grep -i 'debug' /proc/cmdline`" ]; then63 if [ "`grep -i 'debug' $CMDLINE`" ]; then 65 64 mondoopt="$mondoopt -K 99" 66 65 fi -
branches/2.2.10/mindi/rootfs/sbin/start-nfs
r2255 r2329 30 30 31 31 # info from cmdline are predominent 32 for i in `cat /proc/cmdline` ; do32 for i in `cat $CMDLINE` ; do 33 33 echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2` 34 34 echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2` -
branches/2.2.10/mindi/rootfs/sbin/start-usb
r2127 r2329 10 10 11 11 # info from cmdline are predominent 12 for i in `cat /proc/cmdline` ; do12 for i in `cat $CMDLINE` ; do 13 13 echo $i | grep -qi usb= && MRUSBDEV=`echo $i | cut -d= -f2` 14 14 done -
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2328 r2329 732 732 733 733 if (found_it) { 734 mr_asprintf(tmp1, "grep \"%s=ide-scsi\" /proc/cmdline&> /dev/null", strrchr(output, '/') + 1);734 mr_asprintf(tmp1, "grep \"%s=ide-scsi\" " CMDLINE " &> /dev/null", strrchr(output, '/') + 1); 735 735 if (system(tmp1) == 0) { 736 736 log_msg(4, "%s is not right. It's being SCSI-emulated. Continuing.", output); -
branches/2.2.10/mondo/src/common/libmondo-tools.c
r2328 r2329 745 745 } 746 746 g_current_media_number = 1; 747 bkpinfo->postnuke_tarball[0] = '\0';748 747 return (res); 749 748 } -
branches/2.2.10/mondo/src/include/my-stuff.h
r2237 r2329 93 93 */ 94 94 #define MONDO_TRACEFILE "/var/log/mondo-tracefile.log" 95 96 #ifdef __FreeBSD__ 97 #define CMDLINE "/tmp/cmdline" 98 #else 99 // Default Linux 100 #define CMDLINE "/proc/cmdline" 101 #endif 95 102 96 103 #undef assert -
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c
r2327 r2329 784 784 } 785 785 786 if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "pxe")) {786 if (strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "pxe")) { 787 787 /* We need to override prefix value in PXE mode as it's 788 788 * already done in start-nfs */ … … 948 948 949 949 tmp = read_cfg_var(g_mondo_cfg_file, "please-dont-eject"); 950 if (tmp || strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "donteject")) {950 if (tmp || strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "donteject")) { 951 951 bkpinfo->please_dont_eject = TRUE; 952 952 log_msg(2, "Ok, I shan't eject when restoring! Groovy."); … … 977 977 } 978 978 } 979 if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "pxe")) {979 if (strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "pxe")) { 980 980 /* We need to override values in PXE mode as it's 981 981 * already done in start-nfs */ -
branches/2.2.10/mondo/src/mondorestore/mondorestore.c
r2327 r2329 471 471 log_it("Done loading config file; resizing ML"); 472 472 473 #ifdef __FreeBSD__ 474 if (strstr(call_program_and_get_last_line_of_output("cat /tmp/cmdline"), "noresize")) 475 #else 476 if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "noresize")) 477 #endif 478 { 473 if (strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "noresize")) { 479 474 log_msg(1, "Not resizing mountlist."); 480 475 } else { … … 773 768 get_cfg_file_from_archive_or_bust(); 774 769 load_mountlist(mountlist, g_mountlist_fname); // in case read_cfg_file_into_bkpinfo updated the mountlist 775 #ifdef __FreeBSD__ 776 if (strstr 777 (call_program_and_get_last_line_of_output("cat /tmp/cmdline"), 778 "noresize")) 779 #else 780 if (strstr 781 (call_program_and_get_last_line_of_output("cat /proc/cmdline"), 782 "noresize")) 783 #endif 784 { 770 if (strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "noresize")) { 785 771 log_msg(2, "Not resizing mountlist."); 786 772 } else { … … 811 797 twenty_seconds_til_yikes(); 812 798 g_fprep = fopen("/tmp/prep.sh", "w"); 813 #ifdef __FreeBSD__ 814 if (strstr 815 (call_program_and_get_last_line_of_output 816 ("cat /tmp/cmdline"), "nopart")) 817 #else 818 if (strstr 819 (call_program_and_get_last_line_of_output 820 ("cat /proc/cmdline"), "nopart")) 821 #endif 822 { 799 if (strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "nopart")) { 823 800 log_msg(2, 824 801 "Not partitioning drives due to 'nopart' option."); … … 894 871 if (retval) { 895 872 log_to_screen("Errors occurred during the nuke phase."); 896 } else if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "RESTORE")) {873 } else if (strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "RESTORE")) { 897 874 log_to_screen 898 875 ("PC was restored successfully. Thank you for using Mondo Rescue."); … … 2667 2644 /* Configure global variables */ 2668 2645 malloc_libmondo_global_strings(); 2669 #ifdef __FreeBSD__ 2670 if (strstr(call_program_and_get_last_line_of_output("cat /tmp/cmdline"), "textonly")) 2671 #else 2672 if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "textonly")) 2673 #endif 2646 if (strstr(call_program_and_get_last_line_of_output("cat " CMDLINE), "textonly")) 2674 2647 { 2675 2648 g_text_mode = TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.