Changeset 1924 in MondoRescue


Ignore:
Timestamp:
Apr 18, 2008, 1:41:41 AM (16 years ago)
Author:
Bruno Cornec
Message:

svn merge -r 1902:1923 $SVN_M/branches/2.2.6

Location:
branches/stable
Files:
7 deleted
20 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/deplist.txt

    r1904 r1924  
    1313
    1414#-------------------------------- ESSENTIAL -----------------------------------
    15 fstab raidtab modules.conf conf.modules mondorestore modules.conf.local
     15fstab raidtab
     16/usr/sbin/mondorestore
    1617/etc/mdadm/mdadm.conf /etc/mdadm.conf
    1718/sbin/ldconfig
     
    2122bzip2 bunzip2 lzop
    2223ctrlaltdel
    23 # Do not remove as they need to be aligned with the kernel
    24 insmod lsmod
     24# Everything needed to handle modules correctly
     25insmod lsmod /sbin/modprobe
     26/etc/modprobe.d /etc/modprobe.conf /etc/modules.conf /etc/conf.modules /etc/modules.conf.local
     27
    2528hosts host.conf resolv.conf hosts.allow hosts.deny
    2629klogd sysklogd
     
    4750# gdb valgrind /usr/lib/valgrind
    4851
    49 #----------------- For all you LVM users out there, much love -----------------
    50 LVMFILES:
    51 lvmiopversion  lvmcreate_initrd  pvdata
    5252#------------------------------------------------------------------------------
    5353#
     
    5656conrep cpqacuxe hponcfg
    5757lshw
     58#----------------- For all you LVM users out there, much love -----------------
     59LVMFILES:
     60lvmiopversion  lvmcreate_initrd  pvdata /etc/lvm/lvm.conf
     61#------------------------------------------------------------------------------
  • branches/stable/mindi/distributions/conf/mindi.conf.dist

    r1842 r1924  
    1010
    1111#
    12 # Maximum number of disks made by mindi
    13 #
    14 mindi_max_disks=99
    15 #
    1612# Extra space for Ram disk
    1713#
    18 mindi_extra_space=32768
     14mindi_extra_space=49152
    1915
    2016#
  • branches/stable/mindi/mindi

    r1904 r1924  
    108108
    109109BOOT_MEDIA_MESSAGE="$mindi_boot_msg"
     110
    110111FDISK=$MINDI_SBIN/parted2fdisk
    111112
     
    171172
    172173    mkdir -p $bigdir/etc
    173     cp --parents -pRdf $mappath $bigdir 2>> $LOGFILE || LogIt "AKMF -- Could not copy $mappath to $bigdir"
     174    #cp --parents -pRdf $mappath $bigdir 2>> $LOGFILE || LogIt "AKMF -- Could not copy $mappath to $bigdir"
     175    tar cf - $mappath 2>> /dev/null | (cd $bigdir ; tar xf -) || LogIt "AKMF -- Could not copy $mappath to $bigdir"
    174176    if [ "`echo $mappath | grep -F ".gz"`" ] ; then
    175177        included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
     
    206208    [ "`head $scratchfile -n1 | grep -F "bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-"
    207209    [ "`echo "$filename" | grep -F "etc/termcap"`" != "" ] && StripComments $scratchfile "-$filename-"
    208     if [ "`echo "$filename" | grep -F "lib/modules/" | grep "\.*o\.gz"`" != "" ] ; then
     210
     211    # Uncompress modules only if not using udevd
     212    if [ "`echo "$filename" | grep -F "lib/modules/" | grep "\.*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then
    209213        mv $scratchfile $scratchfile.gz
    210214        gunzip -f $scratchfile || LogIt "Cannot gunzip $scratchfile.gz"
     
    278282                BIGNO=$(($BIGNO+1))
    279283            else
    280                 cp --parents -Rdf $incoming $outdir 2> /dev/null || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
    281                 if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] ; then
     284                #cp --parents -Rdf $incoming $outdir 2> /dev/null || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
     285                tar cf - $incoming 2> /dev/null | (cd $outdir ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
     286   
     287                # Only uncompress modules if not using udevd
     288                if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then
    282289                    gunzip -f $outdir/$incoming || LogIt "Cannot gunzip $outdir/$incoming"
    283290                fi
     
    10221029
    10231030
    1024 MakeModuleLoadingScript() {
    1025     local module fname params modpath kver outerloop i modpaths kver searchpath list_to_echo j
    1026     tmpmodprobe_flag=$1
    1027     outfile=$2
    1028     > $outfile || Die "Cannot create empty $outfile"
    1029     echo -en "#\041/bin/sh\n\n" >> $outfile
    1030     echo "echo -en \"Loading your modules...\"" >> $outfile
    1031     if [ "$YOUR_KERNEL_SUCKS" ] ; then
    1032         kver=$FAILSAFE_KVER
    1033         cd $MINDI_TMP
    1034         searchpath=lib/modules/$kver
    1035     else
    1036 ###
    1037 ### Sq-Modification ... Use kernelname for module search path if specified
    1038 ###
    1039         #kver=`uname -r`
    1040         if [ "${kernelname}" != "" ]
    1041         then
    1042             kver=${kernelname}
    1043         else
    1044             kver=`uname -r`
    1045         fi
    1046 ###
    1047 ### Sq-Modification end
    1048 ###
    1049         searchpath=/lib/modules/$kver
    1050     fi
    1051    
    1052     echo -en "for outerloop in 1 2 3 4 5 ; do\necho -en \".\"\n" >> $outfile
    1053     list_to_echo="$MODULES"
    1054     # Remove unwanted modules from list
    1055     for i in $DENY_MODS; do
    1056         list_to_echo=`echo ${list_to_echo} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '`
    1057         EXTRA_MODS=`echo ${EXTRA_MODS} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '`
    1058     done
    1059 
    1060     # Make temporary modprobe.conf file if we are told so
    1061     if [ "$tmpmodprobe_flag" = "Y" ] ; then
    1062         infile="$MINDI_TMP/modprobe.conf.mindi"
    1063         find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f -print0 | xargs -0 cat > $infile
    1064     else
    1065         infile="/etc/modules.conf"
    1066     fi
    1067 
    1068     for module in $list_to_echo $EXTRA_MODS ; do
    1069         params=`sed -n "s/^options \\+$module \\+//p" $infile`
    1070         modpaths=`FindSpecificModuleInPath $searchpath $module`
    1071         for i in $modpaths ; do
    1072             echo "MyInsmod $i $params > /dev/null 2> /dev/null" \
    1073                 | tr '.' '#' \
    1074                 | sed s/#o#gz/#o/ \
    1075                 | sed s/#o#gz/#o/ \
    1076                 | sed s/#ko#gz/#ko/ \
    1077                 | sed s/#ko#gz/#ko/ \
    1078                 | tr '#' '.' >> $outfile
    1079             echo -en "$i added to module list.\n" >> $LOGFILE
    1080         done
    1081     done
    1082     echo -en "done\n" >> $outfile
    1083     echo "echo \"Done.\"" >> $outfile
    1084     chmod +x $outfile
    1085     cd /
    1086     # Remove temporary modprobe.conf file if we have created one
    1087     if [ "$tmpmodprobe_flag" = "Y" ] ; then
    1088         rm -f $infile
    1089     fi
    1090 }
    1091 
    1092 
    10931031MakeMountlist() {
    10941032    local scratchdir mountlist all_partitions current_partition \
     
    20221960        cd $MINDI_TMP
    20231961        for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
    2024             cp --parents -pRdf ./$i $bigdir 2>> $LOGFILE || Die "PDDI can't cp $i->$bigdir"
     1962            #cp --parents -pRdf ./$i $bigdir 2>> $LOGFILE || Die "PDDI can't cp $i->$bigdir"
     1963            tar cf - ./$i 2>> $LOGFILE | (cd $bigdir ; tar xf -) || Die "PDDI can't copy $i->$bigdir"
    20251964            if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then
    2026                 cp --parents -pRdf $i $bigdir 2>> $LOGFILE
     1965                #cp --parents -pRdf $i $bigdir 2>> $LOGFILE
     1966                tar cf - $i 2>> $LOGFILE | (cd $bigdir ; tar xf -)
    20271967            else
    20281968                ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO
     
    20351975            for k in $j ; do
    20361976                if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then
    2037                     cp --parents -pRdf $k $bigdir 2>> $LOGFILE
     1977                    #cp --parents -pRdf $k $bigdir 2>> $LOGFILE
     1978                    tar cf - $k 2>> $LOGFILE | (cd $bigdir ; tar xf -)
    20381979                else
    20391980                    ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO
     
    20952036        [ "$?" -ne "0" ] && [ _"$MONDO_SHARE" != _"" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
    20962037    fi
    2097     [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state . 2>> $LOGFILE
     2038    #[ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state . 2>> $LOGFILE
     2039    [ -d "/lib/dev-state" ] && tar cf - /lib/dev-state 2>> $LOGFILE | tar xf -
    20982040    cd $old_pwd
    20992041    echo -e "$DONE"
     
    24012343    cp -Rdf $tgz_dir_fname/* . 2>&1 >> $LOGFILE
    24022344    tar -zxf symlinks.tgz || Die "Cannot untar symlinks.tgz"
     2345
    24032346    cd dev || Die "Can't cd to dev"
    24042347    tar -zxf dev-entries.tgz || Die "Cannot untar dev-entries.tgz"
     
    24092352        s=`which $w 2> /dev/null`
    24102353        if [ -e "$s" ] ; then
    2411             cp --parents -af $s . 2>> $LOGFILE
    2412         fi
    2413     done
    2414 
    2415     mkdir -p tmp
     2354            #cp --parents -af $s . 2>> $LOGFILE
     2355            tar cf - $s 2> /dev/null | tar xf -
     2356        fi
     2357    done
     2358
    24162359    [ -e "/dev/.devfsd" ] && echo "/dev/.devfsd found" > tmp/USE-DEVFS
    24172360
    24182361    # Handle the case where busybox and mount are dynamically linked
    2419     # Should be done first so that if /lib64 is a link, it's
    2420     # created first like that, instead of as a real dir later on
    24212362    file $MINDI_LIB/rootfs/bin/busybox 2>&1 | grep -q "dynamically"
    24222363    if [ $? -eq 0 ]; then
     2364        # We want to use the real mount
     2365        rm -f bin/mount
    24232366        LocateDeps $MINDI_LIB/rootfs/bin/busybox /bin/mount > $MINDI_TMP/busy.lis
    2424         cp --parents -Rdf `sort -u $MINDI_TMP/busy.lis` .
     2367        #cp --parents -Rdf `sort -u $MINDI_TMP/busy.lis` .
     2368        tar cf - /bin/mount `sort -u $MINDI_TMP/busy.lis` 2> /dev/null | tar xf -
    24252369        rm -f $MINDI_TMP/busy.lis
    24262370    fi
    24272371
     2372    mkdir -p $mountpoint/tmp
    24282373    # Management of udev (which includes modprobe in rules)
    24292374    ps auxww | grep -v grep | grep -qw udevd
    24302375    if [ $? -eq 0 ]; then
    2431         echo "udev device manager found" > tmp/USE-UDEV
     2376        echo "udev device manager found" > $mountpoint/tmp/USE-UDEV
    24322377        LogIt "udev device manager found"
    2433         cp --parents -Rdf /etc/udev . 2> /dev/null
     2378        #cp --parents -Rdf /etc/udev . 2> /dev/null
     2379        tar cf - /etc/udev 2> /dev/null | tar xf -
    24342380        # This avoids NIC remapping if on another machine at restore time on Debian at least
    24352381        rm -f ./etc/udev/rules.d/z25_persistent-net.rules
    2436         cp --parents -Rdf /lib/udev /lib64/udev . 2> /dev/null
     2382        #cp --parents -Rdf /lib/udev /lib64/udev . 2> /dev/null
     2383        tar cf - /lib*/udev 2> /dev/null | tar xf -
    24372384        if [ -x /sbin/udevd ]; then
    24382385            lis2=`grep -Ev '^#' $MINDI_CONF/udev.files`
     
    24602407                fi
    24612408            done
    2462             cp --parents -Rdf $lis `sort -u $MINDI_TMP/udev.lis` .
     2409            #cp --parents -Rdf $lis `sort -u $MINDI_TMP/udev.lis` .
     2410            tar cf - $lis `sort -u $MINDI_TMP/udev.lis` 2> /dev/null | tar xf -
    24632411            rm -f $MINDI_TMP/udev.lis
    24642412        else
    24652413            echo "udevd daemon not in standard place (/sbin)" 2>&1 | tee -a $LOGFILE
    24662414            echo "mindi will use static devices which may cause problems" 2>&1 | tee -a $LOGFILE
    2467             rm -f tmp/USE-UDEV
     2415            rm -f $mountpoint/tmp/USE-UDEV
    24682416        fi
    24692417    fi
     
    24782426            lis=`grep -Ev '^#' $MINDI_CACHE/tools.files`
    24792427            LocateDeps $lis > $MINDI_TMP/tools.lis
    2480             cp --parents -Rdf $lis `sort -u $MINDI_TMP/tools.lis` .
     2428            #cp --parents -Rdf $lis `sort -u $MINDI_TMP/tools.lis` .
     2429            tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2> /dev/null | tar xf -
    24812430        fi
    24822431        if [ -f $MINDI_CACHE/mindi-rsthw ]; then
     
    24972446    fi
    24982447
    2499     cp --parents -Rdf /dev/fd0*[1,2][4,7,8]* . 2> /dev/null
     2448    #cp --parents -Rdf /dev/fd0*[1,2][4,7,8]* . 2> /dev/null
     2449    tar cf - /dev/fd0*[1,2][4,7,8]* 2> /dev/null | tar xf -
    25002450
    25012451    cd $old_pwd
    2502     echo -en "..."
    2503     MakeModuleLoadingScript $TMPMODPROBE_FLAG $mountpoint/sbin/insert-all-my-modules
    25042452    echo -en "..."
    25052453    old_pwd=`pwd`
     
    25362484        needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`"
    25372485    done
     2486
    25382487    for i in $needed_modules ; do
    25392488        [ -e "$i" ] && s=`du -sk $i | cut -f1` || s=""
    25402489        [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i
    25412490        echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE
    2542         cp --parents -pdf $i $mountpoint 2>/dev/null || LogIt "Unable to copy $i to $mountpoint"
    2543         # Uncompress modules if not useing udev and native modprobe
     2491        #cp --parents -Rpdf $i $mountpoint 2>/dev/null || LogIt "Unable to copy $i to $mountpoint"
     2492        tar cf - $i 2>/dev/null | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy $i to $mountpoint"
     2493        # Uncompress modules if not using udev and native modprobe
    25442494        if [ ! -f $mountpoint/tmp/USE-UDEV ]; then
    25452495            if [ "`echo "$i" | grep -F ".gz"`" ]; then
     2496                echo "Uncompressing $i" >> $LOGFILE
    25462497                gunzip -f $mountpoint/$i
    2547                 #i=`echo $i | sed 's/.gz//'`
    25482498            fi
    25492499        fi
     
    25512501
    25522502    # Also copy modules.dep in case of udev so that normal modprobe works
    2553     cp --parents -pdf /$needed_modules_path/modules.dep $mountpoint 2>/dev/null || LogIt "Unable to copy modules.dep to $mountpoint"
    2554 
    2555     # For all modules supported, create symlinks under the mountpoint
    2556     for i in $EXTRA_MODS $NET_MODS $SCSI_MODS; do
    2557         all_modules="$all_modules `FindSpecificModuleInPath $mountpoint $i | sed 's~^$mountpoint/~~g'`"
    2558     done
    2559     for i in $all_modules; do
    2560         (cd $mountpoint ; ln -s $i . 2>/dev/null)
    2561     done
     2503    #cp --parents -Rpdf /$needed_modules_path/modules.dep $mountpoint 2>/dev/null || LogIt "Unable to copy modules.dep to $mountpoint"
     2504    tar cf - /$needed_modules_path/modules.dep 2>/dev/null | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy modules.dep to $mountpoint"
     2505
    25622506    if [ ! -e "/sbin/devfsd" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then
    25632507        echo "Deleting devfsd daemon from ramdisk" >> $LOGFILE
     
    25702514    dd if=/dev/zero of=$mountpoint/zero &> /dev/null
    25712515    rm -f $mountpoint/zero
    2572     mkdir -p $mountpoint/tmp
    25732516    if [ _"$MONDO_SHARE" != _"" ]; then
    25742517        cp -f $MONDO_CACHE/mondo-restore.cfg $mountpoint/tmp &> /dev/null || Die "Cannot copy mondo-restore.cfg to ramdisk"
     
    26662609echo "-----------------------------" >> $LOGFILE
    26672610
    2668 if [ -e "/etc/conf.modules" ] && [ ! -e "/etc/modules.conf" ] ; then
    2669     LogIt "WARNING - Ancient distro detected." 1
    2670     ln -sf /etc/conf.modules /etc/modules.conf
    2671 fi
    26722611[ -e "/sbin/mkdosfs" ] && [ ! -e "/sbin/mkfs.vfat" ] && ln -sf /sbin/mkdosfs /sbin/mkfs.vfat
    26732612
     
    27042643
    27052644[ "`uname -r | grep "2.4.[0-6]" | grep -v "2.4.[0-9][0-9]"`" != "" ] &&  echo "WARNING! Your kernel may have buggy loopfs code. Consider upgrading to 2.4.7"
    2706 # If we have a 2.6 kernel, the system uses module-init-tools which means that we
    2707 # may have the modprobe configuration spread out across multiple files in
    2708 # directory /etc/modprobe.d. If this is the case we concatenate these files into
    2709 # a temporary file for further processing. Otherwise we continue in the standard
    2710 # way. Note further that in case /etc/modprobe.d exists, we use it and ignore
    2711 # /etc/modprobe.conf which is exactly what module-init-tools does. The temporary
    2712 # modprobe.conf file is created in MakeModuleLoadingScript. AL041128.
    2713 if [ -d "/etc/modprobe.d" ] && [ "`uname -r | cut -c1-3`" = "2.6" ] ; then
    2714     TMPMODPROBE_FLAG="Y"
    2715 else
    2716     TMPMODPROBE_FLAG="N"
    2717     [ -e "/etc/modprobe.conf" ] && [ ! -e "/etc/modules.conf" ] && ln -sf /etc/modprobe.conf /etc/modules.conf
    2718     [ ! -e "/etc/modules.conf" ] && Die "/etc/modules.conf not found; you may have to create a softlink from /etc/conf.modules to /etc/modules.conf; of course, all good distros use modules.conf anyway..."
    2719 fi
    27202645
    27212646# Update the PATH variable if incomplete
     
    30372962    mkdir -p $MINDI_TMP/small-all/tmp
    30382963    MakeMountlist $MINDI_TMP/small-all/tmp/mountlist.txt
    3039     cp -f $MINDI_TMP/{filelist.full.gz,biggielist.txt} $MONDO_CACHE/mondo-restore.cfg $MINDI_CACHE/small-all/tmp 2>/dev/null || Die "Cannot copy small all.tar.gz"
     2964    cp -f $MINDI_TMP/{mountlist.txt,filelist.full.gz,biggielist.txt} $MONDO_CACHE/mondo-restore.cfg $MINDI_CACHE/small-all/tmp 2>/dev/null || Die "Cannot copy small all.tar.gz"
    30402965    cd $MINDI_TMP/small-all
    3041     tar -cv tmp | gzip -9 > $MINDI_CACHE/all.tar.gz || Die "Cannot make small all.tar.gz"
     2966    tar -cv ./tmp | gzip -9 > $MINDI_TMP/all.tar.gz || Die "Cannot make small all.tar.gz"
    30422967    sync
     2968    sleep 2
    30432969    LogIt "Done. Exiting."
    30442970    MindiExit 0
  • branches/stable/mindi/mindi-bkphw

    r1903 r1924  
    1111# Handling Configuration files
    1212die "No CACHE_DIR parameter" if ((not defined $ARGV[0]) || (! -d $ARGV[0]));
    13 my $bkpdir = "$ARGV[0]/bkphw";
     13my $locbkpdir = "/bkphw";
     14my $bkpdir = "$ARGV[0]$locbkpdir";
    1415die "No CONF_DIR parameter" if ((not defined $ARGV[1]) || (! -d $ARGV[1]));
    1516my $confdir = "$ARGV[1]";
     
    5960        if ($tool =~ /\/conrep$/) {
    6061            $ret = system("cd $tooldir ; $tool -s -f$bkpdir/conrep.dat");
    61             print SCRIPT "(cd $tooldir ; $tool -l -f$bkpdir/conrep.dat)\n";
     62            print SCRIPT "(cd $tooldir ; $tool -l -f$locbkpdir/conrep.dat)\n";
    6263            print TOOLS "$tool.xml\n";
    6364        }
     
    6566            my $dir=basename($tool);
    6667            $ret = system("export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -c $bkpdir/cpqacuxe.dat");
    67             print SCRIPT "export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -i $bkpdir/cpqacuxe.dat\n";
     68            print SCRIPT "export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -i $locbkpdir/cpqacuxe.dat\n";
    6869            print TOOLS "$tooldir/bld\n";
    6970        }
    7071        if ($tool =~ /\/hponcfg$/) {
    7172            $ret = system("$tool -w $bkpdir/hponcfg.dat");
    72             print SCRIPT "$tool -r $bkpdir/hponcfg.dat\n";
     73            print SCRIPT "$tool -r $locbkpdir/hponcfg.dat\n";
    7374        }
    7475        if ($tool =~ /\.scexe$/) {
    7576            print "Found $tool, that firmware will be applied at restore time on your HP Proliant\n";
    76             print SCRIPT "$tool\n";
     77            print SCRIPT "./$tool\n";
    7778        }
    7879        if ($ret != 0) {
  • branches/stable/mindi/rootfs/sbin/init

    r1903 r1924  
    7979    openvt 7 /bin/sh /sbin/wait-for-petris
    8080    openvt 8 /usr/bin/tail -f $LOGFILE
     81    # May avoid shell error messages
     82    chmod 666 /dev/tty* /dev/console
    8183}
    8284
     
    162164    fi
    163165    echo "Activating a potential USB Storage device"
    164     if [ -f usb-storage.ko ] || [ -f usb-storage.ko.gz ]; then
    165         if [ -e "/tmp/USE-UDEV" ] ; then
    166             modprobe -q usb-storage
    167         else
    168             insmod usb-storage.ko*
    169         fi
    170     fi
     166    modprobe -q usb-storage
    171167    for i in 1 2 3 4 5 6 7 8 9 10 ; do
    172168        sleep 1
     
    199195HowMuchFreeSpaceOnRamdisk() {
    200196   df -m -P | grep /dev/ram | head -n1 | tr -s '\t' ' ' | cut -d' ' -f4
    201 }
    202 
    203 
    204 
    205 InsertEssentialModules() {
    206 #   Load the VIA IDE module first thing if it exists (requires ide-core).
    207 #   This is to ensure that DMA is working for VIA chipsets with 2.6 kernels.
    208     for module in /ide-core.ko* /via82cxxx.ko*; do
    209         [ -f "$module" ] && MyInsmod $module > /dev/null 2> /dev/null
    210     done
    211 #   Then load the remaining modules in normal (i.e. arbitrary) order.
    212     for j in 1 2 3 4 5 ; do
    213         for i in `ls /*.*o* 2> /dev/null` ; do
    214             [ -f "$i" ] && MyInsmod $i > /dev/null 2> /dev/null
    215         done
    216     done
    217197}
    218198
     
    314294    fi
    315295    create_dev_makedev
    316     # May avoid shell error messages
    317     chmod 644 /dev/tty*
    318296    if [ -x /sbin/udevsettle ]; then
    319297        /sbin/udevsettle
     
    353331            answer="YES"
    354332        fi
    355         if [ "$answer" -eq "YES" ] ; then
     333        if [ "$answer" = "YES" ] ; then
    356334            ./mindi-rsthw
    357335        fi
     
    389367    return
    390368fi
    391 if [ -e "/tmp/USE-UDEV" ] ; then
    392     if [ -f uhcd_hci.ko ] || [ -f uhcd_hci.ko.gz ]; then
    393         modprobe -q uhcd_hci
    394     fi
    395     if [ -f usbhid.ko ] || [ -f usbhid.ko.gz ]; then
    396         modprobe -q usbhid
    397     fi
    398 else
    399     if [ -f uhcd_hci.ko ]; then
    400         insmod uhcd_hci.ko
    401     fi
    402     if [ -f usbhid.ko ]; then
    403         insmod usbcore.ko
    404         insmod usbhid.ko
    405     fi
    406 fi
     369modprobe -q uhcd_hci
     370modprobe -q usbhid
    407371}
    408372
     
    413377        LogIt "Scanning LVM's..." 1
    414378        if which lvm ; then
    415             MyInsmod dm-mod
    416             MyInsmod dm_mod
     379            modprobe -q dm-mod
     380            modprobe -q dm_mod
    417381            lvm vgscan --mknodes
    418382        else
     
    566530ModprobeAllModules() {
    567531
    568     for m in `find /lib/modules -name '*.ko*'`; do
     532    for m in `find /lib/modules -name '*\.ko*' -o -name '*\.o*'`; do
    569533        j=`basename $m | sed 's/\.ko.*$//'`
     534        j=`basename $m | sed 's/\.o.*$//'`
    570535        echo "$DENY_MODS" | grep -q "$j "
    571536        if [ $? -eq 0 ]; then
     
    584549    PKLVL=`cut -f1 /proc/sys/kernel/printk`
    585550    echo 0 > /proc/sys/kernel/printk
    586     if [ ! -e "/tmp/USE-UDEV" ] ; then
    587         echo "Inserting modules ..."
    588         insert-all-my-modules >> $LOGFILE 2>> $LOGFILE
    589         for i in $FORCE_MODS; do
    590             MyInsmod $i
    591         done
    592     else
    593         ModprobeAllModules
    594     fi
     551    ModprobeAllModules
    595552    echo $PKLVL > /proc/sys/kernel/printk
    596553}
     
    654611PKLVL=`cut -f1 /proc/sys/kernel/printk`
    655612echo 0 > /proc/sys/kernel/printk
    656 if [ ! -e "/tmp/USE-UDEV" ] ; then
    657     InsertEssentialModules
    658 else
    659     ModprobeAllModules
    660 fi
     613ModprobeAllModules
    661614echo $PKLVL > /proc/sys/kernel/printk
    662615
  • branches/stable/mondo/src/common/Makefile.am

    r1056 r1924  
    1313                       libmondo-mountlist.c libmondo-raid.c \
    1414                       libmondo-stream.c libmondo-string.c libmondo-tools.c \
    15                        libmondo-verify.c newt-specific.c \
     15                       libmondo-verify.c newt-specific.c libmondo-cli.c \
    1616                       libmondo-archive.h libmondo-devices.h \
    1717                       libmondo-filelist.h libmondo-files.h libmondo-fork.h \
    1818                       libmondo-gui.h libmondo-mountlist.h libmondo-raid.h \
    1919                       libmondo-stream.h libmondo-string.h libmondo-tools.h \
    20                        libmondo-verify.h libmondo-fifo.h \
     20                       libmondo-verify.h libmondo-fifo.h libmondo-cli.h \
    2121                       libmondo-archive-EXT.h my-stuff.h mondostructures.h \
    2222                       libmondo-devices-EXT.h libmondo-fifo-EXT.h \
     
    2525                       libmondo-mountlist-EXT.h libmondo-raid-EXT.h  \
    2626                       libmondo-string-EXT.h libmondo-tools-EXT.h \
    27                        libmondo-verify-EXT.h  libmondo-stream-EXT.h \
     27                       libmondo-verify-EXT.h  libmondo-stream-EXT.h libmondo-cli-EXT.h \
    2828                       newt-specific.h
  • branches/stable/mondo/src/common/libmondo-devices.c

    r1903 r1924  
    6161 */
    6262bool g_restoring_live_from_cd = FALSE;
     63bool g_restoring_live_from_nfs = FALSE;
    6364
    6465extern t_bkptype g_backup_media_type;   // set by main()
     
    18521853                }
    18531854            } else {
    1854                 sz_size = 0;
     1855                strcpy(sz_size, "0");
    18551856            }
    18561857            mr_free(comment);
  • branches/stable/mondo/src/common/libmondo-filelist.c

    r1903 r1924  
    15901590        mr_asprintf(&tmp2, call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|fat|vfat|dos' | awk '{print $3}'"));
    15911591        if (strlen(tmp2) < 1) {
    1592             mr_asprintf(&tmp1,"");
     1592            mr_asprintf(&tmp1," ");
    15931593        } else {
    15941594            mr_msg(2, "Found windows FS: %s",tmp2);
  • branches/stable/mondo/src/common/libmondo-mountlist.c

    r1904 r1924  
    843843#if linux
    844844        sscanf(incoming,
    845                "%s %s %s %s %s %s",
     845               "%s %s %s %s %s",
    846846               mountlist->el[items].device,
    847847               mountlist->el[items].mountpoint,
     
    909909                     mountlist->el[items].format,
    910910                     mountlist->el[items].size,
    911                     mountlist->el[items].label);
     911                     mountlist->el[items].label);
    912912            items++;
    913913        }
     
    948948    for (i = 0; i < mountlist->entries; i++) {
    949949        fprintf(fout,
    950                 "%-15s %-15s %-15s %-15lld %-15s %-15s\n",
     950                "%-15s %-15s %-15s %-15lld %-15s\n",
    951951                mountlist->el[i].device, mountlist->el[i].mountpoint,
    952952                mountlist->el[i].format, mountlist->el[i].size,
  • branches/stable/mondo/src/common/libmondo-stream.c

    r1904 r1924  
    695695    (void) getcwd(old_cwd, MAX_STR_LEN);
    696696    chdir(bkpinfo->tmpdir);
    697     mr_asprintf(&tmp, "tar -zxf %s tmp/mondo-restore.cfg 2> /dev/null",
     697    mr_asprintf(&tmp, "tar -zxf %s ./tmp/mondo-restore.cfg 2> /dev/null",
    698698             outfname);
    699699    paranoid_system(tmp);
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1903 r1924  
    2121#include "libmondo-fork-EXT.h"
    2222#include "libmondo-raid-EXT.h"
     23#include "libmondo-devices-EXT.h"
    2324#include <sys/socket.h>
    2425#include <netdb.h>
     
    7879
    7980extern bool am_I_in_disaster_recovery_mode(void);
     81
     82/* Return a string containing the date */
     83char *mr_date(void) {
     84
     85        time_t tcurr;
     86
     87        tcurr = time(NULL);
     88        return(ctime(&tcurr));
     89}
     90
     91/*-----------------------------------------------------------*/
    8092
    8193
     
    692704    strcpy(bkpinfo->tmpdir,p);
    693705    paranoid_free(tmp);
    694 
    695     //sprintf(bkpinfo->tmpdir, "%s/tmpfs/mondo.tmp.%d", "/tmp", (int) (random() % 32768));  // for mondorestore
    696706}
    697707
     
    711721    memset((void *) bkpinfo, 0, sizeof(struct s_bkpinfo));
    712722
    713     /* special case for tmpdir as used eveywhere after */
    714     setup_tmpdir(NULL);
     723    sensibly_set_tmpdir_and_scratchdir();
    715724
    716725    bkpinfo->manual_tray = mr_conf->manual_tray;
     
    764773    bkpinfo->prefix = tmp;
    765774
    766     bkpinfo->scratchdir[0] = '\0';
    767775    bkpinfo->make_filelist = TRUE;  // unless -J supplied to mondoarchive
    768776    bkpinfo->optimal_set_size = 0;
     
    823831 * - make sure afio, cdrecord, bzip2, awk, md5sum, strings, mindi, and buffer exist
    824832 * - make sure CD-ROM is unmounted
    825  * - make sure /etc/modules.conf exists
    826833 * - make sure user's mountlist is OK by running <tt>mindi --makemountlist</tt>
    827834 *
     
    940947    }
    941948    mr_free(tmp);
    942 #ifndef __FreeBSD__
    943     if (!does_file_exist("/etc/modules.conf")) {
    944         if (does_file_exist("/etc/conf.modules")) {
    945             log_it("Linking /etc/modules.conf to /etc/conf.modules");
    946             run_program_and_log_output
    947                 ("ln -sf /etc/conf.modules /etc/modules.conf", 5);
    948         } else if (does_file_exist("/etc/modprobe.d")) {
    949             log_it
    950                 ("Directory /etc/modprobe.d found. mindi will use its contents.");
    951         } else if (does_file_exist("/etc/modprobe.conf")) {
    952             log_it("Linking /etc/modules.conf to /etc/modprobe.conf");
    953             run_program_and_log_output
    954                 ("ln -sf /etc/modprobe.conf /etc/modules.conf", 5);
    955         } else {
    956             retval++;
    957             log_to_screen
    958                 (_("Please find out what happened to /etc/modules.conf"));
    959         }
    960     }
    961 #endif
    962949
    963950    run_program_and_log_output("cat /etc/fstab", 5);
  • branches/stable/mondo/src/include/my-stuff.h

    r1770 r1924  
    1818#define MINDI_CACHE "/var/cache/mindi"
    1919#define MONDORESTORECFG MONDO_CACHE"/mondo-restore.cfg"
     20
    2021/**
    2122 * The mondo-restore.cfg stub (appended to the directory where all.tar.gz was unpacked).
    2223 */
    23 #define MONDO_CFG_FILE_STUB "tmp/mondo-restore.cfg"
    24 
    25 
     24#define MONDO_CFG_FILE_STUB "./tmp/mondo-restore.cfg"
    2625
    2726/**
     
    7675 * The biggielist stub (appended to the directory where all.tar.gz was unpacked).
    7776 */
    78 #define BIGGIELIST_TXT_STUB "tmp/biggielist.txt"
     77#define BIGGIELIST_TXT_STUB "./tmp/biggielist.txt"
    7978
    8079/**
    8180 * The filelist stub (appended to the directory where all.tar.gz was unpacked).
    8281 */
    83 #define FILELIST_FULL_STUB "tmp/filelist.full.gz"
     82#define FILELIST_FULL_STUB "./tmp/filelist.full.gz"
    8483
    8584/**
    8685 * The mountlist stub (appended to the directory where all.tar.gz was unpacked).
    8786 */
    88 #define MOUNTLIST_FNAME_STUB "tmp/mountlist.txt"
     87#define MOUNTLIST_FNAME_STUB "./tmp/mountlist.txt"
     88
     89/**
     90 * The mondo-restore.cfg stub (appended to the directory where all.tar.gz was unpacked).
     91 */
     92#define MONDO_CFG_FILE_STUB "./tmp/mondo-restore.cfg"
    8993
    9094/**
  • branches/stable/mondo/src/lib/mr_str.c

    r1594 r1924  
    66 */
    77
     8#include <stdlib.h>
    89#include <stdio.h>
    910#include <string.h>
  • branches/stable/mondo/src/mondoarchive/Makefile.am

    r1560 r1924  
    77
    88## Headers
    9 noinst_HEADERS       = mondo-cli-EXT.h mondo-cli.h mondoarchive.h
     9noinst_HEADERS       = mondoarchive.h
    1010
    1111## The program
    1212sbin_PROGRAMS        = mondoarchive
    13 mondoarchive_SOURCES = mondoarchive.c mondo-cli.c
     13mondoarchive_SOURCES = mondoarchive.c
    1414mondoarchive_LDADD   = ${top_builddir}/src/common/libmondo.a ${top_builddir}/src/lib/libmr.a
  • branches/stable/mondo/src/mondoarchive/mondoarchive.c

    r1842 r1924  
    5959
    6060/****************** subroutines used only here ******************/
     61
     62/**
     63 * Whether we're restoring from ISOs. Obviously not, since this is the
     64 * backup program.
     65 * @note You @b MUST declare this variable somewhere in your program if
     66 * you use libmondo. Otherwise the link will fail.
     67 * @ingroup globalGroup
     68 */
     69bool g_ISO_restore_mode = FALSE;
     70
     71/* Do we use extended attributes and acl ?
     72 *  * By default no, use --acl & --attr options to force their usage */
     73char *g_getfacl = NULL;
     74char *g_getfattr = NULL;
    6175
    6276/* Reference to global bkpinfo */
  • branches/stable/mondo/src/mondoarchive/mondoarchive.h

    r1326 r1924  
    1717 */
    1818char *MONDO_LOGFILE = "/var/log/mondoarchive.log";
     19char *MONDO_OPTIONS = "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z";
    1920
    2021/* No restriction on ps options */
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c

    r1903 r1924  
    11181118                    BIGGIELIST_TXT_STUB,
    11191119                    FILELIST_FULL_STUB,
    1120                     "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
     1120                    "./tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    11211121            mr_msg(1, "tarcommand = %s", command);
    11221122            run_program_and_log_output(command, 1);
     
    11351135                    BIGGIELIST_TXT_STUB,
    11361136                    FILELIST_FULL_STUB,
    1137                     "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
     1137                    "./tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    11381138            mr_msg(1, "tarcommand = %s", command);
    11391139            run_program_and_log_output(command, 1);
     
    11421142            if (!does_file_exist(BIGGIELIST_TXT_STUB)) {
    11431143                fatal_error
    1144                     ("all.tar.gz did not include tmp/biggielist.txt");
     1144                    ("all.tar.gz did not include ./tmp/biggielist.txt");
    11451145            }
    11461146            if (!does_file_exist(FILELIST_FULL_STUB)) {
    11471147                fatal_error
    1148                     ("all.tar.gz did not include tmp/filelist.full.gz");
     1148                    ("all.tar.gz did not include ./tmp/filelist.full.gz");
    11491149            }
    11501150        }
     
    20832083            1024L * 1024 * 32 / bkpinfo->internal_tape_block_size,
    20842084            MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB,
    2085             BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm");
     2085            BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "./tmp/i-want-my-lvm");
    20862086    mr_msg(2, "command = '%s'", command);
    20872087    res = run_program_and_log_output(command, -1);
     
    21132113    char *ramdisk_fname = NULL;
    21142114    char *mountlist_file = NULL;
    2115     int res = 0;
    21162115
    21172116    bool try_plan_B = FALSE;
     
    22052204                mr_msg(2,
    22062205                        "gcffa --- Plan B, a.k.a. untarring some file from all.tar.gz");
    2207                 mr_asprintf(&command, "tar -zxvf " MNT_CDROM "/images/all.tar.gz %s %s %s %s %s", MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm"); // add -b TAPE_BLOCK_SIZE if you _really_ think it's necessary
     2206                mr_asprintf(&command, "tar -zxvf " MNT_CDROM "/images/all.tar.gz %s %s %s %s %s", MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "./tmp/i-want-my-lvm");   // add -b TAPE_BLOCK_SIZE if you _really_ think it's necessary
    22082207                run_program_and_log_output(command, TRUE);
    22092208                mr_free(command);
  • branches/stable/mondo/src/mondorestore/mondorestore.c

    r1904 r1924  
    924924
    925925    strcpy(bkpinfo->restore_path, "/");
    926     if (!g_restoring_live_from_cd) {
     926    if (!g_restoring_live_from_cd && !g_restoring_live_from_nfs) {
    927927        popup_and_OK
    928928            (_("Please insert tape/CD/USB key, then hit 'OK' to continue."));
    929929        sleep(1);
    930930    }
    931     interactively_obtain_media_parameters_from_user(FALSE);
     931    if (!g_restoring_live_from_nfs) {
     932        interactively_obtain_media_parameters_from_user(FALSE);
     933    }
    932934    if (!bkpinfo->media_device) {
    933935        mr_msg(2, "Warning - failed to find media dev");
     
    948950    retval = load_mountlist(mountlist, g_mountlist_fname);
    949951    load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    950     filelist = process_filelist_and_biggielist();
    951     if (filelist) {
     952
     953    if (!g_restoring_live_from_nfs && (filelist = process_filelist_and_biggielist())) {
    952954        save_filelist(filelist, "/tmp/selected-files.txt");
    953955        mr_asprintf(&old_restpath,bkpinfo->restore_path);
     
    961963        strcpy(bkpinfo->restore_path, old_restpath);
    962964        mr_free(old_restpath);
     965    } else {
     966        retval += restore_everything(NULL);
    963967    }
    964968    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
     
    27062710    paranoid_fclose(fout);
    27072711    sprintf(command,
    2708             "tar -zxvf %s tmp/mondo-restore.cfg tmp/mountlist.txt tmp/filelist.full tmp/biggielist.txt",
     2712            "tar -zxvf %s ./tmp/mondo-restore.cfg ./tmp/mountlist.txt ./tmp/filelist.full ./tmp/biggielist.txt",
    27092713            datadisks_fname);
    27102714    run_program_and_log_output(command, 4);
     
    30443048            g_restoring_live_from_cd = TRUE;
    30453049        }
     3050        if (bkpinfo->backup_media_type == nfs) {
     3051            g_restoring_live_from_nfs = TRUE;
     3052        }
    30463053        if (argc == 5 && strcmp(argv[1], "--monitas-live") == 0) {
    30473054            retval =
  • branches/stable/mondo/src/mondorestore/mr-externs.h

    r1663 r1924  
    108108extern bool g_text_mode;
    109109extern bool g_restoring_live_from_cd;
     110extern bool g_restoring_live_from_nfs;
    110111extern int fput_string_one_char_at_a_time(FILE *, char *);
    111112
Note: See TracChangeset for help on using the changeset viewer.