- Timestamp:
- Apr 13, 2016, 11:59:30 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi/mindi
r3557 r3565 166 166 LogScreen "$1" 167 167 LogFile "$1" "$2" 168 }169 170 # Preserved for compatibility171 LogIt() {172 LogAll "$1" "$2"173 168 } 174 169 … … 689 684 LocateDeps $bigdir/usr/bin/mondo*restore >> $outfile.pre 690 685 else 691 Log It"ERROR: Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP"692 Log It" I bet you've got a spare copy of Mondo or Mindi floating around on your system."693 Log It" If Mindi was called by Mondo then send a bug report."694 Log It" It not, type 'ps ax' to see which Mondo-related process is still running then kill it. :-)"695 Log It" Finally, run Mindi again."686 LogAll "ERROR: Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP" 687 LogAll " I bet you've got a spare copy of Mondo or Mindi floating around on your system." 688 LogAll " If Mindi was called by Mondo then send a bug report." 689 LogAll " It not, type 'ps ax' to see which Mondo-related process is still running then kill it. :-)" 690 LogAll " Finally, run Mindi again." 696 691 Die "Odd." 697 692 fi 698 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || Log It"\nINFO: Mondo v1.2x defaults to LILO as the bootloader, BTW."693 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogAll "\nINFO: Mondo v1.2x defaults to LILO as the bootloader, BTW." 699 694 if [ -e "$MINDI_TMP/NETFS-SERVER-MOUNT" ] ; then 700 695 LogAll "\nINFO: Incorporating Network-related settings" … … 1051 1046 [ -e "$MY_FSTAB" ] || Die "Cannot find your fstab file ($MY_FSTAB)" 1052 1047 1053 [ "$mountlist" != "" ] && rm -Rf $mountlist1048 [ "$mountlist" != "" ] && [ "$mountlist" != "/" ] && rm -Rf $mountlist 1054 1049 > $mountlist 1055 1050 all_partitions="" … … 1821 1816 cat $MINDI_TMP/syslinux.log |tee -a $LOGFILE 1822 1817 LogAll "------------------------------------------" 1823 Log It"ERROR: Failed to create USB image."1818 LogAll "ERROR: Failed to create USB image." 1824 1819 else 1825 1820 LogFile "INFO: Created bootable USB image on $USBDEVICE" … … 2316 2311 echo -e "$DONE" 2317 2312 2318 rm -rf $bigdir2313 [ "$bigdir" != "/" ] && rm -rf $bigdir 2319 2314 rm -f $needlist 2320 2315 } … … 2578 2573 if [ -h "/$d" ]; then 2579 2574 thelink=`readlink /$d` 2580 mkdir -p $mountpoint/$thelink || Log It"ERROR: Unable to create $thelink in $mountpoint."2575 mkdir -p $mountpoint/$thelink || LogAll "ERROR: Unable to create $thelink in $mountpoint." 2581 2576 mv $mountpoint/$d/* $mountpoint/$d/.??* $mountpoint/$thelink 2> /dev/null 2582 2577 if [ -d "$mountpoint/$d" -a ! -h "$mountpoint/$d" ]; then … … 2585 2580 if [ ! -h $mountpoint/$d ]; then 2586 2581 rm -f $mountpoint/$d 2> /dev/null 2587 (cd $mountpoint ; ln -s $thelink $d) || Log It"ERROR: /$d is a symbolic link, but I couldn't create it in $mountpoint."2582 (cd $mountpoint ; ln -s $thelink $d) || LogAll "ERROR: /$d is a symbolic link, but I couldn't create it in $mountpoint." 2588 2583 fi 2589 2584 fi … … 2632 2627 if [ $? -eq 0 ]; then 2633 2628 # We want to use the real mount and all the supported variants (nfs, cifs, ...) 2634 rm -f bin/mount2629 rm -f $mountpoint/bin/mount 2635 2630 fi 2636 2631 … … 2684 2679 fnllist=`echo $finallist | tr ' ' '\n' | sort -u | tr '\n' ' '` 2685 2680 LogFile "INFO: Copy the minimal env with cp -a --parents $fnllist -t $mountpoint" 2686 cp -a --parents $fnllist -t $mountpoint 2> $templog || Log It"WARNING: Problem in minimal analysis" $templog2681 cp -a --parents $fnllist -t $mountpoint 2> $templog || LogAll "WARNING: Problem in minimal analysis" $templog 2687 2682 2688 2683 # In case target /bin dir still doesn't exist, create it before using it … … 2708 2703 echo "udev device manager found" > $mountpoint/tmp/USE-UDEV 2709 2704 LogFile "INFO: udev device manager found" 2710 tar cf - -C / /etc/udev 2> $templog | (cd $mountpoint ; tar xf -) || Log It"ERROR: Problem in /etc/udev analysis" $templog2705 tar cf - -C / /etc/udev 2> $templog | (cd $mountpoint ; tar xf -) || LogAll "ERROR: Problem in /etc/udev analysis" $templog 2711 2706 # This avoids NIC remapping if on another machine at restore time on Debian/Ubuntu at least 2712 rm -f ./etc/udev/rules.d/[z]*[0-9][0-9][-_]persistent-net.rules2707 rm -f $mountpoint/etc/udev/rules.d/[z]*[0-9][0-9][-_]persistent-net.rules 2713 2708 # Do not do it if it's a link (Ubuntu 64 bits #503) 2714 2709 if [ -e "/lib64/udev" ] && [ ! -h "/lib64" ] && [ ! -h "/lib64/udev" ]; then 2715 tar cf - -C / /lib64/udev 2> $templog | (cd $mountpoint ; tar xf -) || Log It"ERROR: Problem in /lib64/udev analysis" $templog2710 tar cf - -C / /lib64/udev 2> $templog | (cd $mountpoint ; tar xf -) || LogAll "ERROR: Problem in /lib64/udev analysis" $templog 2716 2711 fi 2717 2712 if [ -e "/lib32/udev" ] && [ ! -h "/lib32" ] && [ ! -h "/lib32/udev" ]; then 2718 tar cf - -C / /lib32/udev 2> $templog | (cd $mountpoint ; tar xf -) || Log It"ERROR: Problem in /lib32/udev analysis" $templog2713 tar cf - -C / /lib32/udev 2> $templog | (cd $mountpoint ; tar xf -) || LogAll "ERROR: Problem in /lib32/udev analysis" $templog 2719 2714 fi 2720 2715 if [ -e "/lib/udev" ] && [ ! -h "/lib" ] && [ ! -h "/lib/udev" ]; then 2721 tar cf - -C / /lib/udev 2> $templog | (cd $mountpoint ; tar xf -) || Log It"ERROR: Problem in /lib/udev analysis" $templog2716 tar cf - -C / /lib/udev 2> $templog | (cd $mountpoint ; tar xf -) || LogAll "ERROR: Problem in /lib/udev analysis" $templog 2722 2717 fi 2723 2718 if [ -e "/usr/lib/udev" ] && [ ! -h "/usr/lib" ] && [ ! -h "/usr/lib/udev" ]; then 2724 tar cf - -C / /usr/lib/udev 2> $templog | (cd $mountpoint ; tar xf -) || Log It"ERROR: Problem in /usr/lib/udev analysis" $templog2719 tar cf - -C / /usr/lib/udev 2> $templog | (cd $mountpoint ; tar xf -) || LogAll "ERROR: Problem in /usr/lib/udev analysis" $templog 2725 2720 fi 2726 2721 if [ -x /sbin/udevd ] || [ -x /usr/bin/udevd ] || [ -x /usr/lib/systemd/systemd-udevd ] || [ -x /lib/systemd/systemd-udevd ]; then … … 2748 2743 if [ "`echo $i | cut -c1`" = "/" ]; then 2749 2744 j=`echo $i | cut -c2-` 2750 [ "$j" != "" ] && rm -f $ j2745 [ "$j" != "" ] && rm -f $mountpoint/$j 2751 2746 fi 2752 2747 echo "$i" >> $MINDI_TMP/udev.lis … … 2767 2762 fnllist=`echo $finallist | tr ' ' '\n' | sort -u | tr '\n' ' '` 2768 2763 LogFile "INFO: Copying udev related files with cp -a --parents $fnllist -t $mountpoint/" 2769 cp -a --parents $fnllist $lis3 -t $mountpoint/ 2> $templog || Log It"WARNING: Problem in udev.lis analysis" $templog2764 cp -a --parents $fnllist $lis3 -t $mountpoint/ 2> $templog || LogAll "WARNING: Problem in udev.lis analysis" $templog 2770 2765 rm -f $MINDI_TMP/udev.lis 2771 2766 else … … 2780 2775 mindi-bkphw $MINDI_CACHE $MINDI_CONF | tee -a $LOGFILE 2781 2776 if [ -d $MINDI_CACHE/bkphw ]; then 2782 Log It"INFO: Hardware Information found and saved ..."2777 LogAll "INFO: Hardware Information found and saved ..." 2783 2778 cp -rp $MINDI_CACHE/bkphw $mountpoint 2784 2779 if [ -f $MINDI_CACHE/tools.files ]; then 2785 2780 lis=`grep -Ev '^#' $MINDI_CACHE/tools.files` 2786 2781 LocateDeps $lis > $MINDI_TMP/tools.lis 2787 tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2> $templog | (cd $mountpoint ; tar xf -) || Log It"ERROR: Problem in tools.lis analysis" $templog2782 tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2> $templog | (cd $mountpoint ; tar xf -) || LogAll "ERROR: Problem in tools.lis analysis" $templog 2788 2783 fi 2789 2784 if [ -f $MINDI_CACHE/mindi-rsthw ]; then … … 2796 2791 # Management of perl scripts delivered needed at restore time 2797 2792 LogAll "INFO: Analyzing perl modules dependencies..." 2798 mindi-get-perl-modules `cat $MINDI_CONF/perl-scripts` /usr/[s]*bin/mr-* 2> $templog > $MINDI_TMP/perl.lis || Log It"ERROR: Problem in mindi-get-perl-modules" $templog2793 mindi-get-perl-modules `cat $MINDI_CONF/perl-scripts` /usr/[s]*bin/mr-* 2> $templog > $MINDI_TMP/perl.lis || LogAll "ERROR: Problem in mindi-get-perl-modules" $templog 2799 2794 LogFile "DBG4: Perl Modules found:" 2800 2795 LogFile "-------------------------" 2801 2796 cat $MINDI_TMP/perl.lis >> $LOGFILE 2802 2797 LogFile "-------------------------" 2803 tar cf - `cat $MINDI_TMP/perl.lis` 2> $templog | (cd $mountpoint ; tar xf -) || Log It"ERROR: Problem in perl scripts analysis" $templog2798 tar cf - `cat $MINDI_TMP/perl.lis` 2> $templog | (cd $mountpoint ; tar xf -) || LogAll "ERROR: Problem in perl scripts analysis" $templog 2804 2799 2805 2800 for w in cdrom groovy-stuff ; do … … 2807 2802 done 2808 2803 2809 tar cf - -C / /dev/fd0*[1,2][4,7,8]* 2> $templog | (cd $mountpoint ; tar xf -) || Log It"ERROR: Problem in fd dev analysis" $templog2804 tar cf - -C / /dev/fd0*[1,2][4,7,8]* 2> $templog | (cd $mountpoint ; tar xf -) || LogAll "ERROR: Problem in fd dev analysis" $templog 2810 2805 2811 2806 needed_modules="" … … 2829 2824 fi 2830 2825 2831 [ -e "/$needed_modules_path" ] || Log It"WARNING: path $needed_modules_path does not exist.\n If you're not using a modular kernel then mindi won't probably work."2826 [ -e "/$needed_modules_path" ] || LogAll "WARNING: path $needed_modules_path does not exist.\n If you're not using a modular kernel then mindi won't probably work." 2832 2827 LogAll "INFO: Analyzing kernel modules dependencies..." 2833 2828 needed_modules=`mr-kernel-get-modules $mkgmopt $list_of_groovy_mods` 2834 2829 2835 2830 LogFile "INFO: Adding $needed_modules to the rootfs with $mkgmopt" 2836 cp --parents -aL $needed_modules $mountpoint/ 2> $templog || Log It"ERROR: Unable to copy modules to $mountpoint" $templog2831 cp --parents -aL $needed_modules $mountpoint/ 2> $templog || LogAll "ERROR: Unable to copy modules to $mountpoint" $templog 2837 2832 2838 2833 # Uncompress modules if not using udev and native modprobe … … 2853 2848 2854 2849 # Also copy modules.* in case of udev so that normal modprobe works 2855 tar cf - -C / /$needed_modules_path/modules.* 2> $templog | (cd "$mountpoint" ; tar xf -) || Log It"ERROR: Unable to copy modules.* to $mountpoint" $templog2850 tar cf - -C / /$needed_modules_path/modules.* 2> $templog | (cd "$mountpoint" ; tar xf -) || LogAll "ERROR: Unable to copy modules.* to $mountpoint" $templog 2856 2851 2857 2852 # Copy FW in case some drivers needs it … … 2878 2873 mkdir -p $mountpoint/usr/bin 2879 2874 cp -a /usr/bin/hpsa_obdr_mode $mountpoint/usr/bin 2880 Log It"INFO: Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved Smart Array OBDR support"2875 LogAll "INFO: Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved Smart Array OBDR support" 2881 2876 found=1 2882 2877 fi … … 2885 2880 lis="/usr/bin/sg_map /usr/bin/sg_inq /usr/bin/sg_reset /usr/bin/rev" 2886 2881 LocateDeps $lis > $MINDI_TMP/obdr.lis 2887 tar cf - $lis -C / `sort -u $MINDI_TMP/obdr.lis` 2> $templog | (cd $mountpoint ; tar xf -) || Log It"ERROR: Problem in obdr.lis analysis" $templog2888 Log It"INFO: Copying /usr/bin/sg_reset to ramdisk for improved SCSI OBDR support"2882 tar cf - $lis -C / `sort -u $MINDI_TMP/obdr.lis` 2> $templog | (cd $mountpoint ; tar xf -) || LogAll "ERROR: Problem in obdr.lis analysis" $templog 2883 LogAll "INFO: Copying /usr/bin/sg_reset to ramdisk for improved SCSI OBDR support" 2889 2884 found=1 2890 2885 fi … … 3042 3037 if which awk &> /dev/null ; then 3043 3038 if ! which gawk &> /dev/null ; then 3044 Log It"INFO: You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n"3039 LogAll "INFO: You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n" 3045 3040 fi 3046 3041 fi … … 3386 3381 [ "$USE_LZMA" = "" ] && USE_LZMA=no 3387 3382 [ "$NOT_BOOT" = "" ] && NOT_BOOT=no 3388 [ "$TAPEDEV" ] && Log It"INFO: This is a tape-based backup. Fine."3383 [ "$TAPEDEV" ] && LogAll "INFO: This is a tape-based backup. Fine." 3389 3384 # MONDO_ROOT is the real scratchdir 3390 3385 MONDO_ROOT=`echo $MINDI_CACHE | sed 's/\(.*\)\/.*/\1/'` … … 3408 3403 3409 3404 if [ _"$MONDO_SHARE" = _"" ]; then 3410 Log It"Mindi Linux mini-distro generator v$MINDI_VERSION"3411 Log It"Latest Mindi is available from http://www.mondorescue.org"3412 Log It"BusyBox sources are available from http://www.busybox.net"3413 Log It"------------------------------------------------------------------------------"3405 LogAll "Mindi Linux mini-distro generator v$MINDI_VERSION" 3406 LogAll "Latest Mindi is available from http://www.mondorescue.org" 3407 LogAll "BusyBox sources are available from http://www.busybox.net" 3408 LogAll "------------------------------------------------------------------------------" 3414 3409 else 3415 3410 LogFile "INFO: You are using Mindi v$MINDI_VERSION to make boot+data disks" 3416 3411 fi 3417 3412 if [ -f $MINDI_LIB/rootfs/usr/bin/busybox ]; then 3418 Log It"INFO: You are using Mindi-`$MINDI_LIB/rootfs/usr/bin/busybox 2>&1 | head -1`"3413 LogAll "INFO: You are using Mindi-`$MINDI_LIB/rootfs/usr/bin/busybox 2>&1 | head -1`" 3419 3414 else 3420 Log It"ERROR: Unable to find mindi-busybox, please install it"3415 LogAll "ERROR: Unable to find mindi-busybox, please install it" 3421 3416 MindiExit -1 3422 3417 fi … … 3433 3428 LogFile "NOT_BOOT = '$NOT_BOOT'" 3434 3429 if [ "$NOT_BOOT" != "" ] && [ "$NOT_BOOT" != "0" ] && [ "$NOT_BOOT" != "no" ] ; then 3435 Log It"INFO: Just creating $MRCFG and a small all.tar.gz for Mondo. Nothing else."3430 LogAll "INFO: Just creating $MRCFG and a small all.tar.gz for Mondo. Nothing else." 3436 3431 MakeMondoConfigFile $MINDI_TMP/$MRCFG 3437 3432 MakeMountlist $MINDI_TMP/mountlist.txt 3438 3433 CheckMountlist $MINDI_TMP/mountlist.txt 3439 3434 mkdir -p $MINDI_TMP/small-all/tmp 3440 cd "$MINDI_TMP/small-all" 3441 cp -f $MINDI_TMP/{mountlist.txt,$MRCFG,filelist.full.gz,biggielist.txt} tmp 2>> $LOGFILE || Die "Cannot copy small all.tar.gz" 3442 tar -cv ./tmp | gzip -9 > $MINDI_TMP/all.tar.gz 2>> $MINDI_TMP/$$.log || Die "Cannot make small all.tar.gz" $MINDI_TMP/$$.log 3435 cp -f $MINDI_TMP/{mountlist.txt,$MRCFG,filelist.full.gz,biggielist.txt} $MINDI_TMP/small-all/tmp 2>> $LOGFILE || Die "Cannot copy small all.tar.gz" 3436 (cd $MINDI_TMP/small-all ; tar -cv ./tmp | gzip -9 > $MINDI_TMP/all.tar.gz 2>> $MINDI_TMP/$$.log || Die "Cannot make small all.tar.gz" $MINDI_TMP/$$.log) 3443 3437 sleep 2 3444 Log It"Done. Exiting."3438 LogAll "Done. Exiting." 3445 3439 MindiExit 0 3446 3440 fi 3447 3441 3448 3442 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then 3449 Log It"INFO: Including the generation of a Bootable USB device on $USBDEVICE"3443 LogAll "INFO: Including the generation of a Bootable USB device on $USBDEVICE" 3450 3444 fi 3451 3445 … … 3469 3463 3470 3464 echo -e "Mindi's temp dir = $MINDI_TMP \nMindi's output dir=$MINDI_CACHE" >> $LOGFILE 3471 [ "$(($RANDOM%64))" -eq "0" ] && Log It"INFO: Dude, I've looked inside your computer and it's really dusty..."3465 [ "$(($RANDOM%64))" -eq "0" ] && LogAll "INFO: Dude, I've looked inside your computer and it's really dusty..." 3472 3466 3473 3467 mountpoint=$MINDI_TMP/mountpoint.$$ … … 3514 3508 else 3515 3509 if [ _"$MONDO_SHARE" != _"" ] ; then 3516 Log It"ERROR: You don't have a $MRCFG file !"3510 LogAll "ERROR: You don't have a $MRCFG file !" 3517 3511 fi 3518 3512 fi
Note:
See TracChangeset
for help on using the changeset viewer.