Changeset 963 in MondoRescue for branches/stable/mindi
- Timestamp:
- Nov 23, 2006, 4:21:46 PM (18 years ago)
- Location:
- branches/stable/mindi
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/analyze-my-lvm
r911 r963 37 37 Die() { 38 38 echo "$1" >> /dev/stderr 39 exit 139 exit -1 40 40 } 41 41 … … 217 217 218 218 # -------------------------------- main ----------------------------------- 219 which lvmdiskscan 2>/dev/null 2>&1 || Die " Cannot find lvmdiskscan. Are you sure you're using LVM?"219 which lvmdiskscan 2>/dev/null 2>&1 || Die "lvmdiskscan not found. Won't handle LVM." 220 220 if [ -e "/proc/lvm/global" ] && [ "`tr -s '\t' ' ' < /proc/lvm/global | grep "0 VGs 0 PVs 0 LVs"`" != "" ] ; then 221 221 exit 0 -
branches/stable/mindi/mindi
r960 r963 178 178 if [ ! -e "$filename" ] ; then 179 179 if [ -h "$filename" ] ; then 180 cp --parents -pRdf $filename $minidir_root/$diskno 180 cp --parents -pRdf $filename $minidir_root/$diskno 2>> $LOGFILE 181 181 return $noof_disks 182 182 else … … 189 189 mkdir -p $minidir_root/$diskno 190 190 filesize=`du -sk $filename | cut -f1` 191 cp --parents -Rdf $filename $minidir_root/$diskno 191 cp --parents -Rdf $filename $minidir_root/$diskno 2>> $LOGFILE 192 192 if [ "$filesize" -le "4" ] ; then 193 193 siz=$filesize … … 228 228 mappath=`find $KEYDIR/keymaps | grep "i[3-8]86" | grep "$locale[^r][^/]" | grep -vx " *#.*"` 229 229 if [ ! -e "$mappath" ] ; then 230 LogIt "Cannot add $mappath: kbd map file not found \n"230 LogIt "Cannot add $mappath: kbd map file not found" 231 231 return 232 232 fi … … 236 236 237 237 mkdir -p $bigdir/etc 238 cp --parents -pRdf $mappath $bigdir || LogIt "AKMF -- Could not copy $mappath to $bigdir\n"238 cp --parents -pRdf $mappath $bigdir 2>> $LOGFILE || LogIt "AKMF -- Could not copy $mappath to $bigdir" 239 239 if [ "`echo $mappath | grep -F ".gz"`" ] ; then 240 240 included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2` … … 268 268 sliceno=0 269 269 scratchfile=$MINDI_TMP/blah.$$.dat 270 cp -f $filename $scratchfile || Die "CUACF -- cannot copy $filename to $scratchfile - did you run out of disk space?"270 cp -f $filename $scratchfile 2>> $LOGFILE || Die "CUACF -- cannot copy $filename to $scratchfile - did you run out of disk space?" 271 271 [ "`head $scratchfile -n1 | grep -F "bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-" 272 272 [ "`echo "$filename" | grep -F "etc/termcap"`" != "" ] && StripComments $scratchfile "-$filename-" 273 273 if [ "`echo "$filename" | grep -F "lib/modules/" | grep "\.*o\.gz"`" != "" ] ; then 274 274 mv $scratchfile $scratchfile.gz 275 gunzip -f $scratchfile || LogIt "Cannot gunzip $scratchfile.gz \n"275 gunzip -f $scratchfile || LogIt "Cannot gunzip $scratchfile.gz" 276 276 filename=`echo "$filename" | tr '.' '#' | sed s/#o#gz/#o/ | sed s/#ko#gz/#ko/ | tr '#' '.'` 277 277 fi … … 282 282 [ -x "$scratchfile" ] && StripExecutable $scratchfile "-$filename-" 283 283 while [ "$sliceno" -le "$noof_slices" ] ; do 284 dd if=$scratchfile skip=$(($sliceno*$slicesize)) of=$outdir/slice-$biggienumber.`printf "%03d" $sliceno` bs=1k count=$slicesize 2> /dev/null284 dd if=$scratchfile skip=$(($sliceno*$slicesize)) of=$outdir/slice-$biggienumber.`printf "%03d" $sliceno` bs=1k count=$slicesize &> /dev/null 285 285 sliceno=$(($sliceno+1)) 286 286 done … … 297 297 if [ $liloc ]; then 298 298 if ! [ `strings $liloc | grep "boot\.b"` ]; then 299 LogIt "boot.b files built into lilo; I'll create a dummy. \n"299 LogIt "boot.b files built into lilo; I'll create a dummy." 300 300 > $copy_to 301 301 return 0 … … 306 306 copy_from=`grep install= /etc/lilo.conf | grep "\.b" | cut -d'=' -f2` 307 307 if [ ! -f "$copy_from" ] ; then 308 LogIt "Nor can I find it from your /etc/lilo.conf file. This is very odd. \n"308 LogIt "Nor can I find it from your /etc/lilo.conf file. This is very odd." 309 309 copy_from=`FindSensibleBootBFile` 310 LogIt "I'm going to use '$copy_from' \n"311 fi 312 fi 313 cp -f $copy_from $copy_to || LogIt "CBBF -- warning -- cannot find your boot.b file. That's it, I quit... (j/k)\n"310 LogIt "I'm going to use '$copy_from'" 311 fi 312 fi 313 cp -f $copy_from $copy_to 2>> $LOGFILE || LogIt "CBBF -- warning -- cannot find your boot.b file. That's it, I quit... (j/k)" 314 314 } 315 315 … … 332 332 cp --parents -Rdf $incoming $outdir 2> /dev/null || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" 333 333 if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] ; then 334 gunzip -f $outdir/$incoming || LogIt "Cannot gunzip $outdir/$incoming \n"334 gunzip -f $outdir/$incoming || LogIt "Cannot gunzip $outdir/$incoming" 335 335 fi 336 336 [ -x "$outdir" ] && StripExecutable $outdir "-$filename-" … … 376 376 done 377 377 echo -e "$DONE" 378 LogIt "$comment has been written. \n"378 LogIt "$comment has been written." 379 379 } 380 380 … … 401 401 while [ "$diskno" -le "$noof_disks" ] ; do 402 402 echo -en "#$diskno..." 403 cp -f $tardir/$diskno.tar.gz $outdir || LogIt "[line 424] Cannot copy $tardir/$diskno.tar.gz to $outdir\n"403 cp -f $tardir/$diskno.tar.gz $outdir 2>> $LOGFILE || LogIt "[line 424] Cannot copy $tardir/$diskno.tar.gz to $outdir" 404 404 CreateOneDataDiskImage $tardir/$diskno.tar.gz $outdir/mindi-data-$diskno.img $diskno $noof_disks 405 405 diskno=$(($diskno+1)) … … 421 421 mountpoint=$MINDI_TMP/mountpoint.$$ 422 422 mkdir -p $mountpoint 423 dd if=/dev/zero of=$imagefile bs=1k count=1440 &> /dev/null || LogIt "Cannot dd (CODI) \n"423 dd if=/dev/zero of=$imagefile bs=1k count=1440 &> /dev/null || LogIt "Cannot dd (CODI)" 424 424 mke2fs -N 12 -F $imagefile > $MINDI_TMP/mke2fs.$$ 2>> $MINDI_TMP/mke2fs.$$ 425 425 [ "$?" -ne "0" ] && cat $MINDI_TMP/mke2fs.$$ … … 432 432 fi 433 433 [ "$diskno" -eq "$noof_disks" ] && echo "This is the last disk ($diskno=$noof_disks)" >> $mountpoint/LAST-DISK 434 umount $mountpoint || LogIt "Cannot umount (CODI) \n"435 rmdir $mountpoint || LogIt "Cannot rmdir (CODI) \n"434 umount $mountpoint || LogIt "Cannot umount (CODI)" 435 rmdir $mountpoint || LogIt "Cannot rmdir (CODI)" 436 436 } 437 437 … … 470 470 local i 471 471 if [ "$1" = "" ] ; then 472 LogIt "F atal error\n"473 else 474 LogIt "F atal error. $1\n"472 LogIt "FATAL ERROR" 473 else 474 LogIt "FATAL ERROR. $1" 475 475 fi 476 476 477 477 # Creates a tar file containing all required files 478 478 for i in /etc/fstab /etc/lilo.conf /etc/raidtab $LOGFILE /var/log/mondo-archive.log ; do 479 [ -e "$i" ] && cp -f $i $MINDI_TMP 479 [ -e "$i" ] && cp -f $i $MINDI_TMP 2>> $LOGFILE 480 480 done 481 481 rm -f $TMPDIR/mindi.err.*.tgz 482 482 tar -cf - $MINDI_TMP | gzip -9 > $TMPDIR/mindi.err.$$.tgz 483 LogIt "Please e-mail a copy of $TMPDIR/mindi.err.$$.tgz to the mailing list. \n"484 LogIt "See http://www.mondorescue.org for more information. \n"483 LogIt "Please e-mail a copy of $TMPDIR/mindi.err.$$.tgz to the mailing list." 484 LogIt "See http://www.mondorescue.org for more information." 485 485 LogIt "WE CANNOT HELP unless you enclose that file.\n" 486 486 MindiExit -1 … … 524 524 FindAndAddUserKeyboardMappingFile() { 525 525 local r res mapfile mappath included_item included_list keyfile mp locale 526 LogIt "Analyzing your keyboard's configuration. \n"526 LogIt "Analyzing your keyboard's configuration." 527 527 KEYDIR=/lib/kbd 528 528 [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share/kbd # Slackware … … 530 530 [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share 531 531 if [ ! -e "$KEYDIR" ] ; then 532 LogIt "Keyboard mapping directory not found. I shall use default map at boot-time. \n"532 LogIt "Keyboard mapping directory not found. I shall use default map at boot-time." 533 533 return 0 534 534 fi … … 549 549 KBDEPTH=0 550 550 mkdir -p $bigdir/etc/console 551 cp /etc/console/boottime.kmap.gz $bigdir/etc/console 551 cp /etc/console/boottime.kmap.gz $bigdir/etc/console 2>> $LOGFILE 552 552 echo -e "$DONE" 553 553 return 0 … … 556 556 keyfile=`find /etc -name rc.config | head -n1` 557 557 if [ "$keyfile" = "" ] || [ ! -e "$keyfile" ] ; then 558 LogIt "Unknown config detected. Default keyboard map will be used. \n"558 LogIt "Unknown config detected. Default keyboard map will be used." 559 559 return 560 560 else … … 563 563 fi 564 564 if [ ! -e "$KEYDIR/keymaps" ] ; then 565 LogIt "Keyboard mapping directory not found. Default keyboard map will be used. \n"565 LogIt "Keyboard mapping directory not found. Default keyboard map will be used." 566 566 return 567 567 fi … … 587 587 echo "mappath = $mappath" >> $LOGFILE 588 588 if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then 589 LogIt "Keyboard mapping file not found. Default keyboard map will be used. \n"589 LogIt "Keyboard mapping file not found. Default keyboard map will be used." 590 590 return 591 591 fi … … 625 625 if which lilo.real > /dev/null 2> /dev/null ; then 626 626 LILO_EXE=lilo.real 627 LogIt "lilo.real found; will be used instead of lilo (*grumble* *mutter*) \n"627 LogIt "lilo.real found; will be used instead of lilo (*grumble* *mutter*)" 628 628 else 629 629 LILO_EXE=lilo … … 679 679 fi 680 680 if [ ! -e "$1" ] ; then 681 LogIt "W arning - cannot search specific path '$1'\n"681 LogIt "WARNING - cannot search specific path '$1'" 682 682 return 1 683 683 fi … … 714 714 filelist=`GenerateListForFile "$incoming"` 715 715 r=$? 716 [ "$r" -ne "0" ] && LogIt "$incoming not found \n"716 [ "$r" -ne "0" ] && LogIt "$incoming not found" 717 717 res=$(($res+$r)) 718 718 # echo "'$incoming' generates filelist '$filelist'" >> $LOGFILE … … 821 821 mkdir -p $bigdir/bin 822 822 if [ -e "$MINDI_TMP/post-nuke.tgz" ] ; then 823 LogIt "\nIncorporating post-nuke tarball \n"823 LogIt "\nIncorporating post-nuke tarball" 824 824 old_pwd=`pwd` 825 825 cd $bigdir 826 tar -zxf $MINDI_TMP/post-nuke.tgz || LogIt "Error occurred when untarring post-nuke tarball \n"826 tar -zxf $MINDI_TMP/post-nuke.tgz || LogIt "Error occurred when untarring post-nuke tarball" 827 827 cd $old_pwd 828 828 fi 829 if cp -f $MINDI_TMP/mondo*restore $bigdir/usr/bin ; then829 if cp -f $MINDI_TMP/mondo*restore $bigdir/usr/bin 2>> $LOGFILE ; then 830 830 LocateDeps $bigdir/usr/bin/mondo*restore >> $outfile.pre 831 831 else 832 LogIt "Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP \n"833 LogIt "I bet you've got a spare copy of Mondo or Mindi floating around on your system. \n"832 LogIt "Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP" 833 LogIt "I bet you've got a spare copy of Mondo or Mindi floating around on your system." 834 834 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." 835 835 Die "Odd." 836 836 fi 837 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2> /dev/null || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW. \n"837 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2> /dev/null || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW." 838 838 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 839 LogIt "Incorporating NFS-related settings \n"839 LogIt "Incorporating NFS-related settings" 840 840 for r in NFS-* ISO-PREFIX ; do 841 cp -f $MINDI_TMP/$r $bigdir/tmp || Die "Cannot copy $r - did you run out of disk space?"841 cp -f $MINDI_TMP/$r $bigdir/tmp 2>> $LOGFILE || Die "Cannot copy $r - did you run out of disk space?" 842 842 echo "Copying $r to ramdisk" >> $LOGFILE 843 843 done … … 972 972 for fname in $incoming ; do 973 973 if [ ! -e "$fname" ] ; then 974 echo "W arning- $fname does not exist; cannot be LDD'd." >> $LOGFILE974 echo "WARNING - $fname does not exist; cannot be LDD'd." >> $LOGFILE 975 975 if echo $fname | grep lvm &> /dev/null ; then 976 976 echo "This warning only affects you if you are using LVM." >> $LOGFILE … … 1188 1188 echo -en "\rAnalyzing LVM...\r" 1189 1189 all_partitions=`$MINDI_LIB/analyze-my-lvm | grep -F ">>>" | cut -d' ' -f2-32` 1190 if [ $? -eq -1 ]; then 1191 LVM="false" 1192 fi 1190 1193 fi 1191 1194 all_partitions="$all_partitions `ListAllPartitions 2> /dev/null`" … … 1236 1239 # For LVM FS it will give a /dev/dm-# which should then be converted 1237 1240 if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then 1238 major=`/bin/ls -l $actual_dev | awk'{print $5}'`1239 minor=`/bin/ls -l $actual_dev | awk'{print $6}'`1241 major=`/bin/ls -l $actual_dev | $AWK '{print $5}'` 1242 minor=`/bin/ls -l $actual_dev | $AWK '{print $6}'` 1240 1243 for dev in `ls /dev/mapper/*`; do 1241 major1=`/bin/ls -l $dev | awk'{print $5}'`1242 minor1=`/bin/ls -l $dev | awk'{print $6}'`1244 major1=`/bin/ls -l $dev | $AWK '{print $5}'` 1245 minor1=`/bin/ls -l $dev | $AWK '{print $6}'` 1243 1246 if [ $major1 = $major ] && [ $minor1 = $minor ]; then 1244 actual_dev=`/bin/ls -l $dev | awk'{print $10}'`1247 actual_dev=`/bin/ls -l $dev | $AWK '{print $10}'` 1245 1248 break 1246 1249 fi … … 1258 1261 # SWAP only 1259 1262 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then 1260 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | /bin/awk'{ print $1 }' `1263 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | $AWK '{ print $1 }' ` 1261 1264 for dev_swap in $list_swaps ; do 1262 1265 dev_exists=`/sbin/vol_id $dev_swap | /bin/grep "$redhat_label"` … … 1276 1279 do 1277 1280 # Location of the swap label for kernel 2.6 1278 try_dev_label=`dd bs=1 count=16 skip=1052 if=$try_dev 2> /dev/null`1281 try_dev_label=`dd bs=1 count=16 skip=1052 if=$try_dev &> /dev/null` 1279 1282 if [ "x$try_dev_label" = "x$redhat_label" ]; then 1280 1283 actual_dev=$try_dev … … 1301 1304 # For LVM FS it will give a /dev/dm-# which should then be converted 1302 1305 if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then 1303 major=`/bin/ls -l $actual_dev | awk'{print $5}'`1304 minor=`/bin/ls -l $actual_dev | awk'{print $6}'`1306 major=`/bin/ls -l $actual_dev | $AWK '{print $5}'` 1307 minor=`/bin/ls -l $actual_dev | $AWK '{print $6}'` 1305 1308 for dev in `ls /dev/mapper/*`; do 1306 major1=`/bin/ls -l $dev | awk'{print $5}'`1307 minor1=`/bin/ls -l $dev | awk'{print $6}'`1309 major1=`/bin/ls -l $dev | $AWK '{print $5}'` 1310 minor1=`/bin/ls -l $dev | $AWK '{print $6}'` 1308 1311 if [ $major1 = $major ] && [ $minor1 = $minor ]; then 1309 actual_dev=`/bin/ls -l $dev | awk'{print $10}'`1312 actual_dev=`/bin/ls -l $dev | $AWK '{print $10}'` 1310 1313 break 1311 1314 fi … … 1316 1319 # 3th try, with vol_id 1317 1320 if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then 1318 list_dev=`mount | /bin/grep -E '^/' | /bin/awk'{ print $1 }' `1321 list_dev=`mount | /bin/grep -E '^/' | $AWK '{ print $1 }' ` 1319 1322 for dev in $list_dev ; do 1320 1323 dev_exists=`/sbin/vol_id $dev | /bin/grep "$uuid"` … … 1330 1333 current_partition=$actual_dev 1331 1334 else 1332 Die "Your system uses a UUID partition ($current_partition), but you lack the tool to support it.\nPlease replace labels with their correct devices in /etc/fstab or install findfs|blkid|vol_id \n"1335 Die "Your system uses a UUID partition ($current_partition), but you lack the tool to support it.\nPlease replace labels with their correct devices in /etc/fstab or install findfs|blkid|vol_id" 1333 1336 fi 1334 1337 else … … 1428 1431 partition_format="compaq" 1429 1432 elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then 1430 LogIt "Unable to find mountpoint of $current_partition - ignoring \n"1433 LogIt "Unable to find mountpoint of $current_partition - ignoring" 1431 1434 continue 1432 1435 fi 1433 1436 fi 1434 1437 partition_format="`echo "$partition_format" | cut -d',' -f1`"; # in case user has ext3,ext2 or something dumb like that 1435 [ "$partition_format" = "auto" ] && partition_format="`mount | grep -w $current_partition | awk'{print$5;}'`"; # in case user uses 'auto' (dumb!)1438 [ "$partition_format" = "auto" ] && partition_format="`mount | grep -w $current_partition | $AWK '{print$5;}'`"; # in case user uses 'auto' (dumb!) 1436 1439 unofficial_outstring=`printf "\t%-15s %-15s %-15s %7s\n" $current_partition $partition_mountpt $partition_format $psz` 1437 1440 if [ "$current_partition" = "" ] ; then … … 1518 1521 old_pwd=`pwd` 1519 1522 cd $minidir_root/$old_diskno 1520 cp --parents -Rdf $filename $minidir_root/$d/ || Die "Can't move $filename (sensibly) from $old_diskno to $d"1523 cp --parents -Rdf $filename $minidir_root/$d/ 2>> $LOGFILE || Die "Can't move $filename (sensibly) from $old_diskno to $d" 1521 1524 rm -f $filename 1522 1525 cd $old_pwd … … 1569 1572 fi 1570 1573 if [ ! "$MINDI_TMP" ] ; then 1571 LogIt "NB: Mindi's bootable CD always uses isolinux. \n"1572 LogIt "For a bootable CD w/LILO, please use Mondo. \n"1574 LogIt "NB: Mindi's bootable CD always uses isolinux." 1575 LogIt "For a bootable CD w/LILO, please use Mondo." 1573 1576 fi 1574 1577 rm -Rf $MINDI_TMP/iso 1575 1578 mkdir -p $MINDI_TMP/iso/{images,archives,isolinux} 1576 cp -f $1/*.img $1/*.gz $MINDI_TMP/iso/images || LogIt "OfferToMakeBootableISO: Cannot copy $i to $MINDI_TMP/iso/images\n"1579 cp -f $1/*.img $1/*.gz $MINDI_TMP/iso/images 2>> $LOGFILE || LogIt "OfferToMakeBootableISO: Cannot copy $i to $MINDI_TMP/iso/images" 1577 1580 old_pwd=`pwd` 1578 1581 cd $MINDI_TMP/iso … … 1583 1586 k=$MINDI_TMP/iso/isolinux 1584 1587 if [ -e "$j" ] ; then 1585 LogIt "Copying $j to $k \n"1588 LogIt "Copying $j to $k" 1586 1589 cp -f $j $k 2> /dev/null || Die "Failed to copy $j to $k" 1587 1590 cp -f $j $MINDI_TMP 2> /dev/null || Die "Failed to copy $j to $MINDI_TMP" … … 1591 1594 MakeSyslinuxMessageFile $MINDI_TMP/iso/isolinux/message.txt 1592 1595 cp $kernelpath $MINDI_TMP/iso/isolinux/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/isolinux/vmlinuz). Did you run out of disk space?" 1593 cp $MINDI_TMP/mindi.rdz $MINDI_TMP/iso/isolinux/initrd.img 1594 cp $MINDI_TMP/mindi.rdz $CACHE_LOC/initrd.img 1596 cp $MINDI_TMP/mindi.rdz $MINDI_TMP/iso/isolinux/initrd.img 2>> $LOGFILE 1597 cp $MINDI_TMP/mindi.rdz $CACHE_LOC/initrd.img 2>> $LOGFILE 1595 1598 [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur" 1596 1599 cd $MINDI_TMP/iso/isolinux … … 1602 1605 if [ "$ARCH" != "ia64" ] ; then 1603 1606 cp $ISOLINUX isolinux.bin 2> /dev/null || Die "Cannot copy isolinux.bin ($ISOLINUX) to tmp_root - did you run out of disk space?" 1604 cp $ISOLINUX ../ 1607 cp $ISOLINUX ../ 2>> $LOGFILE 1605 1608 fi 1606 1609 cd $MINDI_TMP/iso … … 1608 1611 cp -f $MINDI_TMP/iso/isolinux/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2> /dev/null || Die "Cannot copy core files to ramdisk for boot disk. Did you run out of disk space?" 1609 1612 fi 1610 [ "$MONDO_SHARE" ] && cp -f $MONDO_SHARE/autorun . 1613 [ "$MONDO_SHARE" ] && cp -f $MONDO_SHARE/autorun . 2>> $LOGFILE 1611 1614 if [ "$ARCH" != "ia64" ] ; then 1612 1615 mkisofs -U -J -r -o $CACHE_LOC/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log … … 1619 1622 echo "mkisofs returned the following errors:-" 1620 1623 cat $MINDI_TMP/mkisofs.log 1621 LogIt "Failed to create ISO image. \n"1624 LogIt "Failed to create ISO image." 1622 1625 else 1623 1626 echo "Created bootable ISO image at $CACHE_LOC/mindi.iso" >> $LOGFILE … … 1674 1677 image=$MINDI_TMP/$rand1.$rand2.img 1675 1678 mtpt=$MINDI_TMP/$rand1.$rand2.mtpt 1676 dd if=/dev/zero of=$image bs=1k count=$disksize 1679 dd if=/dev/zero of=$image bs=1k count=$disksize &> /dev/null 1677 1680 mke2fs -N 26 -F $image > /dev/null 1678 1681 mkdir -p $mtpt … … 1680 1683 cd $mtpt 1681 1684 mkdir -p {dev,tmp,boot} 1682 cp -f $1 vmlinuz 1685 cp -f $1 vmlinuz 2>> $LOGFILE 1683 1686 if [ "$?" -ne "0" ] ; then 1684 LogIt "Failed to copy $1 to ramdisk \n"1687 LogIt "Failed to copy $1 to ramdisk" 1685 1688 cd $old_pwd 1686 1689 umount $mtpt … … 1694 1697 rdev -r vmlinuz 49152 1695 1698 1696 tar -zxf $MINDI_LIB/dev.tgz || LogIt "Cannot untar dev.tgz \n"1699 tar -zxf $MINDI_LIB/dev.tgz || LogIt "Cannot untar dev.tgz" 1697 1700 losetup /dev/loop0 > /dev/null 2> /dev/null 1698 [ "$?" -eq "0" ] || losetup /dev/loop0 -d || Die "Please free up /dev/loop0 by typing 'losetup /dev/loop0 -d'.\nReboot if necessary. \n"1701 [ "$?" -eq "0" ] || losetup /dev/loop0 -d || Die "Please free up /dev/loop0 by typing 'losetup /dev/loop0 -d'.\nReboot if necessary." 1699 1702 CopyBootBFile $mtpt/boot.b 1700 1703 … … 1820 1823 [ "$?" -ne "0" ] && cat $MINDI_TMP/mke2fs.log 1821 1824 rm -f $MINDI_TMP/mke2fs.log 1822 mount -t $t -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI) \n\n"1825 mount -t $t -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)" 1823 1826 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it 1824 1827 mkdir -p $mountpoint/etc … … 1831 1834 cd $mountpoint 1832 1835 if [ "$ARCH" != "ia64" ] ; then 1833 tar -zxf $MINDI_LIB/dev.tgz || LogIt "Cannot untar dev.tgz \n"1836 tar -zxf $MINDI_LIB/dev.tgz || LogIt "Cannot untar dev.tgz" 1834 1837 fi 1835 1838 cd $old_pwd 1836 1839 losetup /dev/loop0 > /dev/null 2> /dev/null 1837 [ "$?" -eq "0" ] || losetup /dev/loop0 -d || Die "Please free up /dev/loop0 by typing 'losetup /dev/loop0 -d'.\nReboot if necessary. \n"1840 [ "$?" -eq "0" ] || losetup /dev/loop0 -d || Die "Please free up /dev/loop0 by typing 'losetup /dev/loop0 -d'.\nReboot if necessary." 1838 1841 CopyBootBFile $mountpoint/boot.b 1839 1842 … … 1843 1846 cp -f $MINDI_TMP/mindi.rdz $mountpoint 2>> $LOGFILE 1844 1847 if [ "$?" -ne "0" ] ; then 1845 LogIt "Failed to copy $MINDI_TMP/mindi.rdz to $mountpoint \n"1848 LogIt "Failed to copy $MINDI_TMP/mindi.rdz to $mountpoint" 1846 1849 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1847 LogIt "Please unload some of your modules and try again. \n"1850 LogIt "Please unload some of your modules and try again." 1848 1851 rm -f $MINDI_TMP/mtpt.$$ 1849 LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?) \n"1852 LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?)" 1850 1853 retval=$(($retval+1)) 1851 1854 fi … … 1874 1877 cd $old_pwd 1875 1878 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1876 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI) \n"1879 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)" 1877 1880 # losetup /dev/loop0 -d 1878 1881 res=0 1879 1882 write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 1440 1880 1883 res=$(($res+$?)) 1881 cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img 1884 cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img 2>> $LOGFILE 1882 1885 res=$(($res+$?)) 1883 1886 rm -f $imagefile 1884 1887 if [ "$res" -ne "0" ]; then 1885 LogIt "W arning - failed to create 1.44MB boot/root floppies\n"1888 LogIt "WARNING - failed to create 1.44MB boot/root floppies" 1886 1889 rm -f $imagesdir/mindi-*.1440.img 1887 1890 fi … … 1894 1897 # make it bootable 1895 1898 rm -f $mountpoint/zero 1896 [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint 1899 [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint 2>> $LOGFILE 1897 1900 if [ "$disksize" -gt "2880" ] && [ ! "$KERN_DISK_MADE" ] ; then 1898 1901 if [ "$ARCH" != "ia64" ] ; then … … 1911 1914 if [ $? -ne "0" ] ; then 1912 1915 if [ "`grep -F "/tmp/dev.0" $LOGFILE`" ] ; then 1913 LogIt "The '/tmp/dev.0' error is NOT Mindi's fault. It is LILO's. \n"1914 LogIt "Please reboot your PC as a workaround. \n"1915 Die "LILO sneezed and Mindi caught a cold. Please read the README / FAQ. \n"1916 LogIt "The '/tmp/dev.0' error is NOT Mindi's fault. It is LILO's." 1917 LogIt "Please reboot your PC as a workaround." 1918 Die "LILO sneezed and Mindi caught a cold. Please read the README / FAQ." 1916 1919 fi 1917 1920 echo "$LILO_EXE -r $mountpoint ...failed." 1918 1921 echo -en "Press ENTER to continue."; read line 1919 LogIt "Cannot run lilo on $mountpoint\nPlease upgrade/downgrade your version of LILO. It has a bug. \n"1922 LogIt "Cannot run lilo on $mountpoint\nPlease upgrade/downgrade your version of LILO. It has a bug." 1920 1923 retval=$(($retval+1)) 1921 1924 fi 1922 cp -f $liloconf $MINDI_TMP/lilo.conf 1925 cp -f $liloconf $MINDI_TMP/lilo.conf 2>> $LOGFILE 1923 1926 if [ "$ARCH" = "ia64" ] ; then 1924 cp `dirname $kernelpath`/*.efi $mountpoint 1927 cp `dirname $kernelpath`/*.efi $mountpoint 2>> $LOGFILE 1925 1928 fi 1926 1929 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1927 1930 echo -en "..." 1928 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI) \n"1931 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)" 1929 1932 if [ "$retval" -eq "0" ] ; then 1930 1933 echo -en "...$DONE\r" … … 1937 1940 rm -f $imagefile 1938 1941 fi 1939 [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero \n"1942 [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero" 1940 1943 return $retval 1941 1944 } … … 1970 1973 else 1971 1974 dd if=/dev/zero of=$imagefile bs=1k count=$disksize &> /dev/null || Die "Cannot dd blank file" 1972 mkfs.vfat $imagefile 1973 syslinux $imagefile 1974 fi 1975 mount -t vfat -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI) \n\n"1975 mkfs.vfat $imagefile 2>> $LOGFILE 1976 syslinux $imagefile 2>> $LOGFILE 1977 fi 1978 mount -t vfat -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)" 1976 1979 1977 1980 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it … … 1989 1992 cp -f $MINDI_TMP/mindi.rdz $mountpoint/initrd.img 2>> $LOGFILE 1990 1993 if [ "$?" -ne "0" ] ; then 1991 LogIt "Failed to copy $MINDI_TMP/mindi.rdz to $mountpoint \n"1994 LogIt "Failed to copy $MINDI_TMP/mindi.rdz to $mountpoint" 1992 1995 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1993 LogIt "Please unload some of your modules and try again. \n"1996 LogIt "Please unload some of your modules and try again." 1994 1997 rm -f $MINDI_TMP/mtpt.$$ 1995 LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?) \n"1998 LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?)" 1996 1999 retval=$(($retval+1)) 1997 2000 fi … … 2014 2017 cd $old_pwd 2015 2018 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 2016 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI) \n"2019 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)" 2017 2020 2018 2021 res=0 2019 2022 write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 1440 2020 2023 res=$(($res+$?)) 2021 cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img 2024 cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img 2>> $LOGFILE 2022 2025 res=$(($res+$?)) 2023 2026 rm -f $imagefile 2024 2027 if [ "$res" -ne "0" ]; then 2025 LogIt "W arning - failed to create 1.44MB boot/root floppies\n"2028 LogIt "WARNING - failed to create 1.44MB boot/root floppies" 2026 2029 rm -f $imagesdir/mindi-*.1440.img 2027 2030 fi … … 2036 2039 rm -f $mountpoint/zero 2037 2040 mkdir -p $mountpoint/etc 2038 [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint 2041 [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint 2>> $LOGFILE 2039 2042 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 2040 2043 echo -en "..." 2041 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI) \n"2044 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)" 2042 2045 2043 2046 if [ "$retval" -eq "0" ] ; then … … 2052 2055 rm -f $imagefile 2053 2056 fi 2054 [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero \n"2057 [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero" 2055 2058 return $retval 2056 2059 } … … 2076 2079 cd $MINDI_TMP 2077 2080 for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do 2078 cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir"2081 cp --parents -pRdf ./$i $bigdir 2>> $LOGFILE || Die "PDDI can't cp $i->$bigdir" 2079 2082 if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then 2080 cp --parents -pRdf $i $bigdir 2083 cp --parents -pRdf $i $bigdir 2>> $LOGFILE 2081 2084 else 2082 2085 ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO … … 2086 2089 for i in $EXTRA_MODS ; do 2087 2090 j=`find lib/modules/$FAILSAFE_KVER -name $i.*o 2> /dev/null` 2088 [ ! "$j" ] && echo "W arning- cannot find failsafe module $i.o" >> $LOGFILE2091 [ ! "$j" ] && echo "WARNING - cannot find failsafe module $i.o" >> $LOGFILE 2089 2092 for k in $j ; do 2090 2093 if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then 2091 cp --parents -pRdf $k $bigdir 2094 cp --parents -pRdf $k $bigdir 2>> $LOGFILE 2092 2095 else 2093 2096 ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO … … 2118 2121 for i in `mount | cut -d' ' -f3` ; do 2119 2122 for j in io.sys msdos.sys ; do 2120 [ -e "$i/$j" ] && cp -f $i/$j $bigdir 2123 [ -e "$i/$j" ] && cp -f $i/$j $bigdir 2>> $LOGFILE 2121 2124 done 2122 2125 done … … 2125 2128 i=`cat $MINDI_TMP/BOOTLOADER.DEVICE 2> /dev/null` 2126 2129 if [ "$i" ] ; then 2127 LogIt "Backing up $i's MBR \n"2130 LogIt "Backing up $i's MBR" 2128 2131 dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE 2129 2132 sleep 1 … … 2131 2134 j=$i 2132 2135 [ -h "$j" ] && j=`readlink -f $j` 2133 LogIt "Creating /dev/boot_device ($j) \n"2136 LogIt "Creating /dev/boot_device ($j)" 2134 2137 mkdir -p $bigdir/dev 2135 2138 cp -pRdf $j $bigdir/dev/boot_device 2> /dev/null || Die "Unable to create /dev/boot_device on ramdisk" … … 2140 2143 2141 2144 [ -e "$MINDI_LIB/aux-tools" ] || Die "aux-tools not found in Mindi's home dir. Do you have multiple copies of Mindi lying around? Please delete them. No, don't e-mail me and ask how. ;) Use 'rm'." 2142 cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "W arning - error occurred while unzipping aux-tools\n"2145 cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "WARNING - error occurred while unzipping aux-tools" 2143 2146 if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then 2144 tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "W arning - error occurred while unzipping x11-tools.tgz\n"2147 tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "WARNING - error occurred while unzipping x11-tools.tgz" 2145 2148 fi 2146 2149 if [ -e "$MONDO_SHARE/restore-scripts" ] ; then … … 2148 2151 [ "$?" -ne "0" ] && [ "`DidMondoCallMe`" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts" 2149 2152 fi 2150 [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state . 2153 [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state . 2>> $LOGFILE 2151 2154 cd $old_pwd 2152 2155 echo -e "$DONE" … … 2163 2166 mkdir -p $minidir_root/$noof_disks/tmp 2164 2167 cp -f $MINDI_TMP/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt 2> /dev/null || Die "Cannot copy mountlist.txt from $MINDI_TMP to data disk" 2165 [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MINDI_TMP/. 2168 [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MINDI_TMP/. 2>> $LOGFILE 2166 2169 [ $LVM != "false" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm 2167 2170 cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE … … 2242 2245 return 1 2243 2246 fi 2244 lines_total=`wc -l $orig_file | gawk'{print $1;}'`2247 lines_total=`wc -l $orig_file | $AWK '{print $1;}'` 2245 2248 lines_remaining=$(($lines_total-$lino)) 2246 2249 head -n$(($lino-1)) $orig_file > $new_file … … 2311 2314 2312 2315 tempfile=$MINDI_TMP/$$.strip.txt 2313 cp -f $1 $tempfile 2316 cp -f $1 $tempfile 2>> $LOGFILE 2314 2317 $AWK '{if (substr($0,0,1)!="#" || substr($0,0,3)=="#!/") {print $0;};}' $tempfile > $1 2315 2318 rm -f $tempfile … … 2343 2346 tmpfile=$MINDI_TMP/stripped.$$.dat 2344 2347 [ -d "$1" ] || [ -h "$1" ] && return 2345 cp -f $1 $tmpfile 2348 cp -f $1 $tmpfile 2>> $LOGFILE 2346 2349 strip $tmpfile 2> /dev/null 2347 2350 if [ "$?" -eq "0" ] ; then 2348 cp -f $tmpfile $1 2351 cp -f $tmpfile $1 2>> $LOGFILE 2349 2352 echo "Stripped binary $2" >> $LOGFILE 2350 2353 fi … … 2403 2406 # Used by ia64 2404 2407 if [ "`gzip -cd $fname | strings 2> /dev/null | grep -F "$kdate"`" = "" ] ; then 2405 LogIt "Have you recompiled your kernel \"$fname\" w/o rebooting? Naughty but I'll allow it... \n"2408 LogIt "Have you recompiled your kernel \"$fname\" w/o rebooting? Naughty but I'll allow it..." 2406 2409 duff_kernels="$fname $duff_kernels" 2407 2410 else … … 2411 2414 else 2412 2415 if [ "`strings $fname 2> /dev/null | grep -F "$kdate"`" = "" ] ; then 2413 LogIt "Have you recompiled your kernel \"$fname\" w/o rebooting?\n Naughty but I'll allow it... \n"2416 LogIt "Have you recompiled your kernel \"$fname\" w/o rebooting?\n Naughty but I'll allow it..." 2414 2417 duff_kernels="$fname $duff_kernels" 2415 2418 else … … 2423 2426 fi 2424 2427 if [ ! "$possible_kernels" ] ; then 2425 LogIt "No kernel matches exactly. Are there any duff kernels? \n"2428 LogIt "No kernel matches exactly. Are there any duff kernels?" 2426 2429 possible_kernels="$duff_kernels" 2427 2430 if [ ! "$possible_kernels" ] ; then 2428 LogIt "Sorry, no duff kernels either \n"2431 LogIt "Sorry, no duff kernels either" 2429 2432 else 2430 LogIt "I bet you're running Debian or Gentoo, aren't you? \n"2431 LogIt "Your kernel doesn't have a sane builddate. Oh well... \n"2433 LogIt "I bet you're running Debian or Gentoo, aren't you?" 2434 LogIt "Your kernel doesn't have a sane builddate. Oh well..." 2432 2435 fi 2433 2436 fi … … 2435 2438 noof_kernels=`CountItemsIn "$possible_kernels"` 2436 2439 if [ "$noof_kernels" -eq "0" ] ; then 2437 LogIt "Could not find your kernel. \n"2440 LogIt "Could not find your kernel." 2438 2441 if [ -e "/boot/vmlinuz" ] ; then 2439 LogIt "Using /boot/vmlinuz as a last resort. \n"2442 LogIt "Using /boot/vmlinuz as a last resort." 2440 2443 output=/boot/vmlinuz 2441 2444 else … … 2450 2453 if echo $i | grep "`uname -r`" ; then 2451 2454 LogIt "OK, I used my initiative and found that " 2452 LogIt "$i is probably your kernel. \n"2455 LogIt "$i is probably your kernel. " 2453 2456 output="$i" 2454 2457 return … … 2459 2462 echo "Schlomo, this one's for you." >> $LOGFILE 2460 2463 else 2461 LogIt "Two or more possible kernels found. You may specify any one of them and the \n"2462 LogIt "boot disks will still work, probably. If one does not work, try another. \n"2463 LogIt "$possible_kernels \n"2464 LogIt "Two or more possible kernels found. You may specify any one of them and the " 2465 LogIt "boot disks will still work, probably. If one does not work, try another." 2466 LogIt "$possible_kernels" 2464 2467 echo "" 2465 2468 fi … … 2491 2494 if [ -e "dev" ] ; then 2492 2495 echo "Copying dev/* to $minidir_root/$noof_disks" >> $LOGFILE 2493 cp --parents -pRdf dev $minidir_root/$noof_disks 2496 cp --parents -pRdf dev $minidir_root/$noof_disks 2>> $LOGFILE 2494 2497 fi 2495 2498 TemporarilyCompressAllFiles "$list_of_files" $minidir_root … … 2502 2505 fi 2503 2506 if [ "$i" -eq "0" ] ; then 2504 LogIt "Cannot add file $filename to minidir $minidir_root \n"2507 LogIt "Cannot add file $filename to minidir $minidir_root" 2505 2508 retval=$(($retval+1)) 2506 2509 fi … … 2555 2558 s=`which $w 2> /dev/null` 2556 2559 if [ -e "$s" ] ; then 2557 cp --parents -af $s . 2560 cp --parents -af $s . 2>> $LOGFILE 2558 2561 fi 2559 2562 done … … 2608 2611 list_of_groovy_mods="$list_of_groovy_mods $NET_MODS" 2609 2612 fi 2610 [ -e "$floppy_modules_path" ] || LogIt "path $floppy_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS. \n"2613 [ -e "$floppy_modules_path" ] || LogIt "path $floppy_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS." 2611 2614 for i in $list_of_groovy_mods ; do 2612 2615 floppy_modules="$floppy_modules `FindSpecificModuleInPath $floppy_modules_path $i`" … … 2616 2619 [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i 2617 2620 echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE 2618 cp -df $i $mountpoint/ 2>/dev/null || LogIt "Unable to copy $i to $mountpoint \n"2621 cp -df $i $mountpoint/ 2>/dev/null || LogIt "Unable to copy $i to $mountpoint" 2619 2622 [ "`echo "$i" | grep -F ".gz"`" ] && gunzip -f $mountpoint/`basename $i` 2620 2623 done … … 2678 2681 diskno=1 2679 2682 while [ "$diskno" -le "$noof_disks" ] ; do 2680 cd $minidir_root/$diskno || LogIt "W arning - cannot cd to $minidir_root/$diskno\n"2683 cd $minidir_root/$diskno || LogIt "WARNING - cannot cd to $minidir_root/$diskno" 2681 2684 tar -cf - . 2>> $LOGFILE | gzip -9 > $tardir/$diskno.tar.gz || Die "Can't tar/gzip disk#$diskno; please tell Dev Team -exactly- what the errors where." 2682 2685 diskno=$(($diskno+1)) 2683 2686 echo -n "..." 2684 cp -pRdf * $minidir_root/all 2687 cp -pRdf * $minidir_root/all 2>> $LOGFILE 2685 2688 done 2686 2689 mkdir -p $minidir_root/all/tmp … … 2690 2693 for q in filelist.full.gz biggielist.txt ; do 2691 2694 [ ! -e "$MINDI_TMP/$q" ] && Die "Cannot find $MINDI_TMP/$q" 2692 cp -pRdf $MINDI_TMP/$q tmp/ 2695 cp -pRdf $MINDI_TMP/$q tmp/ 2>> $LOGFILE 2693 2696 done 2694 2697 mkdir -p $minidir_root/all/tmp … … 2718 2721 2719 2722 if [ -e "/etc/conf.modules" ] && [ ! -e "/etc/modules.conf" ] ; then 2720 LogIt "W arning - Ancient distro detected.\n" 12723 LogIt "WARNING - Ancient distro detected." 1 2721 2724 ln -sf /etc/conf.modules /etc/modules.conf 2722 2725 fi … … 2824 2827 ### 2825 2828 kernelname=`echo $kernelpath | cut -d'-' -f2-` 2826 LogIt "kernelname = $kernelname \n"2827 LogIt "kernelpath = $kernelpath \n"2829 LogIt "kernelname = $kernelname" 2830 LogIt "kernelpath = $kernelpath" 2828 2831 if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ] 2829 2832 then 2830 LogIt "Module path for ${kernelpath} not found... \n"2831 LogIt "using running kernel\'s modules. \n"2833 LogIt "Module path for ${kernelpath} not found..." 2834 LogIt "using running kernel\'s modules." 2832 2835 kernelname=`uname -r` 2833 2836 else 2834 LogIt "Using modules for kernel: ${kernelname} \n"2837 LogIt "Using modules for kernel: ${kernelname}" 2835 2838 fi 2836 2839 ### … … 2862 2865 [ "$USE_COMP" = "" ] && USE_COMP=yes 2863 2866 [ "$NOT_BOOT" = "" ] && NOT_BOOT=no 2864 [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine. \n"2867 [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine." 2865 2868 [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath` 2866 2869 kernelname=`echo $kernelpath | cut -d'-' -f2-` 2867 2870 if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ] 2868 2871 then 2869 LogIt "Module path for ${kernelpath} not found... \n"2870 LogIt "using running kernel\'s modules. \n"2872 LogIt "Module path for ${kernelpath} not found..." 2873 LogIt "using running kernel\'s modules." 2871 2874 kernelname=`uname -r` 2872 2875 else 2873 LogIt "Using modules for kernel: ${kernelname} \n"2876 LogIt "Using modules for kernel: ${kernelname}" 2874 2877 fi 2875 2878 [ "$CDRECOVERY" = "yes" ] && [ "$TAPEDEV" != "" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time" … … 2897 2900 [ -e "$iso_cfg_file" ] || Die "Cannot find $iso_cfg_file" 2898 2901 if [ ! "`DidMondoCallMe`" ] ; then 2899 LogIt "Mindi Linux mini-distro generator v$MINDI_VERSION \n"2900 LogIt "Latest Mindi is available from http://www.mondorescue.org \n"2901 LogIt "BusyBox sources are available from http://www.busybox.net \n"2902 LogIt "Mindi Linux mini-distro generator v$MINDI_VERSION" 2903 LogIt "Latest Mindi is available from http://www.mondorescue.org" 2904 LogIt "BusyBox sources are available from http://www.busybox.net" 2902 2905 LogIt "------------------------------------------------------------------------------" 2903 2906 else … … 2917 2920 echo "NOT_BOOT = '$NOT_BOOT'" >> $LOGFILE 2918 2921 if [ "$NOT_BOOT" != "" ] && [ "$NOT_BOOT" != "0" ] && [ "$NOT_BOOT" != "no" ] ; then 2919 LogIt "Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else. \n"2922 LogIt "Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else." 2920 2923 MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg 2921 2924 MakeMountlist $MINDI_TMP/mountlist.txt … … 2925 2928 tar -cv tmp | gzip -9 > $MINDI_TMP/all.tar.gz || Die "Cannot make small all.tar.gz" 2926 2929 sleep 2 2927 LogIt "Done. Exiting. \n"2930 LogIt "Done. Exiting." 2928 2931 MindiExit 0 2929 2932 fi … … 2960 2963 if [ "$YOUR_KERNEL_SUCKS" != "" ] || [ "$kernelpath" = "" ] || [ "$kernelpath" = "SUCKS" ] || [ "$kernelpath" = "FAILSAFE" ] ; then 2961 2964 kernelpath=$MINDI_LIB/vmlinuz 2962 LogIt "I shall include Mindi's failsafe kernel, not your kernel, in the boot disks. \n"2963 LogIt "However, you are still running your kernel. If Mindi fails to create your \n"2964 LogIt "disks then it may still be a result of a problem with your kernel. \n"2965 LogIt "I shall include Mindi's failsafe kernel, not your kernel, in the boot disks." 2966 LogIt "However, you are still running your kernel. If Mindi fails to create your" 2967 LogIt "disks then it may still be a result of a problem with your kernel." 2965 2968 pwd=`pwd` 2966 2969 cd $MINDI_TMP … … 2970 2973 fi 2971 2974 echo -e "Mindi's temp dir = $MINDI_TMP \nMindi's output dir=$CACHE_LOC" >> $LOGFILE 2972 [ "$(($RANDOM%64))" -eq "0" ] && LogIt "Dude, I've looked inside your computer and it's really dusty... \n"2975 [ "$(($RANDOM%64))" -eq "0" ] && LogIt "Dude, I've looked inside your computer and it's really dusty..." 2973 2976 2974 2977 [ "$YOUR_KERNEL_SUCKS" ] && [ ! "$FAILSAFE_KVER" ] && Die "Please install mindi-kernel package. You need it. Go to http://www.mondorescue.org and download it, then install it." … … 2988 2991 else 2989 2992 if ! PrepareBootDiskImage_LILO $CACHE_LOC 1722 $kernelpath $ramdisk_size ; then 2990 LogIt "W arning - failed to create 1.72MB boot image. Please reduce your kernel's size\n"2991 LogIt "if you want to make a 1.72MB floppy disk. \n"2993 LogIt "WARNING - failed to create 1.72MB boot image. Please reduce your kernel's size" 2994 LogIt "if you want to make a 1.72MB floppy disk." 2992 2995 fi 2993 2996 if ! PrepareBootDiskImage_LILO $CACHE_LOC 2880 $kernelpath $ramdisk_size ; then 2994 LogIt "W arning - failed to create 2.88MB floppy disk image.\n"2995 LogIt "Please reduce your kernel's size \n"2996 LogIt "if you want to make a 2.88MB floppy disk. \n"2997 LogIt "WARNING - failed to create 2.88MB floppy disk image." 2998 LogIt "Please reduce your kernel's size" 2999 LogIt "if you want to make a 2.88MB floppy disk." 2997 3000 PrepareBootDiskImage_LILO $CACHE_LOC 5760 $kernelpath $ramdisk_size || Die "Failed to create 2.88MB floppy disk image." 2998 3001 fi … … 3000 3003 else 3001 3004 if ! PrepareBootDiskImage_SYSLINUX $CACHE_LOC 1722 $kernelpath $ramdisk_size ; then 3002 LogIt "W arning - failed to create 1.72MB boot image. Please reduce your kernel's size\n"3003 LogIt "if you want to make a 1.72MB floppy disk. \n"3005 LogIt "WARNING - failed to create 1.72MB boot image. Please reduce your kernel's size" 3006 LogIt "if you want to make a 1.72MB floppy disk." 3004 3007 if ! PrepareBootDiskImage_SYSLINUX $CACHE_LOC 2880 $kernelpath $ramdisk_size ; then 3005 LogIt "W arning - failed to create 2.88MB floppy disk image.\n"3006 LogIt "Please reduce your kernel's size \n"3007 LogIt "if you want to make a 2.88MB floppy disk. \n"3008 LogIt "WARNING - failed to create 2.88MB floppy disk image." 3009 LogIt "Please reduce your kernel's size" 3010 LogIt "if you want to make a 2.88MB floppy disk." 3008 3011 PrepareBootDiskImage_SYSLINUX $CACHE_LOC 5760 $kernelpath $ramdisk_size || Die "Failed to create 5.76MB floppy disk image." 3009 3012 fi … … 3024 3027 fi 3025 3028 OfferToMakeBootableISO $CACHE_LOC 3026 LogIt "Finished. \n"3029 LogIt "Finished." 3027 3030 elif [ "$TAPEDEV" ] ; then 3028 3031 mkdir -p /root/images/mindi … … 3030 3033 OfferToMakeBootableISO $CACHE_LOC 3031 3034 if [ -e "$CACHE_LOC/all.tar.gz" ] ; then 3032 cp -f $CACHE_LOC/all.tar.gz $MINDI_TMP/ 3035 cp -f $CACHE_LOC/all.tar.gz $MINDI_TMP/ 2>> $LOGFILE 3033 3036 else 3034 3037 Die "Cannot find all.tar.gz, to be written to tape" … … 3038 3041 fi 3039 3042 # cleanup 3040 LogIt "$FRIENDLY_OUTSTRING \n"3043 LogIt "$FRIENDLY_OUTSTRING" 3041 3044 for mtpt in $FLOPPY_WAS_MOUNTED ; do 3042 3045 mount $mtpt
Note:
See TracChangeset
for help on using the changeset viewer.