Changeset 2341 in MondoRescue for branches/2.2.10
- Timestamp:
- Aug 21, 2009, 2:50:32 AM (15 years ago)
- Location:
- branches/2.2.10
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mindi/mindi
r2338 r2341 137 137 [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 2160, approx.)" 138 138 if [ -e "$bigdir/$mappath" ] ; then 139 echo "$mappath already added" >> $LOGFILE139 LogFile "$mappath already added" 140 140 return 141 141 elif [ -d "$bigdir/$mappath" ] ; then … … 143 143 return 144 144 fi 145 echo "Added kbd map $mappath" >> $LOGFILE145 LogFile "Added kbd map $mappath" 146 146 if [ ! -e "$mappath" ] ; then 147 147 mappath=`grep "i[3-8]86" $MINDI_TMP/keymaps.find | grep "$locale[^r][^/]" | grep -vx " *#.*"` 148 148 if [ ! -e "$mappath" ] ; then 149 Log It"Cannot add $mappath: kbd map file not found"149 LogAll "Cannot add $mappath: kbd map file not found" 150 150 return 151 151 fi … … 155 155 156 156 mkdir -p $bigdir/etc 157 tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd $bigdir ; tar xf -) || Log It"AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log157 tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd $bigdir ; tar xf -) || LogAll "AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log 158 158 if [ "`echo $mappath | grep -F ".gz"`" ] ; then 159 159 included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2` … … 184 184 # Non absolute file names should not arrive till here => skipped 185 185 if [ `echo "$incoming" | cut -c1` != '/' ]; then 186 Log It"Unable to handle $incoming"186 LogAll "Unable to handle $incoming" 187 187 incoming=`ReadLine` 188 188 continue … … 202 202 # Only uncompress modules if not using udevd 203 203 if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then 204 gunzip -f $outdir/$incoming || Log It"Cannot gunzip $outdir/$incoming"204 gunzip -f $outdir/$incoming || LogAll "Cannot gunzip $outdir/$incoming" 205 205 fi 206 206 [ -x "$outdir" ] && StripExecutable $outdir "-$filename-" … … 231 231 local my_partitions 232 232 233 echo "Mindi $MINDI_VERSION is exiting" >> $LOGFILE234 echo "End date : `date`" >> $LOGFILE233 LogFile "Mindi $MINDI_VERSION is exiting" 234 LogFile "End date : `date`" 235 235 if [ _"$MONDO_SHARE" != _"" ] ; then 236 236 echo "------------- mindi logfile included -------------------------" >> /var/log/mondoarchive.log … … 255 255 local i 256 256 if [ "$1" = "" ] ; then 257 Log It"FATAL ERROR"258 else 259 Log It"FATAL ERROR. $1"257 LogAll "FATAL ERROR" 258 else 259 LogAll "FATAL ERROR. $1" 260 260 fi 261 261 if [ _"$2" != _"" ]; then … … 264 264 rm -f "$2" 265 265 266 Log It"Please e-mail a copy of $LOGFILE to the mailing list."267 Log It"See http://www.mondorescue.org for more information."268 Log It"WE CANNOT HELP unless you enclose that file.\n"266 LogAll "Please e-mail a copy of $LOGFILE to the mailing list." 267 LogAll "See http://www.mondorescue.org for more information." 268 LogAll "WE CANNOT HELP unless you enclose that file.\n" 269 269 MindiExit -1 270 270 } … … 286 286 vanilla_lib_name=`echo "$optimized_lib_name" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'` 287 287 echo "$vanilla_lib_name" >> $filelist 288 echo "Adding $vanilla_lib_name to filelist" >> $LOGFILE288 LogFile "Adding $vanilla_lib_name to filelist" 289 289 mkdir -p $outdir$optimized_lib_name > /dev/null 2> /dev/null 290 290 rmdir $outdir$optimized_lib_name > /dev/null 2> /dev/null … … 292 292 # This may return multiple files 293 293 for resolved in `ReadAllLink $vanilla_lib_name`; do 294 echo "Adding as deps $resolved to filelist" >> $LOGFILE294 LogFile "Adding as deps $resolved to filelist" 295 295 vanilla_resolved_name=`echo "$resolved" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'` 296 296 mkdir -p $outdir$resolved> /dev/null 2> /dev/null 297 297 rmdir $outdir$resolved > /dev/null 2> /dev/null 298 298 ln -sf $vanilla_resolved_name $outdir$resolved 299 echo "Excluding deps $resolved" >> $LOGFILE299 LogFile "Excluding deps $resolved" 300 300 grep -Fvx "$resolved" "$filelist" > $filelist.tmp 301 echo "Replacing it with $vanilla_resolved_name" >> $LOGFILE301 LogFile "Replacing it with $vanilla_resolved_name" 302 302 echo "$vanilla_resolved_name" >> $filelist.tmp 303 303 mv -f $filelist.tmp $filelist … … 312 312 FindAndAddUserKeyboardMappingFile() { 313 313 local r res mapfile mappath included_item included_list keyfile mp locale 314 Log It"Analyzing your keyboard's configuration."314 LogAll "Analyzing your keyboard's configuration." 315 315 KEYDIR=/lib/kbd 316 316 [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share/kbd # Slackware … … 320 320 [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole-setup 321 321 if [ ! -e "$KEYDIR" ] ; then 322 Log It"Keyboard mapping directory not found. I shall use default map at boot-time."322 LogAll "Keyboard mapping directory not found. I shall use default map at boot-time." 323 323 return 0 324 324 fi 325 325 if [ -e "/etc/sysconfig/keyboard" ] ; then 326 echo "Red Hat-style config detected." >> $LOGFILE326 LogFile "Red Hat-style config detected." 327 327 keyfile=/etc/sysconfig/keyboard 328 328 elif [ -e "/etc/rc.d/rc.keymap" ] ; then 329 echo "Slackware-style config detected." >> $LOGFILE329 LogFile "Slackware-style config detected." 330 330 keyfile=/etc/rc.d/rc.keymap 331 331 elif [ -e "/etc/rc.config" ] ; then 332 echo "Debian-style config detected." >> $LOGFILE332 LogFile "Debian-style config detected." 333 333 keyfile=/etc/rc.config 334 334 elif [ -e "/etc/console/boottime.kmap.gz" ] ; then 335 echo "Debian-style config detected." >> $LOGFILE335 LogFile "Debian-style config detected." 336 336 echo -en "Adding the following keyboard mapping tables: " 337 337 mkdir -p $bigdir/tmp … … 343 343 return 0 344 344 elif [ -e "/etc/console-setup/boottime.kmap.gz" ] ; then 345 echo "Ubuntu-style config detected." >> $LOGFILE345 LogFile "Ubuntu-style config detected." 346 346 echo -en "Adding the following keyboard mapping tables: " 347 347 mkdir -p $bigdir/tmp … … 353 353 return 0 354 354 elif [ -e "/etc/conf.d/keymaps" ] ; then 355 echo "Gentoo-style config detected." >> $LOGFILE355 LogFile "Gentoo-style config detected." 356 356 keyfile=/etc/conf.d/keymaps 357 357 else … … 359 359 keyfile=`find /etc -name rc.config | head -n1` 360 360 if [ "$keyfile" = "" ] || [ ! -e "$keyfile" ] ; then 361 Log It"Unknown config detected. Default keyboard map will be used."361 LogAll "Unknown config detected. Default keyboard map will be used." 362 362 return 363 363 else 364 echo "Found $keyfile" >> $LOGFILE364 LogFile "Found $keyfile" 365 365 fi 366 366 fi 367 367 if [ ! -e "$KEYDIR/keymaps" ] ; then 368 Log It"Keyboard mapping directory not found. Default keyboard map will be used."368 LogAll "Keyboard mapping directory not found. Default keyboard map will be used." 369 369 return 370 370 fi 371 echo "keyfile=$keyfile" >> $LOGFILE371 LogFile "keyfile=$keyfile" 372 372 locale=`grep -F KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2` 373 373 [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'` # Slackware 374 374 [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | tr -d '"' |cut -d'=' -f2` # Gentoo 375 echo "locale=$locale" >> $LOGFILE375 LogFile "locale=$locale" 376 376 # 377 377 # Process the keymaps dir once for all … … 384 384 echo "$mp" | grep -q " " 385 385 if [ $? -eq 0 ]; then 386 echo "WARNING: Multiple keymaps found: $mp" | tee -a $LOGFILE387 echo "The following one will be used" >> $LOGFILE386 LogAll "WARNING: Multiple keymaps found: $mp" 387 LogFile "The following one will be used" 388 388 fi 389 389 for i in $mp ; do … … 394 394 mappath=$(find / -name "*/kbd/keymaps/*/$locale") 395 395 fi 396 echo "mappath = $mappath" >> $LOGFILE396 LogFile "mappath = $mappath" 397 397 if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then 398 Log It"Keyboard mapping file not found. Default keyboard map will be used."398 LogAll "Keyboard mapping file not found. Default keyboard map will be used." 399 399 return 400 400 fi … … 419 419 [ ! -e "$ISOLINUX" ] && ISOLINUX=`find / -name isolinux.bin | grep -x "/.*/isolinux.bin"` 420 420 [ ! -e "$ISOLINUX" ] && Die "Please install isolinux first. If your syslinux RPM doesn't include isolinux, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.com and click on 'Download'" 421 echo "Found isolinux.bin at $ISOLINUX" >> $LOGFILE421 LogFile "Found isolinux.bin at $ISOLINUX" 422 422 } 423 423 … … 432 432 fi 433 433 if [ ! -e "$1" ] ; then 434 Log It"WARNING - cannot search specific path '$1'"434 LogAll "WARNING - cannot search specific path '$1'" 435 435 return 1 436 436 fi … … 467 467 filelist=`GenerateListForFile "$incoming"` 468 468 r=$? 469 [ "$r" -ne "0" ] && Log It"$incoming not found"469 [ "$r" -ne "0" ] && LogAll "$incoming not found" 470 470 res=$(($res+$r)) 471 471 # echo "'$incoming' generates filelist '$filelist'" >> $LOGFILE … … 474 474 done 475 475 progress=$(($progress+1)) 476 echo -en "\r\t\t\t\t\t\t\t\t" 477 i=$(($progress*100)) 478 i=$(($i/$noof_lines)) 479 echo -en "$i" 480 echo -en "%" 481 modres=$(($progress%4)) 482 [ "$modres" -eq "0" ] && echo -en "\t/" 483 [ "$modres" -eq "1" ] && echo -en "\t-" 484 [ "$modres" -eq "2" ] && echo -en "\t\\" 485 [ "$modres" -eq "3" ] && echo -en "\t|" 476 LogProgress $progress $noof_lines 486 477 incoming=`ReadLine` 487 478 done … … 534 525 done 535 526 progress=$(($progress+1)) 536 echo -en "\r\t\t\t\t\t\t\t\t" 537 i=$(($progress*100)) 538 i=$(($i/$noof_lines)) 539 echo -en "$i" 540 echo -en "%" 541 modres=$(($progress%4)) 542 [ "$modres" -eq "0" ] && echo -en "\t/" 543 [ "$modres" -eq "1" ] && echo -en "\t-" 544 [ "$modres" -eq "2" ] && echo -en "\t\\" 545 [ "$modres" -eq "3" ] && echo -en "\t|" 527 LogProgress $progress $noof_lines 546 528 incoming=`ReadLine` 547 529 done … … 554 536 progress=0 555 537 noof_lines=`cat $tempfile | wc -l` 556 echo "---------------------------------" >> $LOGFILE557 echo "List of dependencies: " >> $LOGFILE558 echo "---------------------------------" >> $LOGFILE538 LogFile "---------------------------------" 539 LogFile "List of dependencies: " 540 LogFile "---------------------------------" 559 541 for fname in `cat $tempfile` ; do 560 542 echo "$fname" | tee -a $LOGFILE >> $outfile.pre 561 543 LocateDeps $fname | tee -a $LOGFILE >> $outfile.pre 562 544 progress=$(($progress+1)) 563 echo -en "\r\t\t\t\t\t\t\t\t" 564 i=$(($progress*100)) 565 i=$(($i/$noof_lines)) 566 echo -en "$i" 567 echo -en "%" 568 modres=$(($progress%4)) 569 [ "$modres" -eq "0" ] && echo -en "\t/" 570 [ "$modres" -eq "1" ] && echo -en "\t-" 571 [ "$modres" -eq "2" ] && echo -en "\t\\" 572 [ "$modres" -eq "3" ] && echo -en "\t|" 545 LogProgress $progress $noof_lines 573 546 done 574 547 if [ _"$MONDO_SHARE" != _"" ]; then … … 577 550 mkdir -p $bigdir/bin 578 551 if [ -e "$MINDI_TMP/post-nuke.tgz" ] ; then 579 Log It"\nIncorporating post-nuke tarball"552 LogAll "\nIncorporating post-nuke tarball" 580 553 old_pwd=`pwd` 581 554 cd $bigdir 582 tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || Log It"Error occurred when untarring post-nuke tarball" $MINDI_TMP/$$.log555 tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogAll "Error occurred when untarring post-nuke tarball" $MINDI_TMP/$$.log 583 556 cd $old_pwd 584 557 fi … … 586 559 LocateDeps $bigdir/usr/bin/mondo*restore >> $outfile.pre 587 560 else 588 Log It"Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP"589 Log It"I bet you've got a spare copy of Mondo or Mindi floating around on your system."590 Log It"If Mindi was called by Mondo then send me a bug report.\n It not, type 'ps ax' to see which Mondo-related process is still running;\n then kill it. :-)\n Finally, run Mindi again."561 LogAll "Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP" 562 LogAll "I bet you've got a spare copy of Mondo or Mindi floating around on your system." 563 LogAll "If Mindi was called by Mondo then send me a bug report.\n It not, type 'ps ax' to see which Mondo-related process is still running;\n then kill it. :-)\n Finally, run Mindi again." 591 564 Die "Odd." 592 565 fi 593 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || Log It"\nMondo v1.2x defaults to LILO as the bootloader, BTW."566 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogAll "\nMondo v1.2x defaults to LILO as the bootloader, BTW." 594 567 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 595 Log It"\nIncorporating NFS-related settings"568 LogAll "\nIncorporating NFS-related settings" 596 569 for r in NFS-* ISO-PREFIX ; do 597 570 cp -f $MINDI_TMP/$r $bigdir/tmp 2>> $LOGFILE || Die "Cannot copy $r - did you run out of disk space?" 598 echo "Copying $r to ramdisk" >> $LOGFILE571 LogFile "Copying $r to ramdisk" 599 572 done 600 573 fi … … 669 642 670 643 # say where we are. 671 echo " GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage.\n" >> $LOGFILE644 LogFile " GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage.\n" 672 645 673 646 # verify that file exists … … 683 656 [ $lvOffset -eq 0 ] && Die "gzip magic not found in file $lvKernelImage. Terminating." 684 657 lvOffset=`expr $lvOffset / 2` 685 echo " GetInitrdFilesystemToUse(): gzip magic found at lvOffset $lvOffset.\n" >> $LOGFILE658 LogFile " GetInitrdFilesystemToUse(): gzip magic found at lvOffset $lvOffset.\n" 686 659 687 660 # scan kernel image for initrd filessystem support … … 701 674 702 675 # say what we are using 703 echo " GetInitrdFilesystemToUse(): Filesytem to use for initrd is $lvUseFilesystem.\n" >> $LOGFILE676 LogFile " GetInitrdFilesystemToUse(): Filesytem to use for initrd is $lvUseFilesystem.\n" 704 677 705 678 # return file system to use … … 787 760 for module in $module_list $EXTRA_MODS ; do 788 761 r=`find /lib/modules/$kern -type f | grep "/${module}\..*o" | tail -n1` 789 echo "module $module --> $r" >> $LOGFILE762 LogFile "module $module --> $r" 790 763 [ "$r" ] && echo "$r" 791 764 [ -f "$oss" ] && find $oss | grep -F $module … … 804 777 for fname in $incoming ; do 805 778 if [ ! -e "$fname" ] ; then 806 echo "WARNING - $fname does not exist; cannot be LDD'd." >> $LOGFILE779 LogFile "WARNING - $fname does not exist; cannot be LDD'd." 807 780 if echo $fname | grep lvm &> /dev/null ; then 808 echo "This warning only affects you if you are using LVM." >> $LOGFILE781 LogFile "This warning only affects you if you are using LVM." 809 782 if echo "$MODULES" | grep lvm &> /dev/null ; then 810 echo "I think you are, so please take heed!" >> $LOGFILE783 LogFile "I think you are, so please take heed!" 811 784 else 812 echo "I don't think you are, so don't worry about it." >> $LOGFILE785 LogFile "I don't think you are, so don't worry about it." 813 786 fi 814 787 fi 815 788 elif [ -h "$fname" ] && [ -x "$fname" ] ; then 816 echo "$fname is softlink" >> $LOGFILE789 LogFile "$fname is softlink" 817 790 else 818 791 ldd $fname 2> /dev/null | ProcessLDD … … 884 857 } 885 858 886 887 LogIt() { 859 LogProgress() { 860 local i progress modres noof_lines 861 862 progress=$1 863 noof_lines=$2 864 865 echo -en "\r\t\t\t\t\t\t\t\t" 866 i=$(($progress*100)) 867 i=$(($i/$noof_lines)) 868 echo -en "$i" 869 echo -en "%" 870 modres=$(($progress%4)) 871 [ "$modres" -eq "0" ] && echo -en "\t/" 872 [ "$modres" -eq "1" ] && echo -en "\t-" 873 [ "$modres" -eq "2" ] && echo -en "\t\\" 874 [ "$modres" -eq "3" ] && echo -en "\t|" 875 } 876 877 # Function to log on screen only 878 LogScreen() { 888 879 if [ -e /dev/stderr ] ; then 889 880 echo -e "$1" >> /dev/stderr … … 891 882 /usr/bin/logger -s $1 892 883 fi 884 } 885 886 # Function to log in log file only 887 LogFile() { 888 893 889 echo -e "$1" >> $LOGFILE 894 890 if [ _"$2" != _"" ]; then … … 896 892 fi 897 893 rm -f "$2" 894 } 895 896 # Function to log in both screen and logfile 897 LogAll() { 898 LogScreen "$1" 899 LogFile "$1" "$2" 898 900 } 899 901 … … 951 953 absolute_partition old_partition_fmt current_lvolume uname skip 952 954 953 echo "Your raw fstab file looks like this:" >> $LOGFILE954 echo "------------------------------------" >> $LOGFILE955 LogFile "Your raw fstab file looks like this:" 956 LogFile "------------------------------------" 955 957 cat $MY_FSTAB >> $LOGFILE 956 echo "Your mountlist will look like this:" | tee -a $LOGFILE957 echo "-----------------------------------" >> $LOGFILE958 LogAll "Your mountlist will look like this:" 959 LogAll "-----------------------------------" 958 960 959 961 # scratchdir, mountlist(OUT) … … 1187 1189 echo $current_lvolume | grep -q ' ' 1188 1190 if [ $? -eq 0 ]; then 1189 echo "WARNING: Multiple Logical Volumes found. Report to dev team" >> $LOGFILE1191 LogFile "WARNING: Multiple Logical Volumes found. Report to dev team" 1190 1192 fi 1191 1193 # if it's not found, it may well be a real device such as a multipath one … … 1218 1220 [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0 1219 1221 [ "$partition_size" -lt "125000" ] && partition_size=125000 1220 echo "I'm guessing $c_p is $(($partition_size/1024))MB" >> $LOGFILE1222 LogFile "I'm guessing $c_p is $(($partition_size/1024))MB" 1221 1223 fi 1222 1224 fi … … 1236 1238 fi 1237 1239 psz=$partition_size 1238 echo "Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)" >> $LOGFILE1240 LogFile "Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)" 1239 1241 [ "$psz" != "lvm" ] && psz=$(($psz/1024)) 1240 1242 if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then … … 1244 1246 partition_size=$(($partition_size+1)); # just in case 1245 1247 if [ "$partition_format" = "Linux" ] ; then 1246 echo "Are you imaging a mounted swap partition? Silly..." >> $LOGFILE1247 echo "Reverting format from $old_partition_fmt to $partition_format" >> $LOGFILE1248 LogFile "Are you imaging a mounted swap partition? Silly..." 1249 LogFile "Reverting format from $old_partition_fmt to $partition_format" 1248 1250 partition_format=$old_partition_fmt 1249 1251 fi 1250 1252 fi 1251 1253 if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep -F " $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then 1252 echo "Excluding $current_partition from mountlist" >> $LOGFILE1254 LogFile "Excluding $current_partition from mountlist" 1253 1255 continue 1254 1256 fi 1255 1257 if [ ! "$partition_mountpt" ] ; then 1256 echo "------- $FDISK -l $qq log ------------" >> $LOGFILE1258 LogFile "------- $FDISK -l $qq log ------------" 1257 1259 for qq in "" `find /dev/ida/c*d* ! -name '*p*' 2> /dev/null`; do 1258 1260 partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9` 1259 1261 [ "$partition_format" ] && break 1260 1262 done 1261 echo "------- $FDISK log end ------------" >> $LOGFILE1263 LogFile "------- $FDISK log end ------------" 1262 1264 if [ "$partition_format" = "Compaq diagnostics" ] ; then 1263 1265 partition_format="compaq" 1264 1266 elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then 1265 Log It"Unable to find mountpoint of $current_partition - ignoring"1267 LogAll "Unable to find mountpoint of $current_partition - ignoring" 1266 1268 continue 1267 1269 fi … … 1276 1278 unofficial_outstring=`printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$label"` 1277 1279 if [ "$current_partition" = "" ] ; then 1278 echo "Unknown partition (outstring = $unofficial_outstring)" >> $LOGFILE1280 LogFile "Unknown partition (outstring = $unofficial_outstring)" 1279 1281 elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then 1280 1282 if [ "`grep -F device /etc/raidtab 2>/dev/null | grep -F $current_partition`" ] ; then … … 1284 1286 printf "%s %s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$label" >> $mountlist 1285 1287 else 1286 echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE1288 LogFile "Unknown mountpoint (outstring = $unofficial_outstring)" 1287 1289 fi 1288 1290 elif [ "$partition_format" = "" ] ; then 1289 echo "Unknown format (outstring = $unofficial_outstring)" >> $LOGFILE1291 LogFile "Unknown format (outstring = $unofficial_outstring)" 1290 1292 elif [ "$partition_size" = "" ] ; then 1291 echo "Unknown partition size (outstring = $unofficial_outstring)" >> $LOGFILE1293 LogFile "Unknown partition size (outstring = $unofficial_outstring)" 1292 1294 elif [ "$partition_mountpt" = "/proc" ] || [ "$partition_mountpt" = "/dev/pts" ] ; then 1293 1295 continue 1294 1296 else 1295 1297 if [ "$partition_format" = "dos" ] || [ "$partition_format" = "msdos" ] ; then 1296 echo "Stupid bastard..." >> $LOGFILE1298 LogFile "Stupid bastard..." 1297 1299 partition_format="vfat" 1298 1300 fi … … 1322 1324 rm -Rf $MINDI_TMP/iso 1323 1325 mkdir -p $MINDI_TMP/iso/{images,archives} 1324 cp -f $MINDI_CACHE/{*.gz,*.img} $MINDI_TMP/iso/images 2>> $LOGFILE || Log It"OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images"1325 echo "mindi_lib = $MINDI_LIB" >> $LOGFILE1326 cp -f $MINDI_CACHE/{*.gz,*.img} $MINDI_TMP/iso/images 2>> $LOGFILE || LogAll "OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images" 1327 LogFile "mindi_lib = $MINDI_LIB" 1326 1328 for i in memdisk memtest.bin memtest.img ; do 1327 1329 j=$MINDI_LIB/$i 1328 1330 k=$MINDI_TMP/iso 1329 1331 if [ -e "$j" ] ; then 1330 Log It"Copying $j to $k"1332 LogAll "Copying $j to $k" 1331 1333 cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k" 1332 1334 cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP" … … 1360 1362 fi 1361 1363 if [ "$?" -ne "0" ] ; then 1362 echo "----------- $ISO_CMD's errors --------------" >> $LOGFILE1364 LogFile "----------- $ISO_CMD's errors --------------" 1363 1365 cat $MINDI_TMP/mkisofs.log >> $LOGFILE 1364 1366 echo "$ISO_CMD returned the following errors:-" 1365 1367 cat $MINDI_TMP/mkisofs.log 1366 Log It"Failed to create ISO image."1367 else 1368 echo "Created bootable ISO image at $MINDI_CACHE/mindi.iso" | tee -a $LOGFILE1368 LogAll "Failed to create ISO image." 1369 else 1370 LogAll "Created bootable ISO image at $MINDI_CACHE/mindi.iso" 1369 1371 fi 1370 1372 rm -f $MINDI_TMP/mkisofs.log … … 1395 1397 echo -en "Transforming $USBDEVICE in a Bootable device " 1396 1398 echo -en "." 1397 echo "Transforming $USBDEVICE in a Bootable device" >> $LOGFILE1398 echo "Checking $USBDEVICE" >> $LOGFILE1399 LogFile "Transforming $USBDEVICE in a Bootable device" 1400 LogFile "Checking $USBDEVICE" 1399 1401 $FDISK -l $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE 1400 1402 if [ $? -ne 0 ]; then 1401 echo "Unable to access $USBDEVICE" | tee -a $LOGFILE1402 echo "Make sure your USB device is pluged in" | tee -a $LOGFILE1403 LogAll "Unable to access $USBDEVICE" 1404 LogAll "Make sure your USB device is pluged in" 1403 1405 exit -1 1404 1406 fi 1405 1407 echo -en "." 1406 echo "Unmounting $USBDEVICE just in case" >> $LOGFILE1408 LogFile "Unmounting $USBDEVICE just in case" 1407 1409 umount $USBPART 2>> $LOGFILE 1>> $LOGFILE 1408 1410 # If your key has no MBR it may cause an issue 1409 1411 # Use dd if=mbr.bin of=$USBDEVICE or ms-sys -s $USBDEVICE 1410 echo "Preparing $USBDEVICE" >> $LOGFILE1412 LogFile "Preparing $USBDEVICE" 1411 1413 $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE << EOF 1412 1414 d … … 1426 1428 EOF 1427 1429 if [ $? -ne 0 ]; then 1428 echo "Unable to create a vfat Filesystem on $USBDEVICE" | tee -a $LOGFILE1429 echo "Make sure your USB device is pluged in" | tee -a $LOGFILE1430 LogAll "Unable to create a vfat Filesystem on $USBDEVICE" 1431 LogAll "Make sure your USB device is pluged in" 1430 1432 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1431 1433 MindiExit -1 1432 1434 fi 1433 echo "The USB device $USBDEVICE now looks like this:" >> $LOGFILE1435 LogFile "The USB device $USBDEVICE now looks like this:" 1434 1436 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1435 1437 echo -en "." 1436 echo "Creating a vfat filesystem on $USBPART" >> $LOGFILE1438 LogFile "Creating a vfat filesystem on $USBPART" 1437 1439 mkdosfs -F 32 $USBPART 2>&1 >> $LOGFILE 1438 1440 if [ $? -ne 0 ]; then 1439 echo "Unable to create a vfat filesystem on $USBPART" | tee -a $LOGFILE1440 echo "Make sure your USB device is pluged in and partitioned ($USBPART must exist on it)" | tee -a $LOGFILE1441 LogAll "Unable to create a vfat filesystem on $USBPART" 1442 LogAll "Make sure your USB device is pluged in and partitioned ($USBPART must exist on it)" 1441 1443 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1442 1444 MindiExit -1 1443 1445 fi 1444 1446 echo -en "." 1445 echo "Mounting $USBPART on $MINDI_TMP/usb" >> $LOGFILE1447 LogFile "Mounting $USBPART on $MINDI_TMP/usb" 1446 1448 mount $USBPART $MINDI_TMP/usb 2>> $LOGFILE 1447 1449 if [ $? -ne 0 ]; then 1448 echo "Unable to mount $USBPART on $MINDI_TMP/usb" | tee -a $LOGFILE1449 echo "Make sure your USB device is pluged in, partitioned and formated ($USBPART must exist on it)" | tee -a $LOGFILE1450 LogAll "Unable to mount $USBPART on $MINDI_TMP/usb" 1451 LogAll "Make sure your USB device is pluged in, partitioned and formated ($USBPART must exist on it)" 1450 1452 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1451 1453 MindiExit -1 … … 1453 1455 echo -en "." 1454 1456 mkdir -p $MINDI_TMP/usb/images 1455 cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || Log It"OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images"1457 cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogAll "OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images" 1456 1458 echo -en "." 1457 echo "mindi_lib = $MINDI_LIB" >> $LOGFILE1459 LogFile "mindi_lib = $MINDI_LIB" 1458 1460 for i in memdisk memtest.bin memtest.img ; do 1459 1461 j=$MINDI_LIB/$i 1460 1462 k=$MINDI_TMP/usb 1461 1463 if [ -e "$j" ] ; then 1462 Log It"Copying $j to $k"1464 LogAll "Copying $j to $k" 1463 1465 cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k" 1464 1466 cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP" … … 1478 1480 syslinux -s $USBPART 2>> $MINDI_TMP/syslinux.log 1479 1481 if [ "$?" -ne "0" ] ; then 1480 echo"----------- syslinux's errors --------------" |tee -a $LOGFILE1482 LogAll "----------- syslinux's errors --------------" |tee -a $LOGFILE 1481 1483 cat $MINDI_TMP/syslinux.log |tee -a $LOGFILE 1482 Log It"Failed to create USB image."1484 LogAll "Failed to create USB image." 1483 1485 else 1484 1486 echo -e "$DONE" 1485 echo "Created bootable USB image on $USBDEVICE" >> $LOGFILE1487 LogFile "Created bootable USB image on $USBDEVICE" 1486 1488 fi 1487 1489 rm -f $MINDI_TMP/syslinux.log 1488 1490 else 1489 echo "No USB boot support for ia64" | tee -a $LOGFILE1491 echo "No USB boot support for ia64" 1490 1492 MindiExit -1 1491 1493 fi … … 1631 1633 dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file" 1632 1634 mkdosfs $imagefile >> $LOGFILE 2>> $LOGFILE 1633 mount -t vfat -o loop $imagefile $mountpoint || Log It"Cannot mount (PBDI)"1635 mount -t vfat -o loop $imagefile $mountpoint || LogAll "Cannot mount (PBDI)" 1634 1636 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it 1635 1637 mkdir -p $mountpoint/etc … … 1656 1658 fi 1657 1659 1658 echo "Copying $MINDI_TMP/initrd.img to $mountpoint..." >> $LOGFILE1660 LogFile "Copying $MINDI_TMP/initrd.img to $mountpoint..." 1659 1661 cp -f $MINDI_TMP/initrd.img $mountpoint 2>> $LOGFILE 1660 1662 if [ "$?" -ne "0" ] ; then 1661 Log It"Failed to copy $MINDI_TMP/initrd.img to $mountpoint"1663 LogAll "Failed to copy $MINDI_TMP/initrd.img to $mountpoint" 1662 1664 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1663 Log It"Please unload some of your modules and try again."1665 LogAll "Please unload some of your modules and try again." 1664 1666 rm -f $MINDI_TMP/mtpt.$$ 1665 Log It"Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)"1667 LogAll "Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)" 1666 1668 retval=$(($retval+1)) 1667 1669 fi … … 1679 1681 cp -f $kernelpath $mountpoint/vmlinuz > /dev/null 2>> $LOGFILE 1680 1682 if [ "$?" -ne "0" ] ; then 1681 echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE1683 LogFile "Files at mountpoint ($mountpoint) :-" 1682 1684 du -sk $mountpoint/* >> $LOGFILE 1683 echo "--- end of list of files ---" >> $LOGFILE1685 LogFile "--- end of list of files ---" 1684 1686 echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n\ 1685 1687 Sorry, your kernel is too big for your image.\n" >> $LOGFILE … … 1687 1689 cd $old_pwd 1688 1690 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1689 rmdir $mountpoint || Log It"Cannot rmdir (PBDI)"1691 rmdir $mountpoint || LogAll "Cannot rmdir (PBDI)" 1690 1692 # losetup /dev/loop0 -d 1691 1693 [ "$imagefile" != "" ] && rm -f $imagefile … … 1694 1696 free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4` 1695 1697 max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`)) 1696 echo "Free space left on image = $free_space KB" >> $LOGFILE1697 echo "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" >> $LOGFILE1698 LogFile "Free space left on image = $free_space KB" 1699 LogFile "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" 1698 1700 # make it bootable 1699 1701 [ "$mountpoint" != "" ] && rm -f $mountpoint/zero 1700 1702 [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint 2>> $LOGFILE 1701 1703 if [ "$KERN_DISK_MADE" ] ; then 1702 echo "Not running LILO. It's not that kind of disk." >> $LOGFILE1704 LogFile "Not running LILO. It's not that kind of disk." 1703 1705 fi 1704 1706 … … 1706 1708 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1707 1709 echo -en "..." 1708 rmdir $mountpoint || Log It"Cannot rmdir (PBDI)"1710 rmdir $mountpoint || LogAll "Cannot rmdir (PBDI)" 1709 1711 if [ "$retval" -eq "0" ] ; then 1710 1712 echo -en "...$DONE\n" 1711 1713 if [ "$KERN_DISK_MADE" ] ; then 1712 Log It"$BOOT_SIZE KB boot disks were created OK\n"1714 LogAll "$BOOT_SIZE KB boot disks were created OK\n" 1713 1715 fi 1714 1716 else 1715 1717 echo -en "...failed\n" 1716 Log It$BOOT_SIZE"KB boot disk was NOT created\n"1718 LogAll $BOOT_SIZE"KB boot disk was NOT created\n" 1717 1719 [ "$imagefile" != "" ] && rm -f $imagefile 1718 1720 fi 1719 [ "$retval" -ne "0" ] && Log It"PrepareBootDiskImage() is returning nonzero"1721 [ "$retval" -ne "0" ] && LogAll "PrepareBootDiskImage() is returning nonzero" 1720 1722 return $retval 1721 1723 } … … 1738 1740 mkdir -p $mountpoint 1739 1741 dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file" 1740 echo "Creating vfat filesystem on $imagefile" >> $LOGFILE1742 LogFile "Creating vfat filesystem on $imagefile" 1741 1743 mkfs.vfat $imagefile >> $LOGFILE 2>> $LOGFILE 1742 1744 # syslinux should be run on a local file (doen't work through NFS Cf: #297) … … 1747 1749 imagefile=$imagesdir/mindi-bootroot.$BOOT_SIZE.img 1748 1750 1749 mount -t vfat -o loop $imagefile $mountpoint || Log It"Cannot mount (PBDI)"1751 mount -t vfat -o loop $imagefile $mountpoint || LogAll "Cannot mount (PBDI)" 1750 1752 1751 1753 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it 1752 1754 MakeMessageFile > $mountpoint/message.txt 1753 1755 MakeBootConfFile isolinux > $mountpoint/syslinux.cfg 1754 echo "Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..." >> $LOGFILE1756 LogFile "Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..." 1755 1757 cp -f $MINDI_TMP/initrd.img $mountpoint/initrd.img 2>> $LOGFILE 1756 1758 if [ "$?" -ne "0" ] ; then 1757 Log It"Failed to copy $MINDI_TMP/initrd.img to $mountpoint"1759 LogAll "Failed to copy $MINDI_TMP/initrd.img to $mountpoint" 1758 1760 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1759 Log It"Please unload some of your modules and try again."1761 LogAll "Please unload some of your modules and try again." 1760 1762 rm -f $MINDI_TMP/mtpt.$$ 1761 Log It"Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)"1763 LogAll "Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)" 1762 1764 retval=$(($retval+1)) 1763 1765 fi … … 1774 1776 cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null 1775 1777 if [ "$?" -ne "0" ] ; then 1776 echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE1778 LogFile "Files at mountpoint ($mountpoint) :-" 1777 1779 du -sk $mountpoint/* >> $LOGFILE 1778 echo "--- end of list of files ---" >> $LOGFILE1780 LogFile "--- end of list of files ---" 1779 1781 echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n\ 1780 1782 Sorry, your kernel is too big for your image.\n" >> $LOGFILE … … 1782 1784 cd $old_pwd 1783 1785 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1784 rmdir $mountpoint || Log It"Cannot rmdir (PBDI)"1786 rmdir $mountpoint || LogAll "Cannot rmdir (PBDI)" 1785 1787 1786 1788 [ "$imagefile" != "" ] && rm -f $imagefile … … 1789 1791 free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4` 1790 1792 max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`)) 1791 echo "Free space left on image = $free_space KB" >> $LOGFILE1792 echo "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" >> $LOGFILE1793 LogFile "Free space left on image = $free_space KB" 1794 LogFile "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" 1793 1795 1794 1796 # make it bootable … … 1798 1800 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1799 1801 echo -en "..." 1800 rmdir $mountpoint || Log It"Cannot rmdir (PBDI)"1802 rmdir $mountpoint || LogAll "Cannot rmdir (PBDI)" 1801 1803 1802 1804 if [ "$retval" -eq "0" ] ; then … … 1804 1806 if [ "$KERN_DISK_MADE" ] ; then 1805 1807 [ "$imagefile" != "" ] && rm -f $imagefile 1806 Log It"$BOOT_SIZE KB boot disks were created OK\n"1808 LogAll "$BOOT_SIZE KB boot disks were created OK\n" 1807 1809 fi 1808 1810 else 1809 1811 echo -en "...failed\n" 1810 Log It$BOOT_SIZE"KB boot disk was NOT created\n"1812 LogAll $BOOT_SIZE"KB boot disk was NOT created\n" 1811 1813 [ "$imagefile" != "" ] && rm -f $imagefile 1812 1814 fi 1813 [ "$retval" -ne "0" ] && Log It"PrepareBootDiskImage() is returning nonzero"1815 [ "$retval" -ne "0" ] && LogAll "PrepareBootDiskImage() is returning nonzero" 1814 1816 return $retval 1815 1817 } … … 1862 1864 for i in $EXTRA_MODS ; do 1863 1865 j=`find lib/modules/$FAILSAFE_KVER -name $i.*o.gz 2> /dev/null` 1864 [ ! "$j" ] && echo "WARNING - cannot find failsafe module $i.o.gz" >> $LOGFILE1866 [ ! "$j" ] && LogFile "WARNING - cannot find failsafe module $i.o.gz" 1865 1867 for k in $j ; do 1866 tar cf - $k 2>> $MINDI_TMP/$$.log | (cd $bigdir ; tar xf -) || Log It"ERROR on module $k" $MINDI_TMP/$$.log1867 echo "Added failsafe module $k to ramdisk" >> $LOGFILE1868 tar cf - $k 2>> $MINDI_TMP/$$.log | (cd $bigdir ; tar xf -) || LogAll "ERROR on module $k" $MINDI_TMP/$$.log 1869 LogFile "Added failsafe module $k to ramdisk" 1868 1870 done 1869 1871 done … … 1896 1898 i=`cat $MINDI_TMP/BOOTLOADER.DEVICE 2> /dev/null` 1897 1899 if [ "$i" ] ; then 1898 Log It"Backing up $i's MBR"1900 LogAll "Backing up $i's MBR" 1899 1901 dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE 1900 1902 sleep 1 … … 1902 1904 j=$i 1903 1905 [ -h "$j" ] && j=`readlink -f $j` 1904 Log It"Creating /dev/boot_device ($j)"1906 LogAll "Creating /dev/boot_device ($j)" 1905 1907 mkdir -p $bigdir/dev 1906 1908 cp -pRdf $j $bigdir/dev/boot_device 2>> $LOGFILE || Die "Unable to create /dev/boot_device on ramdisk" … … 1914 1916 if [ -d /$ti ]; then 1915 1917 mkdir -p $ti 1916 cp -Rdf /$ti/* $ti 2>> $LOGFILE || Log It"WARNING - error occurred while copying terminfo"1918 cp -Rdf /$ti/* $ti 2>> $LOGFILE || LogAll "WARNING - error occurred while copying terminfo" 1917 1919 fi 1918 1920 if [ -e "$MONDO_SHARE/restore-scripts" ]; then … … 1921 1923 fi 1922 1924 if [ -d "/lib/dev-state" ]; then 1923 tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || Log It"Unable to handle /lib/dev-state" $MINDI_TMP/$$.log1925 tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "Unable to handle /lib/dev-state" $MINDI_TMP/$$.log 1924 1926 fi 1925 1927 cd $old_pwd … … 1951 1953 echo -en "Tarring and zipping the data content..." 1952 1954 size_of_all_tools=`du -sk $bigdir | cut -f1` 1953 (cd $bigdir ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || Log It"Problem creating all.tar.gz" $MINDI_TMP/$$.log)1955 (cd $bigdir ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogAll "Problem creating all.tar.gz" $MINDI_TMP/$$.log) 1954 1956 du -sk $imagesdir/*gz >> $LOGFILE 1955 1957 echo -e "$DONE" … … 2057 2059 $AWK '{if (substr($0,0,1)!="#" || substr($0,0,3)=="#!/") {print $0;};}' $tempfile > $1 2058 2060 rm -f $tempfile 2059 echo "Stripped comments from $2" >> $LOGFILE2061 LogFile "Stripped comments from $2" 2060 2062 } 2061 2063 … … 2072 2074 if [ "$?" -eq "0" ] ; then 2073 2075 cp -f $tmpfile $1 2>> $LOGFILE 2074 echo "Stripped binary $2" >> $LOGFILE2076 LogFile "Stripped binary $2" 2075 2077 fi 2076 2078 rm -f $tmpfile … … 2117 2119 # Used by ia64 2118 2120 if [ "`gzip -cd $fname | strings 2> /dev/null | grep -F "$kdate"`" = "" ] ; then 2119 Log It"Have you recompiled your kernel \"$fname\" w/o rebooting? Naughty but I'll allow it..."2121 LogAll "Have you recompiled your kernel \"$fname\" w/o rebooting? Naughty but I'll allow it..." 2120 2122 duff_kernels="$fname $duff_kernels" 2121 2123 else … … 2125 2127 else 2126 2128 if [ "`strings $fname 2> /dev/null | grep -F "$kdate"`" = "" ] ; then 2127 Log It"Have you recompiled your kernel \"$fname\" w/o rebooting?\n Naughty but I'll allow it..."2129 LogAll "Have you recompiled your kernel \"$fname\" w/o rebooting?\n Naughty but I'll allow it..." 2128 2130 duff_kernels="$fname $duff_kernels" 2129 2131 else … … 2137 2139 fi 2138 2140 if [ ! "$possible_kernels" ] ; then 2139 Log It"No kernel matches exactly. Are there any duff kernels?"2141 LogAll "No kernel matches exactly. Are there any duff kernels?" 2140 2142 possible_kernels="$duff_kernels" 2141 2143 if [ ! "$possible_kernels" ] ; then 2142 Log It"Sorry, no duff kernels either"2144 LogAll "Sorry, no duff kernels either" 2143 2145 else 2144 Log It"I bet you're running Debian or Gentoo, aren't you?"2145 Log It"Your kernel doesn't have a sane builddate. Oh well..."2146 LogAll "I bet you're running Debian or Gentoo, aren't you?" 2147 LogAll "Your kernel doesn't have a sane builddate. Oh well..." 2146 2148 fi 2147 2149 fi … … 2149 2151 noof_kernels=`CountItemsIn "$possible_kernels"` 2150 2152 if [ "$noof_kernels" -eq "0" ] ; then 2151 Log It"Could not find your kernel."2153 LogAll "Could not find your kernel." 2152 2154 if [ -e "/boot/vmlinuz" ] ; then 2153 Log It"Using /boot/vmlinuz as a last resort."2155 LogAll "Using /boot/vmlinuz as a last resort." 2154 2156 output=/boot/vmlinuz 2155 2157 else … … 2158 2160 elif [ "$noof_kernels" -eq "1" ] ; then 2159 2161 kernelpath=`echo "$possible_kernels" | sed s/' '//` 2160 echo "Your kernel is $kernelpath (v$KERVERRUN)" >> $LOGFILE2162 LogFile "Your kernel is $kernelpath (v$KERVERRUN)" 2161 2163 output="$kernelpath" 2162 2164 else 2163 2165 for i in $possible_kernels ; do 2164 2166 if echo $i | grep "$KERVERRUN" ; then 2165 Log It"OK, I used my initiative and found that "2166 Log It"$i is probably your kernel. "2167 LogAll "OK, I used my initiative and found that " 2168 LogAll "$i is probably your kernel. " 2167 2169 output="$i" 2168 2170 return … … 2171 2173 if echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null ; then 2172 2174 output=/boot/vmlinuz 2173 echo "Schlomo, this one's for you." >> $LOGFILE2175 LogFile "Schlomo, this one's for you." 2174 2176 else 2175 Log It"Two or more possible kernels found. You may specify any one of them and the "2176 Log It"boot disks will still work, probably. If one does not work, try another."2177 Log It"$possible_kernels"2177 LogAll "Two or more possible kernels found. You may specify any one of them and the " 2178 LogAll "boot disks will still work, probably. If one does not work, try another." 2179 LogAll "$possible_kernels" 2178 2180 echo "" 2179 2181 fi … … 2197 2199 dd if=/dev/zero of=$tempfile bs=1k count=$ramdisk_size &> /dev/null || Die "Not enough room for temporary ramdisk (TurnTgzIntoRdz)" 2198 2200 echo -en "..." 2199 echo "Creating ext2 filesystem on $tempfile" >> $LOGFILE2201 LogFile "Creating ext2 filesystem on $tempfile" 2200 2202 mke2fs -b 1024 -m 1 -i 2048 -F $tempfile >> $LOGFILE 2>> $LOGFILE || Die "Unable to create an ext2 file system on $tempfile" 2201 2203 echo -en "..." … … 2208 2210 # AL04Oct08: Check whether /lib64 is a link and if so explicitly create one in rootfs 2209 2211 if [ -h "/lib64" ]; then 2210 mkdir -p lib || Log It"Unable to create lib in $mountpoint."2211 ln -s lib lib64 || Log It"/lib64 is a symbolic link, but I couldn't create it in $mountpoint."2212 mkdir -p lib || LogAll "Unable to create lib in $mountpoint." 2213 ln -s lib lib64 || LogAll "/lib64 is a symbolic link, but I couldn't create it in $mountpoint." 2212 2214 fi 2213 2215 … … 2240 2242 fi 2241 2243 done 2242 tar cf - $mountlis `sort -u $MINDI_TMP/busy.lis` 2>> $MINDI_TMP/$$.log | tar xf - || Log It"Problem in mount analysis" $MINDI_TMP/$$.log2244 tar cf - $mountlis `sort -u $MINDI_TMP/busy.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "Problem in mount analysis" $MINDI_TMP/$$.log 2243 2245 rm -f $MINDI_TMP/busy.lis 2244 2246 fi … … 2255 2257 if [ $? -eq 0 ]; then 2256 2258 echo "udev device manager found" > $mountpoint/tmp/USE-UDEV 2257 Log It"udev device manager found"2258 tar cf - -C / /etc/udev 2>> $MINDI_TMP/$$.log | tar xf - || Log It"Problem in /etc/udev analysis" $MINDI_TMP/$$.log2259 LogAll "udev device manager found" 2260 tar cf - -C / /etc/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "Problem in /etc/udev analysis" $MINDI_TMP/$$.log 2259 2261 # This avoids NIC remapping if on another machine at restore time on Debian at least 2260 2262 rm -f ./etc/udev/rules.d/z[0-9][0-9]_persistent-net.rules 2261 2263 # This avoids NIC remapping if on another machine at restore time on Ubuntu at least 2262 2264 rm -f ./etc/udev/rules.d/[0-9][0-9]-persistent-net.rules 2263 tar cf - -C / /lib*/udev 2>> $MINDI_TMP/$$.log | tar xf - || Log It"Problem in /lib/udev analysis" $MINDI_TMP/$$.log2265 tar cf - -C / /lib*/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "Problem in /lib/udev analysis" $MINDI_TMP/$$.log 2264 2266 if [ -x /sbin/udevd ]; then 2265 2267 lis2=`grep -Ev '^#' $MINDI_CONF/udev.files` … … 2287 2289 fi 2288 2290 done 2289 tar cf - -C / $lis `sort -u $MINDI_TMP/udev.lis` 2>> $MINDI_TMP/$$.log | tar xf - || Log It"Problem in udev.lis analysis" $MINDI_TMP/$$.log2291 tar cf - -C / $lis `sort -u $MINDI_TMP/udev.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "Problem in udev.lis analysis" $MINDI_TMP/$$.log 2290 2292 rm -f $MINDI_TMP/udev.lis 2291 2293 else 2292 echo "udevd daemon not in standard place (/sbin)" 2>&1 | tee -a $LOGFILE2293 echo "mindi will use static devices which may cause problems" 2>&1 | tee -a $LOGFILE2294 LogAll "udevd daemon not in standard place (/sbin)" 2295 LogAll "mindi will use static devices which may cause problems" 2294 2296 rm -f $mountpoint/tmp/USE-UDEV 2295 2297 fi … … 2300 2302 mindi-bkphw $MINDI_CACHE $MINDI_CONF | tee -a $LOGFILE 2301 2303 if [ -d $MINDI_CACHE/bkphw ]; then 2302 Log It"Hardware Information found and saved ..."2304 LogAll "Hardware Information found and saved ..." 2303 2305 cp -rp $MINDI_CACHE/bkphw . 2304 2306 if [ -f $MINDI_CACHE/tools.files ]; then 2305 2307 lis=`grep -Ev '^#' $MINDI_CACHE/tools.files` 2306 2308 LocateDeps $lis > $MINDI_TMP/tools.lis 2307 tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2>> $MINDI_TMP/$$.log | tar xf - || Log It"Problem in tools.lis analysis" $MINDI_TMP/$$.log2309 tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "Problem in tools.lis analysis" $MINDI_TMP/$$.log 2308 2310 fi 2309 2311 if [ -f $MINDI_CACHE/mindi-rsthw ]; then … … 2316 2318 # Management of perl scripts delivered needed at restore time 2317 2319 mindi-get-perl-modules `cat $MINDI_CONF/perl-scripts` > $MINDI_TMP/perl.lis 2318 tar cf - `cat $MINDI_TMP/perl.lis` 2>> $MINDI_TMP/$$.log | tar xf - || Log It"Problem in perl scripts analysis" $MINDI_TMP/$$.log2320 tar cf - `cat $MINDI_TMP/perl.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "Problem in perl scripts analysis" $MINDI_TMP/$$.log 2319 2321 2320 2322 for w in cdrom groovy-stuff ; do … … 2322 2324 done 2323 2325 2324 tar cf - -C / /dev/fd0*[1,2][4,7,8]* 2>> $MINDI_TMP/$$.log | tar xf - || Log It"Problem in fd dev analysis" $MINDI_TMP/$$.log2326 tar cf - -C / /dev/fd0*[1,2][4,7,8]* 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "Problem in fd dev analysis" $MINDI_TMP/$$.log 2325 2327 2326 2328 cd $old_pwd … … 2351 2353 fi 2352 2354 for i in $DENY_MODS; do 2353 echo "Removing $i from the list of modules to load" >> $LOGFILE2355 LogFile "Removing $i from the list of modules to load" 2354 2356 list_of_groovy_mods=`echo ${list_of_groovy_mods} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '` 2355 2357 done 2356 2358 2357 [ -e "$needed_modules_path" ] || Log It"path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS."2359 [ -e "$needed_modules_path" ] || LogAll "path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS." 2358 2360 for i in $list_of_groovy_mods ; do 2359 2361 needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`" … … 2363 2365 [ -e "$i" ] && s=`du -sk $i | cut -f1` || s="" 2364 2366 [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i 2365 echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE2366 tar cf - -C / $i 2>> $MINDI_TMP/$$.log | (cd $mountpoint ; tar xf -) || Log It"Unable to copy $i to $mountpoint" $MINDI_TMP/$$.log2367 LogFile "Adding $i ($s KB) to the rootfs" 2368 tar cf - -C / $i 2>> $MINDI_TMP/$$.log | (cd $mountpoint ; tar xf -) || LogAll "Unable to copy $i to $mountpoint" $MINDI_TMP/$$.log 2367 2369 # Uncompress modules if not using udev and native modprobe 2368 2370 if [ ! -f $mountpoint/tmp/USE-UDEV ]; then 2369 2371 if [ "`echo "$i" | grep -F ".gz"`" ]; then 2370 echo "Uncompressing $i" >> $LOGFILE2372 LogFile "Uncompressing $i" 2371 2373 gunzip -f $mountpoint/$i 2372 2374 fi … … 2375 2377 2376 2378 # Also copy modules.dep in case of udev so that normal modprobe works 2377 tar cf - -C / /$needed_modules_path/modules.dep 2>> $MINDI_TMP/$$.log | (cd $mountpoint ; tar xf -) || Log It"Unable to copy modules.dep to $mountpoint" $MINDI_TMP/$$.log2379 tar cf - -C / /$needed_modules_path/modules.dep 2>> $MINDI_TMP/$$.log | (cd $mountpoint ; tar xf -) || LogAll "Unable to copy modules.dep to $mountpoint" $MINDI_TMP/$$.log 2378 2380 2379 2381 if [ ! -e "/sbin/devfsd" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then 2380 echo "Deleting devfsd daemon from ramdisk" >> $LOGFILE2381 [ ! -e "/sbin/devfsd" ] && echo "...because /sbin/devfsd not found" >> $LOGFILE2382 [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] && echo "...because kernel is failsafe" >> $LOGFILE2382 LogFile "Deleting devfsd daemon from ramdisk" 2383 [ ! -e "/sbin/devfsd" ] && LogFile "...because /sbin/devfsd not found" 2384 [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] && LogFile "...because kernel is failsafe" 2383 2385 rm -f $mountpoint/sbin/devfsd 2384 2386 fi … … 2402 2404 echo "$BOOT_SIZE" > $mountpoint/tmp/$BOOT_SIZE.siz 2403 2405 # Determine what filesystem to use for initrd image 2404 echo "Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd." >> $LOGFILE2406 LogFile "Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd." 2405 2407 gvFileSystem=`GetInitrdFilesystemToUse ${kernelpath}` 2406 2408 [ -z gvFileSystem ] && Die "GetFilesystemToUse() failed. Terminating." … … 2408 2410 "ext2fs") 2409 2411 # say what will be used 2410 echo "Creating an ext2 initrd image..." >> $LOGFILE2412 LogFile "Creating an ext2 initrd image..." 2411 2413 # kernel expects linuxrc in ext2 filesystem 2412 2414 ( cd $mountpoint && ln -sf sbin/init linuxrc ) … … 2419 2421 rm -f ${rdz_fname}.tmp 2420 2422 # log that we are done 2421 echo "...done." >> $LOGFILE2423 LogFile "...done." 2422 2424 ;; 2423 2425 "initramfs") 2424 2426 # say what will be used 2425 echo "Creating a gzip'ed cpio (AKA initramfs) initrd image..." >> $LOGFILE2427 LogFile "Creating a gzip'ed cpio (AKA initramfs) initrd image..." 2426 2428 # make sure that cpio is there 2427 2429 which cpio &> /dev/null; [ $? -eq 0 ] || Die "cpio not found. Please install package cpio and try again." … … 2435 2437 umount $mountpoint || Die "Cannot unmount $tempfile" 2436 2438 # log that we are done 2437 echo "...done." >> $LOGFILE2439 LogFile "...done." 2438 2440 ;; 2439 2441 *) … … 2471 2473 2472 2474 > $LOGFILE 2473 echo "mindi v$MINDI_VERSION" >> $LOGFILE 2474 echo "$ARCH architecture detected" >> $LOGFILE 2475 echo "mindi called with the following arguments:" >> $LOGFILE 2476 echo "$@" >> $LOGFILE 2477 echo "Start date : `date`" >> $LOGFILE 2478 echo "-----------------------------" >> $LOGFILE 2475 LogFile "mindi v$MINDI_VERSION" 2476 LogFile "$ARCH architecture detected" 2477 LogFile "mindi called with the following arguments:" 2478 LogFile "$@" 2479 LogFile "Start date : `date`" 2480 LogFile "-----------------------------" 2479 2481 2480 2482 [ -e "/sbin/mkdosfs" ] && [ ! -e "/sbin/mkfs.vfat" ] && ln -sf /sbin/mkdosfs /sbin/mkfs.vfat … … 2482 2484 # Log some capital variables 2483 2485 [ "$MINDI_PREFIX" = "XXX" ] && Die "Mindi has not been installed correctly." 2484 echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE 2485 echo "MINDI_LIB = $MINDI_LIB" >> $LOGFILE 2486 echo "MINDI_SBIN = $MINDI_SBIN" >> $LOGFILE 2486 LogFile "MONDO_SHARE = $MONDO_SHARE" 2487 LogFile "MINDI_LIB = $MINDI_LIB" 2488 LogFile "MINDI_SBIN = $MINDI_SBIN" 2487 2489 [ "$MINDI_CONF" = "YYY" ] && Die "Mindi has not been installed correctly." 2488 echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE 2490 LogFile "MINDI_CONF = $MINDI_CONF" 2489 2491 if [ -f $MINDI_CONFIG ]; then 2490 echo "-----------------------------" >> $LOGFILE2491 echo " Mindi configuration file " >> $LOGFILE2492 echo "-----------------------------" >> $LOGFILE2492 LogFile "-----------------------------" 2493 LogFile " Mindi configuration file " 2494 LogFile "-----------------------------" 2493 2495 grep -Ev '^#' $MINDI_CONFIG >> $LOGFILE 2494 echo "-----------------------------" >> $LOGFILE2496 LogFile "-----------------------------" 2495 2497 fi 2496 2498 … … 2505 2507 if which awk &> /dev/null ; then 2506 2508 if ! which gawk &> /dev/null ; then 2507 Log It"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"2509 LogAll "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" 2508 2510 fi 2509 2511 fi … … 2517 2519 PATH=$PATH:/sbin:/usr/sbin 2518 2520 export PATH 2519 echo "Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily." >> $LOGFILE2520 echo "However, you may wish to ask your vendor to provide a permanent fix..." >> $LOGFILE2521 echo " Or you might like to call 'su -' instead of 'su', for example." >> $LOGFILE2521 LogFile "Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily." 2522 LogFile "However, you may wish to ask your vendor to provide a permanent fix..." 2523 LogFile " Or you might like to call 'su -' instead of 'su', for example." 2522 2524 fi 2523 2525 … … 2526 2528 source $MINDI_LIB/FindDistroFailsafe 2527 2529 # Log kernel image 2528 Log It"FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)"2530 LogAll "FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)" 2529 2531 else 2530 2532 [ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | grep -E "2\.[46]" | cut -d' ' -f1` … … 2572 2574 fi 2573 2575 2574 echo "LVM set to $LVM" >> $LOGFILE 2575 echo "----------" >> $LOGFILE 2576 echo "mount result:" >> $LOGFILE 2577 echo "-------------" >> $LOGFILE 2576 LogFile "LVM set to $LVM" 2577 LogFile "----------" 2578 LogFile "mount result:" 2579 LogFile "-------------" 2578 2580 mount >> $LOGFILE 2579 echo "-------------" >> $LOGFILE 2581 LogFile "-------------" 2580 2582 if [ -e /etc/raidtab ]; then 2581 echo "-------------" >> $LOGFILE2582 echo "/etc/raidtab content:" >> $LOGFILE2583 echo "-------------" >> $LOGFILE2583 LogFile "-------------" 2584 LogFile "/etc/raidtab content:" 2585 LogFile "-------------" 2584 2586 cat /etc/raidtab >> $LOGFILE 2585 2587 fi 2586 echo "-------------" >> $LOGFILE 2587 echo "cat $CMDLINE" >> $LOGFILE 2588 echo "-------------" >> $LOGFILE 2588 LogFile "-------------" 2589 LogFile "cat $CMDLINE" 2590 LogFile "-------------" 2589 2591 cat $CMDLINE >> $LOGFILE 2590 echo "-------------" >> $LOGFILE 2591 echo "cat /proc/swaps:" >> $LOGFILE 2592 echo "-------------" >> $LOGFILE 2592 LogFile "-------------" 2593 LogFile "cat /proc/swaps:" 2594 LogFile "-------------" 2593 2595 cat /proc/swaps >> $LOGFILE 2594 echo "-------------" >> $LOGFILE 2595 echo "cat /proc/partitions:" >> $LOGFILE 2596 echo "-------------" >> $LOGFILE 2596 LogFile "-------------" 2597 LogFile "cat /proc/partitions:" 2598 LogFile "-------------" 2597 2599 cat /proc/partitions >> $LOGFILE 2598 echo "-------------" >> $LOGFILE 2599 echo "cat /proc/filesystems:" >> $LOGFILE 2600 echo "-------------" >> $LOGFILE 2600 LogFile "-------------" 2601 LogFile "cat /proc/filesystems:" 2602 LogFile "-------------" 2601 2603 cat /proc/filesystems >> $LOGFILE 2602 echo "-------------" >> $LOGFILE 2603 echo "lsmod result:" >> $LOGFILE 2604 echo "-------------" >> $LOGFILE 2604 LogFile "-------------" 2605 LogFile "lsmod result:" 2606 LogFile "-------------" 2605 2607 lsmod >> $LOGFILE 2606 2608 MODULES="`cat /proc/modules | awk '{print $1}'`" 2607 2609 if [ -x /usr/sbin/esxcfg-module ]; then 2608 echo "-------------" >> $LOGFILE2609 echo "VMWare ESX server detected - Enabling dedicated support" >> $LOGFILE2610 echo "-------------" >> $LOGFILE2611 echo "VMWare modules" >> $LOGFILE2612 echo "-------------" >> $LOGFILE2610 LogFile "-------------" 2611 LogFile "VMWare ESX server detected - Enabling dedicated support" 2612 LogFile "-------------" 2613 LogFile "VMWare modules" 2614 LogFile "-------------" 2613 2615 /usr/sbin/esxcfg-module -l >> $LOGFILE 2614 2616 MODULES="$MODULES `/usr/sbin/esxcfg-module -l | awk '{print $1}'`" 2615 2617 fi 2616 echo "FORCE_MODS:" >> $LOGFILE 2617 echo "-------------" >> $LOGFILE 2618 echo $FORCE_MODS >> $LOGFILE 2619 echo "-------------" >> $LOGFILE 2620 echo "DENY_MODS:" >> $LOGFILE 2621 echo "-------------" >> $LOGFILE 2622 echo $DENY_MODS >> $LOGFILE 2623 echo "-------------" >> $LOGFILE 2624 echo "df result:" >> $LOGFILE 2625 echo "----------" >> $LOGFILE 2618 LogFile "FORCE_MODS:" 2619 LogFile "-------------" 2620 LogFile $FORCE_MODS 2621 LogFile "-------------" 2622 LogFile "DENY_MODS:" 2623 LogFile "-------------" 2624 LogFile $DENY_MODS 2625 LogFile "-------------" 2626 LogFile "df result:" 2627 LogFile "----------" 2626 2628 df -T >> $LOGFILE 2627 echo "-------------" >> $LOGFILE 2628 echo "Liste of extra modules is:" >> $LOGFILE 2629 echo "$EXTRA_MODS" >> $LOGFILE 2630 echo "-------------" >> $LOGFILE 2629 LogFile "-------------" 2630 LogFile "Liste of extra modules is:" 2631 LogFile "$EXTRA_MODS" 2632 LogFile "-------------" 2631 2633 2632 2634 # Compute libata version … … 2636 2638 if [ "$laver" = "2" ]; then 2637 2639 DENY_MODS="$DENY_MODS ide-generic" 2638 echo "ide-generic removed from module list as your system uses libata v2+" >> $LOGFILE2639 echo "-------------" >> $LOGFILE2640 LogFile "ide-generic removed from module list as your system uses libata v2+" 2641 LogFile "-------------" 2640 2642 fi 2641 2643 fi … … 2723 2725 ### 2724 2726 kernelname=`echo $kernelpath | cut -d'-' -f2-` 2725 Log It"kernelname = $kernelname"2726 Log It"kernelpath = $kernelpath"2727 LogAll "kernelname = $kernelname" 2728 LogAll "kernelpath = $kernelpath" 2727 2729 if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ] 2728 2730 then 2729 Log It"Module path for ${kernelpath} not found..."2730 Log It"using running kernel\'s modules."2731 LogAll "Module path for ${kernelpath} not found..." 2732 LogAll "using running kernel\'s modules." 2731 2733 kernelname=$KERVERRUN 2732 2734 else 2733 Log It"Using modules for kernel: ${kernelname}"2735 LogAll "Using modules for kernel: ${kernelname}" 2734 2736 fi 2735 2737 ### … … 2748 2750 if [ "${11}" ] ; then 2749 2751 LILO_OPTIONS="" 2750 # Log It"LILO will use conservative settings, to be compatible with older BIOSes."2752 # LogAll "LILO will use conservative settings, to be compatible with older BIOSes." 2751 2753 fi 2752 2754 LAST_FILELIST_NUMBER=${12} … … 2765 2767 [ "$USE_LZMA" = "" ] && USE_LZMA=no 2766 2768 [ "$NOT_BOOT" = "" ] && NOT_BOOT=no 2767 [ "$TAPEDEV" ] && Log It"This is a tape-based backup. Fine."2769 [ "$TAPEDEV" ] && LogAll "This is a tape-based backup. Fine." 2768 2770 [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath` 2769 2771 kernelname=`echo $kernelpath | cut -d'-' -f2-` 2770 2772 if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ] 2771 2773 then 2772 Log It"Module path for ${kernelpath} not found..."2773 Log It"using running kernel\'s modules."2774 LogAll "Module path for ${kernelpath} not found..." 2775 LogAll "using running kernel\'s modules." 2774 2776 kernelname=$KERVERRUN 2775 2777 else 2776 Log It"Using modules for kernel: ${kernelname}"2778 LogAll "Using modules for kernel: ${kernelname}" 2777 2779 fi 2778 2780 # MONDO_ROOT is the real scratchdir … … 2784 2786 fi 2785 2787 else 2786 echo "Syntax: mindi (--custom ....)" >> /dev/stderr2788 LogScreen "Syntax: mindi (--custom ....)" 2787 2789 MindiExit -1 2788 2790 fi … … 2797 2799 2798 2800 if [ _"$MONDO_SHARE" = _"" ]; then 2799 Log It"Mindi Linux mini-distro generator v$MINDI_VERSION"2800 Log It"Latest Mindi is available from http://www.mondorescue.org"2801 Log It"BusyBox sources are available from http://www.busybox.net"2802 Log It"------------------------------------------------------------------------------"2801 LogAll "Mindi Linux mini-distro generator v$MINDI_VERSION" 2802 LogAll "Latest Mindi is available from http://www.mondorescue.org" 2803 LogAll "BusyBox sources are available from http://www.busybox.net" 2804 LogAll "------------------------------------------------------------------------------" 2803 2805 else 2804 echo "You are using Mindi-Linux v$MINDI_VERSION to make boot+data disks" >> $LOGFILE2806 LogFile "You are using Mindi-Linux v$MINDI_VERSION to make boot+data disks" 2805 2807 fi 2806 2808 if [ -f $MINDI_LIB/rootfs/bin/busybox ]; then 2807 Log It"Mindi-`$MINDI_LIB/rootfs/bin/busybox 2>&1 | head -1`"2809 LogAll "Mindi-`$MINDI_LIB/rootfs/bin/busybox 2>&1 | head -1`" 2808 2810 else 2809 Log It"Unable to find mindi-busybox, please install it"2811 LogAll "Unable to find mindi-busybox, please install it" 2810 2812 MindiExit -1 2811 2813 fi … … 2819 2821 KERN_DISK_MADE="" 2820 2822 2821 echo "DIFFERENTIAL = $DIFFERENTIAL" >> $LOGFILE 2822 echo "INTERNAL TAPE BLOCK SIZE = $INTERNAL_TAPE_BLOCK_SIZE" >> $LOGFILE 2823 echo "NOT_BOOT = '$NOT_BOOT'" >> $LOGFILE 2823 LogFile "DIFFERENTIAL = $DIFFERENTIAL" 2824 LogFile "INTERNAL TAPE BLOCK SIZE = $INTERNAL_TAPE_BLOCK_SIZE" 2825 LogFile "NOT_BOOT = '$NOT_BOOT'" 2824 2826 if [ "$NOT_BOOT" != "" ] && [ "$NOT_BOOT" != "0" ] && [ "$NOT_BOOT" != "no" ] ; then 2825 Log It"Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else."2827 LogAll "Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else." 2826 2828 MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg 2827 2829 MakeMountlist $MINDI_TMP/mountlist.txt … … 2831 2833 tar -cv ./tmp | gzip -9 > $MINDI_TMP/all.tar.gz 2>> $MINDI_TMP/$$.log || Die "Cannot make small all.tar.gz" $MINDI_TMP/$$.log 2832 2834 sleep 2 2833 Log It"Done. Exiting."2835 LogAll "Done. Exiting." 2834 2836 MindiExit 0 2835 2837 fi 2836 2838 2837 2839 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then 2838 Log It"Including the generation of a Bootable USB device on $USBDEVICE"2840 LogAll "Including the generation of a Bootable USB device on $USBDEVICE" 2839 2841 fi 2840 2842 … … 2864 2866 source $MINDI_LIB/FindDistroFailsafe 2865 2867 # Log kernel image 2866 Log It"FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)"2868 LogAll "FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)" 2867 2869 kernelpath="$FAILSAFE_KBIN" 2868 Log It"I shall include a failsafe kernel, not your kernel, in the boot disks.\n"2869 Log It"The failsafe kernel is $kernelpath.\n"2870 Log It"However, you are still running your kernel. If Mindi fails to create your\n"2871 Log It"disks then it may still be a result of a problem with your kernel.\n"2870 LogAll "I shall include a failsafe kernel, not your kernel, in the boot disks.\n" 2871 LogAll "The failsafe kernel is $kernelpath.\n" 2872 LogAll "However, you are still running your kernel. If Mindi fails to create your\n" 2873 LogAll "disks then it may still be a result of a problem with your kernel.\n" 2872 2874 pwd=`pwd` 2873 2875 cd $MINDI_TMP … … 2877 2879 else 2878 2880 kernelpath=$MINDI_LIB/vmlinuz 2879 Log It"I shall include Mindi's failsafe kernel, not your kernel, in the boot disks."2880 Log It"However, you are still running your kernel. If Mindi fails to create your"2881 Log It"disks then it may still be a result of a problem with your kernel."2881 LogAll "I shall include Mindi's failsafe kernel, not your kernel, in the boot disks." 2882 LogAll "However, you are still running your kernel. If Mindi fails to create your" 2883 LogAll "disks then it may still be a result of a problem with your kernel." 2882 2884 pwd=`pwd` 2883 2885 cd $MINDI_TMP … … 2887 2889 YOUR_KERNEL_SUCKS="Your kernel sucks" 2888 2890 fi 2889 echo -e "Mindi's temp dir = $MINDI_TMP \nMindi's output dir=$MINDI_CACHE" >> $LOGFILE 2890 [ "$(($RANDOM%64))" -eq "0" ] && LogIt "Dude, I've looked inside your computer and it's really dusty..." 2891 LogFile "Mindi's temp dir=$MINDI_TMP" 2892 LogFile "Mindi's output dir=$MINDI_CACHE" 2893 [ "$(($RANDOM%64))" -eq "0" ] && LogAll "Dude, I've looked inside your computer and it's really dusty..." 2891 2894 2892 2895 [ "$YOUR_KERNEL_SUCKS" ] && [ ! "$FAILSAFE_KVER" ] && Die "Please install mindi-kernel package. You need it.\nGo to http://www.mondorescue.org and download it, then install it." … … 2898 2901 export ramdisk_size=$rds 2899 2902 2900 echo "Ramdisk will be $ramdisk_size KB" >> $LOGFILE 2903 LogFile "Ramdisk will be $ramdisk_size KB" 2901 2904 if [ "$ARCH" = "ia64" ] ; then 2902 2905 PrepareBootDiskImage_LILO $kernelpath || Die "Failed to create ia64 image disk image." … … 2914 2917 OfferToMakeBootableUSB 2915 2918 fi 2916 Log It"Finished."2919 LogAll "Finished." 2917 2920 elif [ "$TAPEDEV" ] ; then 2918 2921 if [ "$ARCH" != "ia64" ] ; then … … 2937 2940 fi 2938 2941 # cleanup 2939 Log It"$FRIENDLY_OUTSTRING"2942 LogAll "$FRIENDLY_OUTSTRING" 2940 2943 for mtpt in $FLOPPY_WAS_MOUNTED ; do 2941 2944 mount $mtpt -
branches/2.2.10/mondo-doc/mondoarchive.8
r2340 r2341 274 274 275 275 .TP 276 .BI "-Y " 277 Use lzma, the new quicker and optimized Linux compression engine, instead of bzip2. 278 279 .TP 276 280 .BI "-R " 277 281 EXPERIMENTAL. Do not use in mission-critical environments. Star is an alternative to afio. Mondo now supports POSIX ACLs and extended attributes, so -R is essentially redundant for now. -
branches/2.2.10/mondo/src/common/libmondo-archive.c
r2338 r2341 545 545 } 546 546 547 mvaddstr_and_log_it(g_currentY, 0, "Calling MINDI to create boot+data disks");548 547 mr_asprintf(tmp, "%s/filelist.full", bkpinfo->tmpdir); 549 548 if (!does_file_exist(tmp)) { … … 840 839 11=\"%s\" 12=%s 13=%ld 14=\"%s\" 15=\"%s\" 16=\"%s\" 17=\"%s\" 18=%ld 19=%d",*/ 841 840 mr_asprintf(command, "mindi %s --custom %s %s/images '%s' '%s' '%s' %ld '%s' '%s' '%s' \ 842 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s' >> %s",841 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s' '%s' >> %s", 843 842 tmp2, // parameter #1 844 843 bkpinfo->tmpdir, // parameter #2 … … 886 885 // popup_and_OK("Pausing"); 887 886 887 mvaddstr_and_log_it(g_currentY, 0, "Calling MINDI to create boot+data disks"); 888 888 res = run_external_binary_with_percentage_indicator_NEW("Generating boot+data disks", command); 889 889 paranoid_free(command); -
branches/2.2.10/mondo/src/common/libmondo-files.c
r2338 r2341 448 448 } 449 449 450 for (p--; isdigit( p) && p != lastline; p--);450 for (p--; isdigit(*p) && p != lastline; p--); 451 451 if (p != lastline) { 452 452 p++; -
branches/2.2.10/mondo/src/lib/mr_mem.c
r2322 r2341 118 118 */ 119 119 void mr_strcat_int(char **in, int line, const char *file, const char *fmt, ...) { 120 char *p = NULL;121 120 char *fmt2 = NULL; 122 121 va_list args;
Note:
See TracChangeset
for help on using the changeset viewer.