Changeset 1924 in MondoRescue for branches/stable
- Timestamp:
- Apr 18, 2008, 1:41:41 AM (17 years ago)
- Location:
- branches/stable
- Files:
-
- 7 deleted
- 20 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/deplist.txt
r1904 r1924 13 13 14 14 #-------------------------------- ESSENTIAL ----------------------------------- 15 fstab raidtab modules.conf conf.modules mondorestore modules.conf.local 15 fstab raidtab 16 /usr/sbin/mondorestore 16 17 /etc/mdadm/mdadm.conf /etc/mdadm.conf 17 18 /sbin/ldconfig … … 21 22 bzip2 bunzip2 lzop 22 23 ctrlaltdel 23 # Do not remove as they need to be aligned with the kernel 24 insmod lsmod 24 # Everything needed to handle modules correctly 25 insmod lsmod /sbin/modprobe 26 /etc/modprobe.d /etc/modprobe.conf /etc/modules.conf /etc/conf.modules /etc/modules.conf.local 27 25 28 hosts host.conf resolv.conf hosts.allow hosts.deny 26 29 klogd sysklogd … … 47 50 # gdb valgrind /usr/lib/valgrind 48 51 49 #----------------- For all you LVM users out there, much love -----------------50 LVMFILES:51 lvmiopversion lvmcreate_initrd pvdata52 52 #------------------------------------------------------------------------------ 53 53 # … … 56 56 conrep cpqacuxe hponcfg 57 57 lshw 58 #----------------- For all you LVM users out there, much love ----------------- 59 LVMFILES: 60 lvmiopversion lvmcreate_initrd pvdata /etc/lvm/lvm.conf 61 #------------------------------------------------------------------------------ -
branches/stable/mindi/distributions/conf/mindi.conf.dist
r1842 r1924 10 10 11 11 # 12 # Maximum number of disks made by mindi13 #14 mindi_max_disks=9915 #16 12 # Extra space for Ram disk 17 13 # 18 mindi_extra_space= 3276814 mindi_extra_space=49152 19 15 20 16 # -
branches/stable/mindi/mindi
r1904 r1924 108 108 109 109 BOOT_MEDIA_MESSAGE="$mindi_boot_msg" 110 110 111 FDISK=$MINDI_SBIN/parted2fdisk 111 112 … … 171 172 172 173 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" 174 176 if [ "`echo $mappath | grep -F ".gz"`" ] ; then 175 177 included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2` … … 206 208 [ "`head $scratchfile -n1 | grep -F "bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-" 207 209 [ "`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 209 213 mv $scratchfile $scratchfile.gz 210 214 gunzip -f $scratchfile || LogIt "Cannot gunzip $scratchfile.gz" … … 278 282 BIGNO=$(($BIGNO+1)) 279 283 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 282 289 gunzip -f $outdir/$incoming || LogIt "Cannot gunzip $outdir/$incoming" 283 290 fi … … 1022 1029 1023 1030 1024 MakeModuleLoadingScript() {1025 local module fname params modpath kver outerloop i modpaths kver searchpath list_to_echo j1026 tmpmodprobe_flag=$11027 outfile=$21028 > $outfile || Die "Cannot create empty $outfile"1029 echo -en "#\041/bin/sh\n\n" >> $outfile1030 echo "echo -en \"Loading your modules...\"" >> $outfile1031 if [ "$YOUR_KERNEL_SUCKS" ] ; then1032 kver=$FAILSAFE_KVER1033 cd $MINDI_TMP1034 searchpath=lib/modules/$kver1035 else1036 ###1037 ### Sq-Modification ... Use kernelname for module search path if specified1038 ###1039 #kver=`uname -r`1040 if [ "${kernelname}" != "" ]1041 then1042 kver=${kernelname}1043 else1044 kver=`uname -r`1045 fi1046 ###1047 ### Sq-Modification end1048 ###1049 searchpath=/lib/modules/$kver1050 fi1051 1052 echo -en "for outerloop in 1 2 3 4 5 ; do\necho -en \".\"\n" >> $outfile1053 list_to_echo="$MODULES"1054 # Remove unwanted modules from list1055 for i in $DENY_MODS; do1056 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 done1059 1060 # Make temporary modprobe.conf file if we are told so1061 if [ "$tmpmodprobe_flag" = "Y" ] ; then1062 infile="$MINDI_TMP/modprobe.conf.mindi"1063 find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f -print0 | xargs -0 cat > $infile1064 else1065 infile="/etc/modules.conf"1066 fi1067 1068 for module in $list_to_echo $EXTRA_MODS ; do1069 params=`sed -n "s/^options \\+$module \\+//p" $infile`1070 modpaths=`FindSpecificModuleInPath $searchpath $module`1071 for i in $modpaths ; do1072 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 '#' '.' >> $outfile1079 echo -en "$i added to module list.\n" >> $LOGFILE1080 done1081 done1082 echo -en "done\n" >> $outfile1083 echo "echo \"Done.\"" >> $outfile1084 chmod +x $outfile1085 cd /1086 # Remove temporary modprobe.conf file if we have created one1087 if [ "$tmpmodprobe_flag" = "Y" ] ; then1088 rm -f $infile1089 fi1090 }1091 1092 1093 1031 MakeMountlist() { 1094 1032 local scratchdir mountlist all_partitions current_partition \ … … 2022 1960 cd $MINDI_TMP 2023 1961 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" 2025 1964 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 -) 2027 1967 else 2028 1968 ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO … … 2035 1975 for k in $j ; do 2036 1976 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 -) 2038 1979 else 2039 1980 ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO … … 2095 2036 [ "$?" -ne "0" ] && [ _"$MONDO_SHARE" != _"" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts" 2096 2037 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 - 2098 2040 cd $old_pwd 2099 2041 echo -e "$DONE" … … 2401 2343 cp -Rdf $tgz_dir_fname/* . 2>&1 >> $LOGFILE 2402 2344 tar -zxf symlinks.tgz || Die "Cannot untar symlinks.tgz" 2345 2403 2346 cd dev || Die "Can't cd to dev" 2404 2347 tar -zxf dev-entries.tgz || Die "Cannot untar dev-entries.tgz" … … 2409 2352 s=`which $w 2> /dev/null` 2410 2353 if [ -e "$s" ] ; then 2411 cp --parents -af $s . 2>> $LOGFILE2412 fi2413 done2414 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 2416 2359 [ -e "/dev/.devfsd" ] && echo "/dev/.devfsd found" > tmp/USE-DEVFS 2417 2360 2418 2361 # Handle the case where busybox and mount are dynamically linked 2419 # Should be done first so that if /lib64 is a link, it's2420 # created first like that, instead of as a real dir later on2421 2362 file $MINDI_LIB/rootfs/bin/busybox 2>&1 | grep -q "dynamically" 2422 2363 if [ $? -eq 0 ]; then 2364 # We want to use the real mount 2365 rm -f bin/mount 2423 2366 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 - 2425 2369 rm -f $MINDI_TMP/busy.lis 2426 2370 fi 2427 2371 2372 mkdir -p $mountpoint/tmp 2428 2373 # Management of udev (which includes modprobe in rules) 2429 2374 ps auxww | grep -v grep | grep -qw udevd 2430 2375 if [ $? -eq 0 ]; then 2431 echo "udev device manager found" > tmp/USE-UDEV2376 echo "udev device manager found" > $mountpoint/tmp/USE-UDEV 2432 2377 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 - 2434 2380 # This avoids NIC remapping if on another machine at restore time on Debian at least 2435 2381 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 - 2437 2384 if [ -x /sbin/udevd ]; then 2438 2385 lis2=`grep -Ev '^#' $MINDI_CONF/udev.files` … … 2460 2407 fi 2461 2408 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 - 2463 2411 rm -f $MINDI_TMP/udev.lis 2464 2412 else 2465 2413 echo "udevd daemon not in standard place (/sbin)" 2>&1 | tee -a $LOGFILE 2466 2414 echo "mindi will use static devices which may cause problems" 2>&1 | tee -a $LOGFILE 2467 rm -f tmp/USE-UDEV2415 rm -f $mountpoint/tmp/USE-UDEV 2468 2416 fi 2469 2417 fi … … 2478 2426 lis=`grep -Ev '^#' $MINDI_CACHE/tools.files` 2479 2427 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 - 2481 2430 fi 2482 2431 if [ -f $MINDI_CACHE/mindi-rsthw ]; then … … 2497 2446 fi 2498 2447 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 - 2500 2450 2501 2451 cd $old_pwd 2502 echo -en "..."2503 MakeModuleLoadingScript $TMPMODPROBE_FLAG $mountpoint/sbin/insert-all-my-modules2504 2452 echo -en "..." 2505 2453 old_pwd=`pwd` … … 2536 2484 needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`" 2537 2485 done 2486 2538 2487 for i in $needed_modules ; do 2539 2488 [ -e "$i" ] && s=`du -sk $i | cut -f1` || s="" 2540 2489 [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i 2541 2490 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 2544 2494 if [ ! -f $mountpoint/tmp/USE-UDEV ]; then 2545 2495 if [ "`echo "$i" | grep -F ".gz"`" ]; then 2496 echo "Uncompressing $i" >> $LOGFILE 2546 2497 gunzip -f $mountpoint/$i 2547 #i=`echo $i | sed 's/.gz//'`2548 2498 fi 2549 2499 fi … … 2551 2501 2552 2502 # 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 2562 2506 if [ ! -e "/sbin/devfsd" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then 2563 2507 echo "Deleting devfsd daemon from ramdisk" >> $LOGFILE … … 2570 2514 dd if=/dev/zero of=$mountpoint/zero &> /dev/null 2571 2515 rm -f $mountpoint/zero 2572 mkdir -p $mountpoint/tmp2573 2516 if [ _"$MONDO_SHARE" != _"" ]; then 2574 2517 cp -f $MONDO_CACHE/mondo-restore.cfg $mountpoint/tmp &> /dev/null || Die "Cannot copy mondo-restore.cfg to ramdisk" … … 2666 2609 echo "-----------------------------" >> $LOGFILE 2667 2610 2668 if [ -e "/etc/conf.modules" ] && [ ! -e "/etc/modules.conf" ] ; then2669 LogIt "WARNING - Ancient distro detected." 12670 ln -sf /etc/conf.modules /etc/modules.conf2671 fi2672 2611 [ -e "/sbin/mkdosfs" ] && [ ! -e "/sbin/mkfs.vfat" ] && ln -sf /sbin/mkdosfs /sbin/mkfs.vfat 2673 2612 … … 2704 2643 2705 2644 [ "`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 we2707 # may have the modprobe configuration spread out across multiple files in2708 # directory /etc/modprobe.d. If this is the case we concatenate these files into2709 # a temporary file for further processing. Otherwise we continue in the standard2710 # way. Note further that in case /etc/modprobe.d exists, we use it and ignore2711 # /etc/modprobe.conf which is exactly what module-init-tools does. The temporary2712 # modprobe.conf file is created in MakeModuleLoadingScript. AL041128.2713 if [ -d "/etc/modprobe.d" ] && [ "`uname -r | cut -c1-3`" = "2.6" ] ; then2714 TMPMODPROBE_FLAG="Y"2715 else2716 TMPMODPROBE_FLAG="N"2717 [ -e "/etc/modprobe.conf" ] && [ ! -e "/etc/modules.conf" ] && ln -sf /etc/modprobe.conf /etc/modules.conf2718 [ ! -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 fi2720 2645 2721 2646 # Update the PATH variable if incomplete … … 3037 2962 mkdir -p $MINDI_TMP/small-all/tmp 3038 2963 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" 3040 2965 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" 3042 2967 sync 2968 sleep 2 3043 2969 LogIt "Done. Exiting." 3044 2970 MindiExit 0 -
branches/stable/mindi/mindi-bkphw
r1903 r1924 11 11 # Handling Configuration files 12 12 die "No CACHE_DIR parameter" if ((not defined $ARGV[0]) || (! -d $ARGV[0])); 13 my $bkpdir = "$ARGV[0]/bkphw"; 13 my $locbkpdir = "/bkphw"; 14 my $bkpdir = "$ARGV[0]$locbkpdir"; 14 15 die "No CONF_DIR parameter" if ((not defined $ARGV[1]) || (! -d $ARGV[1])); 15 16 my $confdir = "$ARGV[1]"; … … 59 60 if ($tool =~ /\/conrep$/) { 60 61 $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"; 62 63 print TOOLS "$tool.xml\n"; 63 64 } … … 65 66 my $dir=basename($tool); 66 67 $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"; 68 69 print TOOLS "$tooldir/bld\n"; 69 70 } 70 71 if ($tool =~ /\/hponcfg$/) { 71 72 $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"; 73 74 } 74 75 if ($tool =~ /\.scexe$/) { 75 76 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"; 77 78 } 78 79 if ($ret != 0) { -
branches/stable/mindi/rootfs/sbin/init
r1903 r1924 79 79 openvt 7 /bin/sh /sbin/wait-for-petris 80 80 openvt 8 /usr/bin/tail -f $LOGFILE 81 # May avoid shell error messages 82 chmod 666 /dev/tty* /dev/console 81 83 } 82 84 … … 162 164 fi 163 165 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 171 167 for i in 1 2 3 4 5 6 7 8 9 10 ; do 172 168 sleep 1 … … 199 195 HowMuchFreeSpaceOnRamdisk() { 200 196 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*; do209 [ -f "$module" ] && MyInsmod $module > /dev/null 2> /dev/null210 done211 # Then load the remaining modules in normal (i.e. arbitrary) order.212 for j in 1 2 3 4 5 ; do213 for i in `ls /*.*o* 2> /dev/null` ; do214 [ -f "$i" ] && MyInsmod $i > /dev/null 2> /dev/null215 done216 done217 197 } 218 198 … … 314 294 fi 315 295 create_dev_makedev 316 # May avoid shell error messages317 chmod 644 /dev/tty*318 296 if [ -x /sbin/udevsettle ]; then 319 297 /sbin/udevsettle … … 353 331 answer="YES" 354 332 fi 355 if [ "$answer" -eq"YES" ] ; then333 if [ "$answer" = "YES" ] ; then 356 334 ./mindi-rsthw 357 335 fi … … 389 367 return 390 368 fi 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 369 modprobe -q uhcd_hci 370 modprobe -q usbhid 407 371 } 408 372 … … 413 377 LogIt "Scanning LVM's..." 1 414 378 if which lvm ; then 415 MyInsmoddm-mod416 MyInsmoddm_mod379 modprobe -q dm-mod 380 modprobe -q dm_mod 417 381 lvm vgscan --mknodes 418 382 else … … 566 530 ModprobeAllModules() { 567 531 568 for m in `find /lib/modules -name '* .ko*'`; do532 for m in `find /lib/modules -name '*\.ko*' -o -name '*\.o*'`; do 569 533 j=`basename $m | sed 's/\.ko.*$//'` 534 j=`basename $m | sed 's/\.o.*$//'` 570 535 echo "$DENY_MODS" | grep -q "$j " 571 536 if [ $? -eq 0 ]; then … … 584 549 PKLVL=`cut -f1 /proc/sys/kernel/printk` 585 550 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 595 552 echo $PKLVL > /proc/sys/kernel/printk 596 553 } … … 654 611 PKLVL=`cut -f1 /proc/sys/kernel/printk` 655 612 echo 0 > /proc/sys/kernel/printk 656 if [ ! -e "/tmp/USE-UDEV" ] ; then 657 InsertEssentialModules 658 else 659 ModprobeAllModules 660 fi 613 ModprobeAllModules 661 614 echo $PKLVL > /proc/sys/kernel/printk 662 615 -
branches/stable/mondo/src/common/Makefile.am
r1056 r1924 13 13 libmondo-mountlist.c libmondo-raid.c \ 14 14 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 \ 16 16 libmondo-archive.h libmondo-devices.h \ 17 17 libmondo-filelist.h libmondo-files.h libmondo-fork.h \ 18 18 libmondo-gui.h libmondo-mountlist.h libmondo-raid.h \ 19 19 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 \ 21 21 libmondo-archive-EXT.h my-stuff.h mondostructures.h \ 22 22 libmondo-devices-EXT.h libmondo-fifo-EXT.h \ … … 25 25 libmondo-mountlist-EXT.h libmondo-raid-EXT.h \ 26 26 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 \ 28 28 newt-specific.h -
branches/stable/mondo/src/common/libmondo-devices.c
r1903 r1924 61 61 */ 62 62 bool g_restoring_live_from_cd = FALSE; 63 bool g_restoring_live_from_nfs = FALSE; 63 64 64 65 extern t_bkptype g_backup_media_type; // set by main() … … 1852 1853 } 1853 1854 } else { 1854 s z_size = 0;1855 strcpy(sz_size, "0"); 1855 1856 } 1856 1857 mr_free(comment); -
branches/stable/mondo/src/common/libmondo-filelist.c
r1903 r1924 1590 1590 mr_asprintf(&tmp2, call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|fat|vfat|dos' | awk '{print $3}'")); 1591 1591 if (strlen(tmp2) < 1) { 1592 mr_asprintf(&tmp1," ");1592 mr_asprintf(&tmp1," "); 1593 1593 } else { 1594 1594 mr_msg(2, "Found windows FS: %s",tmp2); -
branches/stable/mondo/src/common/libmondo-mountlist.c
r1904 r1924 843 843 #if linux 844 844 sscanf(incoming, 845 "%s %s %s %s %s %s",845 "%s %s %s %s %s", 846 846 mountlist->el[items].device, 847 847 mountlist->el[items].mountpoint, … … 909 909 mountlist->el[items].format, 910 910 mountlist->el[items].size, 911 mountlist->el[items].label);911 mountlist->el[items].label); 912 912 items++; 913 913 } … … 948 948 for (i = 0; i < mountlist->entries; i++) { 949 949 fprintf(fout, 950 "%-15s %-15s %-15s %-15lld %-15s %-15s\n",950 "%-15s %-15s %-15s %-15lld %-15s\n", 951 951 mountlist->el[i].device, mountlist->el[i].mountpoint, 952 952 mountlist->el[i].format, mountlist->el[i].size, -
branches/stable/mondo/src/common/libmondo-stream.c
r1904 r1924 695 695 (void) getcwd(old_cwd, MAX_STR_LEN); 696 696 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", 698 698 outfname); 699 699 paranoid_system(tmp); -
branches/stable/mondo/src/common/libmondo-tools.c
r1903 r1924 21 21 #include "libmondo-fork-EXT.h" 22 22 #include "libmondo-raid-EXT.h" 23 #include "libmondo-devices-EXT.h" 23 24 #include <sys/socket.h> 24 25 #include <netdb.h> … … 78 79 79 80 extern bool am_I_in_disaster_recovery_mode(void); 81 82 /* Return a string containing the date */ 83 char *mr_date(void) { 84 85 time_t tcurr; 86 87 tcurr = time(NULL); 88 return(ctime(&tcurr)); 89 } 90 91 /*-----------------------------------------------------------*/ 80 92 81 93 … … 692 704 strcpy(bkpinfo->tmpdir,p); 693 705 paranoid_free(tmp); 694 695 //sprintf(bkpinfo->tmpdir, "%s/tmpfs/mondo.tmp.%d", "/tmp", (int) (random() % 32768)); // for mondorestore696 706 } 697 707 … … 711 721 memset((void *) bkpinfo, 0, sizeof(struct s_bkpinfo)); 712 722 713 /* special case for tmpdir as used eveywhere after */ 714 setup_tmpdir(NULL); 723 sensibly_set_tmpdir_and_scratchdir(); 715 724 716 725 bkpinfo->manual_tray = mr_conf->manual_tray; … … 764 773 bkpinfo->prefix = tmp; 765 774 766 bkpinfo->scratchdir[0] = '\0';767 775 bkpinfo->make_filelist = TRUE; // unless -J supplied to mondoarchive 768 776 bkpinfo->optimal_set_size = 0; … … 823 831 * - make sure afio, cdrecord, bzip2, awk, md5sum, strings, mindi, and buffer exist 824 832 * - make sure CD-ROM is unmounted 825 * - make sure /etc/modules.conf exists826 833 * - make sure user's mountlist is OK by running <tt>mindi --makemountlist</tt> 827 834 * … … 940 947 } 941 948 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_output947 ("ln -sf /etc/conf.modules /etc/modules.conf", 5);948 } else if (does_file_exist("/etc/modprobe.d")) {949 log_it950 ("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_output954 ("ln -sf /etc/modprobe.conf /etc/modules.conf", 5);955 } else {956 retval++;957 log_to_screen958 (_("Please find out what happened to /etc/modules.conf"));959 }960 }961 #endif962 949 963 950 run_program_and_log_output("cat /etc/fstab", 5); -
branches/stable/mondo/src/include/my-stuff.h
r1770 r1924 18 18 #define MINDI_CACHE "/var/cache/mindi" 19 19 #define MONDORESTORECFG MONDO_CACHE"/mondo-restore.cfg" 20 20 21 /** 21 22 * The mondo-restore.cfg stub (appended to the directory where all.tar.gz was unpacked). 22 23 */ 23 #define MONDO_CFG_FILE_STUB "tmp/mondo-restore.cfg" 24 25 24 #define MONDO_CFG_FILE_STUB "./tmp/mondo-restore.cfg" 26 25 27 26 /** … … 76 75 * The biggielist stub (appended to the directory where all.tar.gz was unpacked). 77 76 */ 78 #define BIGGIELIST_TXT_STUB " tmp/biggielist.txt"77 #define BIGGIELIST_TXT_STUB "./tmp/biggielist.txt" 79 78 80 79 /** 81 80 * The filelist stub (appended to the directory where all.tar.gz was unpacked). 82 81 */ 83 #define FILELIST_FULL_STUB " tmp/filelist.full.gz"82 #define FILELIST_FULL_STUB "./tmp/filelist.full.gz" 84 83 85 84 /** 86 85 * The mountlist stub (appended to the directory where all.tar.gz was unpacked). 87 86 */ 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" 89 93 90 94 /** -
branches/stable/mondo/src/lib/mr_str.c
r1594 r1924 6 6 */ 7 7 8 #include <stdlib.h> 8 9 #include <stdio.h> 9 10 #include <string.h> -
branches/stable/mondo/src/mondoarchive/Makefile.am
r1560 r1924 7 7 8 8 ## Headers 9 noinst_HEADERS = mondo -cli-EXT.h mondo-cli.h mondoarchive.h9 noinst_HEADERS = mondoarchive.h 10 10 11 11 ## The program 12 12 sbin_PROGRAMS = mondoarchive 13 mondoarchive_SOURCES = mondoarchive.c mondo-cli.c13 mondoarchive_SOURCES = mondoarchive.c 14 14 mondoarchive_LDADD = ${top_builddir}/src/common/libmondo.a ${top_builddir}/src/lib/libmr.a -
branches/stable/mondo/src/mondoarchive/mondoarchive.c
r1842 r1924 59 59 60 60 /****************** 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 */ 69 bool 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 */ 73 char *g_getfacl = NULL; 74 char *g_getfattr = NULL; 61 75 62 76 /* Reference to global bkpinfo */ -
branches/stable/mondo/src/mondoarchive/mondoarchive.h
r1326 r1924 17 17 */ 18 18 char *MONDO_LOGFILE = "/var/log/mondoarchive.log"; 19 char *MONDO_OPTIONS = "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"; 19 20 20 21 /* No restriction on ps options */ -
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
r1903 r1924 1118 1118 BIGGIELIST_TXT_STUB, 1119 1119 FILELIST_FULL_STUB, 1120 " tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);1120 "./tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1121 1121 mr_msg(1, "tarcommand = %s", command); 1122 1122 run_program_and_log_output(command, 1); … … 1135 1135 BIGGIELIST_TXT_STUB, 1136 1136 FILELIST_FULL_STUB, 1137 " tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);1137 "./tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1138 1138 mr_msg(1, "tarcommand = %s", command); 1139 1139 run_program_and_log_output(command, 1); … … 1142 1142 if (!does_file_exist(BIGGIELIST_TXT_STUB)) { 1143 1143 fatal_error 1144 ("all.tar.gz did not include tmp/biggielist.txt");1144 ("all.tar.gz did not include ./tmp/biggielist.txt"); 1145 1145 } 1146 1146 if (!does_file_exist(FILELIST_FULL_STUB)) { 1147 1147 fatal_error 1148 ("all.tar.gz did not include tmp/filelist.full.gz");1148 ("all.tar.gz did not include ./tmp/filelist.full.gz"); 1149 1149 } 1150 1150 } … … 2083 2083 1024L * 1024 * 32 / bkpinfo->internal_tape_block_size, 2084 2084 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"); 2086 2086 mr_msg(2, "command = '%s'", command); 2087 2087 res = run_program_and_log_output(command, -1); … … 2113 2113 char *ramdisk_fname = NULL; 2114 2114 char *mountlist_file = NULL; 2115 int res = 0;2116 2115 2117 2116 bool try_plan_B = FALSE; … … 2205 2204 mr_msg(2, 2206 2205 "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 necessary2206 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 2208 2207 run_program_and_log_output(command, TRUE); 2209 2208 mr_free(command); -
branches/stable/mondo/src/mondorestore/mondorestore.c
r1904 r1924 924 924 925 925 strcpy(bkpinfo->restore_path, "/"); 926 if (!g_restoring_live_from_cd ) {926 if (!g_restoring_live_from_cd && !g_restoring_live_from_nfs) { 927 927 popup_and_OK 928 928 (_("Please insert tape/CD/USB key, then hit 'OK' to continue.")); 929 929 sleep(1); 930 930 } 931 interactively_obtain_media_parameters_from_user(FALSE); 931 if (!g_restoring_live_from_nfs) { 932 interactively_obtain_media_parameters_from_user(FALSE); 933 } 932 934 if (!bkpinfo->media_device) { 933 935 mr_msg(2, "Warning - failed to find media dev"); … … 948 950 retval = load_mountlist(mountlist, g_mountlist_fname); 949 951 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())) { 952 954 save_filelist(filelist, "/tmp/selected-files.txt"); 953 955 mr_asprintf(&old_restpath,bkpinfo->restore_path); … … 961 963 strcpy(bkpinfo->restore_path, old_restpath); 962 964 mr_free(old_restpath); 965 } else { 966 retval += restore_everything(NULL); 963 967 } 964 968 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { … … 2706 2710 paranoid_fclose(fout); 2707 2711 sprintf(command, 2708 "tar -zxvf %s tmp/mondo-restore.cfg tmp/mountlist.txt tmp/filelist.fulltmp/biggielist.txt",2712 "tar -zxvf %s ./tmp/mondo-restore.cfg ./tmp/mountlist.txt ./tmp/filelist.full ./tmp/biggielist.txt", 2709 2713 datadisks_fname); 2710 2714 run_program_and_log_output(command, 4); … … 3044 3048 g_restoring_live_from_cd = TRUE; 3045 3049 } 3050 if (bkpinfo->backup_media_type == nfs) { 3051 g_restoring_live_from_nfs = TRUE; 3052 } 3046 3053 if (argc == 5 && strcmp(argv[1], "--monitas-live") == 0) { 3047 3054 retval = -
branches/stable/mondo/src/mondorestore/mr-externs.h
r1663 r1924 108 108 extern bool g_text_mode; 109 109 extern bool g_restoring_live_from_cd; 110 extern bool g_restoring_live_from_nfs; 110 111 extern int fput_string_one_char_at_a_time(FILE *, char *); 111 112
Note:
See TracChangeset
for help on using the changeset viewer.