Changeset 2963 in MondoRescue for branches/3.0/mindi/mindi
- Timestamp:
- Mar 11, 2012, 4:13:48 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mindi/mindi
r2958 r2963 117 117 fi 118 118 119 # Last function called before exiting120 # Parameter is exit code value121 # Should be declared here as used immediately below potentialy122 MindiExit() {123 echo "Mindi $MINDI_VERSION is exiting" >> $LOGFILE124 echo "End date : `date`" >> $LOGFILE125 if [ _"$MONDO_SHARE" != _"" ] ; then126 echo "------------- mindi logfile included -------------------------" >> /var/log/mondoarchive.log127 cat $LOGFILE >> /var/log/mondoarchive.log128 echo "--------------------------------------------------------------">> /var/log/mondoarchive.log129 fi130 131 cd /132 sync&133 134 # Clean temporary files only when standalone mindi135 if [ _"$MINDI_TMP" != _"$MONDO_TMP" ]; then136 rm -Rf $MINDI_TMP137 fi138 exit $1139 }140 141 LogOnly() {142 echo -e "$1" >> $LOGFILE143 if [ _"$2" != _"" ]; then144 grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE145 fi146 rm -f "$2"147 }148 119 149 120 # Function to log on screen only … … 177 148 } 178 149 150 # Last function called before exiting 151 # Parameter is exit code value 152 # Should be declared here as used immediately below potentialy 153 MindiExit() { 154 LogFile "Mindi $MINDI_VERSION is exiting" >> $LOGFILE 155 LogFile "End date : `date`" >> $LOGFILE 156 if [ _"$MONDO_SHARE" != _"" ] ; then 157 echo "------------- mindi logfile included -------------------------" >> /var/log/mondoarchive.log 158 cat $LOGFILE >> /var/log/mondoarchive.log 159 echo "--------------------------------------------------------------">> /var/log/mondoarchive.log 160 fi 161 162 cd / 163 sync& 164 165 # Clean temporary files only when standalone mindi 166 if [ _"$MINDI_TMP" != _"$MONDO_TMP" ]; then 167 rm -Rf $MINDI_TMP 168 fi 169 exit $1 170 } 179 171 180 172 Die() { … … 238 230 [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 2160, approx.)" 239 231 if [ -e "$bigdir/$mappath" ] ; then 240 echo"$mappath already added" >> $LOGFILE232 LogFile "$mappath already added" >> $LOGFILE 241 233 return 242 234 elif [ -d "$bigdir/$mappath" ] ; then … … 244 236 return 245 237 fi 246 echo"Added kbd map $mappath" >> $LOGFILE238 LogFile "Added kbd map $mappath" >> $LOGFILE 247 239 if [ ! -e "$mappath" ] ; then 248 240 mappath=`grep "i[3-8]86" $MINDI_TMP/keymaps.find | grep "$locale[^r][^/]" | grep -vx " *#.*"` 249 241 if [ ! -e "$mappath" ] ; then 250 LogIt " Cannot add $mappath: kbd map file not found"242 LogIt "WARNING: Cannot add $mappath: kbd map file not found" 251 243 return 252 244 fi … … 256 248 257 249 mkdir -p $bigdir/etc 258 tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogIt " AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log250 tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogIt "WARNING: AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log 259 251 if [ "`echo $mappath | grep -F ".gz"`" ] ; then 260 252 included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2` … … 285 277 # Non absolute file names should not arrive till here => skipped 286 278 if [ `echo "$incoming" | cut -c1` != '/' ]; then 287 LogIt " Unable to handle $incoming"279 LogIt "WARNING: Unable to handle $incoming" 288 280 incoming=`ReadLine` 289 281 continue … … 303 295 # Only uncompress modules if not using udevd 304 296 if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then 305 gunzip -f $outdir/$incoming || LogIt " Cannot gunzip $outdir/$incoming"297 gunzip -f $outdir/$incoming || LogIt "WARNING: Cannot gunzip $outdir/$incoming" 306 298 fi 307 299 [ -x "$outdir" ] && StripExecutable $outdir "-$filename-" … … 342 334 vanilla_lib_name=`echo "$optimized_lib_name" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'` 343 335 echo "$vanilla_lib_name" >> $filelist 344 echo "Adding $vanilla_lib_name to filelist" >> $LOGFILE336 LogFile "INFO: Adding $vanilla_lib_name to filelist" 345 337 mkdir -p $outdir$optimized_lib_name > /dev/null 2> /dev/null 346 338 rmdir $outdir$optimized_lib_name > /dev/null 2> /dev/null … … 348 340 # This may return multiple files 349 341 for resolved in `ReadAllLink $vanilla_lib_name`; do 350 echo "Adding as deps $resolved to filelist" >> $LOGFILE342 LogFile "INFO: Adding as deps $resolved to filelist" 351 343 vanilla_resolved_name=`echo "$resolved" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'` 352 344 mkdir -p $outdir$resolved> /dev/null 2> /dev/null 353 345 rmdir $outdir$resolved > /dev/null 2> /dev/null 354 346 ln -sf $vanilla_resolved_name $outdir$resolved 355 echo "Excluding deps $resolved" >> $LOGFILE347 LogFile "INFO: Excluding deps $resolved" 356 348 grep -Fvx "$resolved" "$filelist" > $filelist.tmp 357 echo "Replacing it with $vanilla_resolved_name" >> $LOGFILE349 LogFile "INFO: Replacing it with $vanilla_resolved_name" 358 350 echo "$vanilla_resolved_name" >> $filelist.tmp 359 351 mv -f $filelist.tmp $filelist … … 368 360 FindAndAddUserKeyboardMappingFile() { 369 361 local r res mapfile mappath included_item included_list keyfile mp locale 370 LogIt " Analyzing your keyboard's configuration."362 LogIt "INFO: Analyzing your keyboard's configuration." 371 363 KEYDIR=/lib/kbd 372 364 [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share/kbd # Slackware … … 376 368 [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole-setup 377 369 if [ ! -e "$KEYDIR" ] ; then 378 LogIt " Keyboard mapping directory not found. I shall use default map at boot-time."370 LogIt "WARNING: Keyboard mapping directory not found. I shall use default map at boot-time." 379 371 return 0 380 372 fi 381 373 if [ -e "/etc/sysconfig/keyboard" ] ; then 382 echo "Red Hat-style config detected." >> $LOGFILE374 LogFile "INFO: Red Hat-style config detected." 383 375 keyfile=/etc/sysconfig/keyboard 384 376 elif [ -e "/etc/rc.d/rc.keymap" ] ; then 385 echo "Slackware-style config detected." >> $LOGFILE377 LogFile "INFO: Slackware-style config detected." 386 378 keyfile=/etc/rc.d/rc.keymap 387 379 elif [ -e "/etc/rc.config" ] ; then 388 echo "Debian-style config detected." >> $LOGFILE380 LogFile "INFO: Debian-style config detected." 389 381 keyfile=/etc/rc.config 390 382 elif [ -e "/etc/console/boottime.kmap.gz" ] ; then 391 echo "Debian-style config detected." >> $LOGFILE383 LogFile "INFO: Debian-style config detected." 392 384 echo -en "Adding the following keyboard mapping tables: " 393 385 mkdir -p $bigdir/tmp … … 400 392 return 0 401 393 elif [ -e "/etc/console-setup/boottime.kmap.gz" ] || [ -e "/etc/console-setup/cached.kmap.gz" ] ; then 402 echo "Ubuntu-style config detected." >> $LOGFILE394 LogFile "INFO: Ubuntu-style config detected." 403 395 echo -en "Adding the following keyboard mapping tables: " 404 396 mkdir -p $bigdir/tmp … … 416 408 return 0 417 409 elif [ -e "/etc/rc.conf" ] ; then 418 echo "ArchLinux config detected." >> $LOGFILE410 LogFile "INFO: ArchLinux config detected." 419 411 keyfile=/etc/rc.conf 420 412 elif [ -e "/etc/conf.d/keymaps" ] ; then 421 echo "Gentoo-style config detected." >> $LOGFILE413 LogFile "INFO: Gentoo-style config detected." 422 414 keyfile=/etc/conf.d/keymaps 423 415 else … … 425 417 keyfile=`find /etc -name rc.config | head -n1` 426 418 if [ "$keyfile" = "" ] || [ ! -e "$keyfile" ] ; then 427 LogIt " Unknown config detected. Default keyboard map will be used."419 LogIt "WARNING: Unknown config detected. Default keyboard map will be used." 428 420 return 429 421 else 430 echo "Found $keyfile" >> $LOGFILE422 LogFile "INFO: Found $keyfile" 431 423 fi 432 424 fi 433 425 if [ ! -e "$KEYDIR/keymaps" ] ; then 434 LogIt " Keyboard mapping directory not found. Default keyboard map will be used."426 LogIt "WARNING: Keyboard mapping directory not found. Default keyboard map will be used." 435 427 return 436 428 fi 437 echo "keyfile=$keyfile" >> $LOGFILE429 LogFile "INFO: keyfile=$keyfile" 438 430 locale=`grep -F KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2` 439 431 [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'` # Slackware 440 432 [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | tr -d '"' |cut -d'=' -f2` # Gentoo & ArchLinux 441 echo "locale=$locale" >> $LOGFILE433 LogFile "INFO: locale=$locale" 442 434 # 443 435 # Process the keymaps dir once for all … … 450 442 echo "$mp" | grep -q " " 451 443 if [ $? -eq 0 ]; then 452 echo "WARNING: Multiple keymaps found: $mp" | tee -a $LOGFILE453 echo "The following one will be used" >> $LOGFILE444 LogAll "WARNING: Multiple keymaps found: $mp" 445 LogFile "INFO: The following one will be used" 454 446 fi 455 447 for i in $mp ; do … … 460 452 mappath=$(find / -wholename "*/kbd/keymaps/*/$locale | head -1") 461 453 fi 462 echo "mappath = $mappath" >> $LOGFILE454 LogFile "INFO: mappath = $mappath" 463 455 if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then 464 LogIt " Keyboard mapping file not found. Default keyboard map will be used."456 LogIt "WARNING: Keyboard mapping file not found. Default keyboard map will be used." 465 457 return 466 458 fi … … 486 478 [ ! -e "$MBOOTC32" ] && MBOOTC32=`find / -name mboot.c32 | grep -x "/.*/mboot.c32"` 487 479 [ ! -e "$MBOOTC32" ] && Die "Please install mboot.c32 first. If your syslinux RPM doesn't include mboot.c32, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml" 488 LogFile " Found mboot.c32 at $MBOOTC32"480 LogFile "INFO: Found mboot.c32 at $MBOOTC32" 489 481 } 490 482 … … 498 490 [ ! -e "$ISOLINUX" ] && ISOLINUX=`find / -name isolinux.bin | grep -x "/.*/isolinux.bin"` 499 491 [ ! -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.org/downloads.shtml" 500 echo "Found isolinux.bin at $ISOLINUX" >> $LOGFILE492 LogFile "INFO: Found isolinux.bin at $ISOLINUX" 501 493 } 502 494 … … 543 535 filelist=`GenerateListForFile "$incoming"` 544 536 r=$? 545 [ "$r" -ne "0" ] && LogIt " $incoming not found"537 [ "$r" -ne "0" ] && LogIt "WARNING: $incoming not found" 546 538 res=$(($res+$r)) 547 # echo "'$incoming' generates filelist '$filelist'" >> $LOGFILE539 # LogFile "INFO: '$incoming' generates filelist '$filelist'" 548 540 for fname in $filelist ; do 549 541 [ "$fname" != "" ] && echo "$fname" >> $tempfile … … 630 622 progress=0 631 623 noof_lines=`cat $tempfile | wc -l` 632 echo "---------------------------------" >> $LOGFILE633 echo "List of dependencies: " >> $LOGFILE634 echo "---------------------------------" >> $LOGFILE624 LogFile "---------------------------------" 625 LogFile "List of dependencies: " 626 LogFile "---------------------------------" 635 627 for fname in `cat $tempfile` ; do 636 628 echo "$fname" | tee -a $LOGFILE >> $outfile.pre … … 653 645 mkdir -p $bigdir/bin 654 646 if [ -e "$MINDI_TMP/post-nuke.tgz" ] ; then 655 LogIt "\nI ncorporating post-nuke tarball"647 LogIt "\nINFO: Incorporating post-nuke tarball" 656 648 old_pwd=`pwd` 657 649 cd "$bigdir" 658 tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogIt "E rror occurredwhen untarring post-nuke tarball" $MINDI_TMP/$$.log650 tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogIt "ERROR: when untarring post-nuke tarball" $MINDI_TMP/$$.log 659 651 cd "$old_pwd" 660 652 fi … … 662 654 LocateDeps $bigdir/usr/bin/mondo*restore >> $outfile.pre 663 655 else 664 LogIt "Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP" 665 LogIt "I bet you've got a spare copy of Mondo or Mindi floating around on your system." 666 LogIt "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." 656 LogIt "ERROR: Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP" 657 LogIt " I bet you've got a spare copy of Mondo or Mindi floating around on your system." 658 LogIt " If Mindi was called by Mondo then send me a bug report." 659 LogIt " It not, type 'ps ax' to see which Mondo-related process is still running then kill it. :-)" 660 LogIt " Finally, run Mindi again." 667 661 Die "Odd." 668 662 fi 669 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogIt "\n Mondo v1.2x defaults to LILO as the bootloader, BTW."663 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogIt "\nINFO: Mondo v1.2x defaults to LILO as the bootloader, BTW." 670 664 if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then 671 LogIt "\nI ncorporating Network-related settings"665 LogIt "\nINFO: Incorporating Network-related settings" 672 666 for r in NETFS-* ISO-PREFIX ; do 673 667 cp -f $MINDI_TMP/$r $bigdir/tmp 2>> $LOGFILE || Die "Cannot copy $r - did you run out of disk space?" 674 echo "Copying $r to ramdisk" >> $LOGFILE668 LogFile "INFO: Copying $r to ramdisk" 675 669 done 676 670 fi … … 747 741 748 742 # say where we are. 749 echo " GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage" >> $LOGFILE743 LogFile "INFO: GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage" 750 744 751 745 # verify that file exists … … 775 769 fi 776 770 # say what we are using 777 echo " GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem.\n" >> $LOGFILE771 LogFile "INFO: GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem." 778 772 779 773 # return file system to use … … 877 871 [ -f "$r" ] && echo "$r" 878 872 fi 879 echo "module $module --> $r" >> $LOGFILE873 LogFile "INFO: module $module --> $r" 880 874 done 881 875 find /lib/modules/$kern/modules.* -type f 2> /dev/null … … 891 885 for fname in $incoming ; do 892 886 if [ ! -e "$fname" ] ; then 893 echo "WARNING - $fname does not exist; cannot be LDD'd." >> $LOGFILE887 LogFile "WARNING - $fname does not exist; cannot be LDD'd." 894 888 if echo $fname | grep lvm &> /dev/null ; then 895 echo "This warning only affects you if you are using LVM." >> $LOGFILE889 LogFile " This warning only affects you if you are using LVM." 896 890 if echo "$MODULES" | grep lvm &> /dev/null ; then 897 echo "I think you are, so please take heed!" >> $LOGFILE891 LogFile " I think you are, so please take heed!" 898 892 else 899 echo "I don't think you are, so don't worry about it." >> $LOGFILE893 LogFile " I don't think you are, so don't worry about it." 900 894 fi 901 895 fi 902 896 elif [ -h "$fname" ] && [ -x "$fname" ] ; then 903 echo "$fname is softlink" >> $LOGFILE897 LogFile "INFO: $fname is softlink" 904 898 else 905 899 ldd $fname 2> /dev/null | ProcessLDD … … 1037 1031 absolute_partition old_partition_fmt current_lvolume uname skip 1038 1032 1039 echo "Your raw fstab file looks like this:" >> $LOGFILE1040 echo "------------------------------------" >> $LOGFILE1033 LogFile "Your raw fstab file looks like this:" 1034 LogFile "------------------------------------" 1041 1035 cat $MY_FSTAB >> $LOGFILE 1042 echo "Your mountlist will look like this:" | tee -a $LOGFILE1043 echo "-----------------------------------" >> $LOGFILE1036 LogAll "Your mountlist will look like this:" 1037 LogFile "-----------------------------------" 1044 1038 1045 1039 # mountlist(OUT) … … 1270 1264 for d in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do 1271 1265 if [ "`echo " $list_of_devices " | grep " $d"`" != "" ]; then 1272 echo "Excluding $current_partition from mountlist (due to excluded device $d)" >> $LOGFILE1266 LogFile "INFO: Excluding $current_partition from mountlist (due to excluded device $d)" 1273 1267 skip=1 1274 1268 continue … … 1299 1293 echo $current_lvolume | grep -q ' ' 1300 1294 if [ $? -eq 0 ]; then 1301 echo "WARNING: Multiple Logical Volumes found. Report to dev team" >> $LOGFILE1295 LogFile "WARNING: Multiple Logical Volumes found. Report to dev team" 1302 1296 fi 1303 1297 # if it's not found, it may well be a real device such as a multipath one … … 1331 1325 [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0 1332 1326 [ "$partition_size" -lt "125000" ] && partition_size=125000 1333 echo "I'm guessing $c_p is $(($partition_size/1024))MB" >> $LOGFILE1327 LogFile "INFO: I'm guessing $c_p is $(($partition_size/1024))MB" 1334 1328 fi 1335 1329 else … … 1351 1345 fi 1352 1346 psz=$partition_size 1353 echo "Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)" >> $LOGFILE1347 LogFile "INFO: Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)" 1354 1348 [ "$psz" != "lvm" ] && psz=$(($psz/1024)) 1355 1349 if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then … … 1359 1353 partition_size=$(($partition_size+1)); # just in case 1360 1354 if [ "$partition_format" = "Linux" ] ; then 1361 echo "Are you imaging a mounted swap partition? Silly..." >> $LOGFILE1362 echo "Reverting format from $old_partition_fmt to $partition_format" >> $LOGFILE1355 LogFile "WARNING: Are you imaging a mounted swap partition? Silly..." 1356 LogFile "WARNING: Reverting format from $old_partition_fmt to $partition_format" 1363 1357 partition_format=$old_partition_fmt 1364 1358 fi … … 1366 1360 1367 1361 if [ ! "$partition_mountpt" ] ; then 1368 echo "------- $FDISK -l $qq log ------------" >> $LOGFILE1362 LogFile "------- $FDISK -l $qq log ------------" 1369 1363 for qq in "" `find /dev/ida/c*d* ! -name '*p*' 2> /dev/null`; do 1370 1364 partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9` 1371 1365 [ "$partition_format" ] && break 1372 1366 done 1373 echo "------- $FDISK log end ------------" >> $LOGFILE1367 LogFile "------- $FDISK log end ------------" 1374 1368 if [ "$partition_format" = "Compaq diagnostics" ] ; then 1375 1369 partition_format="compaq" 1376 1370 elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then 1377 LogIt " Unable to find mountpoint of $current_partition - ignoring"1371 LogIt "WARNING: Unable to find mountpoint of $current_partition - ignoring" 1378 1372 continue 1379 1373 fi … … 1388 1382 unofficial_outstring=`printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$label"` 1389 1383 if [ "$current_partition" = "" ] ; then 1390 echo "Unknown partition (outstring = $unofficial_outstring)" >> $LOGFILE1384 LogFile "WARNING: Unknown partition (outstring = $unofficial_outstring)" 1391 1385 elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then 1392 1386 if [ "`grep -F device /etc/raidtab 2>/dev/null | grep -F $current_partition`" ] ; then … … 1396 1390 printf "%s %s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$label" >> $mountlist 1397 1391 else 1398 echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE1392 LogFile "WARNING: Unknown mountpoint (outstring = $unofficial_outstring)" 1399 1393 fi 1400 1394 elif [ "$partition_format" = "" ] ; then 1401 echo "Unknown format (outstring = $unofficial_outstring)" >> $LOGFILE1395 LogFile "WARNING: Unknown format (outstring = $unofficial_outstring)" 1402 1396 elif [ "$partition_size" = "" ] ; then 1403 echo "Unknown partition size (outstring = $unofficial_outstring)" >> $LOGFILE1397 LogFile "WARNING: Unknown partition size (outstring = $unofficial_outstring)" 1404 1398 elif [ "$partition_mountpt" = "/proc" ] || [ "$partition_mountpt" = "/dev/pts" ] ; then 1405 1399 continue 1406 1400 else 1407 1401 if [ "$partition_format" = "dos" ] || [ "$partition_format" = "msdos" ] ; then 1408 echo "vfat should be used instead of dos/msdos as a partition format" >> $LOGFILE1402 LogFile "WARNING: vfat should be used instead of dos/msdos as a partition format" 1409 1403 partition_format="vfat" 1410 1404 fi … … 1423 1417 ML2=`grep -v ' lvm ' $file | $AWK '{print $2}' | sort -u | wc -l` 1424 1418 if [ "$ML01" -ne "$ML1" ]; then 1425 echo "--------------------------------------------" >> $LOGFILE1426 echo "WARNING: Duplicate device entry in mountlist" | tee -a $LOGFILE1427 echo "--------------------------------------------" >> $LOGFILE1419 LogFile "--------------------------------------------" 1420 LagAll "WARNING: Duplicate device entry in mountlist" 1421 LogFile "--------------------------------------------" 1428 1422 fi 1429 1423 if [ "$ML02" -ne "$ML2" ]; then 1430 echo "--------------------------------------------" >> $LOGFILE1431 echo "WARNING: Duplicate mountpoint entry in mountlist" | tee -a $LOGFILE1432 echo "------------------------------------------------" >> $LOGFILE1424 LogFile "--------------------------------------------" 1425 LogAll "WARNING: Duplicate mountpoint entry in mountlist" 1426 LogFile "------------------------------------------------" 1433 1427 fi 1434 1428 } … … 1446 1440 local i old_pwd 1447 1441 if [ -z "$ISO_CMD" ]; then 1448 LogIt " Neither mkisofs nor genisoimage found, unable to make CD image"1442 LogIt "ERROR: Neither mkisofs nor genisoimage found, unable to make CD image" 1449 1443 return 1450 1444 fi … … 1456 1450 rm -Rf $MINDI_TMP/iso 1457 1451 mkdir -p $MINDI_TMP/iso/{images,archives} 1458 cp -f $MINDI_CACHE/{*.gz,*.img} $MINDI_TMP/iso/images 2>> $LOGFILE || LogIt " OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images"1459 echo "mindi_lib = $MINDI_LIB" >> $LOGFILE1452 cp -f $MINDI_CACHE/{*.gz,*.img} $MINDI_TMP/iso/images 2>> $LOGFILE || LogIt "WARNING: OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images" 1453 LogFile "INFO: mindi_lib = $MINDI_LIB" 1460 1454 for i in memdisk memtest.bin memtest.img ; do 1461 1455 j=$MINDI_LIB/$i 1462 1456 k=$MINDI_TMP/iso 1463 1457 if [ -e "$j" ] ; then 1464 LogIt " Copying $j to $k"1458 LogIt "INFO: Copying $j to $k" 1465 1459 cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k" 1466 1460 cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP" … … 1505 1499 fi 1506 1500 if [ "$?" -ne "0" ] ; then 1507 echo "----------- $ISO_CMD's errors --------------" >> $LOGFILE 1508 cat $MINDI_TMP/mkisofs.log >> $LOGFILE 1509 echo "$ISO_CMD returned the following errors:-" 1510 cat $MINDI_TMP/mkisofs.log 1511 LogIt "Failed to create ISO image." 1512 else 1513 echo "Created bootable ISO image at $MINDI_CACHE/mindi.iso" | tee -a $LOGFILE 1501 LogFile "----------- $ISO_CMD's errors --------------" 1502 LogAll "$ISO_CMD returned the following errors:" 1503 cat $MINDI_TMP/mkisofs.log | tee -a $LOGFILE 1504 LogIt "ERROR: Failed to create ISO image." 1505 else 1506 LogAll "INFO: Created bootable ISO image at $MINDI_CACHE/mindi.iso" 1514 1507 fi 1515 1508 rm -f $MINDI_TMP/mkisofs.log … … 1540 1533 echo -en "Transforming $USBDEVICE in a Bootable device " 1541 1534 echo -en "." 1542 echo "Transforming $USBDEVICE in a Bootable device" >> $LOGFILE1543 echo "Checking $USBDEVICE" >> $LOGFILE1535 LogFile "INFO: Transforming $USBDEVICE in a Bootable device" 1536 LogFile "INFO: Checking $USBDEVICE" 1544 1537 $FDISK -l $USBDEVICE 2>&1 >> $LOGFILE 1545 1538 if [ $? -ne 0 ]; then 1546 echo "Unable to access $USBDEVICE" | tee -a $LOGFILE1547 echo "Make sure your USB device is pluged in" | tee -a $LOGFILE1548 exit -11539 LogAll "ERROR: Unable to access $USBDEVICE" 1540 LogAll " Make sure your USB device is pluged in" 1541 MindiExit -1 1549 1542 fi 1550 1543 echo -en "." 1551 echo "Unmounting $USBPART just in case" >> $LOGFILE1544 LogFile "INFO: Unmounting $USBPART just in case" 1552 1545 umount $USBPART 2>> $LOGFILE 1>> $LOGFILE 1553 1546 # If your key has no MBR it may cause an issue 1554 1547 # Use dd if=mbr.bin of=$USBDEVICE or ms-sys -s $USBDEVICE 1555 1548 if [ -r $MBRFILE ]; then 1556 echo "Installing an MBR ($MBRFILE) on $USBDEVICE" | tee -a $LOGFILE1549 LogAll "INFO: Installing an MBR ($MBRFILE) on $USBDEVICE" 1557 1550 dd if=$MBRFILE of=$USBDEVICE 1558 1551 else 1559 echo "You may need to install an MBR (usually in $MBRFILE, but not found on your system) " | tee -a $LOGFILE1560 echo "on $USBDEVICE with dd if=$MBRFILE of=$USBDEVICE" | tee -a $LOGFILE1561 fi 1562 echo "Preparing $USBDEVICE" >> $LOGFILE1552 LogAll "WARNING: You may need to install an MBR (usually in $MBRFILE, but not found on your system)" 1553 LogAll " on $USBDEVICE with dd if=$MBRFILE of=$USBDEVICE" 1554 fi 1555 LogFile "INFO: Preparing $USBDEVICE" 1563 1556 cat > $MINDI_TMP/fdisk.txt << EOF 1564 1557 d … … 1579 1572 $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE < $MINDI_TMP/fdisk.txt 1580 1573 if [ $? -ne 0 ]; then 1581 echo "Unable to create a vfat Filesystem on $USBDEVICE" | tee -a $LOGFILE1582 echo "Make sure your USB device is pluged in" | tee -a $LOGFILE1574 LogAll "ERROR: Unable to create a vfat Filesystem on $USBDEVICE" 1575 LogAll " Make sure your USB device is pluged in" 1583 1576 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1584 1577 MindiExit -1 1585 1578 fi 1586 echo "fdisk build file" >> $LOGFILE1587 echo "----------------" >> $LOGFILE1579 LogFile "fdisk build file" 1580 LogFile "----------------" 1588 1581 cat $MINDI_TMP/fdisk.txt >> $LOGFILE 1589 echo "----------------" >> $LOGFILE1582 LogFile "----------------" 1590 1583 rm -f $MINDI_TMP/fdisk.txt 1591 echo "The USB device $USBDEVICE now looks like this:" >> $LOGFILE1584 LogFile "INFO: The USB device $USBDEVICE now looks like this:" 1592 1585 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1593 1586 echo -en "." 1594 1587 # Some distro do auto mount at that point (Ubuntu) 1595 echo "Unmounting $USBPART just in case again" >> $LOGFILE1588 LogFile "INFO: Unmounting $USBPART just in case again" 1596 1589 umount $USBPART 2>> $LOGFILE 1>> $LOGFILE 1597 1590 echo -en "." 1598 echo "Creating a vfat filesystem on $USBPART" >> $LOGFILE1591 LogFile "INFO: Creating a vfat filesystem on $USBPART" 1599 1592 mkdosfs -F 32 $USBPART 2>&1 >> $LOGFILE 1600 1593 if [ $? -ne 0 ]; then 1601 echo "Unable to create a vfat filesystem on $USBPART" | tee -a $LOGFILE1602 echo "Make sure your USB device is pluged in and partitioned ($USBPART must exist on it)" | tee -a $LOGFILE1594 LogAll "ERROR: Unable to create a vfat filesystem on $USBPART" 1595 LogAll " Make sure your USB device is pluged in and partitioned ($USBPART must exist on it)" 1603 1596 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1604 1597 MindiExit -1 1605 1598 fi 1606 1599 echo -en "." 1607 echo "Mounting $USBPART on $MINDI_TMP/usb" >> $LOGFILE1600 LogFile "INFO: Mounting $USBPART on $MINDI_TMP/usb" 1608 1601 mount $USBPART $MINDI_TMP/usb 2>> $LOGFILE 1609 1602 if [ $? -ne 0 ]; then 1610 echo "Unable to mount $USBPART on $MINDI_TMP/usb" | tee -a $LOGFILE1611 echo "Make sure your USB device is pluged in, partitioned and formated ($USBPART must exist on it)" | tee -a $LOGFILE1603 LogAll "ERROR: Unable to mount $USBPART on $MINDI_TMP/usb" 1604 LogAll " Make sure your USB device is pluged in, partitioned and formated ($USBPART must exist on it)" 1612 1605 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1613 1606 MindiExit -1 … … 1615 1608 echo -en "." 1616 1609 mkdir -p $MINDI_TMP/usb/images 1617 cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogIt " OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images"1610 cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogIt "ERROR: OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images" 1618 1611 echo -en "." 1619 echo "mindi_lib = $MINDI_LIB" >> $LOGFILE1612 LogFile "INFO: mindi_lib = $MINDI_LIB" 1620 1613 for i in memdisk memtest.bin memtest.img ; do 1621 1614 j=$MINDI_LIB/$i 1622 1615 k=$MINDI_TMP/usb 1623 1616 if [ -e "$j" ] ; then 1624 LogIt " Copying $j to $k"1617 LogIt "INFO: Copying $j to $k" 1625 1618 cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k" 1626 1619 cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP" … … 1636 1629 MakeBootConfFile syslinux > $MINDI_TMP/usb/syslinux.cfg 1637 1630 echo -en "." 1638 echo "----------- syslinux's conf --------------" |tee -a $LOGFILE1631 LogAll "----------- syslinux's conf --------------" 1639 1632 cat $MINDI_TMP/usb/syslinux.cfg |tee -a $LOGFILE 1640 echo "------------------------------------------" |tee -a $LOGFILE1633 LogAll "------------------------------------------" 1641 1634 umount $MINDI_TMP/usb 1642 1635 if [ "$ARCH" != "ia64" ] ; then … … 1651 1644 fi 1652 1645 if [ $res -ne 0 ] ; then 1653 echo "----------- syslinux's errors --------------" |tee -a $LOGFILE1646 LogAll "----------- syslinux's errors --------------" 1654 1647 cat $MINDI_TMP/syslinux.log |tee -a $LOGFILE 1655 echo "------------------------------------------" |tee -a $LOGFILE1656 LogIt " Failed to create USB image."1648 LogAll "------------------------------------------" 1649 LogIt "ERROR: Failed to create USB image." 1657 1650 else 1658 1651 echo -e "$DONE" 1659 echo "Created bootable USB image on $USBDEVICE" >> $LOGFILE1652 LogFile "INFO: Created bootable USB image on $USBDEVICE" 1660 1653 fi 1661 1654 rm -f $MINDI_TMP/syslinux.log 1662 1655 else 1663 echo "No USB boot support for ia64" | tee -a $LOGFILE1656 LogAll "ERROR: No USB boot support for ia64" 1664 1657 MindiExit -1 1665 1658 fi … … 1812 1805 dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file" 1813 1806 mkdosfs $imagefile >> $LOGFILE 2>> $LOGFILE 1814 mount -t vfat -o loop $imagefile $mountpoint || LogIt " Cannot mount (PBDI)"1807 mount -t vfat -o loop $imagefile $mountpoint || LogIt "ERROR: Cannot mount (PBDI)" 1815 1808 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it 1816 1809 mkdir -p $mountpoint/etc … … 1837 1830 fi 1838 1831 1839 echo "Copying $MINDI_TMP/initrd.img to $mountpoint..." >> $LOGFILE1832 LogFile "INFO: Copying $MINDI_TMP/initrd.img to $mountpoint..." 1840 1833 cp -f $MINDI_TMP/initrd.img $mountpoint 2>> $LOGFILE 1841 1834 if [ "$?" -ne "0" ] ; then 1842 LogIt " Failed to copy $MINDI_TMP/initrd.img to $mountpoint"1835 LogIt "ERROR: Failed to copy $MINDI_TMP/initrd.img to $mountpoint" 1843 1836 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1844 LogIt " Please unload some of your modules and try again. Or increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG"1837 LogIt " Please unload some of your modules and try again. Or increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG" 1845 1838 rm -f $MINDI_TMP/mtpt.$$ 1846 LogIt " Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)"1839 LogIt "ERROR: Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)" 1847 1840 retval=$(($retval+1)) 1848 1841 fi … … 1860 1853 cp -f $kernelpath $mountpoint/vmlinuz > /dev/null 2>> $LOGFILE 1861 1854 if [ "$?" -ne "0" ] ; then 1862 echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE1855 LogFile "INFO: Files at mountpoint ($mountpoint) :" 1863 1856 du -sk $mountpoint/* >> $LOGFILE 1864 echo "--- end of list of files ---" >> $LOGFILE1857 LogFile "--- end of list of files ---" 1865 1858 echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE 1866 1859 [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz 1867 1860 cd "$old_pwd" 1868 1861 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1869 rmdir $mountpoint || LogIt " Cannot rmdir (PBDI)"1862 rmdir $mountpoint || LogIt "ERROR: Cannot rmdir (PBDI)" 1870 1863 # losetup /dev/loop0 -d 1871 1864 [ "$imagefile" != "" ] && rm -f $imagefile 1872 LogIt " Sorry, your kernel is too big for your image"1865 LogIt "ERROR: Sorry, your kernel is too big for your image" 1873 1866 Die "Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG" 1874 1867 return 0 1875 1868 fi 1876 1869 max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`)) 1877 echo "Free space left on image = $free_space KB" >> $LOGFILE1878 echo "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" >> $LOGFILE1870 LogFile "INFO: Free space left on image = $free_space KB" 1871 LogFile "INFO: Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" 1879 1872 # make it bootable 1880 1873 [ "$mountpoint" != "" ] && rm -f $mountpoint/zero 1881 1874 [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint 2>> $LOGFILE 1882 1875 if [ "$KERN_DISK_MADE" ] ; then 1883 echo "Not running LILO. It's not that kind of disk." >> $LOGFILE1876 LogFile "INFO: Not running LILO. It's not that kind of disk." 1884 1877 fi 1885 1878 … … 1887 1880 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1888 1881 echo -en "..." 1889 rmdir $mountpoint || LogIt " Cannot rmdir (PBDI)"1882 rmdir $mountpoint || LogIt "ERROR: Cannot rmdir (PBDI)" 1890 1883 if [ "$retval" -eq "0" ] ; then 1891 1884 echo -en "...$DONE\n" 1892 1885 if [ "$KERN_DISK_MADE" ] ; then 1893 LogIt " $BOOT_SIZE KB boot disks were created OK\n"1886 LogIt "INFO: $BOOT_SIZE KB boot disks were created OK\n" 1894 1887 fi 1895 1888 else 1896 1889 echo -en "...failed\n" 1897 LogIt $BOOT_SIZE"KB boot disk was NOT created\n"1890 LogIt "WARNING: $BOOT_SIZE""KB boot disk was NOT created\n" 1898 1891 [ "$imagefile" != "" ] && rm -f $imagefile 1899 1892 fi 1900 [ "$retval" -ne "0" ] && LogIt " PrepareBootDiskImage() is returning nonzero"1893 [ "$retval" -ne "0" ] && LogIt "WARNING: PrepareBootDiskImage() is returning nonzero" 1901 1894 return $retval 1902 1895 } … … 1919 1912 mkdir -p $mountpoint 1920 1913 dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file" 1921 echo "Creating vfat filesystem on $imagefile" >> $LOGFILE1914 LogFile "INFO: Creating vfat filesystem on $imagefile" 1922 1915 mkfs.vfat $imagefile >> $LOGFILE 2>> $LOGFILE 1923 1916 # syslinux should be run on a local file (doen't work through NFS Cf: #297) … … 1928 1921 imagefile=$imagesdir/mindi-bootroot.$BOOT_SIZE.img 1929 1922 1930 mount -t vfat -o loop $imagefile $mountpoint || LogIt " Cannot mount (PBDI)"1923 mount -t vfat -o loop $imagefile $mountpoint || LogIt "ERROR: Cannot mount (PBDI)" 1931 1924 1932 1925 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it 1933 1926 MakeMessageFile | cut -c1-80 > $mountpoint/message.txt 1934 1927 MakeBootConfFile isolinux > $mountpoint/syslinux.cfg 1935 echo "Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..." >> $LOGFILE1928 LogFile "INFO: Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..." 1936 1929 cp -f $MINDI_TMP/initrd.img $mountpoint/initrd.img 2>> $LOGFILE 1937 1930 if [ "$?" -ne "0" ] ; then 1938 Log It "Failed to copy $MINDI_TMP/initrd.img to $mountpoint"1931 LogAll "ERROR: Failed to copy $MINDI_TMP/initrd.img to $mountpoint" 1939 1932 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1940 Log It "Please unload some of your modules and try again."1933 LogAll " Please unload some of your modules and try again." 1941 1934 rm -f $MINDI_TMP/mtpt.$$ 1942 LogIt "Cannot incorporate initrd.img in bootdisk (kernel / modules too big?). Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG" 1935 LogAll " Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)." 1936 LogAll " Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG" 1943 1937 retval=$(($retval+1)) 1944 1938 fi … … 1963 1957 1964 1958 if [ "$retval" -ne "0" ] ; then 1965 echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE1959 LogFile "INFO: Files at mountpoint ($mountpoint) :" 1966 1960 du -sk $mountpoint/* >> $LOGFILE 1967 echo "--- end of list of files ---" >> $LOGFILE1961 LogFile "--- end of list of files ---" 1968 1962 echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE 1969 1963 [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz 1970 1964 cd "$old_pwd" 1971 1965 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1972 rmdir $mountpoint || LogIt " Cannot rmdir (PBDI)"1973 1974 LogIt " Sorry, your kernel is too big for your image"1966 rmdir $mountpoint || LogIt "ERROR: Cannot rmdir (PBDI)" 1967 1968 LogIt "ERROR: Sorry, your kernel is too big for your image" 1975 1969 Die "Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG" 1976 1970 fi 1977 1971 max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`)) 1978 echo "Free space left on image = $free_space KB" >> $LOGFILE1979 echo "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" >> $LOGFILE1972 LogFile "INFO: Free space left on image = $free_space KB" 1973 LogFile "INFO: Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" 1980 1974 1981 1975 # make it bootable … … 1985 1979 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1986 1980 echo -en "..." 1987 rmdir $mountpoint || LogIt " Cannot rmdir (PBDI)"1981 rmdir $mountpoint || LogIt "ERROR: Cannot rmdir (PBDI)" 1988 1982 1989 1983 if [ "$retval" -eq "0" ] ; then … … 1991 1985 if [ "$KERN_DISK_MADE" ] ; then 1992 1986 [ "$imagefile" != "" ] && rm -f $imagefile 1993 LogIt " $BOOT_SIZE KB boot disks were created OK\n"1987 LogIt "INFO: $BOOT_SIZE KB boot disks were created OK\n" 1994 1988 fi 1995 1989 else 1996 1990 echo -en "...failed\n" 1997 LogIt $BOOT_SIZE"KB boot disk was NOT created\n"1991 LogIt "WARNING: $BOOT_SIZE""KB boot disk was NOT created\n" 1998 1992 [ "$imagefile" != "" ] && rm -f $imagefile 1999 1993 fi 2000 [ "$retval" -ne "0" ] && LogIt " PrepareBootDiskImage() is returning nonzero"1994 [ "$retval" -ne "0" ] && LogIt "ERROR: PrepareBootDiskImage() is returning nonzero" 2001 1995 return $retval 2002 1996 } … … 2053 2047 for i in $EXTRA_MODS ; do 2054 2048 j=`find lib/modules/$FAILSAFE_KVER -name $i.*o.gz 2> /dev/null` 2055 [ ! "$j" ] && echo "WARNING - cannot find failsafe module $i.o.gz" >> $LOGFILE2049 [ ! "$j" ] && LogFile "WARNING - cannot find failsafe module $i.o.gz" 2056 2050 for k in $j ; do 2057 tar cf - $k 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogIt "ERROR on module $k" $MINDI_TMP/$$.log2058 echo "Added failsafe module $k to ramdisk" >> $LOGFILE2051 tar cf - $k 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogIt "ERROR: module $k extraction issue" $MINDI_TMP/$$.log 2052 LogFile "INFO: Added failsafe module $k to ramdisk" 2059 2053 done 2060 2054 done … … 2087 2081 i=`cat $MINDI_TMP/BOOTLOADER.DEVICE 2> /dev/null` 2088 2082 if [ "$i" ] ; then 2089 LogIt " Backing up $i's MBR"2083 LogIt "INFO: Backing up $i's MBR" 2090 2084 dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE 2091 2085 sleep 1 … … 2093 2087 j=$i 2094 2088 [ -h "$j" ] && j=`readlink -f $j` 2095 LogIt " Creating /dev/boot_device ($j)"2089 LogIt "INFO: Creating /dev/boot_device ($j)" 2096 2090 mkdir -p $bigdir/dev 2097 2091 cp -pRdf $j $bigdir/dev/boot_device 2>> $LOGFILE || Die "Unable to create /dev/boot_device on ramdisk" … … 2105 2099 if [ -d /$ti ]; then 2106 2100 mkdir -p $ti 2107 cp -Rdf /$ti/* $ti 2>> $LOGFILE || LogIt " WARNING - error occurred while copying terminfo"2101 cp -Rdf /$ti/* $ti 2>> $LOGFILE || LogIt "ERROR: issue copying terminfo" 2108 2102 fi 2109 2103 if [ -e "$MONDO_SHARE/restore-scripts" ]; then … … 2112 2106 fi 2113 2107 if [ -d "/lib/dev-state" ]; then 2114 tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogIt " Unable to handle /lib/dev-state" $MINDI_TMP/$$.log2108 tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Unable to handle /lib/dev-state" $MINDI_TMP/$$.log 2115 2109 fi 2116 2110 cd "$old_pwd" … … 2130 2124 rm -f $bigdir/tmp/i-want-my-lvm 2131 2125 else 2132 echo "Your i-want-my-lvm file content is:" >> $LOGFILE2133 echo "-----------------------------------" >> $LOGFILE2126 LogFile "Your i-want-my-lvm file content is:" 2127 LogFile "-----------------------------------" 2134 2128 cat $bigdir/tmp/i-want-my-lvm >> $LOGFILE 2135 echo "-----------------------------------" >> $LOGFILE2136 fi 2137 fi 2138 echo "Your mountlist.txt file content is:" >> $LOGFILE2139 echo "-----------------------------------" >> $LOGFILE2129 LogFile "-----------------------------------" 2130 fi 2131 fi 2132 LogFile "Your mountlist.txt file content is:" 2133 LogFile "-----------------------------------" 2140 2134 cat $bigdir/tmp/mountlist.txt >> $LOGFILE 2141 echo "-----------------------------------" >> $LOGFILE2135 LogFile "-----------------------------------" 2142 2136 2143 2137 echo -en "$FILES_IN_FILELIST" > $bigdir/FILES-IN-FILELIST 2>> $LOGFILE … … 2152 2146 echo -en "Tarring and zipping the data content..." 2153 2147 size_of_all_tools=`du -sk $bigdir | cut -f1` 2154 (cd "$bigdir" ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogIt " Problem creating all.tar.gz" $MINDI_TMP/$$.log)2148 (cd "$bigdir" ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogIt "ERROR: Problem creating all.tar.gz" $MINDI_TMP/$$.log) 2155 2149 du -sk $imagesdir/*gz >> $LOGFILE 2156 2150 echo -e "$DONE" … … 2262 2256 $AWK '{if (substr($0,0,1)!="#" || substr($0,0,3)=="#!/") {print $0;};}' $tempfile > $1 2263 2257 rm -f $tempfile 2264 echo "Stripped comments from $2" >> $LOGFILE2258 LogFile "INFO: Stripped comments from $2" 2265 2259 } 2266 2260 … … 2277 2271 if [ "$?" -eq "0" ] ; then 2278 2272 cp -f $tmpfile $1 2>> $LOGFILE 2279 echo "Stripped binary $2" >> $LOGFILE2273 LogFile "INFO: Stripped binary $2" 2280 2274 fi 2281 2275 rm -f $tmpfile … … 2317 2311 # It's a Xen kernel 2318 2312 KERNEL_IS_XEN="yes" 2319 LogFile "I t's a Xen kernel..."2313 LogFile "INFO: It's a Xen kernel..." 2320 2314 fi 2321 2315 … … 2353 2347 fi 2354 2348 if [ ! "$possible_kernels" ] ; then 2355 LogFile " No kernel matches exactly. Are there any duff kernels?"2349 LogFile "INFO: No kernel matches exactly. Are there any duff kernels?" 2356 2350 possible_kernels="$duff_kernels" 2357 2351 if [ ! "$possible_kernels" ] ; then 2358 LogFile " Sorry, no duff kernels either"2352 LogFile "INFO: Sorry, no duff kernels either" 2359 2353 else 2360 LogFile "I bet you're running Debian or Gentoo, aren't you?"2361 LogFile " Your kernel doesn't have a sane builddate. Oh well..."2354 LogFile "INFO: I bet you're running Debian or Gentoo, aren't you?" 2355 LogFile "INFO: Your kernel doesn't have a sane builddate. Oh well..." 2362 2356 fi 2363 2357 fi … … 2372 2366 LogFile "Could not find your kernel." 2373 2367 if [ -e "/boot/vmlinuz" ] ; then 2374 LogFile " Using /boot/vmlinuz as a last resort."2368 LogFile "INFO: Using /boot/vmlinuz as a last resort." 2375 2369 output=/boot/vmlinuz 2376 2370 else … … 2379 2373 elif [ "$noof_kernels" -eq "1" ] ; then 2380 2374 kp=`echo "$possible_kernels" | sed s/' '//` 2381 LogFile " Your kernel is $kp (v$KERVERRUN)"2375 LogFile "INFO: Your kernel is $kp (v$KERVERRUN)" 2382 2376 output="$kp" 2383 2377 else 2384 2378 for i in $possible_kernels ; do 2385 2379 if [ "`echo $i | grep "$KERVERRUN"`" ]; then 2386 LogFile " OK, I used my initiative and found that "2387 LogFile " $i is probably your kernel. "2380 LogFile "INFO: OK, I used my initiative and found that " 2381 LogFile "INFO: $i is probably your kernel. " 2388 2382 output="$i" 2389 2383 break … … 2393 2387 if [ "`echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null`" ]; then 2394 2388 output=/boot/vmlinuz 2395 LogFile " Schlomo, this one's for you."2389 LogFile "INFO: Schlomo, this one's for you." 2396 2390 else 2397 LogFile " Two or more possible kernels found. You may specify any one of them and the "2398 LogFile " boot disks will still work, probably. If one does not work, try another."2399 LogFile " $possible_kernels"2391 LogFile "INFO: Two or more possible kernels found. You may specify any one of them and the " 2392 LogFile "INFO: boot disks will still work, probably. If one does not work, try another." 2393 LogFile "INFO: $possible_kernels" 2400 2394 output="" 2401 2395 fi … … 2407 2401 elif [ "$noof_xenkernels" -eq "1" ]; then 2408 2402 xenkernelpath=`echo "$possible_xenkernels" | sed s/' '//` 2409 LogFile " Your Xen kernel is $xenkernelpath (v$KERVERRUN)"2403 LogFile "INFO: Your Xen kernel is $xenkernelpath (v$KERVERRUN)" 2410 2404 else 2411 2405 for i in $possible_xenkernels ; do 2412 2406 if [ "`echo $i | grep "$KERVERRUN"`" ]; then 2413 LogFile " OK, I used my initiative and found that "2414 LogFile " $i is probably your Xen kernel. "2407 LogFile "INFO: OK, I used my initiative and found that " 2408 LogFile "INFO: $i is probably your Xen kernel. " 2415 2409 xenkernelpath="$i" 2416 2410 break … … 2421 2415 if [ ! -n "$new_possible_xenkernels" ]; then 2422 2416 xenkernelpath=`echo $new_possible_xenkernels | tr -s ' ' '\n' | head -1` 2423 LogFile " Using $xenkernelpath"2417 LogFile "INFO: Using $xenkernelpath" 2424 2418 else 2425 LogFile " Two or more possible Xen kernels found. You may specify any one of them and the "2426 LogFile " boot disks will still work, probably. If one does not work, try another."2427 LogFile " $possible_xenkernels"2419 LogFile "INFO: Two or more possible Xen kernels found. You may specify any one of them and the " 2420 LogFile "INFO: boot disks will still work, probably. If one does not work, try another." 2421 LogFile "INFO: $possible_xenkernels" 2428 2422 output="" 2429 2423 xenkernelpath=`echo $possible_xenkernels | tr -s ' ' '\n' | head -1` 2430 LogFile " Using $xenkernelpath"2424 LogFile "INFO: Using $xenkernelpath" 2431 2425 fi 2432 2426 fi … … 2455 2449 dd if=/dev/zero of=$tempfile bs=1k count=$ramdisk_size &> /dev/null || Die "Not enough room for temporary ramdisk (TurnTgzIntoRdz)" 2456 2450 echo -en "..." 2457 echo "Creating ext2 filesystem on $tempfile" >> $LOGFILE2451 LogFile "INFO: Creating ext2 filesystem on $tempfile" 2458 2452 mke2fs -b 1024 -m 1 -i 2048 -F $tempfile >> $LOGFILE 2>> $LOGFILE || Die "Unable to create an ext2 file system on $tempfile" 2459 2453 echo -en "..." … … 2466 2460 # AL04Oct08: Check whether /lib64 is a link and if so explicitly create one in rootfs 2467 2461 if [ -h "/lib64" ]; then 2468 mkdir -p lib || LogIt "Unable to create lib in $mountpoint." 2469 ln -s lib lib64 || LogIt "/lib64 is a symbolic link, but I couldn't create it in $mountpoint." 2470 fi 2471 2472 cp -Rdf $tgz_dir_fname/* . 2>&1 >> $LOGFILE 2462 mkdir -p lib || LogIt "ERROR: Unable to create lib in $mountpoint." 2463 ln -s lib lib64 || LogIt "ERROR: /lib64 is a symbolic link, but I couldn't create it in $mountpoint." 2464 fi 2465 2466 # Check files before copying to discover configuration issues or McAfee preventing mindi reading these files 2467 for f in $tgz_dir_fname/*; do 2468 if [ ! -r $f ]; then 2469 Die "ERROR: Unable to copy $f to the target dir. Check your installation or McAfee presence" 2470 else 2471 cp -Rdf $f . 2>&1 >> $LOGFILE 2472 fi 2473 done 2473 2474 tar -zxf symlinks.tgz || Die "Cannot untar symlinks.tgz" 2474 2475 … … 2516 2517 done 2517 2518 # Initial / are trucated by tar 2518 tar cf - `sort -u $MINDI_TMP/minimal.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt " Problem in minimal analysis" $MINDI_TMP/$$.log2519 tar cf - `sort -u $MINDI_TMP/minimal.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in minimal analysis" $MINDI_TMP/$$.log 2519 2520 rm -f $MINDI_TMP/minimal.lis 2520 2521 … … 2527 2528 if [ $? -eq 0 ]; then 2528 2529 echo "udev device manager found" > $mountpoint/tmp/USE-UDEV 2529 LogIt " udev device manager found"2530 tar cf - -C / /etc/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt " Problem in /etc/udev analysis" $MINDI_TMP/$$.log2530 LogIt "INFO: udev device manager found" 2531 tar cf - -C / /etc/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in /etc/udev analysis" $MINDI_TMP/$$.log 2531 2532 # This avoids NIC remapping if on another machine at restore time on Debian at least 2532 2533 rm -f ./etc/udev/rules.d/z[0-9][0-9]_persistent-net.rules … … 2535 2536 # Do not do it if it's a link (Ubuntu 64 bits #503) 2536 2537 if [ -e "/lib64/udev" ] && [ ! -h "/lib64" ] && [ ! -h "/lib64/udev" ]; then 2537 tar cf - -C / /lib64/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt " Problem in /lib64/udev analysis" $MINDI_TMP/$$.log2538 tar cf - -C / /lib64/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in /lib64/udev analysis" $MINDI_TMP/$$.log 2538 2539 fi 2539 2540 if [ -e "/lib32/udev" ] && [ ! -h "/lib32" ] && [ ! -h "/lib32/udev" ]; then 2540 tar cf - -C / /lib32/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt " Problem in /lib32/udev analysis" $MINDI_TMP/$$.log2541 tar cf - -C / /lib32/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in /lib32/udev analysis" $MINDI_TMP/$$.log 2541 2542 fi 2542 2543 if [ -e "/lib/udev" ] && [ ! -h "/lib" ] && [ ! -h "/lib/udev" ]; then 2543 tar cf - -C / /lib/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt " Problem in /lib/udev analysis" $MINDI_TMP/$$.log2544 tar cf - -C / /lib/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in /lib/udev analysis" $MINDI_TMP/$$.log 2544 2545 fi 2545 2546 if [ -x /sbin/udevd ]; then … … 2568 2569 fi 2569 2570 done 2570 tar cf - -C / $lis `sort -u $MINDI_TMP/udev.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt " Problem in udev.lis analysis" $MINDI_TMP/$$.log2571 tar cf - -C / $lis `sort -u $MINDI_TMP/udev.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in udev.lis analysis" $MINDI_TMP/$$.log 2571 2572 rm -f $MINDI_TMP/udev.lis 2572 2573 else 2573 echo "udevd daemon not in standard place (/sbin)" 2>&1 | tee -a $LOGFILE2574 echo "mindi will use static devices which may cause problems" 2>&1 | tee -a $LOGFILE2574 LogAll "WARNING: udevd daemon not in standard place (/sbin)" 2575 LogAll " mindi will use static devices which may cause problems" 2575 2576 rm -f $mountpoint/tmp/USE-UDEV 2576 2577 fi … … 2581 2582 mindi-bkphw $MINDI_CACHE $MINDI_CONF | tee -a $LOGFILE 2582 2583 if [ -d $MINDI_CACHE/bkphw ]; then 2583 LogIt " Hardware Information found and saved ..."2584 LogIt "INFO: Hardware Information found and saved ..." 2584 2585 cp -rp $MINDI_CACHE/bkphw . 2585 2586 if [ -f $MINDI_CACHE/tools.files ]; then 2586 2587 lis=`grep -Ev '^#' $MINDI_CACHE/tools.files` 2587 2588 LocateDeps $lis > $MINDI_TMP/tools.lis 2588 tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt " Problem in tools.lis analysis" $MINDI_TMP/$$.log2589 tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in tools.lis analysis" $MINDI_TMP/$$.log 2589 2590 fi 2590 2591 if [ -f $MINDI_CACHE/mindi-rsthw ]; then … … 2597 2598 # Management of perl scripts delivered needed at restore time 2598 2599 mindi-get-perl-modules `cat $MINDI_CONF/perl-scripts` > $MINDI_TMP/perl.lis 2599 tar cf - `cat $MINDI_TMP/perl.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt " Problem in perl scripts analysis" $MINDI_TMP/$$.log2600 tar cf - `cat $MINDI_TMP/perl.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in perl scripts analysis" $MINDI_TMP/$$.log 2600 2601 2601 2602 for w in cdrom groovy-stuff ; do … … 2603 2604 done 2604 2605 2605 tar cf - -C / /dev/fd0*[1,2][4,7,8]* 2>> $MINDI_TMP/$$.log | tar xf - || LogIt " Problem in fd dev analysis" $MINDI_TMP/$$.log2606 tar cf - -C / /dev/fd0*[1,2][4,7,8]* 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in fd dev analysis" $MINDI_TMP/$$.log 2606 2607 2607 2608 cd "$old_pwd" … … 2632 2633 fi 2633 2634 for i in $DENY_MODS; do 2634 echo "Removing $i from the list of modules to load" >> $LOGFILE2635 LogFile "INFO: Removing $i from the list of modules to load" 2635 2636 list_of_groovy_mods=`echo ${list_of_groovy_mods} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '` 2636 2637 done 2637 2638 2638 [ -e "$needed_modules_path" ] || LogIt " path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS."2639 [ -e "$needed_modules_path" ] || LogIt "WARNING: path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS." 2639 2640 for i in $list_of_groovy_mods ; do 2640 2641 needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`" … … 2644 2645 [ -e "$i" ] && s=`du -sk $i | cut -f1` || s="" 2645 2646 [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i 2646 echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE2647 tar cf - -C / $i 2>> $MINDI_TMP/$$.log | (cd "$mountpoint" ; tar xf -) || LogIt " Unable to copy $i to $mountpoint" $MINDI_TMP/$$.log2647 LogFile "INFO: Adding $i ($s KB) to the rootfs" 2648 tar cf - -C / $i 2>> $MINDI_TMP/$$.log | (cd "$mountpoint" ; tar xf -) || LogIt "ERROR: Unable to copy $i to $mountpoint" $MINDI_TMP/$$.log 2648 2649 # Uncompress modules if not using udev and native modprobe 2649 2650 if [ ! -f $mountpoint/tmp/USE-UDEV ]; then 2650 2651 if [ "`echo "$i" | grep -F ".gz"`" ]; then 2651 echo "Uncompressing $i" >> $LOGFILE2652 LogFile "INFO: Uncompressing $i" 2652 2653 gunzip -f $mountpoint/$i 2653 2654 fi … … 2656 2657 2657 2658 # Also copy modules.dep in case of udev so that normal modprobe works 2658 tar cf - -C / /$needed_modules_path/modules.dep 2>> $MINDI_TMP/$$.log | (cd "$mountpoint" ; tar xf -) || LogIt " Unable to copy modules.dep to $mountpoint" $MINDI_TMP/$$.log2659 tar cf - -C / /$needed_modules_path/modules.dep 2>> $MINDI_TMP/$$.log | (cd "$mountpoint" ; tar xf -) || LogIt "ERROR: Unable to copy modules.dep to $mountpoint" $MINDI_TMP/$$.log 2659 2660 2660 2661 # Copy FW in case some drivers needs it … … 2668 2669 mkdir -p $mountpoint/usr/bin 2669 2670 cp -a /usr/bin/hpsa_obdr_mode $mountpoint/usr/bin 2670 LogIt " Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved OBDR support"2671 LogIt "INFO: Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved OBDR support" 2671 2672 else 2672 2673 LogAll "WARNING: You're using OBDR mode without having the /usr/bin/hpsa_obdr_mode tool" … … 2676 2677 2677 2678 if [ ! -e "/sbin/devfsd" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then 2678 echo "Deleting devfsd daemon from ramdisk" >> $LOGFILE2679 [ ! -e "/sbin/devfsd" ] && echo "...because /sbin/devfsd not found" >> $LOGFILE2680 [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] && echo "...because kernel is failsafe" >> $LOGFILE2679 LogFile "INFO: Deleting devfsd daemon from ramdisk" 2680 [ ! -e "/sbin/devfsd" ] && LogFile "...because /sbin/devfsd not found" 2681 [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] && LogFile "...because kernel is failsafe" 2681 2682 rm -f $mountpoint/sbin/devfsd 2682 2683 fi … … 2697 2698 fi 2698 2699 mkdir -p $mountpoint/proc 2699 echo "---------------------------" >> $LOGFILE2700 echo "Content of initial ramdisk:" >> $LOGFILE2701 echo "---------------------------" >> $LOGFILE2700 LogFile "---------------------------" 2701 LogFile "Content of initial ramdisk:" 2702 LogFile "---------------------------" 2702 2703 (cd "$mountpoint" ; ls -Rla ) >> $LOGFILE 2703 echo "---------------------------" >> $LOGFILE2704 LogFile "---------------------------" 2704 2705 2705 2706 # Determine what filesystem to use for initrd image 2706 echo "Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd." >> $LOGFILE2707 LogFile "INFO: Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd." 2707 2708 gvFileSystem=`GetInitrdFilesystemToUse ${kernelpath}` 2708 2709 [ -z gvFileSystem ] && Die "GetFilesystemToUse() failed. Terminating." 2709 2710 if [ "$gvFileSystem" = "ext2fs" ] || [ "$gvFileSystem" = "ext3fs" ]; then 2710 2711 # say what will be used 2711 echo "Creating an $gvFileSystem initrd image..." >> $LOGFILE2712 LogFile "INFO: Creating an $gvFileSystem initrd image..." 2712 2713 # kernel expects linuxrc in ext2 filesystem 2713 2714 ( cd "$mountpoint" && ln -sf sbin/init linuxrc ) … … 2720 2721 rm -f ${rdz_fname}.tmp 2721 2722 # log that we are done 2722 echo "...done." >> $LOGFILE2723 LogFile "...done." 2723 2724 elif [ "$gvFileSystem" = "initramfs" ]; then 2724 2725 # say what will be used 2725 echo "Creating a gzip'ed cpio (AKA initramfs) initrd image..." >> $LOGFILE2726 LogFile "INFO: Creating a gzip'ed cpio (AKA initramfs) initrd image..." 2726 2727 # make sure that cpio is there 2727 2728 which cpio &> /dev/null; [ $? -eq 0 ] || Die "cpio not found. Please install package cpio and try again." … … 2735 2736 umount $mountpoint || Die "Cannot unmount $tempfile" 2736 2737 # log that we are done 2737 echo "...done." >> $LOGFILE2738 LogFile "...done." 2738 2739 else 2739 2740 Die "Filesystem $gvFileSystem not supported for initrd image. Terminating." … … 2770 2771 2771 2772 > $LOGFILE 2772 echo "mindi v$MINDI_VERSION" >> $LOGFILE 2773 echo "$ARCH architecture detected" >> $LOGFILE 2774 echo "mindi called with the following arguments:" >> $LOGFILE 2775 echo "$@" >> $LOGFILE 2776 echo "Start date : `date`" >> $LOGFILE 2777 echo "-----------------------------" >> $LOGFILE 2773 LogFile "mindi v$MINDI_VERSION" 2774 LogFile "$ARCH architecture detected" 2775 LogFile "mindi called with the following arguments:" 2776 LogFile "$@" 2777 LogFile "Start date : `date`" 2778 LogFile "-----------------------------" 2778 2779 2779 2780 [ -e "/sbin/mkdosfs" ] && [ ! -e "/sbin/mkfs.vfat" ] && ln -sf /sbin/mkdosfs /sbin/mkfs.vfat … … 2781 2782 # Log some capital variables 2782 2783 [ "$MINDI_PREFIX" = "XXX" ] && Die "Mindi has not been installed correctly." 2783 echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE 2784 echo "MINDI_LIB = $MINDI_LIB" >> $LOGFILE 2785 echo "MINDI_SBIN = $MINDI_SBIN" >> $LOGFILE 2784 LogFile "MONDO_SHARE = $MONDO_SHARE" 2785 LogFile "MINDI_LIB = $MINDI_LIB" 2786 LogFile "MINDI_SBIN = $MINDI_SBIN" 2786 2787 [ "$MINDI_CONF" = "YYY" ] && Die "Mindi has not been installed correctly." 2787 echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE 2788 LogFile "MINDI_CONF = $MINDI_CONF" 2788 2789 if [ -f $MINDI_CONFIG ]; then 2789 echo "-----------------------------" >> $LOGFILE2790 echo " Mindi configuration file " >> $LOGFILE2791 echo "-----------------------------" >> $LOGFILE2790 LogFile "-----------------------------" 2791 LogFile " Mindi configuration file " 2792 LogFile "-----------------------------" 2792 2793 grep -Ev '^#' $MINDI_CONFIG >> $LOGFILE 2793 echo "-----------------------------" >> $LOGFILE2794 LogFile "-----------------------------" 2794 2795 fi 2795 2796 … … 2804 2805 if which awk &> /dev/null ; then 2805 2806 if ! which gawk &> /dev/null ; then 2806 LogIt " 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"2807 LogIt "INFO: You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n" 2807 2808 fi 2808 2809 fi … … 2816 2817 PATH=$PATH:/sbin:/usr/sbin 2817 2818 export PATH 2818 echo "Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily." >> $LOGFILE2819 echo "However, you may wish to ask your vendor to provide a permanent fix..." >> $LOGFILE2820 echo " Or you might like to call 'su -' instead of 'su', for example." >> $LOGFILE2819 LogFile "INFO: Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily." 2820 LogFile "INFO: However, you may wish to ask your vendor to provide a permanent fix..." 2821 LogFile "INFO: Or you might like to call 'su -' instead of 'su', for example." 2821 2822 fi 2822 2823 … … 2825 2826 source $MINDI_LIB/FindDistroFailsafe 2826 2827 # Log kernel image 2827 LogIt " FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)"2828 LogIt "INFO: FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)" 2828 2829 else 2829 2830 [ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | grep -E "2\.[46]" | cut -d' ' -f1` … … 2862 2863 LVM="false" 2863 2864 fi 2864 echo "LVM set to $LVM" >> $LOGFILE 2865 echo "----------" >> $LOGFILE 2866 echo "mount result:" >> $LOGFILE 2867 echo "-------------" >> $LOGFILE 2865 LogFile "INFO: LVM set to $LVM" 2866 LogFile "----------" 2867 LogFile "mount result:" 2868 LogFile "-------------" 2868 2869 mount >> $LOGFILE 2869 echo "-------------" >> $LOGFILE 2870 LogFile "-------------" 2870 2871 if [ -e /etc/raidtab ]; then 2871 echo "-------------" >> $LOGFILE2872 echo "/etc/raidtab content:" >> $LOGFILE2873 echo "-------------" >> $LOGFILE2872 LogFile "-------------" 2873 LogFile "/etc/raidtab content:" 2874 LogFile "-------------" 2874 2875 cat /etc/raidtab >> $LOGFILE 2875 2876 fi 2876 echo "-------------" >> $LOGFILE 2877 echo "cat /proc/cmdline:" >> $LOGFILE 2878 echo "-------------" >> $LOGFILE 2877 LogFile "-------------" 2878 LogFile "cat /proc/cmdline:" 2879 LogFile "-------------" 2879 2880 cat /proc/cmdline >> $LOGFILE 2880 echo "-------------" >> $LOGFILE 2881 echo "cat /proc/swaps:" >> $LOGFILE 2882 echo "-------------" >> $LOGFILE 2881 LogFile "-------------" 2882 LogFile "cat /proc/swaps:" 2883 LogFile "-------------" 2883 2884 cat /proc/swaps >> $LOGFILE 2884 echo "-------------" >> $LOGFILE 2885 echo "cat /proc/partitions:" >> $LOGFILE 2886 echo "-------------" >> $LOGFILE 2885 LogFile "-------------" 2886 LogFile "cat /proc/partitions:" 2887 LogFile "-------------" 2887 2888 cat /proc/partitions >> $LOGFILE 2888 echo "-------------" >> $LOGFILE 2889 echo "cat /proc/filesystems:" >> $LOGFILE 2890 echo "-------------" >> $LOGFILE 2889 LogFile "-------------" 2890 LogFile "cat /proc/filesystems:" 2891 LogFile "-------------" 2891 2892 cat /proc/filesystems >> $LOGFILE 2892 echo "-------------" >> $LOGFILE 2893 echo "lsmod result:" >> $LOGFILE 2894 echo "-------------" >> $LOGFILE 2893 LogFile "-------------" 2894 LogFile "lsmod result:" 2895 LogFile "-------------" 2895 2896 lsmod >> $LOGFILE 2896 2897 MODULES="`cat /proc/modules | $AWK '{print $1}'`" 2897 2898 if [ -x /usr/sbin/esxcfg-module ]; then 2898 echo "-------------" >> $LOGFILE2899 echo "VMWare ESX server detected - Enabling dedicated support" >> $LOGFILE2900 echo "-------------" >> $LOGFILE2901 echo "VMWare modules" >> $LOGFILE2902 echo "-------------" >> $LOGFILE2899 LogFile "-------------" 2900 LogFile "INFO: VMWare ESX server detected - Enabling dedicated support" 2901 LogFile "-------------" 2902 LogFile "VMWare modules" 2903 LogFile "-------------" 2903 2904 /usr/sbin/esxcfg-module -l >> $LOGFILE 2904 2905 MODULES="$MODULES `/usr/sbin/esxcfg-module -l | $AWK '{print $1}'`" 2905 2906 fi 2906 echo "FORCE_MODS:" >> $LOGFILE 2907 echo "-------------" >> $LOGFILE 2908 echo $FORCE_MODS >> $LOGFILE 2909 echo "-------------" >> $LOGFILE 2910 echo "DENY_MODS:" >> $LOGFILE 2911 echo "-------------" >> $LOGFILE 2912 echo $DENY_MODS >> $LOGFILE 2913 echo "-------------" >> $LOGFILE 2914 echo "df result:" >> $LOGFILE 2915 echo "----------" >> $LOGFILE 2907 LogFile "FORCE_MODS:" 2908 LogFile "-------------" 2909 LogFile $FORCE_MODS 2910 LogFile "-------------" 2911 LogFile "DENY_MODS:" 2912 LogFile "-------------" 2913 LogFile $DENY_MODS 2914 LogFile "-------------" 2915 LogFile "df result:" 2916 LogFile "----------" 2916 2917 df -T >> $LOGFILE 2917 echo "-------------" >> $LOGFILE 2918 echo "Liste of extra modules is:" >> $LOGFILE 2919 echo "$EXTRA_MODS" >> $LOGFILE 2920 echo "-------------" >> $LOGFILE 2918 LogFile "-------------" 2919 LogFile "Liste of extra modules is:" 2920 LogFile "$EXTRA_MODS" 2921 LogFile "-------------" 2921 2922 2922 2923 # Compute libata version … … 2926 2927 if [ "$laver" = "2" ]; then 2927 2928 DENY_MODS="$DENY_MODS ide-generic" 2928 echo "ide-generic removed from module list as your system uses libata v2+" >> $LOGFILE 2929 echo "-------------" >> $LOGFILE 2930 fi 2929 LogFile "INFO: ide-generic removed from module list as your system uses libata v2+" 2930 LogFile "-------------" 2931 fi 2932 fi 2933 2934 # Check for McAfee which disturbs the access to some files (tgz in articular) 2935 if [ $(cat /proc/linuxshield/enabled 2>/dev/null) = "1" ]; then 2936 LogFile "WARNING: McAfee LinuxShield is enabled. McAfee might block access to certain special files." 2937 LogFile "WARNING: Check in /var/opt/NAI/LinuxShield/etc/nailsd.cfg for 'nailsd.profile.OAS.action.error: Block'" 2938 LogFile "WARNING: You have two options:" 2939 LogFile "WARNING: - Exclude all directories with special files (check McAfee System Events Log)" 2940 LogFile "WARNING: - Disable the scanner during the backup" 2931 2941 fi 2932 2942 2933 2943 # Check for ISO_CMD command 2934 2944 if [ ! -x $ISO_CMD ]; then 2935 echo "NOTE: No CD image (ISO file) utility found" >> $LOGFILE2945 LogFile "NOTE: No CD image (ISO file) utility found" 2936 2946 fi 2937 2947 … … 2967 2977 if [ $KERNEL_IS_XEN = "yes" ]; then 2968 2978 echo "$xenkernelpath" 2969 Log Only "xenkernelpath = $xenkernelpath"2979 LogFile "INFO: xenkernelpath = $xenkernelpath" 2970 2980 MindiExit 0 2971 2981 else … … 2974 2984 else 2975 2985 echo "$resk" 2976 Log Only "kernelpath = $resk"2986 LogFile "INFO: kernelpath = $resk" 2977 2987 MindiExit 0 2978 2988 fi … … 3031 3041 ### 3032 3042 if [ $KERNEL_IS_XEN = "yes" ]; then 3033 LogIt " xenkernelpath = $xenkernelpath"3043 LogIt "INFO: xenkernelpath = $xenkernelpath" 3034 3044 fi 3035 3045 kernelname=`echo $kernelpath | cut -d'-' -f2- | sed 's/.[bg]z[2]*$//'` 3036 3046 if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ] 3037 3047 then 3038 LogIt " Module path for ${kernelpath} not found..."3039 LogIt " using running kernel\'s modules."3048 LogIt "WARNING: Module path for ${kernelpath} not found..." 3049 LogIt " using running kernel\'s modules." 3040 3050 kernelname=$KERVERRUN 3041 3051 fi 3042 LogIt " kernelname = $kernelname"3043 LogIt " kernelpath = $kernelpath"3052 LogIt "INFO: kernelname = $kernelname" 3053 LogIt "INFO: kernelpath = $kernelpath" 3044 3054 ### 3045 3055 ### end of Sq-Modification … … 3057 3067 if [ "${11}" ] ; then 3058 3068 LILO_OPTIONS="" 3059 # LogIt " LILO will use conservative settings, to be compatible with older BIOSes."3069 # LogIt "INFO: LILO will use conservative settings, to be compatible with older BIOSes." 3060 3070 fi 3061 3071 LAST_FILELIST_NUMBER=${12} … … 3072 3082 [ "$USE_GZIP" = "" ] && USE_GZIP=no 3073 3083 [ "$NOT_BOOT" = "" ] && NOT_BOOT=no 3074 [ "$TAPEDEV" ] && LogIt " This is a tape-based backup. Fine."3084 [ "$TAPEDEV" ] && LogIt "INFO: This is a tape-based backup. Fine." 3075 3085 # MONDO_ROOT is the real scratchdir 3076 3086 MONDO_ROOT=`echo $MINDI_CACHE | sed 's/\(.*\)\/.*/\1/'` … … 3099 3109 LogIt "------------------------------------------------------------------------------" 3100 3110 else 3101 echo "You are using Mindi-Linux v$MINDI_VERSION to make boot+data disks" >> $LOGFILE3111 LogFile "INFO: You are using Mindi-Linux v$MINDI_VERSION to make boot+data disks" 3102 3112 fi 3103 3113 if [ -f $MINDI_LIB/rootfs/bin/busybox ]; then 3104 3114 LogIt "Mindi-`$MINDI_LIB/rootfs/bin/busybox 2>&1 | head -1`" 3105 3115 else 3106 LogIt " Unable to find mindi-busybox, please install it"3116 LogIt "ERROR: Unable to find mindi-busybox, please install it" 3107 3117 MindiExit -1 3108 3118 fi … … 3114 3124 KERN_DISK_MADE="" 3115 3125 3116 echo "DIFFERENTIAL = $DIFFERENTIAL" >> $LOGFILE 3117 echo "INTERNAL TAPE BLOCK SIZE = $INTERNAL_TAPE_BLOCK_SIZE" >> $LOGFILE 3118 echo "NOT_BOOT = '$NOT_BOOT'" >> $LOGFILE 3126 LogFile "DIFFERENTIAL = $DIFFERENTIAL" 3127 LogFile "INTERNAL TAPE BLOCK SIZE = $INTERNAL_TAPE_BLOCK_SIZE" 3128 LogFile "NOT_BOOT = '$NOT_BOOT'" 3119 3129 if [ "$NOT_BOOT" != "" ] && [ "$NOT_BOOT" != "0" ] && [ "$NOT_BOOT" != "no" ] ; then 3120 LogIt " Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else."3130 LogIt "INFO: Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else." 3121 3131 MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg 3122 3132 MakeMountlist $MINDI_TMP/mountlist.txt … … 3132 3142 3133 3143 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then 3134 LogIt "I ncluding the generation of a Bootable USB device on $USBDEVICE"3144 LogIt "INFO: Including the generation of a Bootable USB device on $USBDEVICE" 3135 3145 fi 3136 3146 … … 3160 3170 source $MINDI_LIB/FindDistroFailsafe 3161 3171 # Log kernel image 3162 LogIt " FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)"3172 LogIt "INFO: FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)" 3163 3173 kernelpath="$FAILSAFE_KBIN" 3164 LogIt "I shall include a failsafe kernel, not your kernel, in the boot disks.\n"3165 LogIt " The failsafe kernel is $kernelpath.\n"3166 LogIt " However, you are still running your kernel. If Mindi fails to create your\n"3167 LogIt " disks then it may still be a result of a problem with your kernel.\n"3174 LogIt "INFO: I shall include a failsafe kernel, not your kernel, in the boot disks." 3175 LogIt " The failsafe kernel is $kernelpath." 3176 LogIt " However, you are still running your kernel. If Mindi fails to create your" 3177 LogIt " disks then it may still be a result of a problem with your kernel." 3168 3178 pwd=`pwd` 3169 3179 cd "$MINDI_TMP" … … 3173 3183 else 3174 3184 kernelpath=$MINDI_LIB/vmlinuz 3175 LogIt "I shall include Mindi's failsafe kernel, not your kernel, in the boot disks."3176 LogIt " However, you are still running your kernel. If Mindi fails to create your"3177 LogIt " disks then it may still be a result of a problem with your kernel."3185 LogIt "INFO: I shall include Mindi's failsafe kernel, not your kernel, in the boot disks." 3186 LogIt " However, you are still running your kernel. If Mindi fails to create your" 3187 LogIt " disks then it may still be a result of a problem with your kernel." 3178 3188 pwd=`pwd` 3179 3189 cd "$MINDI_TMP" … … 3184 3194 fi 3185 3195 echo -e "Mindi's temp dir = $MINDI_TMP \nMindi's output dir=$MINDI_CACHE" >> $LOGFILE 3186 [ "$(($RANDOM%64))" -eq "0" ] && LogIt " Dude, I've looked inside your computer and it's really dusty..."3196 [ "$(($RANDOM%64))" -eq "0" ] && LogIt "INFO: Dude, I've looked inside your computer and it's really dusty..." 3187 3197 3188 3198 [ "$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." … … 3194 3204 export ramdisk_size=$rds 3195 3205 3196 echo "Ramdisk will be $ramdisk_size KB" >> $LOGFILE 3206 LogFile "INFO: Ramdisk will be $ramdisk_size KB" 3197 3207 if [ "$ARCH" = "ia64" ] ; then 3198 3208 PrepareBootDiskImage_LILO $kernelpath || Die "Failed to create ia64 image disk image."
Note:
See TracChangeset
for help on using the changeset viewer.