- Timestamp:
- Nov 15, 2006, 12:40:15 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 32 edited
- 7 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/mindi-busybox/distributions/gentoo/mindi-busybox.ebuild
r823 r932 1 # Copyright 1999-200 4Gentoo Foundation1 # Copyright 1999-2006 Gentoo Foundation 2 2 # Distributed under the terms of the GNU General Public License v2 3 # $Header: $4 5 3 # $Id$ 6 4 7 DESCRIPTION="A program that creates emergency boot disks/CDs using your kernel, tools and modules." 5 inherit eutils flag-o-matic 6 7 DESCRIPTION="The rescue part of a program that creates emergency boot disks/CDs using your kernel, tools and modules." 8 8 HOMEPAGE="http://www.mondorescue.org" 9 9 SRC_URI="ftp://ftp.mondorescue.org/src/${P}.tar.gz" 10 11 10 LICENSE="GPL-2" 12 11 SLOT="0" 13 KEYWORDS="~x86 -*" 14 IUSE="" 15 12 KEYWORDS="~x86 ia64 -*" 16 13 DEPEND="virtual/libc" 17 14 RDEPEND=">=app-arch/bzip2-0.9 … … 20 17 src_unpack() { 21 18 unpack ${A} || die "Failed to unpack ${A}" 19 make oldconfig > /dev/null 20 } 21 22 src_compile() { 23 # work around broken ass powerpc compilers 24 emake EXTRA_CFLAGS="${CFLAGS}" busybox || die "build failed" 22 25 } 23 26 24 27 src_install() { 25 export PREFIX="${D}/usr" 26 export RPMBUILDMINDI="true" 27 "${WORKDIR}"/"${P}"/install.sh 28 # bundle up the symlink files for use later 29 emake PREFIX="/usr/share/mindi/rootfs/bin" install || die 30 rm _install/bin/busybox 31 tar cf busybox-links.tar -C _install . || die 32 insinto /usr/share/mindi 33 doins busybox-links.tar || die 34 } 35 36 pkg_preinst() { 37 mv "${D}"/usr/share/mindi/busybox-links.tar "${T}"/ || die 28 38 } 29 39 30 40 pkg_postinst() { 31 einfo "${P} was successfully installed." 32 einfo "Please read the associated docs for help." 33 einfo "Or visit the website @ ${HOMEPAGE}" 34 echo 35 ewarn "This package is still in unstable." 36 ewarn "Please report bugs to http://bugs.gentoo.org/" 37 ewarn "However, please do an advanced query to search for bugs" 38 ewarn "before reporting. This will keep down on duplicates." 41 cd "${T}" || die 42 mkdir _install 43 tar xf busybox-links.tar -C _install || die 44 cp -vpPR _install/* /usr/share/mindi/rootfs/bin || die "copying links for ${x} failed" 45 39 46 echo 40 47 } -
trunk/mindi-busybox/distributions/rpm/mindi-busybox.spec
r904 r932 13 13 REQ 14 14 ExcludeArch: ppc 15 OBS16 15 17 16 %description … … 34 33 %{__rm} -rf $RPM_BUILD_ROOT 35 34 36 %post37 38 35 %files 39 36 %defattr(-,root,root) -
trunk/mindi/deplist.txt
r903 r932 35 35 lvmiopversion lvmcreate_initrd pvdata 36 36 #------------------------------------------------------------------------------ 37 # 38 # Proliant extended support if available 39 # Look at http://www.hp.com/servers/sstoolkit 40 conrep cpqacuxe hponcfg 41 lshw -
trunk/mindi/install.sh
r929 r932 1 1 #!/bin/bash 2 # 3 # $Id$ 4 # 2 5 3 6 if [ ! -f "mindi" ] ; then … … 63 66 64 67 cp -af rootfs aux-tools $locallib/mindi 65 chmod 755 $locallib/mindi/rootfs/bin/*66 68 chmod 755 $locallib/mindi/rootfs/sbin/* 67 69 chmod 755 $locallib/mindi/aux-tools/sbin/* -
trunk/mindi/mindi
r929 r932 14 14 15 15 ### Which arch are we on (useful for ia64 port) 16 exportARCH=`/bin/arch`17 18 RUN_AFTER_INITIAL_BOOT_PHASE="echo \"Who lives in a pineapple under the sea?\" > /tmp/spongebob.squarepants.txt"16 ARCH=`/bin/arch` 17 18 #RUN_AFTER_INITIAL_BOOT_PHASE="echo \"Who lives in a pineapple under the sea?\" > /tmp/spongebob.squarepants.txt" 19 19 # after booting from floppy/CD image but before 20 20 # accessing auxiliary data disks (or the rest of … … 106 106 107 107 BOOT_MEDIA_MESSAGE="$mindi_boot_msg" 108 108 FDISK=$MINDI_SBIN/parted2fdisk 109 FDISKLOG=$MONDOTMP/parted2fdisk.log 110 touch $FDISKLOG 111 112 # Using a config file allow to overwrite some values 113 MINDI_CONFIG="$MINDI_CONF/mindi.conf" 114 if [ -f $MINDI_CONFIG ]; then 115 . $MINDI_CONFIG 116 fi 117 118 # Now we can create what we nedd 119 MONDOTMP=`mktemp -d $TMPDIR/mondobuild.XXXXXXXXXX` 120 mkdir -p $MONDOTMP 121 mkdir -p $CACHE_LOC 109 122 # ---------------------------------------------------------------------------- 110 123 … … 114 127 Die "Program is terminating in response to signal received from OS/user" 115 128 } 116 117 129 118 130 … … 129 141 done 130 142 if [ -e "$MINDI_LIB/memtest.img" ] ; then 131 # echo -en "label memtest\n kernel memtest.bin\n\n"132 143 echo -en "label memtest\n kernel memdisk\n append initrd=memtest.img\n\n" 133 # echo "Yep, this is a multi-function CD" > $2/MULTIFUNC 134 fi 135 } 136 144 fi 145 } 137 146 138 147 … … 143 152 which gawk > /dev/null 2> /dev/null && AWK=`which gawk 2>/dev/null` || AWK="`which awk 2>/dev/null`" 144 153 if which awk &> /dev/null ; then 145 if ! which gawk &> /dev/null ; then146 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"147 fi154 if ! which gawk &> /dev/null ; then 155 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" 156 fi 148 157 fi 149 158 which mke2fs > /dev/null 2> /dev/null || Die "Please put mke2fs in system path" 150 which afio > /dev/null 2> /dev/null || LogIt "afio not found... mindi doesn't need afio but Mondo does... Be aware...\n"151 [ ! -e "/etc/issue.net" ] && > /etc/issue.net152 FDISK=$MINDI_SBIN/parted2fdisk153 FDISKLOG=/tmp/parted2fdisk.log154 touch $FDISKLOG155 159 [ ! -e "$FDISK" ] && Die "Cannot find (s)fdisk" 156 160 } 157 158 161 159 162 … … 167 170 168 171 169 170 171 172 172 Aborted() { 173 173 trap SIGHUP SIGTERM SIGTRAP SIGINT 174 rm -f $CACHEDIR/mindi*img $CACHEDIR/*gz $CACHEDIR/mindi.iso174 [ "$CACHE_LOC" != "" ] && rm -f $CACHE_LOC/mindi*img $CACHE_LOC/*gz $CACHE_LOC/mindi.iso 175 175 [ "$minidir_root" != "" ] && rm -Rf $minidir_root/* 176 176 Die "User abort." … … 181 181 [ -e "$1" ] && echo -en "$2 `cat $1`\n" >> $3 182 182 } 183 184 183 185 184 … … 190 189 noof_disks=$3 191 190 192 # diskno=1193 191 diskno=$noof_disks 194 192 mkdir -p $minidir_root/$diskno 195 193 [ "$LAST_COMPRESSED_SIZE" = "" ] && LAST_COMPRESSED_SIZE=0 196 194 if [ ! -e "$filename" ] ; then 197 if [ -h "$filename" ] ; then 198 cp --parents -pRdf $filename $minidir_root/$diskno 199 return $noof_disks 200 else 201 Die "AddFileToDir asked me to add $filename, which does not exist. Oops! Did you run out of disk space or is your Linux distro severely broken?" 202 fi 203 fi 204 # move to the disk that has room on it (or end up using the last, if all full) 195 if [ -h "$filename" ] ; then 196 cp --parents -pRdf $filename $minidir_root/$diskno 197 return $noof_disks 198 else 199 Die "AddFileToDir asked me to add $filename, which does not exist. Oops! Did you run out of disk space or is your Linux distro severely broken?" 200 fi 201 fi 202 203 # move to the disk that has room on it (or end up using the last, if all full) 205 204 while [ "$diskno" -lt "40" ] ; do 206 mkdir -p $minidir_root/$diskno205 mkdir -p $minidir_root/$diskno 207 206 filesize=`du -sk $filename | cut -f1` 208 cp --parents -Rdf $filename $minidir_root/$diskno207 cp --parents -Rdf $filename $minidir_root/$diskno 209 208 if [ "$filesize" -le "4" ] ; then 210 209 siz=$filesize … … 216 215 siz=$(($siz-2));# to allow for sectors & the fact that they round up 217 216 fi 218 [ ! "$siz" ] && siz=4219 [ "$siz" -lt "0" ] && siz=0217 [ ! "$siz" ] && siz=4 218 [ "$siz" -lt "0" ] && siz=0 220 219 LAST_COMPRESSED_SIZE=$(($LAST_COMPRESSED_SIZE+$siz)) 221 [ "$LAST_COMPRESSED_SIZE" -le "$MAX_COMPRESSED_SIZE" ] &&return $diskno222 echo "disk=$diskno siz=$LAST_COMPRESSED_SIZE" >> $LOGFILE223 LAST_COMPRESSED_SIZE=0224 rm -f $minidir_root/$diskno/$filename220 [ "$LAST_COMPRESSED_SIZE" -le "$MAX_COMPRESSED_SIZE" ] &&return $diskno 221 echo "disk=$diskno siz=$LAST_COMPRESSED_SIZE" >> $LOGFILE 222 LAST_COMPRESSED_SIZE=0 223 rm -f $minidir_root/$diskno/$filename 225 224 diskno=$(($diskno+1)) 226 225 done 227 226 return 0 ; # failed 228 227 } 229 230 231 228 232 229 … … 262 259 fi 263 260 for included_item in $included_list ; do 264 if [ ! -e "$included_item" ] ; then261 if [ ! -e "$included_item" ] ; then 265 262 sss=`find $KEYDIR/keymaps | grep -F "${included_item}.inc"` 266 [ "$sss" = "" ] && sss=`find $KEYDIR/keymaps | grep -F "$included_item"`267 for ii in $sss ; do263 [ "$sss" = "" ] && sss=`find $KEYDIR/keymaps | grep -F "$included_item"` 264 for ii in $sss ; do 268 265 [ -e "$ii" ] && AddKeyboardMappingFile $ii 269 done 270 else 271 AddKeyboardMappingFile $included_item 272 fi 273 done 274 } 275 276 277 278 279 266 done 267 else 268 AddKeyboardMappingFile $included_item 269 fi 270 done 271 } 280 272 281 273 … … 291 283 292 284 sliceno=0 293 scratchfile=$ TMP_ROOT/blah.$$.dat285 scratchfile=$MONDOTMP/blah.$$.dat 294 286 cp -f $filename $scratchfile || Die "CUACF -- cannot copy $filename to $scratchfile - did you run out of disk space?" 295 287 [ "`head $scratchfile -n1 | grep -F "bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-" 296 288 [ "`echo "$filename" | grep -F "etc/termcap"`" != "" ] && StripComments $scratchfile "-$filename-" 297 289 if [ "`echo "$filename" | grep -F "lib/modules/" | grep "\.*o\.gz"`" != "" ] ; then 298 mv $scratchfile $scratchfile.gz299 gunzip -f $scratchfile || LogIt "Cannot gunzip $scratchfile.gz\n"300 filename=`echo "$filename" | tr '.' '#' | sed s/#o#gz/#o/ | sed s/#ko#gz/#ko/ | tr '#' '.'`290 mv $scratchfile $scratchfile.gz 291 gunzip -f $scratchfile || LogIt "Cannot gunzip $scratchfile.gz\n" 292 filename=`echo "$filename" | tr '.' '#' | sed s/#o#gz/#o/ | sed s/#ko#gz/#ko/ | tr '#' '.'` 301 293 fi 302 294 filesize=`du -sk $scratchfile | cut -f1` … … 339 331 340 332 341 342 343 333 CopyDependenciesToDirectory() { 344 334 local outdir incoming fname filesize counter … … 348 338 counter=0 349 339 while [ "$incoming" != "" ] ; do 350 if [ -d "$incoming" ] ; then340 if [ -d "$incoming" ] ; then 351 341 find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 352 342 elif [ -e "$incoming" ] ; then … … 357 347 else 358 348 cp --parents -Rdf $incoming $outdir || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" 359 if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] ; then360 gunzip -f $outdir/$incoming || LogIt "Cannot gunzip $outdir/$incoming\n"361 fi362 [ -x "$outdir" ] && StripExecutable $outdir "-$filename-"363 364 counter=$(($counter+1))365 if [ "$counter" -ge "5" ] ; then366 counter=0367 echo -en "."368 fi349 if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] ; then 350 gunzip -f $outdir/$incoming || LogIt "Cannot gunzip $outdir/$incoming\n" 351 fi 352 [ -x "$outdir" ] && StripExecutable $outdir "-$filename-" 353 fi 354 counter=$(($counter+1)) 355 if [ "$counter" -ge "5" ] ; then 356 counter=0 357 echo -en "." 358 fi 369 359 fi 370 360 incoming=`ReadLine` 371 361 done 372 362 } 373 374 363 375 364 … … 383 372 echo -en "Formatting disk..." 384 373 if which fdformat > /dev/null ; then 385 fdformat -n $dev > /dev/null 2> /dev/null || Die "Cannot format $dev - is your Linux distro broken?"374 fdformat -n $dev > /dev/null 2> /dev/null || Die "Cannot format $dev - is your Linux distro broken?" 386 375 elif which superformat > /dev/null ; then 387 superformat $dev > /dev/null 2> /dev/null || Die "Cannot format $dev - is your Linux distro broken?"388 else 389 Die "Please install either fdformat or superformat."376 superformat $dev > /dev/null 2> /dev/null || Die "Cannot format $dev - is your Linux distro broken?" 377 else 378 Die "Please install either fdformat or superformat." 390 379 fi 391 380 echo -en "\rWriting $comment" 392 381 if echo $image | grep "mindi-[r|b]oot\.1440" &> /dev/null ; then 393 cat $image > $dev &394 else 395 dd if=$image of=$dev &> /dev/null &382 cat $image > $dev & 383 else 384 dd if=$image of=$dev &> /dev/null & 396 385 fi 397 386 procno=$! … … 407 396 408 397 409 410 411 412 398 CountItemsIn() { 413 399 local r … … 420 406 421 407 422 423 424 425 426 408 CreateDataDiskImagesFromTarballs() { 427 409 local tardir outdir diskno noof_disks kp … … 434 416 echo -en "Creating data disk " 435 417 while [ "$diskno" -le "$noof_disks" ] ; do 436 echo -en "#$diskno..."437 cp -f $tardir/$diskno.tar.gz $outdir || LogIt "[line 424] Cannot copy $tardir/$diskno.tar.gz to $outdir\n"418 echo -en "#$diskno..." 419 cp -f $tardir/$diskno.tar.gz $outdir || LogIt "[line 424] Cannot copy $tardir/$diskno.tar.gz to $outdir\n" 438 420 CreateOneDataDiskImage $tardir/$diskno.tar.gz $outdir/mindi-data-$diskno.img $diskno $noof_disks 439 421 diskno=$(($diskno+1)) … … 453 435 noof_disks=$4 454 436 455 mountpoint=$ TMP_ROOT/mountpoint.$$437 mountpoint=$MONDOTMP/mountpoint.$$ 456 438 mkdir -p $mountpoint 457 439 dd if=/dev/zero of=$imagefile bs=1k count=1440 &> /dev/null || LogIt "Cannot dd (CODI)\n" 458 mke2fs -N 12 -F $imagefile > /tmp/mke2fs.$$ 2>> /tmp/mke2fs.$$459 [ "$?" -ne "0" ] && cat /tmp/mke2fs.$$460 rm -f /tmp/mke2fs.$$440 mke2fs -N 12 -F $imagefile > $MONDOTMP/mke2fs.$$ 2>> $MONDOTMP/mke2fs.$$ 441 [ "$?" -ne "0" ] && cat $MONDOTMP/mke2fs.$$ 442 rm -f $MONDOTMP/mke2fs.$$ 461 443 mount -t ext2 -o loop $imagefile $mountpoint || Die "Can't loopmount $imagefile to $mountpoint! The reason may be missing support for loopfs or ext2 (or both) in the running kernel." 462 444 mv $tarball $mountpoint/ 463 445 if [ "$?" -ne "0" ] ; then 464 umount $mountpoint465 Die "Tarball $tarball is too big for disk! (CODI)\nTell Dev Team to adjust MAX_COMPRESSED_SIZE"446 umount $mountpoint 447 Die "Tarball $tarball is too big for disk! (CODI)\nTell Dev Team to adjust MAX_COMPRESSED_SIZE" 466 448 fi 467 449 [ "$diskno" -eq "$noof_disks" ] && echo "This is the last disk ($diskno=$noof_disks)" >> $mountpoint/LAST-DISK … … 469 451 rmdir $mountpoint || LogIt "Cannot rmdir (CODI)\n" 470 452 } 471 472 453 473 454 … … 481 462 } 482 463 483 484 464 # Last function called before exiting 465 # Parameter is exit code value 466 MindiExit() { 467 local my_partitions 468 469 echo "Mindi $MINDI_VERSION is exiting" >> $LOGFILE 470 echo "End date : `date`" >> $LOGFILE 471 472 sync 473 cd / 474 475 # Unmount whtat could remain mounted 476 my_partitions=`mount | grep -F $$ | cut -f1 -d' '` 477 [ "$my_partitions" != "" ] && umount $my_partitions 478 # Clean temporary files 479 rm -Rf $MONDOTMP $FDISKLOG 480 exit $1 481 } 485 482 486 483 Die() { 487 local my_partitions i 488 echo "MINDI_VERSION is $MINDI_VERSION" >> $LOGFILE 489 echo "End date : `date`" >> $LOGFILE 484 local i 490 485 if [ "$1" = "" ] ; then 491 486 LogIt "Fatal error\n" … … 493 488 LogIt "Fatal error. $1\n" 494 489 fi 495 sync 496 cd / 497 498 my_partitions=`mount | grep -F $$ | cut -f1 -d' '` 499 [ "$my_partitions" != "" ] && umount $my_partitions 500 # BCO : Too Dangerous !!! 501 #[ "$TMP_ROOT" != "/tmp" ] && rm -Rf $TMP_ROOT 502 cd /tmp 503 mkdir -p mindi.err 504 for i in /etc/fstab /etc/lilo.conf /etc/raidtab $LOGFILE /var/log/mondo-archive.log /tmp/mountlist.txt.$$ $FDISKLOG ; do 505 [ -e "$i" ] && cp -f $i mindi.err/ 506 done 507 rm -f mindi.err.*.tgz 508 tar -cf - mindi.err | gzip -9 > mindi.err.$$.tgz 509 rm -Rf mindi.err /tmp/mountlist.txt.$$ mindilinux $FDISKLOG 510 LogIt "Please e-mail a copy of /tmp/mindi.err.$$.tgz to the mailing list.\n" 490 491 # Creates a tar file containing all required files 492 for i in /etc/fstab /etc/lilo.conf /etc/raidtab $LOGFILE /var/log/mondo-archive.log $FDISKLOG ; do 493 [ -e "$i" ] && cp -f $i $MONDOTMP 494 done 495 rm -f $TMPDIR/mindi.err.*.tgz 496 tar -cf - $MONDOTMP | gzip -9 > $TMPDIR/mindi.err.$$.tgz 497 LogIt "Please e-mail a copy of $TMPDIR/mindi.err.$$.tgz to the mailing list.\n" 511 498 LogIt "See http://www.mondorescue.org for more information.\n" 512 499 LogIt "WE CANNOT HELP unless you enclose that file.\n" 513 exit 1 514 } 515 516 500 MindiExit -1 501 } 517 502 518 503 … … 545 530 mv -f $filelist.tmp $filelist 546 531 done 547 sort $filelist | $AWK '{ print $1; }' | uniq> $filelist.tmp532 $AWK '{ print $1; }' $filelist | sort -u > $filelist.tmp 548 533 mv -f $filelist.tmp $filelist 549 534 echo -e "$DONE" 550 535 } 551 552 553 536 554 537 … … 631 614 632 615 633 634 635 636 616 FindHomeOfMindiAndMondo() { 637 617 [ "$MINDI_PREFIX" = "XXX" ] && Die "Mindi has not been installed correctly." … … 641 621 echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE 642 622 echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE 643 mkdir -p $CACHEDIR 644 } 645 646 647 623 } 648 624 649 625 … … 659 635 660 636 661 662 637 FindLiloBinary() { 663 638 if which lilo &> /dev/null ; then 664 if which lilo.real > /dev/null 2> /dev/null ; then 665 LILO_EXE=lilo.real 666 LogIt "lilo.real found; will be used instead of lilo (*grumble* *mutter*)\n" 667 else 668 LILO_EXE=lilo 669 fi 670 $LILO_EXE -V | grep -F "21.6" > /dev/null && Die "Please upgrade LILO. Your verison has a serious bug. If you're not _using_ LILO, fine, uninstall it. :)" 671 else 672 LILO_EXE=`which false` 673 fi 674 } 639 if which lilo.real > /dev/null 2> /dev/null ; then 640 LILO_EXE=lilo.real 641 LogIt "lilo.real found; will be used instead of lilo (*grumble* *mutter*)\n" 642 else 643 LILO_EXE=lilo 644 fi 645 $LILO_EXE -V | grep -F "21.6" > /dev/null && Die "Please upgrade LILO. Your version has a serious bug. If you're not _using_ LILO, fine, uninstall it. :)" 646 else 647 LILO_EXE=`which false` 648 fi 649 } 650 675 651 676 652 FindELiloBinary() { 677 653 if which elilo &> /dev/null ; then 678 LILO_EXE=elilo679 else 680 LILO_EXE=`which false`654 LILO_EXE=elilo 655 else 656 LILO_EXE=`which false` 681 657 fi 682 658 } … … 684 660 685 661 FixPathIfBroken() { 686 662 if [ -e "/sbin/mkfs" ] && ! which mkfs &> /dev/null ; then 687 663 PATH=$PATH:/sbin:/usr/sbin 688 664 export PATH … … 692 668 fi 693 669 } 694 695 670 696 671 … … 702 677 if [ "`strings $i 2> /dev/null | head -n1`" = "LILO" ] ; then 703 678 out="$out $i" 704 679 last="$i" 705 680 fi 706 681 done 707 682 echo "$last" 708 683 } 709 710 684 711 685 … … 714 688 pwd=`pwd` 715 689 if [ "$YOUR_KERNEL_SUCKS" ] ; then 716 cd $ TMP_ROOT690 cd $MONDOTMP 717 691 else 718 692 cd / … … 732 706 733 707 734 735 708 GenerateGiantDependencyList() { 736 709 local incoming loc fname list_of_files i tempfile outfile progress filelist res r mapfile mappath included_list included_item old_pwd tempdepfile modres noof_lines lvmversion lvmresolved … … 738 711 echo -en "Analyzing dependency requirements" 739 712 outfile=$1 740 tempfile=$ TMP_ROOT/$$.txt713 tempfile=$MONDOTMP/$$.txt 741 714 incoming=`ReadLine` 742 715 … … 747 720 while [ "$incoming" != "" ] ; do 748 721 if echo "$incoming" | grep -x " *#.*" &> /dev/null ; then 749 # echo "Skipping '$incoming'"750 722 incoming=`ReadLine` 751 723 continue … … 754 726 break 755 727 fi 756 # echo "Processing '$incoming'."757 # sleep 1758 728 filelist=`GenerateListForFile "$incoming"` 759 729 r=$? … … 846 816 noof_lines=`cat $tempfile | wc -l` 847 817 for fname in `cat $tempfile` ; do 848 tempdepfile=`mktemp /tmp/mindilinux/tempdepfile.XXXXXX` 849 LocateDeps $fname > $tempdepfile 850 echo "$fname" >> $outfile.pre 851 cat $tempdepfile >> $outfile.pre 852 rm -f $tempdepfile 853 progress=$(($progress+1)) 818 echo "$fname" >> $outfile.pre 819 LocateDeps $fname >> $outfile.pre 820 progress=$(($progress+1)) 854 821 echo -en "\r\t\t\t\t\t\t\t\t" 855 822 i=$(($progress*100)) … … 857 824 echo -en "$i" 858 825 echo -en "%" 859 modres=$(($progress%4))826 modres=$(($progress%4)) 860 827 [ "$modres" -eq "0" ] && echo -en "\t/" 861 828 [ "$modres" -eq "1" ] && echo -en "\t-" … … 864 831 done 865 832 if [ "`DidMondoCallMe`" ] ; then 866 mkdir -p $bigdir/tmp867 mkdir -p $bigdir/sbin868 mkdir -p $bigdir/bin869 if [ -e "$MONDO_TMP/post-nuke.tgz" ] ; then870 LogIt "\nIncorporating post-nuke tarball\n"871 old_pwd=`pwd`872 cd $bigdir873 tar -zxf $MONDO_TMP/post-nuke.tgz || LogIt "Error occurred when untarring post-nuke tarball\n"874 cd $old_pwd875 fi876 if cp -f $MONDO_TMP/mondo*restore $bigdir/usr/bin ; then877 878 else879 LogIt "Cannot find mondo*restore in mondo's tempdir, $MONDO_TMP\n"880 LogIt "I bet you've got a spare copy of Mondo or Mindi floating around on your system.\n"881 882 883 fi 884 cp -f $MONDO _TMP/BOOTLOADER.* $bigdir 2> /dev/null || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW.\n"885 if [ -e "$MONDO_TMP/NFS-DEV" ] ; then886 LogIt "Incorporating NFS-related settings\n"887 for r in NFS-* ISO-PREFIX ; do888 cp -f $MONDO_TMP/$r $bigdir/tmp || Die "Cannot copy $r - did you run out of disk space?"889 echo "Copying $r to ramdisk" >> $LOGFILE890 done891 fi892 fi 893 833 mkdir -p $bigdir/tmp 834 mkdir -p $bigdir/sbin 835 mkdir -p $bigdir/bin 836 if [ -e "$MONDOTMP/post-nuke.tgz" ] ; then 837 LogIt "\nIncorporating post-nuke tarball\n" 838 old_pwd=`pwd` 839 cd $bigdir 840 tar -zxf $MONDOTMP/post-nuke.tgz || LogIt "Error occurred when untarring post-nuke tarball\n" 841 cd $old_pwd 842 fi 843 if cp -f $MONDOTMP/mondo*restore $bigdir/usr/bin ; then 844 LocateDeps $bigdir/usr/bin/mondo*restore >> $outfile.pre 845 else 846 LogIt "Cannot find mondo*restore in mondo's tempdir, $MONDOTMP\n" 847 LogIt "I bet you've got a spare copy of Mondo or Mindi floating around on your system.\n" 848 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." 849 Die "Odd." 850 fi 851 cp -f $MONDOTMP/BOOTLOADER.* $bigdir 2> /dev/null || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW.\n" 852 if [ -e "$MONDOTMP/NFS-DEV" ] ; then 853 LogIt "Incorporating NFS-related settings\n" 854 for r in NFS-* ISO-PREFIX ; do 855 cp -f $MONDOTMP/$r $bigdir/tmp || Die "Cannot copy $r - did you run out of disk space?" 856 echo "Copying $r to ramdisk" >> $LOGFILE 857 done 858 fi 859 fi 860 tr ' ' '\n' < $outfile.pre | tr -s '/' '/' | grep -Fvx "" | sort -u | grep -Ev "/libX11|/libXext|/libXi|/libgtk|/libgdk" > $outfile 894 861 rm -f $tempfile $outfile.pre 895 862 [ "$res" -eq "0" ] && echo -e "\r\t\t\t\t\t\t\t\t$DONE" || echo "\nFailed." 896 863 return $res 897 864 } 898 899 900 901 865 902 866 … … 915 879 916 880 917 918 881 # Returns all disk devices which are part of a raid array 919 920 882 GetAllRaidMembers() { 921 883 $AWK "/^[[:space:]]*#/ {next} /^[[:space:]]*device/ if(\$2) {print \$2}" < /etc/raidtab … … 929 891 done 930 892 } 931 932 893 933 894 … … 940 901 941 902 942 943 944 945 903 # Searches parent raid device of given disk device 946 904 # $1: disk device (i.e. /dev/hda1) 947 948 905 GetParentRaidDev() { 949 906 $AWK "/^[[:space:]]*#/ {next} /^[[:space:]]*raiddev/ {dev=\$2} /^[[:space:]]*device/ {if(\$2==\"$1\") {print dev; exit}}" < /etc/raidtab … … 951 908 952 909 953 954 910 # Searches members of raid device 955 911 # $1: raid device (/dev/md...) 956 957 912 GetRaidDevMembers() { 958 913 $AWK "/^[[:space:]]*#/ {next} /^[[:space:]]*raiddev/ {if(dev) exit; if(\$2 == \"$1\") dev=\$2} /^[[:space:]]*device/ {if(dev) {print \$2}}" < /etc/raidtab 959 914 } 960 961 962 HackAwk() {963 local pathname filename dir old_pwd new_fname964 pathname=$1965 filename=$2966 dir=`echo "$pathname" | sed s/$filename//`967 old_pwd=`pwd`968 cd $dir969 [ -f "$filename" ] || Die "Can't find $filename at $dir"970 new_fname="an.icky.icky.spider.ewww"971 [ "$filename" = "gawk" ] && new_fname="awk"972 [ "$filename" = "awk" ] && new_fname="gawk"973 ln -s $filename $new_fname974 cd $old_pwd975 }976 977 978 979 980 HackMountlist() {981 local scratchdir outfile partlist pst partstr \982 res partition swapsize983 scratchdir=$TMP_ROOT984 outfile=$1985 986 mkdir -p $outfile987 rm -Rf $outfile988 > $outfile989 partlist=$(mount | cut -d' ' -f1,3,5 \990 | grep -Ev "((none|/tmp|/ISOs|/proc|/dev/root) )|/mnt/" \991 | tr ' ' '|')992 993 echo -n "Modifying mountlist..."994 995 if [ ! -f "/mountlist.hacked" ] ; then996 Die "Can't find modified mountlist.hacked!"997 else998 cp /mountlist.hacked "$outfile"999 LogIt "Done. (Created by auto-archive, I assume?)\n"1000 fi1001 }1002 1003 1004 915 1005 916 … … 1009 920 incoming=`ReadLine` 1010 921 pwd=`pwd` 1011 cd $ TMP_ROOT922 cd $MONDOTMP 1012 923 while [ "$incoming" != "" ] ; do 1013 stub=`basename $incoming`1014 newpath=`FindSpecificModuleInPath lib/modules/$FAILSAFE_KVER $stub`1015 for i in $newpath ; do1016 echo "$i"1017 done1018 read incoming924 stub=`basename $incoming` 925 newpath=`FindSpecificModuleInPath lib/modules/$FAILSAFE_KVER $stub` 926 for i in $newpath ; do 927 echo "$i" 928 done 929 read incoming 1019 930 done 1020 931 cd $pwd 1021 932 } 1022 1023 933 1024 934 … … 1027 937 1028 938 grep -vx " *#.*" $MY_FSTAB | grep -vx " *none.*" | $AWK '/^\/dev\/[imhs]d||LABEL\=\// && !/fdd|cdr|zip|floppy/ {print $1}' 1029 # for partition in `$FDISK -l | tr -s ' ' '\n' | grep /dev` ; do1030 # [ -e "$i" ] && all_partitions=echo "$i"1031 # done1032 939 [ -e "/etc/raidtab" ] && $AWK '/^ *device/ {print $2}' /etc/raidtab 1033 940 return 1034 941 } 1035 1036 1037 1038 942 1039 943 … … 1047 951 echo " " 1048 952 } 1049 1050 953 1051 954 … … 1076 979 [ -f "$oss" ] && find $oss.* 2> /dev/null 1077 980 } 1078 1079 1080 #ListKernelModules() {1081 #local output q1082 #output=""1083 #for q in `lsmod | sed -n '2,$s/ .*//p'` ; do1084 #output="$q $output"1085 #done1086 #echo "`lsmod | sed -n '2,$s/ .*//p'`"1087 #}1088 1089 981 1090 982 … … 1112 1004 } 1113 1005 1006 1114 1007 # Give all symlinks recursively of a full path name 1115 1008 ReadAllLink() { … … 1133 1026 fi 1134 1027 } 1028 1135 1029 1136 1030 LocateFile() { … … 1165 1059 1166 1060 1167 1168 1061 LogIt() { 1169 1062 if [ -e /dev/stderr ] ; then 1170 echo -e "$1" >> /dev/stderr1063 echo -e "$1" >> /dev/stderr 1171 1064 elif [ -e /usr/bin/logger ] ; then 1172 /usr/bin/logger -s $11065 /usr/bin/logger -s $1 1173 1066 fi 1174 1067 echo -en "$1" >> $LOGFILE … … 1176 1069 1177 1070 1178 1179 1180 1181 1182 1183 1071 # Called by TurnTgzIntoRdz, to make /tmp/mondo-restore.cfg 1184 1185 1072 MakeMondoConfigFile() { 1186 1073 local outfile use_lzo use_comp use_star … … 1200 1087 echo "datestamp `date`" >> $outfile 1201 1088 [ "$ESTIMATED_TOTAL_NOOF_SLICES" ] && echo "total-slices $ESTIMATED_TOTAL_NOOF_SLICES" >> $outfile 1202 AddFileToCfgIfExists $MONDO_TMP/NFS-CLIENT-IPADDR nfs-client-ipaddr $outfile 1203 AddFileToCfgIfExists $MONDO_TMP/NFS-CLIENT-NETMASK nfs-client-netmask $outfile 1204 AddFileToCfgIfExists $MONDO_TMP/NFS-CLIENT-BROADCAST nfs-client-broadcast $outfile 1205 AddFileToCfgIfExists $MONDO_TMP/NFS-CLIENT-DEFGW nfs-client-defgw $outfile 1206 AddFileToCfgIfExists $MONDO_TMP/NFS-SERVER-MOUNT nfs-server-mount $outfile 1207 AddFileToCfgIfExists $MONDO_TMP/NFS-SERVER-PATH nfs-server-path $outfile 1208 AddFileToCfgIfExists $MONDO_TMP/NFS-DEV nfs-dev $outfile 1209 AddFileToCfgIfExists $MONDO_TMP/NFS-SERVER-IPADDR nfs-server-ipaddr $outfile 1210 AddFileToCfgIfExists $MONDO_TMP/ISO-DEV iso-dev $outfile 1211 AddFileToCfgIfExists $MONDO_TMP/ISO-MNT iso-mnt $outfile 1212 AddFileToCfgIfExists $MONDO_TMP/ISO-PREFIX iso-prefix $outfile 1213 AddFileToCfgIfExists $MONDO_TMP/ISODIR isodir $outfile 1214 AddFileToCfgIfExists $MONDO_TMP/BOOTLOADER.DEVICE bootloader.device $outfile 1215 AddFileToCfgIfExists $MONDO_TMP/BOOTLOADER.NAME bootloader.name $outfile 1216 AddFileToCfgIfExists $MONDO_TMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile 1217 AddFileToCfgIfExists $MONDO_TMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile 1218 AddFileToCfgIfExists $MONDO_TMP/BACKUP-MEDIA-TYPE backup-media-type $outfile 1219 AddFileToCfgIfExists $MONDO_TMP/DIFFERENTIAL differential $outfile 1220 } 1221 1222 1089 AddFileToCfgIfExists $MONDOTMP/NFS-CLIENT-IPADDR nfs-client-ipaddr $outfile 1090 AddFileToCfgIfExists $MONDOTMP/NFS-CLIENT-NETMASK nfs-client-netmask $outfile 1091 AddFileToCfgIfExists $MONDOTMP/NFS-CLIENT-BROADCAST nfs-client-broadcast $outfile 1092 AddFileToCfgIfExists $MONDOTMP/NFS-CLIENT-DEFGW nfs-client-defgw $outfile 1093 AddFileToCfgIfExists $MONDOTMP/NFS-SERVER-MOUNT nfs-server-mount $outfile 1094 AddFileToCfgIfExists $MONDOTMP/NFS-SERVER-PATH nfs-server-path $outfile 1095 AddFileToCfgIfExists $MONDOTMP/NFS-DEV nfs-dev $outfile 1096 AddFileToCfgIfExists $MONDOTMP/NFS-SERVER-IPADDR nfs-server-ipaddr $outfile 1097 AddFileToCfgIfExists $MONDOTMP/ISO-DEV iso-dev $outfile 1098 AddFileToCfgIfExists $MONDOTMP/ISO-MNT iso-mnt $outfile 1099 AddFileToCfgIfExists $MONDOTMP/ISO-PREFIX iso-prefix $outfile 1100 AddFileToCfgIfExists $MONDOTMP/ISODIR isodir $outfile 1101 AddFileToCfgIfExists $MONDOTMP/BOOTLOADER.DEVICE bootloader.device $outfile 1102 AddFileToCfgIfExists $MONDOTMP/BOOTLOADER.NAME bootloader.name $outfile 1103 AddFileToCfgIfExists $MONDOTMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile 1104 AddFileToCfgIfExists $MONDOTMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile 1105 AddFileToCfgIfExists $MONDOTMP/BACKUP-MEDIA-TYPE backup-media-type $outfile 1106 AddFileToCfgIfExists $MONDOTMP/DIFFERENTIAL differential $outfile 1107 } 1223 1108 1224 1109 … … 1232 1117 if [ "$YOUR_KERNEL_SUCKS" ] ; then 1233 1118 kver=$FAILSAFE_KVER 1234 cd $ TMP_ROOT1119 cd $MONDOTMP 1235 1120 searchpath=lib/modules/$kver 1236 1121 else … … 1241 1126 if [ "${kernelname}" != "" ] 1242 1127 then 1243 1128 kver=${kernelname} 1244 1129 else 1245 1130 kver=`uname -r` 1246 1131 fi 1247 1132 ### … … 1253 1138 echo -en "for outerloop in 1 2 3 4 5 ; do\necho -en \".\"\n" >> $outfile 1254 1139 list_to_echo="`lsmod | sed -n '2,$s/ .*//p'`" 1255 # LTE=`echo "$list_to_echo" | tr ' ' '\n' | grep -n "" | cut -d':' -f2,3,4 | tr '\n' ' '` 1256 # lte_old="$LTE" 1257 # LTE="" 1258 # for q in $lte_old ; do 1259 # LTE="$q $LTE" 1260 # done 1261 #echo "LTE = '$LTE'" >> $LOGFILE 1140 1262 1141 # Make temporary modprobe.conf file if we are told so 1263 1142 if [ $tmpmodprobe_flag == "Y" ] ; then 1264 infile=" /tmp/modprobe.conf.mindi.$$"1143 infile="$MONDOTMP/modprobe.conf.mindi" 1265 1144 find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f -print0 | xargs -0 cat > $infile 1266 1145 else … … 1284 1163 echo "echo \"Done.\"" >> $outfile 1285 1164 chmod +x $outfile 1286 # cp $outfile /tmp/out.txt1287 1165 cd / 1288 1166 # Remove temporary modprobe.conf file if we have created one … … 1291 1169 fi 1292 1170 } 1293 1294 1295 1296 1171 1297 1172 … … 1307 1182 1308 1183 # scratchdir, mountlist(OUT) 1309 scratchdir=$ TMP_ROOT1184 scratchdir=$MONDOTMP 1310 1185 mountlist=$1 1311 1186 … … 1335 1210 useless_dev="/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw /dev/scd /dev/ram :/ /dev/sr0 /dev/sr1 /dev/cdrom1" 1336 1211 for c_p in $all_partitions ; do 1337 # echo "c_p = $c_p" > /dev/stderr1338 1212 [ "`echo "$useless_dev" | grep -F "$c_p"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] && continue 1339 1213 [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue … … 1424 1298 current_partition=$actual_dev 1425 1299 else 1426 1300 Die "Your system uses a labelled 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" 1427 1301 fi 1428 1302 else … … 1561 1435 1562 1436 1563 1564 1565 1566 1567 1437 MakeSureNumberIsInteger() { 1568 1438 res=`echo "$1" | tr -s '\-[0-9]' ' '` … … 1572 1442 fi 1573 1443 } 1574 1575 1576 1577 1444 1578 1445 … … 1589 1456 rm -f $1.tmp 1590 1457 if [ "$CDRECOVERY" != "yes" ] ; then 1591 if [ -e "$MONDO _TMP/NFS-DEV" ] ; then1458 if [ -e "$MONDOTMP/NFS-DEV" ] ; then 1592 1459 echo -en "Press <enter> to continue.\n" >> $1 1593 elif [ ! "$MONDO _TMP" ] ; then1460 elif [ ! "$MONDOTMP" ] ; then 1594 1461 echo -en "FYI, this is _not_ a Mondo Rescue CD.\n" >> $1 1595 1462 if [ -e "$MINDI_LIB/memtest.img" ] ; then … … 1605 1472 fi 1606 1473 } 1607 1608 1609 1474 1610 1475 … … 1637 1502 1638 1503 1504 OfferToCopyImagesToDisks() { 1505 local imagesdir i imagename dev count boot_dev data_dev 1506 imagesdir=$1 1507 boot_dev=$2 1508 data_dev=$3 1509 1510 echo -en "Would you like to create boot+data floppy disks now (y/n) ?" 1511 read i 1512 [ "$i" != "y" ] && [ "$i" != "Y" ] && return 1513 mount | grep -F /dev/fd > /dev/null && Die "Please unmount your floppies first." 1514 echo "WARNING! THIS WILL ERASE YOUR FLOPPY DISKS." 1515 [ ! -e "$boot_dev" ] && Die "Cannot find $boot_dev - is your Linux distro broken?" 1516 [ ! -e "$data_dev" ] && Die "Cannot find $data_dev - is your Linux distro broken?" 1517 i=`find $imagesdir -type f | grep -F "/mindi-root.1" 2> /dev/null` 1518 j=`find $imagesdir -type f | grep -F "/mindi-boot" | grep -Ev '2880|5760'` 1519 if [ "$i" ] ; then 1520 CopyImageToDisk $j $data_dev "boot disk" 1521 CopyImageToDisk $i $data_dev "root disk" 1522 else 1523 CopyImageToDisk $j $boot_dev "boot/root disk" 1524 fi 1525 count=1 1526 for i in `find $imagesdir | grep -F mindi-data` ; do 1527 CopyImageToDisk $i $data_dev "data disk #$count" 1528 count=$(($count+1)) 1529 done 1530 } 1531 1532 1639 1533 OfferToMakeBootableISO() { 1640 1534 local i old_pwd … … 1644 1538 [ "$i" != "y" ] && [ "$i" != "Y" ] && return 0 1645 1539 fi 1646 if [ ! "$MONDO _TMP" ] ; then1540 if [ ! "$MONDOTMP" ] ; then 1647 1541 LogIt "NB: Mindi's bootable CD always uses isolinux.\n" 1648 1542 LogIt "For a bootable CD w/LILO, please use Mondo.\n" 1649 1543 fi 1650 rm -Rf $ TMP_ROOT/iso1651 mkdir -p $ TMP_ROOT/iso/{images,archives,isolinux}1652 cp -f $1/*.img $1/*.gz $ TMP_ROOT/iso/images || LogIt "OfferToMakeBootableISO: Cannot copy $i to $TMP_ROOT/iso/images\n"1544 rm -Rf $MONDOTMP/iso 1545 mkdir -p $MONDOTMP/iso/{images,archives,isolinux} 1546 cp -f $1/*.img $1/*.gz $MONDOTMP/iso/images || LogIt "OfferToMakeBootableISO: Cannot copy $i to $MONDOTMP/iso/images\n" 1653 1547 old_pwd=`pwd` 1654 cd $ TMP_ROOT/iso1548 cd $MONDOTMP/iso 1655 1549 mkdir -p $MONDO_ROOT/iso/isolinux 1656 1550 echo "mindi_lib = $MINDI_LIB" >> $LOGFILE … … 1658 1552 for i in memdisk memtest.bin memtest.img ; do 1659 1553 j=$MINDI_LIB/$i 1660 k=$ TMP_ROOT/iso/isolinux1554 k=$MONDOTMP/iso/isolinux 1661 1555 if [ -e "$j" ] ; then 1662 1556 LogIt "Copying $j to $k\n" 1663 1557 cp -f $j $k || Die "Failed to copy $j to $k" 1664 cp -f $j $ TMP_ROOT|| Die "Failed to copy $j to $k"1665 fi 1666 done 1667 MakeSyslinuxMessageFile $ TMP_ROOT/iso/isolinux/message.txt1668 cp $kernelpath $ TMP_ROOT/iso/isolinux/vmlinuz || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/isolinux/vmlinuz). Did you run out of disk space?"1669 cp $ TMP_ROOT/mindi.rdz $TMP_ROOT/iso/isolinux/initrd.img1670 cp $ TMP_ROOT/mindi.rdz $CACHEDIR/initrd.img1558 cp -f $j $MONDOTMP || Die "Failed to copy $j to $k" 1559 fi 1560 done 1561 MakeSyslinuxMessageFile $MONDOTMP/iso/isolinux/message.txt 1562 cp $kernelpath $MONDOTMP/iso/isolinux/vmlinuz || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/isolinux/vmlinuz). Did you run out of disk space?" 1563 cp $MONDOTMP/mindi.rdz $MONDOTMP/iso/isolinux/initrd.img 1564 cp $MONDOTMP/mindi.rdz $CACHE_LOC/initrd.img 1671 1565 [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur" 1672 cd $ TMP_ROOT/iso/isolinux1673 cat $iso_cfg_file | HackSyslinuxFile $ramdisk_size $ TMP_ROOT/iso > isolinux.cfg || Die "Cannot copy isolinux.cfg from mindi_home to tmp_root - did you run out of disk space?"1674 if [ -e "$MONDO _TMP/NFS-DEV" ] ; then1566 cd $MONDOTMP/iso/isolinux 1567 cat $iso_cfg_file | HackSyslinuxFile $ramdisk_size $MONDOTMP/iso > isolinux.cfg || Die "Cannot copy isolinux.cfg from mindi_home to tmp_root - did you run out of disk space?" 1568 if [ -e "$MONDOTMP/NFS-DEV" ] ; then 1675 1569 mv isolinux.cfg isolinux.cfg.old 1676 1570 sed s/interactive/iso/ isolinux.cfg.old > isolinux.cfg … … 1680 1574 cp $ISOLINUX ../ 1681 1575 fi 1682 cd $ TMP_ROOT/iso1576 cd $MONDOTMP/iso 1683 1577 if [ "$ARCH" != "ia64" ] ; then 1684 cp -f $ TMP_ROOT/iso/isolinux/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT || Die "Cannot copy core files to ramdisk for boot disk. Did you run out of disk space?"1578 cp -f $MONDOTMP/iso/isolinux/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT || Die "Cannot copy core files to ramdisk for boot disk. Did you run out of disk space?" 1685 1579 fi 1686 1580 [ "$MONDO_SHARE" ] && cp -f $MONDO_SHARE/autorun . 1687 if [ -d "/home/MondoCD" ] ; then1688 cp -pRdu /home/MondoCD/* .1689 fi1690 1581 if [ "$ARCH" != "ia64" ] ; then 1691 1582 mkisofs -U -J -r -o $CACHEDIR/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> /tmp/$$.mk … … 1694 1585 fi 1695 1586 if [ "$?" -ne "0" ] ; then 1696 echo "----------- mkisofs's errors --------------" >> $LOGFILE1697 cat /tmp/$$.mk>> $LOGFILE1698 echo "mkisofs returned the following errors:-"1699 cat /tmp/$$.mk1700 LogIt "Failed to create ISO image.\n"1701 else 1702 echo "Created bootable ISO image at $CACHEDIR/mindi.iso" >> $LOGFILE1703 fi 1704 rm -f /tmp/$$.mk1587 echo "----------- mkisofs's errors --------------" >> $LOGFILE 1588 cat $MONDOTMP/mkisofs.log >> $LOGFILE 1589 echo "mkisofs returned the following errors:-" 1590 cat $MONDOTMP/mkisofs.log 1591 LogIt "Failed to create ISO image.\n" 1592 else 1593 echo "Created bootable ISO image at $CACHEDIR/mindi.iso" >> $LOGFILE 1594 fi 1595 rm -f $MONDOTMP/mkisofs.log 1705 1596 cd $old_pwd 1706 1597 } 1707 1708 1598 1709 1599 … … 1711 1601 [ "$1" -gt "1" ] && echo -en "s" 1712 1602 } 1713 1714 1715 1603 1716 1604 … … 1724 1612 fi 1725 1613 if [ "$disksize" -gt "2880" ] ; then 1726 if [ "`DidMondoCallMe`" ] ; then 1727 if [ "$CDRECOVERY" != "yes" ] ; then 1728 if [ -e "$MONDO_TMP/NFS-DEV" ] ; then 1729 echo -en "Press <enter> to continue.\n" 1730 elif [ ! "$MONDO_TMP" ] ; then 1731 echo -en "FYI, this is _not_ a Mondo Rescue CD.\n" 1732 else 1733 echo -en "$BOOT_MEDIA_MESSAGE" 1614 if [ "`DidMondoCallMe`" ] ; then 1615 if [ "$CDRECOVERY" != "yes" ] ; then 1616 if [ -e "$MONDOTMP/NFS-DEV" ] ; then 1617 echo -en "Press <enter> to continue.\n" 1618 elif [ ! "$MONDOTMP" ] ; then 1619 echo -en "FYI, this is _not_ a Mondo Rescue CD.\n" 1620 else 1621 echo -en "$BOOT_MEDIA_MESSAGE" 1622 fi 1734 1623 fi 1735 1624 fi 1736 fi1737 1625 fi 1738 1626 if [ "$CDRECOVERY" = "yes" ] ; then … … 1743 1631 echo -en "\n\n\n" 1744 1632 } 1745 1746 1747 1633 1748 1634 … … 1756 1642 rand1=$RANDOM 1757 1643 rand2=$RANDOM 1758 image= /tmp/$rand1.$rand2.img1759 mtpt= /tmp/$rand1.$rand2.mtpt1644 image=$MONDOTMP/$rand1.$rand2.img 1645 mtpt=$MONDOTMP/$rand1.$rand2.mtpt 1760 1646 dd if=/dev/zero of=$image bs=1k count=$disksize 1761 1647 mke2fs -N 26 -F $image > /dev/null … … 1783 1669 CopyBootBFile $mtpt/boot.b 1784 1670 1785 # echo "root=/dev/loop0" > bdlilo.conf1786 1671 MakeLiloConfFile $disksize >> bdlilo.conf 1787 1788 # cat bdlilo.conf > /tmp/bdlilo.conf1789 1790 # cat /home/mondostuff/bdlc > bdlilo.conf1791 1672 1792 1673 chmod 644 bdlilo.conf … … 1795 1676 res=$? 1796 1677 1797 #echo "lilo -v -C bdlilo.conf -r $mtpt"1798 #echo -en "Press enter"; read line1799 1800 1678 cd $old_pwd 1801 1679 umount $mtpt … … 1804 1682 1805 1683 return $res 1806 1807 } 1808 1809 1810 1811 1684 } 1812 1685 1813 1686 … … 1816 1689 disksize=$1 1817 1690 options="" 1818 if [ "$ARCH" != "ia64" ] ; then 1819 echo -en "boot=/dev/loop0\ndisk=/dev/loop0\n" 1820 fi 1821 if [ "$disksize" -eq "2880" ] ; then 1822 echo -en "bios=0x00\nsectors=36\nheads=2\ncylinders=80\n" 1823 elif [ "$disksize" -eq "1722" ] ; then 1824 echo -en "bios=0x00\nsectors=21\nheads=2\ncylinders=82\n" 1825 elif [ "$disksize" -gt "2880" ] ; then 1826 /bin/true 1827 else 1828 echo -en "bios=0x00\nsectors=18\nheads=2\ncylinders=80\n" 1829 fi 1830 if [ "$ARCH" != "ia64" ] ; then 1831 echo -en "install=/boot.b\nmap=/boot.map\n" 1832 fi 1691 1692 if [ "$ARCH" != "ia64" ] ; then 1693 echo -en "boot=/dev/loop0\ndisk=/dev/loop0\n" 1694 fi 1695 if [ "$disksize" -eq "2880" ] ; then 1696 echo -en "bios=0x00\nsectors=36\nheads=2\ncylinders=80\n" 1697 elif [ "$disksize" -eq "1722" ] ; then 1698 echo -en "bios=0x00\nsectors=21\nheads=2\ncylinders=82\n" 1699 elif [ "$disksize" -gt "2880" ] ; then 1700 /bin/true 1701 else 1702 echo -en "bios=0x00\nsectors=18\nheads=2\ncylinders=80\n" 1703 fi 1704 if [ "$ARCH" != "ia64" ] ; then 1705 echo -en "install=/boot.b\nmap=/boot.map\n" 1706 fi 1833 1707 if [ "$CDRECOVERY" = "yes" ] ; then 1834 1708 echo -en "default=RESTORE\n" 1835 1709 elif [ "$disksize" -gt "2880" ] && [ "`DidMondoCallMe`" ] ; then 1836 if [ -e "$MONDO _TMP/NFS-DEV" ] ; then1710 if [ -e "$MONDOTMP/NFS-DEV" ] ; then 1837 1711 echo -en "default=iso\n" 1838 1712 else … … 1848 1722 fi 1849 1723 if [ "$CDRECOVERY" != "yes" ] ; then 1850 echo -en "timeout=300\n"1724 echo -en "timeout=300\n" 1851 1725 fi 1852 1726 echo -en "\n" 1853 1727 if [ "$CDRECOVERY" = "yes" ] ; then 1854 options="RESTORE expert"1728 options="RESTORE expert" 1855 1729 elif [ "$disksize" -gt "2880" ] ; then 1856 1730 if [ "`DidMondoCallMe`" ] ; then 1857 if [ -e "$MONDO _TMP/NFS-DEV" ] ; then1731 if [ -e "$MONDOTMP/NFS-DEV" ] ; then 1858 1732 options="iso" 1859 1733 else … … 1863 1737 else 1864 1738 options="expert" 1865 fi1739 fi 1866 1740 else 1867 1741 options="expert" 1868 1742 fi 1869 1743 for i in $options ; do 1870 ooo=$i1871 [ "$ooo" = "RESTORE" ] && ooo="nuke"1872 if [ "$ARCH" = "ia64" ] ; then1873 rootpart="root=/dev/ram0\n\t"1874 else1875 rootpart=""1876 fi1877 outstr="image=vmlinuz\n\tlabel=$i\n\tinitrd=/mindi.rdz\n\t${rootpart}append=\" rw ramdisk=$ramdisksize ramdisk_size=$ramdisksize maxcpus=1 $ooo_mode $ADDITIONAL_BOOT_PARAMS"1744 ooo=$i 1745 [ "$ooo" = "RESTORE" ] && ooo="nuke" 1746 if [ "$ARCH" = "ia64" ] ; then 1747 rootpart="root=/dev/ram0\n\t" 1748 else 1749 rootpart="" 1750 fi 1751 outstr="image=vmlinuz\n\tlabel=$i\n\tinitrd=/mindi.rdz\n\t${rootpart}append=\" rw ramdisk=$ramdisksize ramdisk_size=$ramdisksize maxcpus=1 $ooo_mode $ADDITIONAL_BOOT_PARAMS" 1878 1752 1879 outstr=$outstr" $ooo_mode" 1880 outstr=$outstr"\"\n" 1881 if [ "$disksize" = "1440" ] ; then 1882 echo -en "$outstr" | sed s/initrd=.*// | grep -v root= 1883 else 1884 echo -en "$outstr" 1885 fi 1886 done 1887 } 1888 1889 1753 outstr=$outstr" $ooo_mode" 1754 outstr=$outstr"\"\n" 1755 if [ "$disksize" = "1440" ] ; then 1756 echo -en "$outstr" | sed s/initrd=.*// | grep -v root= 1757 else 1758 echo -en "$outstr" 1759 fi 1760 done 1761 } 1890 1762 1891 1763 … … 1900 1772 [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel" 1901 1773 echo -en "Making "$disksize"KB boot disk..." 1902 TurnTgzIntoRdz $MINDI_LIB/rootfs $ TMP_ROOT/mindi.rdz $ramdisksize $disksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"1774 TurnTgzIntoRdz $MINDI_LIB/rootfs $MONDOTMP/mindi.rdz $ramdisksize $disksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?" 1903 1775 if [ "$ARCH" != "ia64" ] ; then 1904 1776 [ "$disksize" != "1722" ] && [ "$disksize" != "2880" ] && [ "$disksize" != "5760" ] && Die "PDBI - disksize is $disksize - bad size" … … 1906 1778 echo -en "..." 1907 1779 imagefile=$imagesdir/mindi-bootroot.$disksize.img 1908 mountpoint=$ TMP_ROOT/mountpoint.$$1780 mountpoint=$MONDOTMP/mountpoint.$$ 1909 1781 mkdir -p $mountpoint 1910 1782 dd if=/dev/zero of=$imagefile bs=1k count=$disksize &> /dev/null || Die "Cannot dd blank file" 1911 1783 if [ "$ARCH" = "ia64" ] ; then 1912 mkdosfs $imagefile > /tmp/mke2fs.$$ 2>> /tmp/mke2fs.$$1784 mkdosfs $imagefile > $MONDOTMP/mke2fs.log 2>> $MONDOTMP/mke2fs.log 1913 1785 t=vfat 1914 1786 else 1915 mke2fs -N 26 -m 0 -F $imagefile > /tmp/mke2fs.$$ 2>> /tmp/mke2fs.$$1787 mke2fs -N 26 -m 0 -F $imagefile > $MONDOTMP/mke2fs.log 2>> $MONDOTMP/mke2fs.log 1916 1788 t=ext2 1917 1789 fi 1918 [ "$?" -ne "0" ] && cat /tmp/mke2fs.$$1919 rm -f /tmp/mke2fs.$$1790 [ "$?" -ne "0" ] && cat $MONDOTMP/mke2fs.log 1791 rm -f $MONDOTMP/mke2fs.log 1920 1792 mount -t $t -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)\n\n" 1921 1793 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it … … 1924 1796 liloconf=$mountpoint/etc/lilo.conf 1925 1797 else 1926 liloconf=$mountpoint/elilo.conf1798 liloconf=$mountpoint/elilo.conf 1927 1799 fi 1928 1800 old_pwd=`pwd` … … 1938 1810 MakeLiloConfFile $disksize > $liloconf 1939 1811 1940 echo "Copying $ TMP_ROOT/mindi.rdz to $mountpoint..." >> $LOGFILE1941 cp -f $ TMP_ROOT/mindi.rdz $mountpoint 2>> $LOGFILE1812 echo "Copying $MONDOTMP/mindi.rdz to $mountpoint..." >> $LOGFILE 1813 cp -f $MONDOTMP/mindi.rdz $mountpoint 2>> $LOGFILE 1942 1814 if [ "$?" -ne "0" ] ; then 1943 LogIt "Failed to copy $TMP_ROOT/mindi.rdz to $mountpoint\n"1944 cat $TMP_ROOT/mtpt.$$ >> $LOGFILE1945 LogIt "Please unload some of your modules and try again.\n"1946 rm -f $TMP_ROOT/mtpt.$$1947 LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?)\n"1815 LogIt "Failed to copy $MONDOTMP/mindi.rdz to $mountpoint\n" 1816 cat $MONDOTMP/mtpt.$$ >> $LOGFILE 1817 LogIt "Please unload some of your modules and try again.\n" 1818 rm -f $MONDOTMP/mtpt.$$ 1819 LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?)\n" 1948 1820 retval=$(($retval+1)) 1949 1821 fi … … 1951 1823 1952 1824 mkdir -p $mountpoint/tmp 1953 cp -f $ TMP_ROOT/mondo-restore.cfg $mountpoint/tmp &> /dev/null1825 cp -f $MONDOTMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null 1954 1826 if [ -e "$MINDI_LIB/memtest.img" ] ; then 1955 1827 echo -en "image=/memtest.bin\nlabel=memtest\nn" >> $liloconf … … 1957 1829 # echo "Yep, this is a multi-function CD" > $mountpoint/MULTIFUNC 1958 1830 fi 1959 if [ -d "/home/MondoCD" ] ; then 1960 cp -pRdu /home/MondoCD/* . || Die "Cannot do kung pow" 1961 fi 1962 1963 # copy the kernel across 1831 1832 # copy the kernel across 1964 1833 rm -Rf $mountpoint/lost+found 1965 1834 dd if=/dev/zero of=$mountpoint/zero bs=1k count=16 &> /dev/null … … 1967 1836 cp -f $kernelpath $mountpoint/vmlinuz > /dev/null 2> /dev/null 1968 1837 if [ "$?" -ne "0" ] || [ "$FORCE_DUAL_FLOPPIES" = "yes" ] ; then 1969 echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE1970 du -sk $mountpoint/* >> $LOGFILE1971 echo "--- end of list of files ---" >> $LOGFILE1972 echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n\1838 echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE 1839 du -sk $mountpoint/* >> $LOGFILE 1840 echo "--- end of list of files ---" >> $LOGFILE 1841 echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n\ 1973 1842 Sorry, your kernel is too big for a boot/root floppy.\nI'll try the new boot/root two-disk thingy.\n" >> $LOGFILE 1974 1843 rm -f $mountpoint/vmlinuz 1975 cd $old_pwd1844 cd $old_pwd 1976 1845 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1977 1846 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)\n" 1978 # losetup /dev/loop0 -d1979 res=01847 # losetup /dev/loop0 -d 1848 res=0 1980 1849 write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 1440 1981 res=$(($res+$?))1982 cp -f $ TMP_ROOT/mindi.rdz $imagesdir/mindi-root.1440.img1983 res=$(($res+$?))1984 rm -f $imagefile1985 if [ "$res" -ne "0" ]; then1986 LogIt "Warning - failed to create 1.44MB boot/root floppies\n"1987 rm -f $imagesdir/mindi-*.1440.img1988 fi1989 return $res1850 res=$(($res+$?)) 1851 cp -f $MONDOTMP/mindi.rdz $imagesdir/mindi-root.1440.img 1852 res=$(($res+$?)) 1853 rm -f $imagefile 1854 if [ "$res" -ne "0" ]; then 1855 LogIt "Warning - failed to create 1.44MB boot/root floppies\n" 1856 rm -f $imagesdir/mindi-*.1440.img 1857 fi 1858 return $res 1990 1859 fi 1991 1860 free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4` … … 2004 1873 elif [ ! "$KERN_DISK_MADE" ] ; then 2005 1874 # 12/28/2001 - if 1.72MB floppy then don't use LILO's optimizations at all 2006 $LILO_EXE -r $mountpoint >> $LOGFILE 2>> $LOGFILE 2007 else 2008 echo "Not running LILO. It's not that kind of disk." >> $LOGFILE 2009 fi 1875 $LILO_EXE -r $mountpoint >> $LOGFILE 2>> $LOGFILE 1876 else 1877 echo "Not running LILO. It's not that kind of disk." >> $LOGFILE 1878 fi 1879 1880 # BERLIOS does not test necessarily what it expects 2010 1881 if [ $? -ne "0" ] ; then 2011 if [ "`grep -F "/tmp/dev.0" $LOGFILE`" ] ; then2012 LogIt "The '/tmp/dev.0' error is NOT Mindi's fault. It is LILO's.\n"2013 LogIt "Please reboot your PC as a workaround.\n"2014 Die "LILO sneezed and Mindi caught a cold. Please read the README / FAQ.\n"2015 fi2016 echo "$LILO_EXE -r $mountpoint ...failed."2017 echo -en "Press ENTER to continue."; read line2018 LogIt "Cannot run lilo on $mountpoint\nPlease upgrade/downgrade your version of LILO. It has a bug.\n"2019 retval=$(($retval+1))2020 fi 2021 cp -f $liloconf /tmp/lilo.conf1882 if [ "`grep -F "/tmp/dev.0" $LOGFILE`" ] ; then 1883 LogIt "The '/tmp/dev.0' error is NOT Mindi's fault. It is LILO's.\n" 1884 LogIt "Please reboot your PC as a workaround.\n" 1885 Die "LILO sneezed and Mindi caught a cold. Please read the README / FAQ.\n" 1886 fi 1887 echo "$LILO_EXE -r $mountpoint ...failed." 1888 echo -en "Press ENTER to continue."; read line 1889 LogIt "Cannot run lilo on $mountpoint\nPlease upgrade/downgrade your version of LILO. It has a bug.\n" 1890 retval=$(($retval+1)) 1891 fi 1892 cp -f $liloconf $MONDOTMP/lilo.conf 2022 1893 if [ "$ARCH" = "ia64" ] ; then 2023 1894 cp `dirname $kernelpath`/*.efi $mountpoint … … 2039 1910 return $retval 2040 1911 } 2041 2042 2043 1912 2044 1913 … … 2052 1921 local retval old_pwd 2053 1922 retval=0 1923 2054 1924 [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel" 2055 1925 echo -en "Making "$disksize"KB boot disk..." 2056 TurnTgzIntoRdz $MINDI_LIB/rootfs $ TMP_ROOT/mindi.rdz $ramdisksize $disksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"1926 TurnTgzIntoRdz $MINDI_LIB/rootfs $MONDOTMP/mindi.rdz $ramdisksize $disksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?" 2057 1927 [ "$disksize" != "1722" ] && [ "$disksize" != "2880" ] && [ "$disksize" != "5760" ] && Die "PDBI - disksize is $disksize - bad size" 2058 1928 echo -en "..." 2059 1929 imagefile=$imagesdir/mindi-bootroot.$disksize.img 2060 mountpoint=$ TMP_ROOT/mountpoint.$$1930 mountpoint=$MONDOTMP/mountpoint.$$ 2061 1931 mkdir -p $mountpoint 2062 1932 # If I format a 1722KB data file & run syslinux on it, the resultant image … … 2074 1944 fi 2075 1945 mount -t vfat -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)\n\n" 2076 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it 1946 1947 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it 2077 1948 old_pwd=`pwd` 2078 1949 MakeSyslinuxMessageFile $mountpoint/message.txt 2079 1950 cd $mountpoint 2080 1951 [ -e "$sys_cfg_file" ] || Die "Obi Wan, word up?" 2081 # tar -zxf $MINDI_LIB/dev.tgz || LogIt "Cannot untar dev.tgz\n" <--- present for LILO; is it nec. for SYSLINUX too?2082 1952 cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $mountpoint > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root" 2083 if [ -e "$MONDO _TMP/NFS-DEV" ] ; then1953 if [ -e "$MONDOTMP/NFS-DEV" ] ; then 2084 1954 mv syslinux.cfg syslinux.cfg.orig 2085 1955 sed s/interactive/iso/ syslinux.cfg.orig > syslinux.cfg 2086 1956 fi 2087 1957 cd $old_pwd 2088 echo "Copying $ TMP_ROOT/mindi.rdz to $mountpoint/initrd.img..." >> $LOGFILE2089 cp -f $ TMP_ROOT/mindi.rdz $mountpoint/initrd.img 2>> $LOGFILE1958 echo "Copying $MONDOTMP/mindi.rdz to $mountpoint/initrd.img..." >> $LOGFILE 1959 cp -f $MONDOTMP/mindi.rdz $mountpoint/initrd.img 2>> $LOGFILE 2090 1960 if [ "$?" -ne "0" ] ; then 2091 LogIt "Failed to copy $ TMP_ROOT/mindi.rdz to $mountpoint\n"2092 cat $ TMP_ROOT/mtpt.$$ >> $LOGFILE1961 LogIt "Failed to copy $MONDOTMP/mindi.rdz to $mountpoint\n" 1962 cat $MONDOTMP/mtpt.$$ >> $LOGFILE 2093 1963 LogIt "Please unload some of your modules and try again.\n" 2094 rm -f $ TMP_ROOT/mtpt.$$1964 rm -f $MONDOTMP/mtpt.$$ 2095 1965 LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?)\n" 2096 1966 retval=$(($retval+1)) … … 2098 1968 2099 1969 mkdir -p $mountpoint/tmp 2100 cp -f $ TMP_ROOT/mondo-restore.cfg $mountpoint/tmp &> /dev/null2101 2102 # copy the kernel across1970 cp -f $MONDOTMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null 1971 1972 # copy the kernel across 2103 1973 rm -Rf $mountpoint/lost+found 2104 1974 dd if=/dev/zero of=$mountpoint/zero bs=1k count=16 &> /dev/null … … 2115 1985 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 2116 1986 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)\n" 2117 # losetup /dev/loop0 -d2118 1987 2119 1988 res=0 2120 1989 write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 1440 2121 1990 res=$(($res+$?)) 2122 cp -f $ TMP_ROOT/mindi.rdz $imagesdir/mindi-root.1440.img1991 cp -f $MONDOTMP/mindi.rdz $imagesdir/mindi-root.1440.img 2123 1992 res=$(($res+$?)) 2124 1993 rm -f $imagefile … … 2133 2002 echo "Free space left on floppy = $free_space KB" >> $LOGFILE 2134 2003 echo "Max kernel size on $disksize KB floppy (est'd) = $max_kernel_size K" >> $LOGFILE 2135 # make it bootable 2004 2005 # make it bootable 2136 2006 rm -f $mountpoint/zero 2137 2007 mkdir -p $mountpoint/etc … … 2162 2032 imagesdir=$1 2163 2033 rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso 2164 needlist=$ TMP_ROOT/what-we-need.txt2165 bigdir=$ TMP_ROOT/bigdir2166 minidir_root=$ TMP_ROOT/minidir2034 needlist=$MONDOTMP/what-we-need.txt 2035 bigdir=$MONDOTMP/bigdir 2036 minidir_root=$MONDOTMP/minidir 2167 2037 mkdir -p $minidir_root 2168 2038 mkdir -p $bigdir/usr/bin 2169 tardir=$ TMP_ROOT/tardir2039 tardir=$MONDOTMP/tardir 2170 2040 2171 2041 lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt | grep -vx "" | wc -l` … … 2173 2043 res=$? 2174 2044 if [ "$YOUR_KERNEL_SUCKS" ]; then 2175 pwd=`pwd`2176 cd $TMP_ROOT2045 pwd=`pwd` 2046 cd $MONDOTMP 2177 2047 for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do 2178 cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir" 2179 if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then 2180 cp --parents -pRdf $i $bigdir 2181 else 2182 ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO 2183 BIGNO=$(($BIGNO+1)) 2184 fi 2185 done 2186 for i in $EXTRA_MODS ; do 2187 j=`find lib/modules/$FAILSAFE_KVER -name $i.*o 2> /dev/null` 2188 [ ! "$j" ] && echo "Warning - cannot find failsafe module $i.o" >> $LOGFILE 2189 for k in $j ; do 2190 if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then 2191 cp --parents -pRdf $k $bigdir 2192 else 2193 ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO 2194 BIGNO=$(($BIGNO+1)) 2195 fi 2196 echo "Added failsafe module $k to ramdisk" >> $LOGFILE 2048 cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir" 2049 if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then 2050 cp --parents -pRdf $i $bigdir 2051 else 2052 ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO 2053 BIGNO=$(($BIGNO+1)) 2054 fi 2197 2055 done 2198 done 2199 cd $pwd 2200 else 2201 ListKernelModulePaths >> $needlist 2056 for i in $EXTRA_MODS ; do 2057 j=`find lib/modules/$FAILSAFE_KVER -name $i.*o 2> /dev/null` 2058 [ ! "$j" ] && echo "Warning - cannot find failsafe module $i.o" >> $LOGFILE 2059 for k in $j ; do 2060 if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then 2061 cp --parents -pRdf $k $bigdir 2062 else 2063 ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO 2064 BIGNO=$(($BIGNO+1)) 2065 fi 2066 echo "Added failsafe module $k to ramdisk" >> $LOGFILE 2067 done 2068 done 2069 cd $pwd 2070 else 2071 ListKernelModulePaths >> $needlist 2202 2072 fi 2203 2073 if [ "$res" -ne "0" ] ; then … … 2207 2077 mkdir -p $bigdir/tmp 2208 2078 if [ "`DidMondoCallMe`" ] ; then 2209 MakeMondoConfigFile $TMP_ROOT/mondo-restore.cfg 2210 cp -f $TMP_ROOT/mondo-restore.cfg $bigdir/tmp &> /dev/null 2211 cp -f $TMP_ROOT/mondo-restore.cfg $CACHE_LOC &> /dev/null 2079 MakeMondoConfigFile $MONDOTMP/mondo-restore.cfg 2080 cp -f $MONDOTMP/mondo-restore.cfg $bigdir/tmp &> /dev/null 2212 2081 fi 2213 2082 [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO … … 2216 2085 CopyDependenciesToDirectory < $needlist $bigdir 2217 2086 2218 # also copy io.sys and msdos.sys, if we can find them2087 # also copy io.sys and msdos.sys, if we can find them 2219 2088 for i in `mount | cut -d' ' -f3` ; do 2220 for j in io.sys msdos.sys ; do2221 [ -e "$i/$j" ] && cp -f $i/$j $bigdir2222 done2223 done 2224 2225 # master boot record, too2226 i=`cat $MONDO _TMP/BOOTLOADER.DEVICE 2> /dev/null`2089 for j in io.sys msdos.sys ; do 2090 [ -e "$i/$j" ] && cp -f $i/$j $bigdir 2091 done 2092 done 2093 2094 # master boot record, too 2095 i=`cat $MONDOTMP/BOOTLOADER.DEVICE 2> /dev/null` 2227 2096 if [ "$i" ] ; then 2228 LogIt "Backing up $i's MBR\n" 2229 dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE 2230 # < < E O F 2231 sleep 1 2232 sync 2233 # [ "$?" -ne "0" ] && echo "Failed to save $i's MBR to bigdir" >> $LOGFILE 2234 j=$i 2235 [ -h "$j" ] && j=`readlink -f $j` 2236 LogIt "Creating /dev/boot_device ($j)\n" 2237 mkdir -p $bigdir/dev 2238 cp -pRdf $j $bigdir/dev/boot_device || Die "Unable to create /dev/boot_device on ramdisk" 2239 fi 2240 2241 # more stuff 2242 # cp -f $MINDI_LIB/embleer* $bigdir 2097 LogIt "Backing up $i's MBR\n" 2098 dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE 2099 sleep 1 2100 sync 2101 j=$i 2102 [ -h "$j" ] && j=`readlink -f $j` 2103 LogIt "Creating /dev/boot_device ($j)\n" 2104 mkdir -p $bigdir/dev 2105 cp -pRdf $j $bigdir/dev/boot_device || Die "Unable to create /dev/boot_device on ramdisk" 2106 fi 2107 2243 2108 old_pwd=`pwd` 2244 2109 cd $bigdir … … 2247 2112 cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n" 2248 2113 if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then 2249 tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n"2114 tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n" 2250 2115 fi 2251 2116 if [ -e "$MONDO_SHARE/restore-scripts" ] ; then … … 2265 2130 # EXTRA_SPACE=$(($EXTRA_SPACE*2)) 2266 2131 # fi 2267 MakeMountlist $ TMP_ROOT/mountlist.txt2132 MakeMountlist $MONDOTMP/mountlist.txt 2268 2133 mkdir -p $minidir_root/$noof_disks/tmp 2269 cp -f $TMP_ROOT/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $TMP_ROOT to data disk" 2270 cp -f $TMP_ROOT/mountlist.txt $CACHE_LOC 2271 [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDO_TMP/. 2134 cp -f $MONDOTMP/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $MONDOTMP to data disk" 2135 [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDOTMP/. 2272 2136 [ $LVM != "false" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm 2273 2137 cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE … … 2275 2139 CreateDataDiskImagesFromTarballs $tardir $imagesdir $noof_disks 2276 2140 FRIENDLY_OUTSTRING="Boot and data disk images were created." 2277 # One 1.72MB boot disk, one 2.88MB boot disk and $noof_disks data disk images2141 # One 1.72MB boot disk, one 2.88MB boot disk and $noof_disks data disk images 2278 2142 rmdir $tardir $bigdir 2279 2143 rm -f $needlist … … 2297 2161 2298 2162 2299 2300 2163 Prompt() { 2301 2164 echo -en "$1" 2302 2165 read line 2303 2166 } 2304 2305 2167 2306 2168 … … 2310 2172 i=0 2311 2173 while [ "$i" -le "32" ] && [ "$incoming" = "" ] ; do 2312 i=$(($i+1))2313 read incoming2174 i=$(($i+1)) 2175 read incoming 2314 2176 done 2315 2177 echo "$incoming" 2316 2178 } 2317 2318 2179 2319 2180 … … 2331 2192 [ -h "$minidir_root/$diskno/$fname" ] && MoveHyperlinkSensibly $fname $minidir_root $diskno $noof_disks 2332 2193 done 2333 diskno=$(($diskno+1)) 2334 done 2335 2194 diskno=$(($diskno+1)) 2195 done 2336 2196 2337 2197 cd $old_pwd 2338 2198 return 2339 2340 2341 2342 # do some awk/gawk stuff2343 cd $minidir_root2344 awk_loc=`find -name awk`2345 gawk_loc=`find -name gawk`2346 if [ "$awk_loc" = "" ] && [ "$gawk_loc" != "" ] ; then2347 for i in $gawk_loc ; do HackAwk $i gawk ; done2348 elif [ "$gawk_loc" = "" ] && [ "$awk_loc" != "" ] ; then2349 for i in $awk_loc ; do HackAwk $i awk ; done2350 elif [ "$gawk_loc" != "" ] && [ "$awk_loc" != "" ] ; then2351 echo -en "Gawk/awk found. Good.\r"2352 else2353 Die "Look, I don't want to come across as having an attitude, but you need either awk or gawk. Get a distro that doesn't suck, okay? :-)"2354 fi2355 cd $old_pwd2356 2199 } 2357 2200 … … 2359 2202 ReplaceIndividualLine() { 2360 2203 local orig_file new_file lino newstring lines_total lines_remaining 2204 2361 2205 orig_file=$1.orig 2362 2206 mv -f $1 $orig_file || Die "Cannot move $1 to $orig_file" … … 2365 2209 newstring="$3" 2366 2210 if [ "$lino" = "" ] || [ "$lino" -lt "1" ] ; then 2367 echo "Can't find string" >> $LOGFILE2368 return 12211 echo "Can't find string" >> $LOGFILE 2212 return 1 2369 2213 fi 2370 2214 lines_total=`wc -l $orig_file | gawk '{print $1;}'` … … 2375 2219 tail -n$lines_remaining $orig_file >> $new_file 2376 2220 echo "Replace line $lino of $new_file with user-specified line, '$newstring'" >> $LOGFILE 2377 # cp -f $new_file /tmp/init.new2378 2221 [ -x "$orig_file" ] && chmod +x $new_file 2379 2222 rm -f $orig_file … … 2389 2232 done 2390 2233 } 2391 2392 2234 2393 2235 … … 2396 2238 device=$1 2397 2239 if [ "`echo "$device" | grep -F "/dev/md"`" != "" ] ; then 2398 res=`SizeOfRaidPartition $device` 2399 [ "$res" = "" ] && Die "Cannot find $device's size - is your /etc/raidtab sane?" 2400 echo "$res" 2401 return 0 2402 fi 2403 # res=`$FDISK -l 2>> $LOGFILE | grep -w "$device" | head -n1 | sort -u | tr '*' ' ' | tr -s '\t' '|' | tr -s ' ' ' ' | cut -d' ' -f4 | sed s/+// | sed s/-//` 2404 # patch from Bill <bill@iwizard.biz> - 2003/08/25 2240 res=`SizeOfRaidPartition $device` 2241 [ "$res" = "" ] && Die "Cannot find $device's size - is your /etc/raidtab sane?" 2242 echo "$res" 2243 return 0 2244 fi 2245 # patch from Bill <bill@iwizard.biz> - 2003/08/25 2405 2246 res=`$FDISK -s $device` 2406 2247 echo "------- $FDISK -l $device log ------------" >> $LOGFILE 2407 2248 cat $FDISKLOG >> $LOGFILE 2408 2249 echo "------- $FDISK log end ------------" >> $LOGFILE 2409 # end patch2250 # end patch 2410 2251 [ "$res" = "" ] && res=`df -k -P -x supermount | tr -s '\t' ' ' | grep -F "$device " | cut -d' ' -f2` 2411 2252 [ "$res" = "" ] && res="-1" … … 2422 2263 2423 2264 for real_dev in `GetRaidDevMembers $1` ; do 2424 tmp=`SizeOfPartition $real_dev`2425 [ "$tmp" -lt "$smallest_size" ] && smallest_size=$tmp2265 tmp=`SizeOfPartition $real_dev` 2266 [ "$tmp" -lt "$smallest_size" ] && smallest_size=$tmp 2426 2267 done 2427 2268 2428 2269 if [ "$smallest_size" = "$silly" ] ; then 2429 echo "-1" 2430 return 1 2431 else 2432 echo "$smallest_size" 2433 return 0 2434 fi 2435 } 2436 2437 2438 2439 2270 echo "-1" 2271 return 1 2272 else 2273 echo "$smallest_size" 2274 return 0 2275 fi 2276 } 2440 2277 2441 2278 … … 2443 2280 { 2444 2281 local tempfile 2445 tempfile=$TMP_ROOT/$$.strip.txt 2282 2283 tempfile=$MONDOTMP/$$.strip.txt 2446 2284 cp -f $1 $tempfile 2447 2285 $AWK '{if (substr($0,0,1)!="#" || substr($0,0,3)=="#!/") {print $0;};}' $tempfile > $1 … … 2451 2289 2452 2290 2453 2454 2455 2456 2457 2291 SplitDirectoryIntoMinidirs() { 2458 2292 local bigdir minidir_root i noof_disks old_pwd res 2293 2459 2294 bigdir=$1 2460 2295 minidir_root=$2 … … 2464 2299 noof_disks=$? 2465 2300 if [ "$noof_disks" -eq "0" ] ; then 2466 echo "Failed to fit data into several dirs."2301 echo "Failed to fit data into several dirs." 2467 2302 return 0 2468 2303 fi 2469 2304 RejigHyperlinks $minidir_root $noof_disks 2470 2305 rm -Rf $bigdir/* 2471 return $noof_disks 2472 } 2473 2306 return $noof_disks 2307 } 2474 2308 2475 2309 … … 2477 2311 { 2478 2312 local tmpfile 2479 tmpfile=$TMP_ROOT/stripped.$$.dat 2313 2314 tmpfile=$MONDOTMP/stripped.$$.dat 2480 2315 [ -d "$1" ] || [ -h "$1" ] && return 2481 2316 cp -f $1 $tmpfile 2482 2317 strip $tmpfile 2> /dev/null 2483 2318 if [ "$?" -eq "0" ] ; then 2484 cp -f $tmpfile $12485 echo "Stripped binary $2" >> $LOGFILE2319 cp -f $tmpfile $1 2320 echo "Stripped binary $2" >> $LOGFILE 2486 2321 fi 2487 2322 rm -f $tmpfile … … 2508 2343 2509 2344 2510 2511 2345 TryToFindKernelPath() { 2512 2346 local fname incoming res fkern_ver we_want_version possible_kernels noof_kernels kernelpath kdate duff_kernels 2347 2513 2348 we_want_version=`uname -r` 2514 2349 possible_kernels="" … … 2521 2356 fi 2522 2357 for fname in `find $root -maxdepth 2 -type f | grep -F lin | grep -Ev '^/proc/|^/net/'` ; do 2523 [ ! -e "$fname" ] && continue2358 [ ! -e "$fname" ] && continue 2524 2359 [ "$fname" = "/boot/vmlinuz.shipped" ] && [ -f "/boot/vmlinuz" ] && continue; # ignore SuSE's extra kernel 2525 file $fname | grep -q gzip2526 if [ "$?" -eq "0" ] ; then2527 # Used by ia642360 file $fname | grep -q gzip 2361 if [ "$?" -eq "0" ] ; then 2362 # Used by ia64 2528 2363 fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep "[2-9]+*[.][0-9]+*[.][0-9]+*[^\@]*@"` 2529 else2364 else 2530 2365 fkern_ver=`strings $fname 2> /dev/null | grep "[2-9]+*[.][0-9]+*[.][0-9]+*[^\@]*@"` 2531 fi2366 fi 2532 2367 [ "$fkern_ver" = "" ] && continue 2533 # echo "$fname --> $fkern_ver (but we want $we_want_version)" >> /dev/stderr2534 2368 [ "`echo "$fkern_ver" |grep -F "$we_want_version "`" = "" ] && continue 2535 [ -f "$fname" ] || continue2536 [ -h "$fname" ] && continue2537 kdate=`uname -v | $AWK '{for(i=1;i<NF;i++){if(index($i,":")){print $i;};};}' | $AWK '{print $NF;}'`2538 file $fname | grep -q gzip2539 if [ "$?" -eq "0" ] ; then2540 # Used by ia642541 if [ "`gzip -cd $fname | strings 2> /dev/null | grep -F "$kdate"`" = "" ] ; then2542 LogIt "Have you recompiled your kernel \"$fname\" w/o rebooting? Naughty but I'll allow it...\n"2543 duff_kernels="$fname $duff_kernels"2544 else2369 [ -f "$fname" ] || continue 2370 [ -h "$fname" ] && continue 2371 kdate=`uname -v | $AWK '{for(i=1;i<NF;i++){if(index($i,":")){print $i;};};}' | $AWK '{print $NF;}'` 2372 file $fname | grep -q gzip 2373 if [ "$?" -eq "0" ] ; then 2374 # Used by ia64 2375 if [ "`gzip -cd $fname | strings 2> /dev/null | grep -F "$kdate"`" = "" ] ; then 2376 LogIt "Have you recompiled your kernel \"$fname\" w/o rebooting? Naughty but I'll allow it...\n" 2377 duff_kernels="$fname $duff_kernels" 2378 else 2545 2379 [ "`echo "$fname" | grep -F "vmlinux"`" ] && continue 2546 2380 possible_kernels="$fname $possible_kernels" 2547 fi 2548 else 2549 if [ "`strings $fname 2> /dev/null | grep -F "$kdate"`" = "" ] ; then 2550 LogIt "Have you recompiled your kernel \"$fname\" w/o rebooting?\n Naughty but I'll allow it...\n" 2551 duff_kernels="$fname $duff_kernels" 2381 fi 2552 2382 else 2383 if [ "`strings $fname 2> /dev/null | grep -F "$kdate"`" = "" ] ; then 2384 LogIt "Have you recompiled your kernel \"$fname\" w/o rebooting?\n Naughty but I'll allow it...\n" 2385 duff_kernels="$fname $duff_kernels" 2386 else 2553 2387 [ "`echo "$fname" | grep -F "vmlinux"`" ] && continue 2554 2388 possible_kernels="$fname $possible_kernels" 2555 fi2556 fi2389 fi 2390 fi 2557 2391 done 2558 2392 if [ ! "$possible_kernels" ] && uname -a | grep Knoppix > /dev/null ; then 2559 possible_kernels=`find /boot/vmlinuz-2.* | tail -n1`2393 possible_kernels=`find /boot/vmlinuz-2.* | tail -n1` 2560 2394 fi 2561 2395 if [ ! "$possible_kernels" ] ; then … … 2573 2407 if [ "$noof_kernels" -eq "0" ] ; then 2574 2408 LogIt "Could not find your kernel.\n" 2575 if [ -e "/boot/vmlinuz" ] ; then2576 LogIt "Using /boot/vmlinuz as a last resort.\n"2577 output=/boot/vmlinuz2409 if [ -e "/boot/vmlinuz" ] ; then 2410 LogIt "Using /boot/vmlinuz as a last resort.\n" 2411 output=/boot/vmlinuz 2578 2412 else 2579 output=""2580 fi2413 output="" 2414 fi 2581 2415 elif [ "$noof_kernels" -eq "1" ] ; then 2582 2416 kernelpath=`echo "$possible_kernels" | sed s/' '//` … … 2586 2420 for i in $possible_kernels ; do 2587 2421 if echo $i | grep "`uname -r`" ; then 2588 LogIt "OK, I used my initiative and found that "2422 LogIt "OK, I used my initiative and found that " 2589 2423 LogIt "$i is probably your kernel.\n " 2590 output="$i"2591 return2592 fi2424 output="$i" 2425 return 2426 fi 2593 2427 done 2594 if echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null ; then2595 output=/boot/vmlinuz2596 echo "Schlomo, this one's for you." >> $LOGFILE2597 else2428 if echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null ; then 2429 output=/boot/vmlinuz 2430 echo "Schlomo, this one's for you." >> $LOGFILE 2431 else 2598 2432 LogIt "Two or more possible kernels found. You may specify any one of them and the \n" 2599 LogIt "boot disks will still work, probably. If one does not work, try another.\n"2433 LogIt "boot disks will still work, probably. If one does not work, try another.\n" 2600 2434 LogIt "$possible_kernels\n" 2601 2435 echo "" 2602 fi2436 fi 2603 2437 fi 2604 2438 echo "$output" | tr -s ' ' '\n' | sort -u | tr '\n' ' ' 2605 2439 } 2606 2607 2608 2609 2440 2610 2441 … … 2612 2443 local bigdir minidir_root noof_disks diskno list_of_files filename old_pwd progress 2613 2444 local i retval noof_disks total_files list_of_devs 2445 2614 2446 bigdir=$1 2615 2447 minidir_root=$2 … … 2635 2467 for filename in $list_of_files ; do 2636 2468 AddFileToDir $filename $minidir_root $noof_disks 2637 i=$?2638 if [ "$i" -gt "$noof_disks" ] ; then2639 noof_disks=$i2640 echo -en "\r\t\t\t\t\t\t($noof_disks disks)"2641 fi2642 if [ "$i" -eq "0" ] ; then2643 LogIt "Cannot add file $filename to minidir $minidir_root\n"2644 retval=$(($retval+1))2645 fi2469 i=$? 2470 if [ "$i" -gt "$noof_disks" ] ; then 2471 noof_disks=$i 2472 echo -en "\r\t\t\t\t\t\t($noof_disks disks)" 2473 fi 2474 if [ "$i" -eq "0" ] ; then 2475 LogIt "Cannot add file $filename to minidir $minidir_root\n" 2476 retval=$(($retval+1)) 2477 fi 2646 2478 progress=$(($progress+1)) 2647 echo -en "\r\t\t\t\t\t\t\t\t$(($progress*100/$total_files))% complete\r"2479 echo -en "\r\t\t\t\t\t\t\t\t$(($progress*100/$total_files))% complete\r" 2648 2480 done 2649 2481 cd $old_pwd … … 2651 2483 rm -Rf $minidir_root/compressed 2652 2484 if [ "$retval" -gt "0" ] ; then 2653 return 0 2654 else 2655 return $noof_disks 2656 fi 2657 } 2658 2485 return 0 2486 else 2487 return $noof_disks 2488 fi 2489 } 2659 2490 2660 2491 2661 2492 TurnTgzIntoRdz() { 2662 2493 local tgz_dir_fname rdz_fname ramdisksize tempfile mountpoint old_pwd nodes disksize kernelsize maxsize res currsize not_copied j k floppy_modules s w 2494 2663 2495 tgz_dir_fname=$1 2664 2496 rdz_fname=$2 … … 2668 2500 maxsize=$(($disksize-$kernelsize)) 2669 2501 maxsize=$(($maxsize*2)); # to allow for compression of 50% 2670 tempfile=$ TMP_ROOT/temp.rd2671 mountpoint=$ TMP_ROOT/mnt12502 tempfile=$MONDOTMP/temp.rd 2503 mountpoint=$MONDOTMP/mnt1 2672 2504 res=0 2673 2505 echo -en "..." … … 2676 2508 mke2fs -b 1024 -m 1 -i 2048 -F $tempfile >> $LOGFILE 2>> $LOGFILE 2677 2509 2678 [ "$?" -ne "0" ] && cat /tmp/mke2fs.$$2679 rm -f /tmp/mke2fs.$$2510 [ "$?" -ne "0" ] && cat $MONDOTMP/mke2fs.log 2511 rm -f $MONDOTMP/mke2fs.log 2680 2512 echo -en "..." 2681 2513 mkdir -p $mountpoint … … 2684 2516 old_pwd=`pwd` 2685 2517 cd $mountpoint 2686 # [ -e "$MINDI_LIB/memtest.img" ] && echo "Yep, this is a multi-function CD" > MULTIFUNC2687 2518 cp -Rdf $tgz_dir_fname/* . 2>> $LOGFILE >> $LOGFILE 2688 2519 tar -zxf symlinks.tgz || Die "Cannot untar symlinks.tgz" … … 2692 2523 cd .. 2693 2524 2694 # add insmod.static and insmod.static.old if (a) they exist and (b) this is a 64-bit distro2695 # if [ "`uname -a | grep x86`" ] || [ "`uname -a | grep amd64`" ] ; then2696 2697 2525 for w in insmod.static insmod.static.old ; do 2698 s=`which $w 2> /dev/null` 2699 if [ -e "$s" ] ; then 2700 cp --parents -af $s . 2701 # LogIt "Copying $s to initrd" 2702 fi 2703 done 2704 2705 # fi 2526 s=`which $w 2> /dev/null` 2527 if [ -e "$s" ] ; then 2528 cp --parents -af $s . 2529 fi 2530 done 2706 2531 2707 2532 mkdir -p tmp … … 2710 2535 mkdir -p mnt/$w 2711 2536 done 2712 if [ "$RUN_AFTER_INITIAL_BOOT_PHASE" ] ; then2713 ReplaceIndividualLine sbin/init `grep -n "#WHOLIVESINAPINEAPPLEUNDERTHESEA#" sbin/init | cut -d':' -f1` "$RUN_AFTER_INITIAL_BOOT_PHASE"2714 fi2537 #if [ "$RUN_AFTER_INITIAL_BOOT_PHASE" ] ; then 2538 #ReplaceIndividualLine sbin/init `grep -n "#WHOLIVESINAPINEAPPLEUNDERTHESEA#" sbin/init | cut -d':' -f1` "$RUN_AFTER_INITIAL_BOOT_PHASE" 2539 #fi 2715 2540 if [ "$RUN_AFTER_BOOT_PHASE_COMPLETE" ] ; then 2716 ReplaceIndividualLine sbin/init `grep -n "#ABSORBENTANDYELLOWANDPOROUSISHE#" sbin/init | cut -d':' -f1` "$RUN_AFTER_BOOT_PHASE_COMPLETE"2541 ReplaceIndividualLine sbin/init `grep -n "#ABSORBENTANDYELLOWANDPOROUSISHE#" sbin/init | cut -d':' -f1` "$RUN_AFTER_BOOT_PHASE_COMPLETE" 2717 2542 fi 2718 2543 … … 2726 2551 old_pwd=`pwd` 2727 2552 if [ "$YOUR_KERNEL_SUCKS" ] ; then 2728 cd $ TMP_ROOT2553 cd $MONDOTMP 2729 2554 floppy_modules_path=lib/modules/$FAILSAFE_KVER 2730 2555 else … … 2750 2575 list_of_groovy_mods="$CDROM_MODS `WhichOfTheseModulesAreLoaded "$SCSI_MODS"`" 2751 2576 fi 2752 if [ -e "$MONDO _TMP/NFS-DEV" ] ; then2577 if [ -e "$MONDOTMP/NFS-DEV" ] ; then 2753 2578 # For PXE boot 2754 2579 list_of_groovy_mods="$list_of_groovy_mods $NET_MODS" … … 2760 2585 for i in $floppy_modules ; do 2761 2586 [ -e "$i" ] && s=`du -sk $i | cut -f1` || s="" 2762 [ "$YOUR_KERNEL_SUCKS" ] && i=$ TMP_ROOT/$i2587 [ "$YOUR_KERNEL_SUCKS" ] && i=$MONDOTMP/$i 2763 2588 echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE 2764 2589 cp -df $i $mountpoint/ || LogIt "Unable to copy $i to $mountpoint\n" 2765 2590 [ "`echo "$i" | grep -F ".gz"`" ] && gunzip -f $mountpoint/`basename $i` 2766 2591 done 2767 # if [ -e "/dev/.devfsd" ] ; then2768 # echo "Copying devfs stuff to ramdisk" >> $LOGFILE2769 # for i in /dev /etc/devfsd.conf /etc/modules.devfs /lib/dev-state ; do2770 # cp --parents -pRdf $i $mountpoint/ 2>> $LOGFILE2771 # done2772 # fi2773 2592 if [ ! -e "/sbin/devfsd" ] || [ "$disksize" -lt "2880" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then 2774 2593 echo "Deleting devfsd daemon from ramdisk" >> $LOGFILE … … 2776 2595 [ "$disksize" -lt "2880" ] && echo "...because disksize = $disksize" >> $LOGFILE 2777 2596 [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] && echo "...because kernel is failsafe" >> $LOGFILE 2778 # ls -l $mountpoint/sbin/devfsd &> /dev/null || Die "Can't find devfsd daemon on ramdisk"2779 2597 rm -f $mountpoint/sbin/devfsd 2780 2598 fi … … 2785 2603 if [ "`DidMondoCallMe`" ] ; then 2786 2604 MakeMondoConfigFile $mountpoint/tmp/mondo-restore.cfg 2787 cp -f $mountpoint/tmp/mondo-restore.cfg $MONDO _TMP &> /dev/null2788 cp -f $ TMP_ROOT/mountlist.txt $mountpoint/tmp/ || Die "Cannot copy mountlist to ramdisk"2605 cp -f $mountpoint/tmp/mondo-restore.cfg $MONDOTMP &> /dev/null 2606 cp -f $MONDOTMP/mountlist.txt $mountpoint/tmp/ || Die "Cannot copy mountlist to ramdisk" 2789 2607 echo -en "$FILES_IN_FILELIST" > $mountpoint/tmp/FILES-IN-FILELIST 2790 2608 echo -en "$LAST_FILELIST_NUMBER" > $mountpoint/tmp/LAST-FILELIST-NUMBER … … 2810 2628 2811 2629 2812 2813 2630 WhichOfTheseModulesAreLoaded() { 2814 2631 local modname loaded_modules 2815 2632 loaded_modules=" `lsmod | tr -s ' ' '\t' | cut -f1 | grep -Fvx "Modules" | tr '\n' ' '` " 2816 2633 for modname in $1 ; do 2817 [ "`echo "$loaded_modules" | grep -F " $modname "`" ] && echo "$modname" 2818 done 2819 } 2820 2821 2634 [ "`echo "$loaded_modules" | grep -F " $modname "`" ] && echo "$modname" 2635 done 2636 } 2822 2637 2823 2638 … … 2838 2653 diskno=$(($diskno+1)) 2839 2654 echo -n "..." 2840 cp -pRdf * $minidir_root/all2655 cp -pRdf * $minidir_root/all 2841 2656 done 2842 2657 mkdir -p $minidir_root/all/tmp … … 2845 2660 if [ "`DidMondoCallMe`" ] ; then 2846 2661 for q in filelist.full.gz biggielist.txt ; do 2847 [ ! -e "$MONDO _TMP/$q" ] && Die "Cannot find $MONDO_TMP/$q"2848 cp -pRdf $MONDO _TMP/$q tmp/2662 [ ! -e "$MONDOTMP/$q" ] && Die "Cannot find $MONDOTMP/$q" 2663 cp -pRdf $MONDOTMP/$q tmp/ 2849 2664 done 2850 2665 mkdir -p $minidir_root/all/tmp … … 2861 2676 2862 2677 2863 2864 # BERLIOS: This function is wrong2865 # Should be recoded. Desactivated in between2866 2867 #ListUnsavedKernelModules() {2868 #local fname modules2869 #fname=/tmp/$RANDOM.$$.$RANDOM2870 #lsmod | sed -n '2,$s/ .*//p' > $fname2871 #modules=`sort $fname | uniq -d2 | tr '\n' ' '`2872 #rm -f $fname2873 #[ "$modules" ] && echo "Unsaved kernel modules: $modules" >> $LOGFILE2874 #}2875 2876 2877 2878 2879 2880 2678 ############################################################################## 2881 2679 #----------------------------------- main -----------------------------------# 2882 2680 ############################################################################## 2883 2681 2884 2885 if [ "$1" = "-V" ] || [ "$1" = "-v" ] || [ "$1" = "--version" ] || [ "$1" = "-version" ] ; then2886 echo "mindi v$MINDI_VERSION"2887 exit 02888 fi2889 2682 2890 2683 if [ "$1" = "-printvar" ] ; then … … 2921 2714 # modprobe.conf file is created in MakeModuleLoadingScript. AL041128. 2922 2715 if [ -d "/etc/modprobe.d" ] && [ `uname -r | cut -c1-3` == "2.6" ] ; then 2923 2716 TMPMODPROBE_FLAG="Y" 2924 2717 else 2925 2718 TMPMODPROBE_FLAG="N" … … 2930 2723 [ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | grep -E "2\.[46]" | cut -d' ' -f1` 2931 2724 AbortIfMkfsVfatMissing 2932 ### B CO2725 ### BERLIOS 2933 2726 ### Fix as it's not mandatory on ia64 2934 2727 if [ "$ARCH" = "ia64" ] ; then … … 2938 2731 FindLiloBinary 2939 2732 fi 2940 grep -F " $TMP_ROOT " /proc/mounts | grep -F tmpfs > /dev/null 2> /dev/null && TMP_ROOT=/home && LogIt "Changing TMP_ROOT to $TMP_ROOT because you're using tmpfs for /tmp\n" ; # tmpfs doesn't like Mindi and /tmp, for some reason 2941 rm -f /tmp/mindi_lo 2733 # BERLIOS: Remove as too dangerous and now useless 2734 #grep -F " $MONDOTMP " /proc/mounts | grep -F tmpfs > /dev/null 2> /dev/null && MONDOTMP=/home/tmpmondo && mkdir -p $MONDOTMP && LogIt "Changing MONDOTMP to $MONDOTMP because you're using tmpfs for /tmp\n" ; # tmpfs doesn't like Mindi and /tmp, for some reason 2942 2735 trap "Aborted" SIGTERM 2943 2736 DONE="\r\t\t\t\t\t\t\t\tDone. " … … 2945 2738 BIGNO=0 2946 2739 MAX_COMPRESSED_SIZE=1300 2947 imagesdir=$CACHEDIR2948 2740 kernelpath="" 2949 MONDO_ROOT= /tmp/mindilinux/mondo-root2741 MONDO_ROOT=$TMPMONDO/mondo-root 2950 2742 mkdir -p $MONDO_ROOT 2951 2743 … … 2980 2772 if [ "$1" = "--findkernel" ] ; then 2981 2773 res=`TryToFindKernelPath` 2982 # 2> /dev/null`2983 2774 if [ "$res" = "" ] ; then 2984 exit12775 MindiExit -1 2985 2776 else 2986 2777 echo "$res" 2987 exit 02778 MindiExit 0 2988 2779 fi 2989 2780 elif [ "$1" = "--makemountlist" ] ; then 2990 2781 [ ! "$2" ] && Die "Please specify the output file" 2991 2782 MakeMountlist $2 2992 exit $?2993 elif [ "$1" = " --version" ] || [ "$1" = "-v" ] ; then2783 MindiExit $? 2784 elif [ "$1" = "-V" ] || [ "$1" = "-v" ] || [ "$1" = "--version" ] || [ "$1" = "-version" ] ; then 2994 2785 echo "Mindi v$MINDI_VERSION" 2995 exit 02786 MindiExit 0 2996 2787 elif [ "$#" -ge "9" ] && [ "$1" = "--custom" ] ; then 2997 TMP_ROOT=$2 2998 MONDO_TMP=$2 2999 imagesdir=$3 2788 MONDOTMP=$2 2789 BIDON=$3 3000 2790 kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath="" 3001 2791 ### … … 3030 2820 if [ "${11}" ] ; then 3031 2821 LILO_OPTIONS="" 3032 # LogIt "LILO will use conservative settings, to be compatible with older BIOSes."2822 # LogIt "LILO will use conservative settings, to be compatible with older BIOSes." 3033 2823 fi 3034 2824 LAST_FILELIST_NUMBER=${12} … … 3055 2845 fi 3056 2846 [ "$CDRECOVERY" = "yes" ] && [ "$TAPEDEV" != "" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time" 3057 MONDO_ROOT=`echo $ imagesdir| sed 's/\(.*\)\/.*/\1/'`2847 MONDO_ROOT=`echo $CACHEDIR | sed 's/\(.*\)\/.*/\1/'` 3058 2848 [ "$MONDO_ROOT" = "" ] && Die "MONDO_ROOT is undefined" 3059 2849 else 3060 2850 echo "Syntax: mindi (--custom ....)" >> /dev/stderr 3061 exit12851 MindiExit -1 3062 2852 fi 3063 2853 fi … … 3074 2864 3075 2865 [ -e "$iso_cfg_file" ] || Die "Cannot find $iso_cfg_file" 3076 rm -Rf $TMP_ROOT/mindilinux/*3077 TMP_ROOT=$TMP_ROOT/mindilinux/$$3078 mkdir -p $TMP_ROOT3079 2866 if [ ! "`DidMondoCallMe`" ] ; then 3080 2867 LogIt "Mindi Linux mini-distro generator v$MINDI_VERSION\n" … … 3099 2886 if [ "$NOT_BOOT" != "" ] && [ "$NOT_BOOT" != "0" ] && [ "$NOT_BOOT" != "no" ] ; then 3100 2887 LogIt "Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else.\n" 3101 MakeMondoConfigFile $MONDO _TMP/mondo-restore.cfg3102 MakeMountlist $MONDO _TMP/mountlist.txt3103 mkdir -p $MONDO _TMP/small-all/tmp3104 cd $MONDO _TMP/small-all3105 cp -f $MONDO _TMP/{mountlist.txt,mondo-restore.cfg,filelist.full.gz,biggielist.txt} tmp || Die "Cannot copy small all.tar.gz"3106 tar -cv tmp | gzip -9 > $MONDO _TMP/all.tar.gz || Die "Cannot make small all.tar.gz"2888 MakeMondoConfigFile $MONDOTMP/mondo-restore.cfg 2889 MakeMountlist $MONDOTMP/mountlist.txt 2890 mkdir -p $MONDOTMP/small-all/tmp 2891 cd $MONDOTMP/small-all 2892 cp -f $MONDOTMP/{mountlist.txt,mondo-restore.cfg,filelist.full.gz,biggielist.txt} tmp || Die "Cannot copy small all.tar.gz" 2893 tar -cv tmp | gzip -9 > $MONDOTMP/all.tar.gz || Die "Cannot make small all.tar.gz" 3107 2894 sleep 2 3108 2895 LogIt "Done. Exiting.\n" 3109 exit 02896 MindiExit 0 3110 2897 fi 3111 2898 … … 3145 2932 LogIt "disks then it may still be a result of a problem with your kernel.\n" 3146 2933 pwd=`pwd` 3147 cd $ TMP_ROOT2934 cd $MONDOTMP 3148 2935 bzip2 -dc $MINDI_LIB/lib.tar.bz2 | tar -x || Die "Cannot unzip lib.tar.bz2" 3149 2936 cd $pwd 3150 2937 YOUR_KERNEL_SUCKS="Your kernel sucks" 3151 2938 fi 3152 echo -e "Mindi's temp dir = $ TMP_ROOT \nMindi's output dir=$imagesdir" >> $LOGFILE2939 echo -e "Mindi's temp dir = $MONDOTMP \nMindi's output dir=$CACHE_LOC" >> $LOGFILE 3153 2940 [ "$(($RANDOM%64))" -eq "0" ] && LogIt "Dude, I've looked inside your computer and it's really dusty...\n" 3154 rm -f /tmp/mindi.err.*.tgz3155 2941 3156 2942 [ "$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." … … 3158 2944 rm -f $CACHEDIR/{*img,*gz,*iso} 3159 2945 3160 rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso 3161 needlist=$TMP_ROOT/what-we-need.txt 3162 bigdir=$TMP_ROOT/bigdir 3163 minidir_root=$TMP_ROOT/minidir 3164 mkdir -p $minidir_root 3165 mkdir -p $bigdir/usr/bin 3166 tardir=$TMP_ROOT/tardir 3167 3168 lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | grep -vx "" | wc -l` 3169 cat $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | GenerateGiantDependencyList $needlist $lines 3170 res=$? 3171 if [ "$YOUR_KERNEL_SUCKS" ]; then 3172 pwd=`pwd` 3173 cd $TMP_ROOT 3174 for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do 3175 cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir" 3176 if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then 3177 cp --parents -pRdf $i $bigdir 3178 else 3179 ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO 3180 BIGNO=$(($BIGNO+1)) 3181 fi 3182 done 3183 for i in $EXTRA_MODS ; do 3184 j=`find lib/modules/$FAILSAFE_KVER -name $i.*o 2> /dev/null` 3185 [ ! "$j" ] && echo "Warning - cannot find failsafe module $i.o" >> $LOGFILE 3186 for k in $j ; do 3187 if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then 3188 cp --parents -pRdf $k $bigdir 3189 else 3190 ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO 3191 BIGNO=$(($BIGNO+1)) 3192 fi 3193 echo "Added failsafe module $k to ramdisk" >> $LOGFILE 3194 done 3195 done 3196 cd $pwd 3197 else 3198 ListKernelModulePaths >> $needlist 3199 fi 3200 if [ "$res" -ne "0" ] ; then 3201 Die "You have $res file`PluralOrNot $res` present in dependency list\nbut absent from filesystem." 3202 fi 3203 FindAndAddUserKeyboardMappingFile 3204 mkdir -p $bigdir/tmp 3205 if [ "`DidMondoCallMe`" ] ; then 3206 MakeMondoConfigFile $TMP_ROOT/mondo-restore.cfg 3207 cp -f $TMP_ROOT/mondo-restore.cfg $bigdir/tmp &> /dev/null 3208 cp -f $TMP_ROOT/mondo-restore.cfg $CACHEDIR &> /dev/null 3209 fi 3210 [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO 3211 DropOptimizedLibraries $needlist $bigdir 3212 echo -en "Assembling dependency files" 3213 CopyDependenciesToDirectory < $needlist $bigdir 3214 3215 # also copy io.sys and msdos.sys, if we can find them 3216 for i in `mount | cut -d' ' -f3` ; do 3217 for j in io.sys msdos.sys ; do 3218 [ -e "$i/$j" ] && cp -f $i/$j $bigdir 3219 done 3220 done 3221 3222 # master boot record, too 3223 i=`cat $MONDO_TMP/BOOTLOADER.DEVICE 2> /dev/null` 3224 if [ "$i" ] ; then 3225 LogIt "Backing up $i's MBR\n" 3226 dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE 3227 # < < E O F 3228 sleep 1 3229 sync 3230 # [ "$?" -ne "0" ] && echo "Failed to save $i's MBR to bigdir" >> $LOGFILE 3231 j=$i 3232 [ -h "$j" ] && j=`ResolveSoftlink $j` 3233 LogIt "Creating /dev/boot_device ($j)\n" 3234 mkdir -p $bigdir/dev 3235 cp -pRdf $j $bigdir/dev/boot_device || Die "Unable to create /dev/boot_device on ramdisk" 3236 fi 3237 3238 # more stuff 3239 # cp -f $MINDI_LIB/embleer* $bigdir 3240 old_pwd=`pwd` 3241 cd $bigdir 3242 3243 [ -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'." 3244 cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n" 3245 if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then 3246 tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n" 3247 fi 3248 if [ -e "$MONDO_SHARE/restore-scripts" ] ; then 3249 cp -Rdf $MONDO_SHARE/restore-scripts/* . 2>> $LOGFILE 3250 [ "$?" -ne "0" ] && [ "`DidMondoCallMe`" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts" 3251 fi 3252 [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state . 3253 cd $old_pwd 3254 echo -e "$DONE" 3255 TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1` 3256 SplitDirectoryIntoMinidirs $bigdir $minidir_root 2946 PrepareDataDiskImages $CACHEDIR 3257 2947 noof_disks=$? 3258 2948 [ "$noof_disks" -eq "0" ] && Die "Too much stuff!" … … 3266 2956 cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE 3267 2957 ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks 3268 CreateDataDiskImagesFromTarballs $tardir $ imagesdir$noof_disks2958 CreateDataDiskImagesFromTarballs $tardir $CACHEDIR $noof_disks 3269 2959 FRIENDLY_OUTSTRING="Boot and data disk images were created." 3270 2960 # One 1.72MB boot disk, one 2.88MB boot disk and $noof_disks data disk images … … 3280 2970 if [ "$USE_LILO" = "yes" ] ; then 3281 2971 if [ "$ARCH" = "ia64" ] ; then 3282 PrepareBootDiskImage_LILO $ imagesdir$IA64_BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create ia64 floppy disk image."3283 else 3284 if ! PrepareBootDiskImage_LILO $ imagesdir1722 $kernelpath $ramdisk_size ; then2972 PrepareBootDiskImage_LILO $CACHE_LOC $IA64_BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create ia64 floppy disk image." 2973 else 2974 if ! PrepareBootDiskImage_LILO $CACHE_LOC 1722 $kernelpath $ramdisk_size ; then 3285 2975 LogIt "Warning - failed to create 1.72MB boot image. Please reduce your kernel's size\n" 3286 2976 LogIt "if you want to make a 1.72MB floppy disk.\n" 3287 2977 fi 3288 if ! PrepareBootDiskImage_LILO $ imagesdir2880 $kernelpath $ramdisk_size ; then2978 if ! PrepareBootDiskImage_LILO $CACHE_LOC 2880 $kernelpath $ramdisk_size ; then 3289 2979 LogIt "Warning - failed to create 2.88MB floppy disk image.\n" 3290 2980 LogIt "Please reduce your kernel's size\n" 3291 2981 LogIt "if you want to make a 2.88MB floppy disk.\n" 3292 PrepareBootDiskImage_LILO $ imagesdir5760 $kernelpath $ramdisk_size || Die "Failed to create 2.88MB floppy disk image."2982 PrepareBootDiskImage_LILO $CACHE_LOC 5760 $kernelpath $ramdisk_size || Die "Failed to create 2.88MB floppy disk image." 3293 2983 fi 3294 2984 fi 3295 2985 else 3296 if ! PrepareBootDiskImage_SYSLINUX $ imagesdir1722 $kernelpath $ramdisk_size ; then2986 if ! PrepareBootDiskImage_SYSLINUX $CACHE_LOC 1722 $kernelpath $ramdisk_size ; then 3297 2987 LogIt "Warning - failed to create 1.72MB boot image. Please reduce your kernel's size\n" 3298 2988 LogIt "if you want to make a 1.72MB floppy disk.\n" 3299 if ! PrepareBootDiskImage_SYSLINUX $ imagesdir2880 $kernelpath $ramdisk_size ; then2989 if ! PrepareBootDiskImage_SYSLINUX $CACHE_LOC 2880 $kernelpath $ramdisk_size ; then 3300 2990 LogIt "Warning - failed to create 2.88MB floppy disk image.\n" 3301 2991 LogIt "Please reduce your kernel's size\n" 3302 2992 LogIt "if you want to make a 2.88MB floppy disk.\n" 3303 PrepareBootDiskImage_SYSLINUX $ imagesdir5760 $kernelpath $ramdisk_size || Die "Failed to create 5.76MB floppy disk image."2993 PrepareBootDiskImage_SYSLINUX $CACHE_LOC 5760 $kernelpath $ramdisk_size || Die "Failed to create 5.76MB floppy disk image." 3304 2994 fi 3305 2995 fi 3306 2996 fi 3307 3308 3309 2997 3310 2998 [ -e "$MINDI_LIB/memtest.img" ] && BOOT_MEDIA_MESSAGE="$BOOT_MEDIA_MESSAGE\n\ 3311 2999 ...Or type 'memtest' to test your PC's RAM thoroughly.\n" 3312 3000 3313 3314 3001 if [ ! "`DidMondoCallMe`" ] ; then 3315 ListImagesForUser $ imagesdir3002 ListImagesForUser $CACHE_LOC 3316 3003 boot_dev=/dev/fd0u1722 3317 3004 [ ! -e "$boot_dev" ] && mknod $boot_dev b 2 60 … … 3319 3006 [ ! -e "$boot_dev" ] && Die "Will you PLEASE tell your distribution maker to create the 1.72MB devices in /dev?" 3320 3007 if [ "$PROMPT_WRITE_BOOT_FLOPPIES" = "yes" ]; then 3321 echo -en "Would you like to create boot+data floppy disks now (y/n) ?" 3322 read i 3323 [ "$i" != "y" ] && [ "$i" != "Y" ] && return 3324 mount | fgrep /dev/fd > /dev/null && Die "Please unmount your floppies first." 3325 echo "WARNING! THIS WILL ERASE YOUR FLOPPY DISKS." 3326 [ ! -e "$boot_dev" ] && Die "Cannot find $boot_dev - is your Linux distro broken?" 3327 [ ! -e "$FDDEVICE" ] && Die "Cannot find $FDDEVICE - is your Linux distro broken?" 3328 i=`find $imagesdir -type f | fgrep "/mindi-root.1" 2> /dev/null` 3329 j=`find $imagesdir -type f | fgrep "/mindi-boot" | egrep -v '2880|5760'` 3330 if [ "$i" ] ; then 3331 CopyImageToDisk $j $FDDEVICE "boot disk" 3332 CopyImageToDisk $i $FDDEVICE "root disk" 3333 else 3334 CopyImageToDisk $j $boot_dev "boot/root disk" 3335 fi 3336 count=1 3337 for i in `find $imagesdir | fgrep mindi-data` ; do 3338 CopyImageToDisk $i $FDDEVICE "data disk #$count" 3339 count=$(($count+1)) 3340 done 3341 fi 3342 OfferToMakeBootableISO $imagesdir 3008 OfferToCopyImagesToDisks $CACHEDIR $boot_dev $FDDEVICE 3009 fi 3010 OfferToMakeBootableISO $CACHE_LOC 3343 3011 LogIt "Finished.\n" 3344 3012 elif [ "$TAPEDEV" ] ; then 3345 3013 rm -f $CACHEDIR/{*img,*gz,*iso} 3346 OfferToMakeBootableISO $ imagesdir3347 if [ -e "$ imagesdir/all.tar.gz" ] ; then3348 cp -f $ imagesdir/all.tar.gz $MONDO_TMP/3349 else 3350 Die "Cannot find all.tar.gz, to be written to tape"3014 OfferToMakeBootableISO $CACHE_LOC 3015 if [ -e "$CACHE_LOC/all.tar.gz" ] ; then 3016 cp -f $CACHE_LOC/all.tar.gz $MONDOTMP/ 3017 else 3018 Die "Cannot find all.tar.gz, to be written to tape" 3351 3019 fi 3352 3020 else 3353 OfferToMakeBootableISO $ imagesdir3021 OfferToMakeBootableISO $CACHE_LOC 3354 3022 fi 3355 [ "$TMP_ROOT" != "/tmp" ] && rm -Rf $TMP_ROOT3356 3023 # cleanup 3357 rm - f /tmp/mountlist.txt.$$ $FDISKLOG /tmp/mindilinux3024 rm -Rf $MONDOTMP $FDISKLOG 3358 3025 LogIt "$FRIENDLY_OUTSTRING\n" 3359 #ListUnsavedKernelModules3360 3026 for mtpt in $FLOPPY_WAS_MOUNTED ; do 3361 3027 mount $mtpt 3362 3028 done 3363 echo "Mindi is exiting" >> $LOGFILE 3364 echo "End date : `date`" >> $LOGFILE 3365 exit 0 3029 MindiExit 0 -
trunk/mondo-doc/mondorescue-howto.sgml
r764 r932 123 123 constantly evolving. It was started by Hugo Rabson and has 124 124 since been worked upon by a number of people. See the 125 '<ulink url="&WWWB;about. html#devteam">About</ulink>' web125 '<ulink url="&WWWB;about.shtml#devteam">About</ulink>' web 126 126 page for a list of members of the development team.</para> 127 127 … … 164 164 </para> 165 165 <para>See Mondo's 166 <ulink url="http://www.mondorescue.org/ feedback/feedback.html">Feedback</ulink> page for166 <ulink url="http://www.mondorescue.org/support.shtml">Support</ulink> page for 167 167 more information. 168 168 </para> … … 946 946 <sect2 id="overview-sysrq-swreq"> 947 947 <title>Software Requirements</title> 948 <para>See Mondo's <ulink url="http://www.mondorescue.org/download .html">Download948 <para>See Mondo's <ulink url="http://www.mondorescue.org/downloads.shtml">Download 949 949 page</ulink> for details.</para> 950 950 <para>Mondo requires afio, bzip2, cdrtools/cdrecord/growisofs, ncurses, newt, … … 1356 1356 /mnt/cdrom directories.</para> 1357 1357 <para>To see a detailed list of switches and their meaning, see the 1358 <ulink url="http://www.mondorescue.org/do wnload/mondoarchive.1.html">HTML1358 <ulink url="http://www.mondorescue.org/docs/mondoarchive.8.html">HTML 1359 1359 man page</ulink> on the website or type 'man mondoarchive' at the 1360 1360 console.</para> … … 2000 2000 gives you some pointers on how to best lay out partitions. 2001 2001 You can find a good guide at 2002 <ulink url="http://www. ibiblio.org/pub/Linux/docs/HOWTO/mini/Partition/index.html">http://www.ibiblio.o2003 rg/pub/Linux/docs/HOWTO/mini/Partition/index.html</ulink></para>2002 <ulink url="http://www.tldp.org/HOWTO/Partition/index.html">http://www.tldp.org/HOWTO/Partition/index.html</ulink> 2003 </para> 2004 2004 <para>If you want to restore a subset of the backup then:</para> 2005 2005 <itemizedlist> … … 2509 2509 <para>A: A good Linux distribution should contain XXX but the 2510 2510 designers, in their infinite wisdom, decided not to include that 2511 particular tool. Check < !--<link linkend="linuxpackages">-->Related2512 Linux Packages< !--</link>--> and install the missing package. If that2511 particular tool. Check <ulink url="http://www.mondorescue.org/downloads.shtml#dependencies">Related 2512 Linux Packages</ulink> and install the missing package. If that 2513 2513 fails, contact the vendor/distributor/manufacturer/designer of your 2514 2514 distro.</para> … … 2758 2758 <qandaentry> 2759 2759 <question> 2760 <para><anchor id="COPYBOOTDATADISK"/>Q: How do i copy boot+data 2761 disk images to physical floppy disks ?</para> 2760 <para id="copybootdatadisk">Q: How do i copy boot+data disk images to physical floppy disks ?</para> 2762 2761 </question> 2763 2762 <answer> … … 2833 2832 <answer> 2834 2833 <para>A: You have not installed libnewt and/or libnewt-devel. 2835 Please do so. Check <ulink url=" linuxpackages.html">Related Linux2834 Please do so. Check <ulink url="http://www.mondorescue.org/downloads.shtml#dependencies">Related Linux 2836 2835 Packages</ulink> to see what Mondo requires and where you can get 2837 2836 tarballs and RPM's. Make sure you are using the right version of … … 2846 2845 compile, it can be found in the 'popt' package. Check your 2847 2846 distribution and see if they have popt, if not check 2848 <ulink url=" linuxpackages.html">Related Linux Packages</ulink> to2847 <ulink url="http://www.mondorescue.org/downloads.shtml#dependencies">Related Linux Packages</ulink> to 2849 2848 see where you can get it.</para> 2850 2849 </answer> … … 2868 2867 then you'll be told which packages you need. Mondo offers a lot of 2869 2868 those packages on its 2870 <ulink url="http://www.mondorescue.org/download /download.html">Download</ulink>2869 <ulink url="http://www.mondorescue.org/downloads.shtml">Download</ulink> 2871 2870 web page.</para> 2872 2871 </answer> -
trunk/mondo/configure.in
r904 r932 18 18 AC_ARG_PROGRAM 19 19 20 AM_INIT_AUTOMAKE([ src], MONDO_VER)20 AM_INIT_AUTOMAKE([mondo], MONDO_VER) 21 21 AM_MAINTAINER_MODE 22 22 -
trunk/mondo/src/common/libmondo-fifo.c
r900 r932 57 57 58 58 extern char *ps_options; 59 extern char *ps_proc_id; 59 60 60 61 /** … … 151 152 /** 152 153 * Kill @c buffer processes. 154 * Only called in mondoarchive 153 155 */ 154 156 void kill_buffer() … … 159 161 sync(); 160 162 mr_asprintf(&command, 161 "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $ 1;}' | grep -v PID | tr -s '\n' ' ' | awk '{ print $1; }'", ps_options,163 "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, 162 164 g_sz_call_to_buffer); 163 165 mr_free(g_sz_call_to_buffer); -
trunk/mondo/src/common/newt-specific.c
r900 r932 35 35 extern char *g_mondo_home; 36 36 extern char *ps_options; 37 extern char *ps_proc_id; 37 38 38 39 extern void set_signals(int); … … 244 245 char *tmp = NULL; 245 246 246 mr_asprintf(&tmp,"kill `ps %s | grep \" %s \" | awk '{print $1;}' | grep -vx \"\\?\"`", ps_options, str);247 run_program_and_log_output(tmp, TRUE);247 mr_asprintf(&tmp,"kill `ps %s | grep \" %s \" | awk '{print %s;}' | grep -vx \"\\?\"`", ps_options, str, ps_proc_id); 248 run_program_and_log_output(tmp, TRUE); 248 249 mr_free(tmp); 249 250 } -
trunk/mondo/src/mondoarchive/main.c
r900 r932 42 42 long diffs; 43 43 char *ps_options = "auxww"; 44 char *ps_proc_id = "$2"; 44 45 45 46 extern int g_loglevel; -
trunk/mondo/src/mondorestore/mondo-restore.c
r914 r932 124 124 char *g_mondo_home = NULL; 125 125 126 /* Busybox ps has no option and PID in first pos */ 126 127 char *ps_options = ""; 128 char *ps_proc_id = "$1"; 127 129 128 130 /* @} - end of "Restore-Time Globals" in globalGroup */ -
trunk/tools/build2pkg
r923 r932 37 37 c="mindi-kernel mondo-doc mindi mindi-busybox mondo" 38 38 else 39 c= $139 c="$*" 40 40 fi 41 41 fi … … 79 79 rm -rf $p-${PVER} 80 80 81 # set LANGUAGE to check for correct log messages 81 82 export LANGUAGE=C 82 83 rpmbuild -ba $p.spec 2>&1 | tee $log -
trunk/tools/build2qemu
r900 r932 21 21 export TOOLHOME=${PWD}/$dname 22 22 fi 23 24 23 25 24 . $TOOLHOME/common-env … … 89 88 ssh -p $sp root@localhost "date $rdate" 90 89 ssh -p $sp bruno@localhost "cd / ; rm -rf ~bruno/mondo ~bruno/RPMS/BUILD/* ~bruno/RPMS/tmp/* /tmp/* ; tar xfz ~bruno/mkmondo.tar.gz ; $MONDOTMP/mkmondo " | tee $MONDOTMP/mkvm.log 91 #ssh -p $sp bruno@localhost "cd / ; tar xfz ~bruno/mkmondo.tar.gz ; $MONDOTMP/mkmondo ; rm -f $MONDOTMP" | tee $MONDOTMP/mkvm.log92 90 if [ $vmp -eq 1 ]; then 93 91 ssh -p $sp root@localhost "halt -p" -
trunk/tools/distro-env
r900 r932 27 27 export ddir="fedora" 28 28 export dver=`awk '{print $4}' /etc/redhat-release` 29 elif grep -q CentOS /etc/redhat-release ; then 30 export ddir="centos" 31 export dver=`awk '{print $3}' /etc/redhat-release` 29 32 else 30 33 export ddir="redhat" … … 81 84 dtype="rpm" 82 85 suf=".${ddir}${dver}" 83 elif [ $ddir = "fedora" -o $ddir = "redhat" -o $ddir = "rhel" ]; then86 elif [ $ddir = "fedora" -o $ddir = "redhat" -o $ddir = "rhel" -o $ddir = "centos" ]; then 84 87 dfam="redhat" 85 88 dtype="rpm" … … 87 90 if [ $ddir = "fedora" ]; then 88 91 suf=".fc${dver1}" 92 elif [ $ddir = "centos" ]; then 93 dver1=`echo ${dver} | sed "s/\.[0-9]//"` 94 suf=".centos${dver1}" 89 95 elif [ $ddir = "redhat" ]; then 90 96 suf=".rh${dver1}" … … 118 124 119 125 if [ _"$dtype" = _"rpm" ]; then 126 export TOPBUILDDIR=`rpmquery -E '%{_topdir}' 2> /dev/null` 120 127 export ARCH=`rpm --showrc | egrep "^build arch" | awk '{print $4}'` 121 if [ -f ${HOME}/.rpmmacros ]; then 122 export TOPBUILDDIR=`egrep '^%_topdir' ${HOME}/.rpmmacros | awk '{print $2}'` 128 mkdir -p ${TOPBUILDDIR}/{RPMS,SRPMS,SPECS,SOURCES,BUILD} 129 if [ $? -ne 0 ]; then 130 echo "Please ensure that you can write into ${TOPBUILDDIR}" 131 echo "Solution: setup _topdir in your ~/.rpmmacros or" 132 echo "chown the ${TOPBUILDDIR} to your uid" 133 exit -1 123 134 fi 124 mkdir -p ${TOPBUILDDIR}/{RPMS,SRPMS,SPECS,SOURCES,BUILD}125 135 elif [ _"$dtype" = _"deb" ]; then 126 136 mkdir -p ${TOPBUILDDIR} -
trunk/tools/file2ftp
r839 r932 11 11 prem=`echo $dname |cut -c1` 12 12 if [ ${prem} == "/" ]; then 13 13 export TOOLHOME=$dname 14 14 else 15 15 export TOOLHOME=${PWD}/$dname … … 37 37 c="mindi-kernel mondo-doc mindi mindi-busybox mondo" 38 38 else 39 c= $139 c="$*" 40 40 fi 41 41 fi -
trunk/tools/livwww
r900 r932 48 48 if [ $force -eq 1 ]; then 49 49 echo "Purging $LOCALDIR" 50 rm -rf $LOCALDIR 50 rm -rf $LOCALDIR/* $LOCALDIR/.??* 51 51 fi 52 52 … … 55 55 if [ $force -eq 1 ]; then 56 56 echo "Purging $LOCALDOC" 57 rm -rf $LOCALDOC 57 rm -rf $LOCALDOC/* $LOCALDOC/.??* 58 58 fi 59 59 … … 69 69 make -f Makefile.howto 70 70 make -f Makefile.man 71 mv $LOCALDOC $LOCALDIR/docs 71 mkdir -p $LOCALDIR/docs 72 mv $LOCALDOC/* $LOCALDIR/docs 72 73 # 73 74 # Man pages corrections -
trunk/tools/mdv-env
r600 r932 8 8 export ACCOUNT="bcornec@kenobi.mandriva.com" 9 9 export DSTNODE="-t ssh n3.mandriva.com" 10 export SVNMDV=$HOME/mandriva -
trunk/tools/mkchangelog.pl
r782 r932 25 25 my $ver2 = ""; 26 26 my $date = ""; 27 my $tag = ""; 27 28 28 29 # For date handling … … 58 59 } 59 60 } 61 $tmp="$TOOLHOME/../$pkg/TAG"; 62 if (-f "$tmp") { 63 open(TAG,"$tmp") || die "Unable to open $tmp"; 64 $tag = <TAG>; 65 chomp($tag); 66 } else { 67 die "Unable to find a TAG file for $pkg\n"; 68 } 60 69 #print "Using $chglog as input ChangeLog file for $pkg\n"; 61 70 … … 90 99 if ($ver !~ /-/) { 91 100 if ($first eq 1) { 92 $ver2 = "$ver-$ ENV{TAG}"."$ENV{suf}";101 $ver2 = "$ver-$tag"."$ENV{suf}"; 93 102 $first=0; 94 103 } else { -
trunk/tools/mknewtag
r839 r932 16 16 fi 17 17 18 . $TOOLHOME/common-env 19 . $TOOLHOME/distro-env 18 if [ "$1" = "" ]; then 19 mods="mindi mondo mondo-doc mindi-busybox mindi-kernel" 20 else 21 mods="$*" 22 fi 20 23 21 # We need to get $VER and $TAG 22 if [ "$1" = "" ]; then 23 LAST=`cat ${TOPDIR}/LAST` 24 else 25 LAST=$1 26 shift 27 fi 28 VER=`echo $LAST | cut -d- -f1` 29 30 TAG=`echo $LAST | cut -d- -f2` 31 echo -n "Changing TAG of version $VER value from $TAG to " 32 ((TAG=$TAG+1)) 33 echo "$TAG" 34 nb=`svn diff $TOOLHOME/.. | wc -l` 24 cd $TOOLHOME/.. 25 nb=`svn diff | wc -l` 35 26 if [ $nb -gt 0 ]; then 36 27 echo "You'll have to check in before updating the TAG" 37 28 exit -1 38 29 else 39 for p in mindi mondo mindi-busybox mindi-kernel; do 40 v=`cat $TOOLHOME/../$p/VERSION` 41 grep -q "${v}" $TOOLHOME/../$p/ChangeLog 30 for p in $mods; do 31 grep -q "${v}" $p/ChangeLog 42 32 if [ $? -ne 0 ]; then 43 33 echo "You'll have to document in ${p}'s ChangeLog for ${v} related modifications" … … 45 35 fi 46 36 done 47 echo "$TAG" > $TOOLHOME/TAG 48 (cd $TOOLHOME/.. ; svn ci -m "Automatic update of TAG to $TAG" ; svn up) 37 for p in $mods; do 38 TAG=`cat $p/TAG` 39 v=`cat $p/VERSION` 40 echo -n "Changing TAG of $p-$v value from $TAG to " 41 ((TAG=$TAG+1)) 42 echo "$TAG" 43 echo "$TAG" > $p/TAG 44 done 45 svn ci -m "Automatic update of TAGs" ; svn up 49 46 fi -
trunk/tools/mknewversion
r839 r932 16 16 fi 17 17 18 . $TOOLHOME/common-env19 . $TOOLHOME/distro-env20 21 18 # We need to get $VER 22 19 if [ "$1" = "" ]; then 23 LAST=`cat ${TOPDIR}/LAST` 20 echo "Syntax: mknewversion version" 21 exit -1 24 22 else 25 LAST=$123 VER=$1 26 24 shift 27 25 fi 28 VER=`echo $LAST | cut -d- -f1` 29 MAJVER=`echo $VER | cut -d. -f1-2` 30 MINDIMAJVER=`echo $VER | cut -d. -f1` 31 MINDIMINVER=`echo $VER | cut -d. -f2` 32 ((MINDIMAJVER=$MINDIMAJVER-1)) 33 MINVER=`echo $VER | cut -d. -f3` 34 TAG=1 35 ((MINVER=$MINVER+1)) 36 VER=${MAJVER}.${MINVER} 37 echo "Changing Version $LAST to ${VER}-${TAG}" 26 38 27 grep -q stable $TOOLHOME/../mondo/VERSION 39 28 if [ $? -ne 0 ]; then … … 41 30 exit -1 42 31 fi 32 43 33 nb=`svn diff $TOOLHOME/.. | wc -l` 44 34 if [ $nb -gt 0 ]; then 45 35 echo "You'll have to check in before changing version" 46 else 47 svn copy $SVN_M/branches/stable $SVN_M/branches/${VER} 48 cd $TOOLHOME/../.. 49 svn co $SVN_M/branches/${VER} ${VER} 50 cd ${VER} 51 echo "$TAG" > tools/TAG 52 for p in mindi mondo mondo-doc mindi-kernel mindi-busybox; do 53 v=${VER} 54 if [ $p == "mindi" ]; then 55 v=${MINDIMAJVER}.${MINDIMINVER}.${MINVER} 56 fi 57 echo "$v" > $p/VERSION 58 if [ -f $p/ChangeLog ]; then 59 grep -q "${v}-${TAG}" $p/ChangeLog 60 if [ $? -ne 0 ]; then 61 echo "You'll have to document in ${p}'s ChangeLog for ${v}-${TAG} related modifications" 62 exit -1 63 fi 64 fi 65 done 66 svn ci -m "Creation of ${VER}-$TAG" 67 svn up 36 exit -1 68 37 fi 38 39 svn copy $SVN_M/branches/stable $SVN_M/branches/${VER} 40 cd $TOOLHOME/../.. 41 svn co $SVN_M/branches/${VER} ${VER} 42 cd ${VER} 43 44 for p in mindi mondo mondo-doc mindi-kernel mindi-busybox; do 45 # Reset TAG - This maybe an issue for mindi-busybox only 46 echo "1" > $p/TAG 47 v=$VER 48 echo $p | grep -q mindi 49 if [ $? -eq 0 ]; then 50 echo "Please give new $p version for this $VER mondo version ? " 51 read v 52 fi 53 echo "$v" > $p/VERSION 54 done 55 svn ci -m "Creation of mondo ${VER}-$TAG" 56 svn up -
trunk/tools/pkg2fc
r903 r932 36 36 c="mindi-kernel mondo-doc mindi mindi-busybox mondo" 37 37 else 38 c= $138 c="$*" 39 39 fi 40 40 fi … … 51 51 src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz 52 52 pv=`basename $src .tar.gz` 53 spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${TAG}${suf}.src.rpm" 54 ppkg="$ppkg $pv-${TAG}${suf}.src.rpm" 53 tag=`echo $pv | sed "s/-\([0-9]*.*\)/\2/"` 54 spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${tag}${suf}.src.rpm" 55 ppkg="$ppkg $pv-${tag}${suf}.src.rpm" 55 56 done 56 57 … … 62 63 s=\`rpm -qlp \$p | egrep '\.spec'\` 63 64 # Use dist for fc 64 perl -pi -e "s/define Release:[ \t]+ [0-9]+..*/define Release: $TAG%{?dist}/" rpm/SPECS/\$s65 perl -pi -e "s/define Release:[ \t]+([0-9]+)..*/define Release: $1%{?dist}/" rpm/SPECS/\$s 65 66 perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org>..*/ Bruno Cornec <bruno@mondorescue.org> %{version}-%{release}/' rpm/SPECS/\$s 66 67 rm -rf rpm/BUILD/* -
trunk/tools/pkg2ftp
r839 r932 37 37 c="mindi-kernel mondo-doc mindi mindi-busybox mondo" 38 38 else 39 c= $139 c="$*" 40 40 fi 41 41 fi … … 52 52 src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz 53 53 pv=`basename $src .tar.gz` 54 tag=`echo $pv | sed "s/-\([0-9]*.*\)/\2/"` 54 55 if [ _"$dtype" = _"rpm" ]; then 55 56 if [ _"$p" = _"mondo-doc" ]; then … … 58 59 ar=$ARCH 59 60 fi 60 pkg="$pkg ${TOPBUILDDIR}/RPMS/${ar}/$pv-${ TAG}${suf}.${ar}.rpm"61 spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${ TAG}${suf}.src.rpm"61 pkg="$pkg ${TOPBUILDDIR}/RPMS/${ar}/$pv-${tag}${suf}.${ar}.rpm" 62 spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${tag}${suf}.src.rpm" 62 63 elif [ _"$dtype" = "_deb" ]; then 63 64 pkg="$pkg ${TOPBUILDDIR}/$p_*.deb" -
trunk/tools/pkg2mdv
r839 r932 36 36 c="mindi-kernel mondo-doc mindi mindi-busybox mondo" 37 37 else 38 c= $138 c="$*" 39 39 fi 40 40 fi 41 41 42 export pkg=""43 echo "Working under $TOPBUILDDIR"44 cd $TOPBUILDDIR45 46 ppkg=""47 spkg=""48 42 49 43 for p in $c; do 50 # s= stable; t = trunk; 1-9 = official version 51 src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz 52 pv=`basename $src .tar.gz` 53 spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${TAG}${suf}.src.rpm" 54 ppkg="$ppkg $pv-${TAG}${suf}.src.rpm" 44 src=${TOPDIR}/${VER}-$TAG/$p-[1-9]*.tar.bz2 45 s=`basename $src` 46 oldver=`echo $s | sed "s/$p-\([1-9][0-9.]*\).tar.bz2/\1/"` 47 newver=`echo $oldver | sed 's/\([0-9]\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)/\1.\2\3/'` 48 distro=`ls -d ${TOPDIR}/${VER}-$TAG/$p-[1-9]*/distributions/mandriva-* | tail -1` 49 spec=${distro}/$p.spec 50 echo "Updating Mandriva package in $SVNMDV/$p" 51 cd $SVNMDV/$p 52 mkdir -p SOURCES SPECS 53 echo "Modifying $oldver => $newver" 54 svn del --force SOURCES/$p-*.tar.bz2 55 cp -a $src SOURCES/$p-$newver.tar.bz2 56 tar xfj SOURCES/$p-$newver.tar.bz2 57 mv $p-$oldver $p-$newver 58 perl -pi -e "s/$oldver/$newver/" $p-$newver/VERSION 59 tar cfj SOURCES/$p-$newver.tar.bz2 $p-$newver 60 rm -rf $p-$newver 61 svn add SOURCES/$p-$newver.tar.bz2 62 cp -a $spec SPECS 63 # Use mkrel for mdv 64 perl -pi -e "s/^Release:[ \t]+..*/Release: %mkrel $tag/" SPECS/$p.spec 65 perl -pi -e 's/^Version:[ \t]+([0-9])\.([0-9]+)\.([0-9]+)/Version: $1.$2$3/' SPECS/$p.spec 66 perl -pi -e 's/mindi >= ..*,/mindi/' SPECS/$p.spec 67 $TOOLHOME/mdv-changelog.pl SPECS/$p.spec 68 # Changelog management 69 echo "Building packages" 70 bm 71 if [ $? -eq 0 ]; then 72 rm -rf BUILD RPMS SRPMS BUILDROOT 73 echo "Committing from $SVNMDV/$p into Mandriva's SVN" 74 svn ci -F $MONDOTMP/cmt.spec 75 if [ $? -eq 0 ]; then 76 svn up 77 rm -f $MONDOTMP/cmt.spec 78 echo "Building on Mandriva's cluster" 79 ssh $ACCOUNT $DSTNODE "yr $p" 80 fi 81 fi 55 82 done 56 83 57 echo "Packages delivery to ${ACCOUNT}" 58 cat > /tmp/mkmondo << EOF 59 rm -f /tmp/mondorescue.log 60 for p in $ppkg ; do 61 rpm -ivh \$p 62 s=\`rpm -qlp \$p | egrep '\.spec'\` 63 # Use mkrel for mdv 64 perl -pi -e "s/define Release:[ \t]+..*/define Release: %mkrel $TAG/" rpm/SPECS/\$s 65 perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org>..*/ Bruno Cornec <bcornec@mandriva.org> %{version}-%{release}/' rpm/SPECS/\$s 66 rm -rf rpm/BUILD/* 67 rpmbuild -ba rpm/SPECS/\$s 2>&1 | tee -a /tmp/mondorescue.log 68 done 69 apkg=\`egrep "^Wrote:" /tmp/mondorescue.log | grep -v debug | cut -d: -f2\` 70 aspkg=\`echo \$apkg | egrep "\.src.rpm"\` 71 for d in 2006 200664; do 72 scp -p \$aspkg chroot\${d}: 73 ssh chroot\${d} "for p in $aspkg; do rpm -ivh \`basename \$p\` ; rpmbuild -ba rpm/SPECS/\$s | tee -a /tmp/mondorescue.log ; done ; sudo ftp\${d}contrib \`egrep '^Wrote:' /tmp/mondorescue.log | grep -v debug | cut -d: -f2\`" 74 done 75 for p in \$apkg; do 76 sudo ftpcontrib \$p 77 done 78 rm -f \$ppkg 79 EOF 80 chmod 755 /tmp/mkmondo 81 scp -p ${spkg} /tmp/mkmondo ${ACCOUNT}: 82 scp -p /tmp/mkmondo ${ACCOUNT}: 83 echo "Packages rebuild on ${DSTNODE}" 84 ssh ${ACCOUNT} ${DSTNODE} "./mkmondo" 84 rm -rf $MONDOTMP 85 85 86 ) 2>&1 | tee /tmp/pk2mdv.log -
trunk/tools/qemu-vm.txt
r900 r932 4 4 5 5 # RPM based : urpmi, yum install, yast2 6 # Mandriva 6 7 urpmi neon newt-devel slang-devel glibc-static-devel autoconf automake libtool gcc rpm-build wget gvim/vim-X11 gcc-c++ docbook-utils-pdf ImageMagick man patch mindi mondo 8 9 #Fedora 10 yum install neon newt-devel slang-devel autoconf automake libtool gcc rpm-build wget gvim/vim-X11 gcc-c++ docbook-utils-pdf ImageMagick man patch 11 7 12 8 13 # gentoo -
trunk/tools/svn-env
r900 r932 6 6 # 7 7 8 export VER=`cat ${TOOLHOME}/../mondo/VERSION`9 10 8 # To be safe for SVN commands 11 9 export REVISION=`(cd $TOOLHOME/.. ; svnversion .)` 12 export TAG=`cat ${TOOLHOME}/TAG` -
trunk/tools/svn2build
r900 r932 19 19 . ./svn-env 20 20 21 VER=`cat ${TOOLHOME}/../mondo/VERSION` 22 TAG=`cat ${TOOLHOME}/../mondo/TAG` 21 23 DEST=${TOPDIR}/${VER}-$TAG 22 24 mkdir -p $DEST … … 28 30 c="mindi-kernel mondo-doc mindi mindi-busybox mondo" 29 31 else 30 c= $132 c="$*" 31 33 fi 32 34 fi … … 37 39 for p in $c; do 38 40 v=`cat ${TOOLHOME}/../$p/VERSION` 39 echo "Management of $p $v-$TAG (rev $REVISION)" 41 tag=`cat ${TOOLHOME}/../$p/TAG` 42 echo "Management of $p $v-$tag (rev $REVISION)" 40 43 dest="$DEST/$p-$v" 41 44 rm -fr $dest … … 53 56 ddd=`LANG=C ; date '+%Y-%m-%d'` 54 57 cat > $MONDOTMP/mondorescue.mc << EOF 55 define(\`TTT', ${ TAG})dnl56 define(\`RRR', ${ TAG}${suf})dnl58 define(\`TTT', ${tag})dnl 59 define(\`RRR', ${tag}${suf})dnl 57 60 define(\`VVV', ${v})dnl 58 61 define(\`DDD', ${ddd})dnl -
trunk/website/about.shtml
r448 r932 28 28 with your request. It supports software raid as well as most hardware raid controllers. It supports adjustments in disk geometry, 29 29 including migration from non-RAID to RAID. Mondo runs on all major 30 Linux distributions (RedHat, RHEL, SuSE, SLES, Mandriva, Debian ) and is getting better all the time. You may even30 Linux distributions (RedHat, RHEL, SuSE, SLES, Mandriva, Debian, Gentoo) and is getting better all the time. You may even 31 31 use it to backup non-Linux partitions, such as NTFS.</P> 32 32 <p> -
trunk/website/downloads.shtml
r904 r932 21 21 <h2>Mirrors</h2> 22 22 </div> 23 <p><A NAME="mirrors"></A> 23 24 <p>We are interested in up to date mirrors for both the Web and FTP sites. Please contact us on the <a href="/support.shtml">mailing list</a>. 24 25 <ul> … … 63 64 <h2>Dependencies</h2> 64 65 </div> 66 <p><A NAME="dependencies"></A> 65 67 <p>The solution has been written in C/bash/perl and developed on a <a href="http://www.mandriva.com/">Mandriva</a> <a href="http://www.gnu.org/">Gnu</a>/<a href="http://www.lwn.net/">Linux</a> distribution. For it to work, you will need:</p> 66 68 <ul> … … 68 70 <li><b><a href="">gzip</a></b>: the most standard compressor used by Mondo Rescue</li> 69 71 <li><b><a href="">mkisofs</a></b>: the tool to create ISO images</li> 70 <li><b><a href=" http://www.busybox.net">busybox</a></b>: the swiss army knife: a full set of commands in a single binary (embedded)</li>71 <li><b><a href=" http://www.mondorescue.org">mindi</a></b>: the mini-distro builder part of the project</li>72 <li><b><a href=" http://www.mondorescue.org">mondo</a></b>: the disaster recovery tool in itself</li>72 <li><b><a href="ftp://ftp.mondorescue.org/src">mindi-busybox</a></b>: the swiss army knife <a href="http://www.busybox.net">busybox</a> configured for mindi: a full set of commands in a single binary (embedded)</li> 73 <li><b><a href="ftp://ftp.mondorescue.org/src">mindi</a></b>: the mini-distro builder part of the project</li> 74 <li><b><a href="ftp://ftp.mondorescue.org/src">mondo</a></b>: the disaster recovery tool in itself</li> 73 75 </ul> 74 76 … … 102 104 <li>Fedora <a href="ftp://ftp.mondorescue.org/fedora/4">Core 4</a> and <a href="ftp://ftp.mondorescue.org/fedora/5">Core 5</a>.</li> 103 105 <li>RedHat Enterprise Linux <!--<a href="ftp://ftp.mondorescue.org/rhel/2.1">2.1</a>, --><a href="ftp://ftp.mondorescue.org/rhel/3">3</a>, <a href="ftp://ftp.mondorescue.org/rhel/4">4</a>.</li> 104 <li>Mandriva <a href="ftp://ftp.mondorescue.org/mandrake/10.1">10.1</a>, <a href="ftp://ftp.mondorescue.org/mandrake/10.2">10.2</a>, <a href="ftp://ftp.mondorescue.org/mandriva/2006.0">2006.0</a> .</li>106 <li>Mandriva <a href="ftp://ftp.mondorescue.org/mandrake/10.1">10.1</a>, <a href="ftp://ftp.mondorescue.org/mandrake/10.2">10.2</a>, <a href="ftp://ftp.mondorescue.org/mandriva/2006.0">2006.0</a>, <a href="ftp://ftp.mondorescue.org/mandriva/2007.0">2007.0</a>.</li> 105 107 <li>OpenSuSE <a href="ftp://ftp.mondorescue.org/suse/9.3">9.3</a>, <a href="ftp://ftp.mondorescue.org/suse/10.0">10.0</a>, <a href="ftp://ftp.mondorescue.org/suse/10.1">10.1</a>. Look also at <a href="http://www.mikenjane.net/~mike/">this</a> web page for SuSE details. <a href="http://packman.links2linux.org/">Packman</a> may have some useful additional packages. 106 108 <li>SuSE Linux Enterprise Server <a href="ftp://ftp.mondorescue.org/sles/9">9</a>, <a href="ftp://ftp.mondorescue.org/sles/10">10</a>.</li> … … 111 113 <p>Older packages are also on the <a href="ftp://ftp.mondorescue.org/">ftp</a> site to help for some old fashion distros/versions.</p> 112 114 115 <!-- 113 116 <h3>Mondo Rescue CD</h3> 114 117 115 118 <p>In order to make it as easy as possible for you to use Mondo Rescue, you may want to download the latest <a href="ftp://ftp.mondorescue.org/iso/mondorescue.iso">Mondo Rescue CD</a> which contains all the packages with its dependancies available on the ftp site. It is updated daily (Currently un-available for bandwidth issues) 116 <!--117 119 <div class="h2-5"> 118 120 <h2>Change Logs</h2> -
trunk/website/head.shtml
r363 r932 1 1 <title>Mondo Rescue - GPL disaster recovery solution</title> 2 2 <meta name="Author" content="Bruno Cornec" /> 3 <meta name="keywords" lang="en" content="mondo mindi gnu linux gpl freebsd disaster recovery clone" />3 <meta name="keywords" lang="en" content="mondo mindi mondorescue gnu linux gpl freebsd disaster recovery clone dploy.org" /> 4 4 <meta name="description" lang="en" content="Mondo Rescue" /> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> -
trunk/website/index.shtml
r652 r932 20 20 </div> 21 21 <div class="c"> <img src="/images/screenshots.png" alt="Mondo Rescue screenshots" title="Mondo Rescue Screenshots" /></div> 22 <p class="c">Mondo Rescue is a GPL disaster recovery solution. It supports Linux (i386, x86_64, ia64) and FreeBSD (i386). It's packaged for multiple distributions (RedHat, RHEL, SuSE, SLES, Mandriva, Debian ). </p>22 <p class="c">Mondo Rescue is a GPL disaster recovery solution. It supports Linux (i386, x86_64, ia64) and FreeBSD (i386). It's packaged for multiple distributions (RedHat, RHEL, SuSE, SLES, Mandriva, Debian, Gentoo). </p> 23 23 <p class="c">It supports tapes, disks, network and CD/DVD as backup media, multiple filesystems, LVM, software and hardware Raid.</p> 24 24 <p class="c">You need it to be safe.</p> -
trunk/website/support.shtml
r914 r932 23 23 <p>Finally post on the <a href="mailto:mondo-devel_at_lists.sourceforge.net">Mondo Rescue Mailing List</a> if you did not find what you were looking for, as there are more than 400 users there who could help you, including dev team members. <b>But</b>, they can only help you if your provide at least the above mentionned <b>2 first log files</b>.</p> 24 24 <p>If your think you found a bug in Mondo Rescue, please <a href="http://trac.mondorescue.org/newticket">fill a bug report</a> and also include the log files.</p> 25 <p>Likely, if you wish Mondo Rescue had your dreamed new shiny function, feel free to create a n<a href="http://trac.mondorescue.org/newticket">feature request</a>.</p>25 <p>Likely, if you wish Mondo Rescue had your dreamed new shiny function, feel free to create a <a href="http://trac.mondorescue.org/newticket">feature request</a>.</p> 26 26 <div class="h2-3"> 27 27 <h2>Mondo Rescue Mailing Lists</h2> -
trunk/website/thanks.shtml
r404 r932 13 13 14 14 <div class="h2-1"> 15 <h2>Original dev team</h2>15 <h2>Original and current dev team</h2> 16 16 </div> 17 17 <p>Without Hugo and these people, you won't have any project today :</p> … … 25 25 <li>Michael Clark,</li> 26 26 <li>Scott Godin.</li> 27 </ul> 28 <p>And without these new people, you wouldn't have any continuing project today :</p> 29 <ul> 30 <li>Andree Leidenfrost,</li> 31 <li>Bruno Cornec,</li> 27 32 </ul> 28 33 <div class="h2-5"> … … 69 74 Mark Hannah, Ole Hanson, Chad Harrelson, John Harrison, Lee Harvey, Bradley Hartin, Rick Haskin, David Hess, Robert W. Holder, Mikael Hultgren, John Huttley, 70 75 Jesse "KP" Keating, Donald Kerns, David Kim, Andreas Kotowicz, Maciej Kulasa, Charly Kühnast, 71 Fabrice Laborie, Jan-Eric Lindh, Gary Lowder,76 Fabrice Laborie, Andree, Leidenfrost, Jan-Eric Lindh, Gary Lowder, 72 77 John Mann, Markus Markert, Markus Marquardt, Jean-David Marrow, Marshall McMullen, Roger Merchberger, Benjamin Mickens, Jeff Miller, Michael Moellney, Eberhard Moenkeberg, Andreas Mohr, Jason Murray, Philippe de Muyler, 73 78 Matija Nalis, Doug Nordwall, Kosaku Nagasaka,
Note:
See TracChangeset
for help on using the changeset viewer.