Changeset 1983 in MondoRescue
- Timestamp:
- Jun 16, 2008, 9:40:42 PM (17 years ago)
- Location:
- branches/2.2.7
- Files:
-
- 16 deleted
- 10 edited
- 1 copied
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.7/mindi/install.sh
r1802 r1983 72 72 73 73 echo "Copying files ..." 74 cp -af rootfs aux-tools$locallib/mindi74 cp -af rootfs $locallib/mindi 75 75 chmod 755 $locallib/mindi/rootfs/sbin/* 76 chmod 755 $locallib/mindi/aux-tools/sbin/*77 76 install -m 755 analyze-my-lvm $locallib/mindi 78 install -m 644 isolinux.cfg msg-txt sys-disk.raw.gz isolinux-H.cfg syslinux.cfg syslinux-H.cfgdev.tgz $locallib/mindi77 install -m 644 msg-txt dev.tgz $locallib/mindi 79 78 install -m 644 deplist.txt udev.files proliant.files $conf 80 79 -
branches/2.2.7/mindi/mindi
r1967 r1983 17 17 18 18 ADDITIONAL_BOOT_PARAMS="devfs=nomount noresume selinux=0 barrier=off" 19 20 #RUN_AFTER_INITIAL_BOOT_PHASE="echo \"Who lives in a pineapple under the sea?\" > /tmp/spongebob.squarepants.txt"21 # after booting from image/CD but before22 # accessing auxiliary data disks (or the rest of23 # the CD), the initscript will run the above command.24 25 RUN_AFTER_BOOT_PHASE_COMPLETE="ide-opt"26 # after the emergency boot process is complete but27 # before the init script runs mondorestore, it will28 # run this command.29 19 30 20 MINDI_REV=PBREV … … 113 103 114 104 115 HackSyslinuxFile() {116 local incoming117 incoming=`ReadLine`118 while [ "$incoming" ] ; do119 echo -en "$incoming" | sed s/24000/$1/120 if [ "`echo "$incoming" | grep append`" ] ; then121 echo -en " $ADDITIONAL_BOOT_PARAMS"122 fi123 echo -en "\n"124 incoming=`ReadLine`125 done126 if [ -e "$MINDI_LIB/memtest.img" ] ; then127 echo -en "label memtest\n kernel memdisk\n append initrd=memtest.img\n\n"128 fi129 }130 131 132 105 Aborted() { 133 106 trap SIGHUP SIGTERM SIGTRAP SIGINT … … 219 192 done 220 193 rm -f $scratchfile 221 }222 223 224 CopyBootBFile() {225 local copy_to copy_from possible_locations liloc226 copy_to=$1227 copy_from=/boot/boot.b228 liloc=`which lilo.real 2>/dev/null`229 [ $liloc ] || liloc=`which lilo 2>/dev/null`230 if [ $liloc ]; then231 if ! [ `strings $liloc | grep "boot\.b"` ]; then232 LogIt "boot.b files built into lilo; I'll create a dummy."233 > $copy_to234 return 0235 fi236 fi237 if [ ! -f "$copy_from" ] ; then238 LogIt "OK, you don't have a /boot/boot.b file, which is odd because\n most _good_ Linux distributions come with one, even if it's only a softlink"239 copy_from=`grep install= /etc/lilo.conf | grep "\.b" | cut -d'=' -f2`240 if [ ! -f "$copy_from" ] ; then241 LogIt "Nor can I find it from your /etc/lilo.conf file. This is very odd."242 copy_from=`FindSensibleBootBFile`243 LogIt "I'm going to use '$copy_from'"244 fi245 fi246 cp -f $copy_from $copy_to 2>> $LOGFILE || LogIt "CBBF -- warning -- cannot find your boot.b file. That's it, I quit... (j/k)"247 194 } 248 195 … … 472 419 mkdir -p $bigdir/tmp 473 420 echo "$mappath" > $bigdir/tmp/KEYMAP-LIVES-HERE 474 KBDE PTH=0421 KBDElabel=memtest\nPTH=0 475 422 AddKeyboardMappingFile $mappath 476 423 echo -e "$DONE" … … 490 437 [ ! -e "$ISOLINUX" ] && Die "Please install isolinux first. If your syslinux RPM doesn't include isolinux, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.com and click on 'Download'" 491 438 echo "Found isolinux.bin at $ISOLINUX" >> $LOGFILE 492 }493 494 495 FindLiloBinary() {496 if which lilo &> /dev/null ; then497 if which lilo.real > /dev/null 2> /dev/null ; then498 LILO_EXE=lilo.real499 LogIt "lilo.real found; will be used instead of lilo (*grumble* *mutter*)"500 else501 LILO_EXE=lilo502 fi503 $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. :)"504 else505 LILO_EXE=`which false`506 fi507 }508 509 510 FindSensibleBootBFile() {511 local i out last512 out=""513 last=""514 for i in `find /boot -type f | grep -v chain | grep -v os2 | sort -u` ; do515 if [ "`strings $i 2> /dev/null | head -n1`" = "LILO" ] ; then516 out="$out $i"517 last="$i"518 fi519 done520 echo "$last"521 439 } 522 440 … … 853 771 ListImagesForUser() { 854 772 local path fname 855 path=$ 1773 path=$MINDI_CACHE 856 774 echo -en "In the directory '$path' you will find the images:-\n" 857 775 for fname in `ls $path | grep -F mindi-` ; do … … 1384 1302 1385 1303 1386 MakeSyslinuxMessageFile() {1387 mkdir -p $11388 rmdir $11389 echo -en " " > $11390 if [ "`grep -Fi "debian" /etc/issue.net 2> /dev/null`" ] ; then1391 sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ >> $1.tmp1392 else1393 sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`grep -i "linux" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`grep -i "kernel" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' '\\r' 'on' 'an' '\/' '`uname -r`' 'on' 'an' '`uname -m`/ >> $1.tmp1394 fi1395 sed s/%r/"`uname -r`"/ $1.tmp | sed s/%t/"`hostname`"/ > $11396 rm -f $1.tmp1397 if [ "$CDRECOVERY" != "yes" ] ; then1398 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then1399 echo -en "Press <enter> to continue.\n" >> $11400 elif [ ! "$MINDI_TMP" ] ; then1401 echo -en "FYI, this is _not_ a Mondo Rescue CD.\n" >> $11402 if [ -e "$MINDI_LIB/memtest.img" ] ; then1403 echo -en "Type 'memtest' <Enter> to test your PC's memory intensively.\nJust press <Enter> to go to the main test menu.\n" >> $11404 fi1405 else1406 echo -en "$BOOT_MEDIA_MESSAGE" >> $11407 fi1408 else1409 echo -en " \1410 To restore your disk to factory defaults, type 'RESTORE' <enter>.\n\1411 CAUTION: THIS WILL ERASE YOUR WHOLE DISK !!!\n" >> $11412 fi1413 }1414 1415 1416 1304 OfferToMakeBootableISO() { 1417 1305 local i old_pwd … … 1425 1313 fi 1426 1314 rm -Rf $MINDI_TMP/iso 1427 mkdir -p $MINDI_TMP/iso/{images,archives,isolinux} 1428 cp -f $1/*.gz $MINDI_TMP/iso/images 2>> $LOGFILE || LogIt "OfferToMakeBootableISO: Cannot copy $1/*.gz to $MINDI_TMP/iso/images" 1429 old_pwd=`pwd` 1430 cd $MINDI_TMP/iso 1315 mkdir -p $MINDI_TMP/iso/{images,archives} 1316 cp -f $MINDI_CACHE/*.gz $MINDI_TMP/iso/images 2>> $LOGFILE || LogIt "OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images" 1431 1317 echo "mindi_lib = $MINDI_LIB" >> $LOGFILE 1432 1318 for i in memdisk memtest.bin memtest.img ; do 1433 1319 j=$MINDI_LIB/$i 1434 k=$MINDI_TMP/iso /isolinux1320 k=$MINDI_TMP/iso 1435 1321 if [ -e "$j" ] ; then 1436 1322 LogIt "Copying $j to $k" … … 1442 1328 fi 1443 1329 done 1444 Make SyslinuxMessageFile $MINDI_TMP/iso/isolinux/message.txt1445 cp $kernelpath $MINDI_TMP/iso/ isolinux/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/iso/isolinux/vmlinuz). Did you run out of disk space?"1446 cp $MINDI_TMP/ mindi.rdz $MINDI_TMP/iso/isolinux/initrd.img 2>> $LOGFILE || Die "Cannot copy mindi.rdz ($MINDI_TMP/mindi.rdz) to $MINDI_TMP/iso/isolinux/initrd.img. Did you run out of disk space?"1330 MakeMessageFile > $MINDI_TMP/iso/message.txt 1331 cp $kernelpath $MINDI_TMP/iso/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/iso/vmlinuz). Did you run out of disk space?" 1332 cp $MINDI_TMP/initrd.img $MINDI_TMP/iso/initrd.img 2>> $LOGFILE || Die "Cannot copy initrd.img ($MINDI_TMP/initrd.img) to $MINDI_TMP/iso/initrd.img. Did you run out of disk space?" 1447 1333 if [ _"$MONDO_SHARE" != _"" ]; then 1448 1334 cp $kernelpath $MONDO_ROOT/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?" 1449 cp $MINDI_TMP/mindi.rdz $MONDO_ROOT/initrd.img 2>> $LOGFILE || Die "Cannot copy mindi.rdz ($MINDI_TMP/mindi.rdz) to $MONDO_ROOT/initrd.img. Did you run out of disk space?" 1450 fi 1451 [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur" 1452 cd $MINDI_TMP/iso/isolinux 1453 cat $iso_cfg_file | HackSyslinuxFile $ramdisk_size $MINDI_TMP/iso > isolinux.cfg || Die "Cannot copy isolinux.cfg to $MINDI_TMP/iso/isolinux - did you run out of disk space?" 1454 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1455 perl -pi -e 's/interactive/iso/' isolinux.cfg 1456 fi 1335 cp $MINDI_TMP/initrd.img $MONDO_ROOT/initrd.img 2>> $LOGFILE || Die "Cannot copy initrd.img ($MINDI_TMP/initrd.img) to $MONDO_ROOT/initrd.img. Did you run out of disk space?" 1336 fi 1337 MakeBootConfFile syslinux > $MINDI_TMP/iso/isolinux.cfg 1457 1338 if [ "$ARCH" != "ia64" ] ; then 1458 cp $ISOLINUX isolinux.bin 2> /dev/null || Die "Cannot copy isolinux.bin ($ISOLINUX) to $MINDI_TMP/iso/isolinux- did you run out of disk space?"1459 cp $ISOLINUX ../ 2>> $LOGFILE1460 fi1339 cp $ISOLINUX $MINDI_TMP/iso/isolinux.bin 2> /dev/null || Die "Cannot copy isolinux.bin ($ISOLINUX) to $MINDI_TMP/iso - did you run out of disk space?" 1340 fi 1341 old_pwd=`pwd` 1461 1342 cd $MINDI_TMP/iso 1462 1343 if [ "$ARCH" != "ia64" ] ; then 1463 1344 if [ _"$MONDO_SHARE" != _"" ]; then 1464 cp -f $MINDI_TMP/iso/ isolinux/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2> /dev/null || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"1465 cp -f $MONDO_SHARE/autorun .2>> $LOGFILE1466 fi 1467 $ISO_CMD -U $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b isolinux /isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log1468 else 1469 $ISO_CMD $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.$BOOT_SIZE.img -c i solinux/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log1345 cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2> /dev/null || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?" 1346 cp -f $MONDO_SHARE/autorun $MINDI_TMP/iso 2>> $LOGFILE 1347 fi 1348 $ISO_CMD -U $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log 1349 else 1350 $ISO_CMD $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.$BOOT_SIZE.img -c images/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log 1470 1351 rm -f images/mindi-bootroot.$BOOT_SIZE.img 1471 1352 fi … … 1561 1442 echo -en "." 1562 1443 mkdir -p $MINDI_TMP/usb/images 1563 cp -f $ 1/*.img $1/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogIt "OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images"1444 cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogIt "OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images" 1564 1445 echo -en "." 1565 old_pwd=`pwd`1566 cd $MINDI_TMP/usb1567 1446 echo "mindi_lib = $MINDI_LIB" >> $LOGFILE 1568 1447 for i in memdisk memtest.bin memtest.img ; do … … 1576 1455 done 1577 1456 echo -en "." 1578 Make SyslinuxMessageFile$MINDI_TMP/usb/message.txt1457 MakeMessageFile > $MINDI_TMP/usb/message.txt 1579 1458 echo -en "." 1580 cp $kernelpath $MINDI_TMP/usb/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/usb/ syslinux/vmlinuz). Did you run out of disk space?"1459 cp $kernelpath $MINDI_TMP/usb/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/usb/vmlinuz). Did you run out of disk space?" 1581 1460 echo -en "." 1582 cp $MINDI_TMP/ mindi.rdz$MINDI_TMP/usb/initrd.img 2>> $LOGFILE1461 cp $MINDI_TMP/initrd.img $MINDI_TMP/usb/initrd.img 2>> $LOGFILE 1583 1462 echo -en "." 1584 [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur" 1585 cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $MINDI_TMP/usb > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to $MINDI_TMP/usb - did you run out of disk space?" 1586 echo -en "." 1587 if [ "$NFS_DEV" != "" ] ; then 1588 perl -pi -e 's/interactive/iso/' syslinux.cfg 1589 fi 1590 cd $old_pwd 1463 MakeBootConfFile syslinux > syslinux.cfg 1591 1464 echo -en "." 1592 1465 umount $MINDI_TMP/usb … … 1611 1484 1612 1485 MakeMessageFile() { 1613 if [ "`grep -Fi "debian" /etc/issue.net 2> /dev/null`" ] ; then 1614 sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ 1615 else 1616 sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`grep -i "linux" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`grep -i "kernel" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' 'r' 'on' 'an' 'm/' '`uname -r`' 'on' 'an' '`uname -m`/ 1486 iss="/dev/null" 1487 [ -e /etc/issue ] && iss="/etc/issue" 1488 [ -e /etc/issue.net ] && iss="/etc/issue.net" 1489 if [ "`grep -Fi "debian" $iss 2> /dev/null`" ] ; then 1490 sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 $iss` `hostname`"% | sed s/KKKKK/"Kernel `uname -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/%r/"`uname -r`"/ | sed s/%t/"`hostname`"/ 1491 else 1492 sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`grep -i "linux" $iss | sed s~/~~ | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`grep -i "kernel" $iss | sed s~/~~ | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' 'r' 'on' 'an' 'm/' '`uname -r`' 'on' 'an' '`uname -m`/ | sed s/%r/"`uname -r`"/ | sed s/%t/"`hostname`"/ 1617 1493 fi 1618 1494 if [ _"$MONDO_SHARE" != _"" ]; then … … 1622 1498 elif [ ! "$MINDI_TMP" ] ; then 1623 1499 echo -en "FYI, this is _not_ a Mondo Rescue CD.\n" 1500 if [ -e "$MINDI_LIB/memtest.img" ] ; then 1501 echo -en "Type 'memtest' <Enter> to test your PC's memory intensively.\nJust press <Enter> to go to the main test menu.\n" 1502 fi 1624 1503 else 1625 1504 echo -en "$BOOT_MEDIA_MESSAGE" 1626 1505 fi 1627 fi 1628 fi 1629 if [ "$CDRECOVERY" = "yes" ] ; then 1630 echo -en "\ 1506 else 1507 echo -en "\ 1631 1508 To restore your disk to factory defaults, type 'RESTORE' <enter>.\n\ 1632 1509 CAUTION: THIS WILL ERASE YOUR WHOLE DISK !!!\n" 1510 fi 1633 1511 fi 1634 1512 echo -en "\n\n\n" … … 1636 1514 1637 1515 1638 Make LiloConfFile() {1516 MakeBootConfFile() { 1639 1517 local options i ooo 1640 1518 options="" 1641 1642 if [ "$ARCH" != "ia64" ] ; then 1643 echo -en "boot=/dev/loop0\ndisk=/dev/loop0\n" 1644 echo -en "install=/boot.b\nmap=/boot.map\n" 1645 fi 1519 # Type of boot file (elilo or syslinux/isolinux) 1520 type=$1 1521 if [ "$type" = "elilo" ]; then 1522 sep="=" 1523 else 1524 sep=" " 1525 fi 1526 1527 # Generic header for conf file 1528 if [ "$type" != "elilo" ] ; then 1529 echo -en "prompt 1\ndisplay message.txt\n" 1530 else 1531 echo -en "prompt\n" 1532 fi 1533 1534 # Compute which default option to boot from 1646 1535 if [ "$CDRECOVERY" = "yes" ] ; then 1647 echo -en "default=RESTORE\n" 1536 echo -en "default${sep}RESTORE\n" 1537 # In case it's mondoarchive 1648 1538 elif [ _"$MONDO_SHARE" != _"" ]; then 1649 1539 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1650 echo -en "default =iso\n"1540 echo -en "default${sep}iso\n" 1651 1541 else 1652 echo -en "default=interactive\n" 1653 fi 1654 else 1655 echo -en "default=expert\n" 1656 fi 1657 1658 echo -en "prompt\n" 1659 if [ "$ARCH" != "ia64" ] ; then 1660 echo -en "vga=normal\nbackup=/dev/null\nmessage=/message\n" 1661 fi 1542 echo -en "default${sep}interactive\n" 1543 fi 1544 else 1545 echo -en "default${sep}expert\n" 1546 fi 1547 1548 # Handle timeout 1662 1549 if [ "$CDRECOVERY" != "yes" ] ; then 1663 echo -en "timeout=300\n" 1550 echo -en "timeout${sep}300\n" 1551 else 1552 echo -en "timeout${sep}10000\n" 1664 1553 fi 1665 1554 echo -en "\n" 1555 1556 # prepare which labels will be generted 1666 1557 if [ "$CDRECOVERY" = "yes" ] ; then 1667 1558 options="RESTORE expert" … … 1677 1568 fi 1678 1569 fi 1570 1571 # Generate rest of conf file 1679 1572 for i in $options ; do 1680 1573 ooo=$i 1681 1574 [ "$ooo" = "RESTORE" ] && ooo="nuke" 1682 if [ "$ ARCH" = "ia64" ]; then1683 rootpart="root=/dev/ram0\n\t"1575 if [ "$type" = "elilo" ]; then 1576 outstr="image=/vmlinuz\n\tlabel=$i\n\tinitrd=/initrd.img\n\troot=/dev/ram0 append=\" rw ramdisk_size=$ramdisk_size $ooo_mode $ADDITIONAL_BOOT_PARAMS \"\n" 1684 1577 else 1685 rootpart="" 1686 fi 1687 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" 1688 1689 outstr=$outstr" $ooo_mode" 1690 outstr=$outstr"\"\n" 1578 outstr="label $i\n\tkernel /vmlinuz\n\tappend initrd=/initrd.img root=/dev/ram0 rw ramdisk_size=$ramdisk_size ${ooo}_mode $ADDITIONAL_BOOT_PARAMS\n" 1579 fi 1691 1580 echo -en "$outstr" 1692 1581 done 1582 1583 if [ -e "$MINDI_LIB/memtest.img" ] ; then 1584 if [ "$type" = "elilo" ]; then 1585 echo -en "image=/memtest.bin\n\tlabel=memtest\n" 1586 echo -en "image=/memdisk\n\tlabel=memtest\nappend=\"initrd=memtest.img\"\n" 1587 else 1588 echo -en "label memtest\n\tkernel /memtest.bin\n" 1589 echo -en "label=memtest\n\tkernel /memdisk\nappend initrd=memtest.img\n" 1590 fi 1591 fi 1693 1592 } 1694 1593 1695 1594 1696 1595 PrepareBootDiskImage_LILO() { 1697 local imagesdir dev imagefile mountpoint fname i kernelpath ramdisksize cfg_file testpath options retval outstr old_pwd ooo max_kernel_size liloconf 1698 imagesdir=$1 1699 kernelpath=$2 1700 ramdisksize=$3 1596 local imagesdir dev imagefile mountpoint fname i kernelpath cfg_file testpath options retval outstr old_pwd ooo max_kernel_size liloconf 1597 imagesdir=$MINDI_CACHE 1598 kernelpath=$1 1701 1599 1702 1600 retval=0 1703 1601 [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel" 1704 1602 echo -en "Making "$BOOT_SIZE"KB boot disk..." 1705 TurnTgzIntoRdz $MINDI_LIB/rootfs $MINDI_TMP/ mindi.rdz $ramdisksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"1603 TurnTgzIntoRdz $MINDI_LIB/rootfs $MINDI_TMP/initrd.img `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into initrd.img; are you SURE your kernel supports loopfs?" 1706 1604 echo -en "..." 1707 1605 imagefile=$imagesdir/mindi-bootroot.$BOOT_SIZE.img … … 1709 1607 mkdir -p $mountpoint 1710 1608 dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file" 1711 if [ "$ARCH" = "ia64" ] ; then 1712 mkdosfs $imagefile >> $LOGFILE 2>> $LOGFILE 1713 t=vfat 1714 else 1715 echo "Creating ext2 filesystem on $imagefile" >> $LOGFILE 1716 mke2fs -N 26 -m 0 -F $imagefile &> /dev/null || Die "Unable to create an ext2 file system on $imagefile" 1717 t=ext2 1718 fi 1719 mount -t $t -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)" 1609 mkdosfs $imagefile >> $LOGFILE 2>> $LOGFILE 1610 mount -t vfat -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)" 1720 1611 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it 1721 1612 mkdir -p $mountpoint/etc 1722 if [ "$ARCH" != "ia64" ] ; then 1723 liloconf=$mountpoint/etc/lilo.conf 1724 else 1725 liloconf=$mountpoint/elilo.conf 1726 fi 1727 old_pwd=`pwd` 1728 cd $mountpoint 1729 if [ "$ARCH" != "ia64" ] ; then 1730 tar -zxf $MINDI_LIB/dev.tgz || LogIt "Cannot untar dev.tgz" 1731 fi 1732 cd $old_pwd 1733 # BERLIOS : Useless and generating errors on CentOS ? (losetup miss a param) 1734 #losetup /dev/loop0 > /dev/null 2> /dev/null 1735 #[ "$?" -eq "0" ] || losetup /dev/loop0 -d || Die "Please free up /dev/loop0 by typing 'losetup /dev/loop0 -d'.\nReboot if necessary." 1736 CopyBootBFile $mountpoint/boot.b 1737 1738 MakeLiloConfFile > $liloconf 1613 liloconf=$mountpoint/elilo.conf 1614 1615 MakeBootConfFile elilo > $liloconf 1739 1616 1740 1617 # Copy it so that CD-ROM menu entry is satisfied 1741 if [ "$ARCH" = "ia64" ] ; then 1742 mountefi=0 1743 df -T | grep /boot/efi | grep -q vfat 1618 mountefi=0 1619 df -T | grep /boot/efi | grep -q vfat 1620 if [ $? -ne 0 ]; then 1621 mount /boot/efi 1744 1622 if [ $? -ne 0 ]; then 1745 mount /boot/efi 1746 if [ $? -ne 0 ]; then 1747 echo "You have to mount your EFI partition when using mindi" 1748 MindiExit -1 1749 fi 1750 mountefi=1 1751 fi 1752 el=`find /boot/efi -name elilo.efi` 1753 cp $el $mountpoint 1754 cp $liloconf $mountpoint 1755 if [ $mountefi -eq 1 ]; then 1756 umount /boot/efi 2>&1 > /dev/null 1757 fi 1758 fi 1759 1760 echo "Copying $MINDI_TMP/mindi.rdz to $mountpoint..." >> $LOGFILE 1761 cp -f $MINDI_TMP/mindi.rdz $mountpoint 2>> $LOGFILE 1623 echo "You have to mount your EFI partition when using mindi" 1624 MindiExit -1 1625 fi 1626 mountefi=1 1627 fi 1628 el=`find /boot/efi -name elilo.efi` 1629 cp $el $mountpoint 1630 cp $liloconf $mountpoint 1631 if [ $mountefi -eq 1 ]; then 1632 umount /boot/efi 2>&1 > /dev/null 1633 fi 1634 1635 echo "Copying $MINDI_TMP/initrd.img to $mountpoint..." >> $LOGFILE 1636 cp -f $MINDI_TMP/initrd.img $mountpoint 2>> $LOGFILE 1762 1637 if [ "$?" -ne "0" ] ; then 1763 LogIt "Failed to copy $MINDI_TMP/ mindi.rdzto $mountpoint"1638 LogIt "Failed to copy $MINDI_TMP/initrd.img to $mountpoint" 1764 1639 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1765 1640 LogIt "Please unload some of your modules and try again." 1766 1641 rm -f $MINDI_TMP/mtpt.$$ 1767 LogIt "Cannot incorporate mindi.rdzin bootdisk (kernel / modules too big?)"1642 LogIt "Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)" 1768 1643 retval=$(($retval+1)) 1769 1644 fi 1770 MakeMessageFile > $mountpoint/message 1645 MakeMessageFile > $mountpoint/message.txt 1771 1646 1772 1647 mkdir -p $mountpoint/tmp 1773 cp -f $MINDI_TMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null 1774 if [ -e "$MINDI_LIB/memtest.img" ] ; then 1775 echo -en "image=/memtest.bin\nlabel=memtest\nn" >> $liloconf 1776 echo -en "image=/memdisk\nlabel=memtest\nappend=\"initrd=memtest.img\"\n" >> $liloconf 1777 # echo "Yep, this is a multi-function CD" > $mountpoint/MULTIFUNC 1648 if [ -f "$MINDI_TMP/mondo-restore.cfg" ]; then 1649 cp -f $MINDI_TMP/mondo-restore.cfg $mountpoint/tmp 1778 1650 fi 1779 1651 … … 1804 1676 rm -f $mountpoint/zero 1805 1677 [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint 2>> $LOGFILE 1806 if [ ! "$KERN_DISK_MADE" ] ; then 1807 if [ "$ARCH" != "ia64" ] ; then 1808 $LILO_EXE $LILO_OPTIONS -r $mountpoint >> $LOGFILE 2>> $LOGFILE 1809 else 1810 /bin/true 1811 fi 1812 else 1678 if [ "$KERN_DISK_MADE" ] ; then 1813 1679 echo "Not running LILO. It's not that kind of disk." >> $LOGFILE 1814 1680 fi 1815 1681 1816 # BERLIOS does not test necessarily what it expects1817 if [ $? -ne "0" ] ; then1818 if [ "`grep -F "/tmp/dev.0" $LOGFILE`" ] ; then1819 LogIt "The '/tmp/dev.0' error is NOT Mindi's fault. It is LILO's."1820 LogIt "Please reboot your PC as a workaround."1821 Die "LILO sneezed and Mindi caught a cold. Please read the README / FAQ."1822 fi1823 echo "$LILO_EXE -r $mountpoint ...failed."1824 echo -en "Press ENTER to continue."; read line1825 LogIt "Cannot run lilo on $mountpoint\nPlease upgrade/downgrade your version of LILO. It has a bug."1826 retval=$(($retval+1))1827 fi1828 1682 cp -f $liloconf $MINDI_TMP/lilo.conf 2>> $LOGFILE 1829 if [ "$ARCH" = "ia64" ] ; then 1830 cp `dirname $kernelpath`/*.efi $mountpoint 2>> $LOGFILE 1831 fi 1683 cp `dirname $kernelpath`/*.efi $mountpoint 2>> $LOGFILE 1832 1684 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1833 1685 echo -en "..." … … 1849 1701 1850 1702 PrepareBootDiskImage_SYSLINUX() { 1851 local imagesdir dev imagefile mountpoint fname i kernelpath ramdisksize cfg_file testpath options retval outstr old_pwd ooo max_kernel_size bootimage 1852 imagesdir=$1 1853 kernelpath=$2 1854 ramdisksize=$3 1703 local imagesdir dev imagefile mountpoint fname i kernelpath cfg_file testpath options retval outstr old_pwd ooo max_kernel_size bootimage 1704 imagesdir=$MINDI_CACHE 1705 kernelpath=$1 1855 1706 do_boot_root_thingy="" 1856 1707 local retval old_pwd … … 1859 1710 [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel" 1860 1711 echo -en "Making "$BOOT_SIZE"KB boot disk..." 1861 TurnTgzIntoRdz $MINDI_LIB/rootfs $MINDI_TMP/ mindi.rdz $ramdisksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"1712 TurnTgzIntoRdz $MINDI_LIB/rootfs $MINDI_TMP/initrd.img `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into initrd.img; are you SURE your kernel supports loopfs?" 1862 1713 echo -en "..." 1863 1714 imagefile=$imagesdir/mindi-bootroot.$BOOT_SIZE.img … … 1872 1723 1873 1724 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it 1874 old_pwd=`pwd` 1875 MakeSyslinuxMessageFile $mountpoint/message.txt 1876 cd $mountpoint 1877 [ -e "$sys_cfg_file" ] || Die "Obi Wan, word up?" 1878 cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $mountpoint > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root" 1879 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1880 perl -pi -e 's/interactive/iso/' syslinux.cfg 1881 fi 1882 cd $old_pwd 1883 echo "Copying $MINDI_TMP/mindi.rdz to $mountpoint/initrd.img..." >> $LOGFILE 1884 cp -f $MINDI_TMP/mindi.rdz $mountpoint/initrd.img 2>> $LOGFILE 1725 MakeMessageFile > $mountpoint/message.txt 1726 MakeBootConfFile syslinux > $mountpoint/syslinux.cfg 1727 echo "Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..." >> $LOGFILE 1728 cp -f $MINDI_TMP/initrd.img $mountpoint/initrd.img 2>> $LOGFILE 1885 1729 if [ "$?" -ne "0" ] ; then 1886 LogIt "Failed to copy $MINDI_TMP/ mindi.rdzto $mountpoint"1730 LogIt "Failed to copy $MINDI_TMP/initrd.img to $mountpoint" 1887 1731 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1888 1732 LogIt "Please unload some of your modules and try again." 1889 1733 rm -f $MINDI_TMP/mtpt.$$ 1890 LogIt "Cannot incorporate mindi.rdzin bootdisk (kernel / modules too big?)"1734 LogIt "Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)" 1891 1735 retval=$(($retval+1)) 1892 1736 fi 1893 1737 1894 1738 mkdir -p $mountpoint/tmp 1895 cp -f $MINDI_TMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null 1739 if [ -f "$MINDI_TMP/mondo-restore.cfg" ]; then 1740 cp -f $MINDI_TMP/mondo-restore.cfg $mountpoint/tmp 1741 fi 1896 1742 1897 1743 # copy the kernel across … … 1946 1792 local needlist bigdir diskdir imagesdir res i j k old_pwd lines lfiles 1947 1793 1948 imagesdir=$ 11794 imagesdir=$MINDI_CACHE 1949 1795 rm -f $imagesdir/mindi.iso 1950 1796 needlist=$MINDI_TMP/what-we-need.txt 1951 1797 bigdir=$MINDI_TMP/bigdir 1952 1798 mkdir -p $bigdir/usr/bin 1799 mkdir -p $bigdir/usr/sbin 1953 1800 1954 1801 lfiles="$DEPLIST_FILE" … … 2023 1870 cd $bigdir 2024 1871 2025 [ -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'." 2026 cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "WARNING - error occurred while unzipping aux-tools" 2027 if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then 2028 tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "WARNING - error occurred while unzipping x11-tools.tgz" 1872 # Get terminfo content 1873 ti="usr/share/terminfo/l" 1874 if [ -d /$ti ]; then 1875 mkdir -p $ti 1876 cp -Rdf /$ti/* $ti 2>> $LOGFILE || LogIt "WARNING - error occurred while copying terminfo" 2029 1877 fi 2030 1878 if [ -e "$MONDO_SHARE/restore-scripts" ]; then … … 2032 1880 [ "$?" -ne "0" ] && [ _"$MONDO_SHARE" != _"" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts" 2033 1881 fi 2034 #[ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state . 2>> $LOGFILE2035 1882 [ -d "/lib/dev-state" ] && tar cf - /lib/dev-state 2>> $LOGFILE | tar xf - 2036 1883 cd $old_pwd … … 2111 1958 done 2112 1959 echo "$incoming" 2113 }2114 2115 2116 ReplaceIndividualLine() {2117 local orig_file new_file lino newstring lines_total lines_remaining2118 2119 orig_file=$1.orig2120 mv -f $1 $orig_file || Die "Cannot move $1 to $orig_file"2121 new_file=$12122 lino=$22123 newstring="$3"2124 if [ "$lino" = "" ] || [ "$lino" -lt "1" ] ; then2125 echo "Can't find string" >> $LOGFILE2126 return 12127 fi2128 lines_total=`wc -l $orig_file | $AWK '{print $1;}'`2129 lines_remaining=$(($lines_total-$lino))2130 head -n$(($lino-1)) $orig_file > $new_file2131 echo "$newstring" >> $new_file2132 echo "# The above line was added by Mindi, at the user's instruction" >> $new_file2133 tail -n$lines_remaining $orig_file >> $new_file2134 echo "Replace line $lino of $new_file with user-specified line, '$newstring'" >> $LOGFILE2135 [ -x "$orig_file" ] && chmod +x $new_file2136 rm -f $orig_file2137 return 02138 1960 } 2139 1961 … … 2306 2128 2307 2129 TurnTgzIntoRdz() { 2308 local tgz_dir_fname rdz_fname ramdisksizetempfile mountpoint old_pwd nodes kernelsize maxsize res currsize not_copied j k s w needed_modules_path2130 local tgz_dir_fname rdz_fname tempfile mountpoint old_pwd nodes kernelsize maxsize res currsize not_copied j k s w needed_modules_path 2309 2131 2310 2132 tgz_dir_fname=$1 2311 2133 rdz_fname=$2 2312 ramdisksize=$3 2313 kernelsize=$4 2134 kernelsize=$3 2314 2135 maxsize=$(($BOOT_SIZE-$kernelsize)) 2315 2136 maxsize=$(($maxsize*2)); # to allow for compression of 50% … … 2425 2246 mkdir -p mnt/$w 2426 2247 done 2427 #if [ "$RUN_AFTER_INITIAL_BOOT_PHASE" ] ; then2428 #ReplaceIndividualLine sbin/init `grep -n "#WHOLIVESINAPINEAPPLEUNDERTHESEA#" sbin/init | cut -d':' -f1` "$RUN_AFTER_INITIAL_BOOT_PHASE"2429 #fi2430 if [ "$RUN_AFTER_BOOT_PHASE_COMPLETE" ] ; then2431 ReplaceIndividualLine sbin/init `grep -n "#ABSORBENTANDYELLOWANDPOROUSISHE#" sbin/init | cut -d':' -f1` "$RUN_AFTER_BOOT_PHASE_COMPLETE"2432 fi2433 2248 2434 2249 tar cf - /dev/fd0*[1,2][4,7,8]* 2> /dev/null | tar xf - … … 2666 2481 else 2667 2482 FindIsolinuxBinary 2668 FindLiloBinary2669 2483 fi 2670 2484 trap "Aborted" SIGTERM … … 2894 2708 fi 2895 2709 [ "$CDRECOVERY" = "yes" ] || CDRECOVERY=no 2896 if [ "$CDRECOVERY" = "yes" ] ; then 2897 iso_cfg_file=$MINDI_LIB/isolinux-H.cfg 2898 sys_cfg_file=$MINDI_LIB/syslinux-H.cfg 2899 else 2900 iso_cfg_file=$MINDI_LIB/isolinux.cfg 2901 sys_cfg_file=$MINDI_LIB/syslinux.cfg 2902 fi 2903 2904 [ -e "$iso_cfg_file" ] || Die "Cannot find $iso_cfg_file" 2710 2905 2711 if [ _"$MONDO_SHARE" = _"" ]; then 2906 2712 LogIt "Mindi Linux mini-distro generator v$MINDI_VERSION" … … 2965 2771 YOUR_KERNEL_SUCKS="That's why you're using mine, dude. :-)" 2966 2772 fi 2967 fi2968 if [ _"$MONDO_SHARE" = _"" ] && [ "$ARCH" != "ia64" ]; then2969 USE_LILO=no2970 2773 fi 2971 2774 if [ "$YOUR_KERNEL_SUCKS" != "" ] || [ "$kernelpath" = "" ] || [ "$kernelpath" = "SUCKS" ] || [ "$kernelpath" = "FAILSAFE" ] ; then … … 3002 2805 [ "$YOUR_KERNEL_SUCKS" ] && [ ! "$FAILSAFE_KVER" ] && Die "Please install mindi-kernel package. You need it.\nGo to http://www.mondorescue.org and download it, then install it." 3003 2806 3004 PrepareDataDiskImages $MINDI_CACHE 2807 PrepareDataDiskImages 2808 3005 2809 ramdisk_size=$(($size_of_all_tools+$EXTRA_SPACE)) 3006 2810 rds=$(($ramdisk_size-$((ramdisk_size%4096)))) 3007 ramdisk_size=$rds2811 export ramdisk_size=$rds 3008 2812 3009 2813 echo "Ramdisk will be $ramdisk_size KB" >> $LOGFILE 3010 2814 if [ "$ARCH" = "ia64" ] ; then 3011 PrepareBootDiskImage_LILO $ MINDI_CACHE $kernelpath $ramdisk_size|| Die "Failed to create ia64 image disk image."2815 PrepareBootDiskImage_LILO $kernelpath || Die "Failed to create ia64 image disk image." 3012 2816 else 3013 if [ "$USE_LILO" = "yes" ] ; then 3014 PrepareBootDiskImage_LILO $MINDI_CACHE $kernelpath $ramdisk_size || Die "Failed to create $BOOT_SIZE MB disk image." 3015 else 3016 PrepareBootDiskImage_SYSLINUX $MINDI_CACHE $kernelpath $ramdisk_size || Die "Failed to create $BOOT_SIZE MB disk image." 3017 fi 2817 PrepareBootDiskImage_SYSLINUX $kernelpath || Die "Failed to create $ramdisk_size MB disk image." 3018 2818 fi 3019 2819 … … 3022 2822 3023 2823 if [ _"$MONDO_SHARE" = _"" ]; then 3024 ListImagesForUser $MINDI_CACHE3025 OfferToMakeBootableISO $MINDI_CACHE2824 ListImagesForUser 2825 OfferToMakeBootableISO 3026 2826 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ]; then 3027 OfferToMakeBootableUSB $MINDI_CACHE2827 OfferToMakeBootableUSB 3028 2828 fi 3029 2829 LogIt "Finished." … … 3031 2831 rm -f $MINDI_CACHE/{*img,*iso} 3032 2832 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then 3033 OfferToMakeBootableUSB $MINDI_CACHE3034 fi 3035 OfferToMakeBootableISO $MINDI_CACHE2833 OfferToMakeBootableUSB 2834 fi 2835 OfferToMakeBootableISO 3036 2836 if [ -e "$MINDI_CACHE/all.tar.gz" ] ; then 3037 2837 cp -f $MINDI_CACHE/all.tar.gz $MINDI_TMP/ 2>> $LOGFILE … … 3040 2840 fi 3041 2841 elif [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then 3042 OfferToMakeBootableUSB $MINDI_CACHE2842 OfferToMakeBootableUSB 3043 2843 else 3044 OfferToMakeBootableISO $MINDI_CACHE2844 OfferToMakeBootableISO 3045 2845 fi 3046 2846 # cleanup -
branches/2.2.7/mindi/rootfs/sbin/find-and-mount-cdrom
r1888 r1983 7 7 for device in /dev/hd? /dev/scd? /dev/rcd? /dev/sr? /dev/cd? /dev/ide/*/*/*/*/cd /dev/scsi/*/*/*/*/cd; do 8 8 [ ! "$SECOND_TRY" ] && LogIt "Trying $device" 9 if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg `" ]; then9 if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg 2> /dev/null`" ]; then 10 10 pwd=`pwd` 11 11 cd $GROOVY … … 76 76 fi 77 77 [ "$1" = "--second-try" ] && exit 1; 78 if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg `" ] ; then78 if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg 2 > /dev/null`" ] ; then 79 79 LogIt "Because you are using cdstream, I won't try to mount CD." 80 80 exit 0 -
branches/2.2.7/mindi/rootfs/sbin/hack-cfg-if-necessary
r275 r1983 16 16 LogIt "OK, we've found /mnt/cdrom/archives/*; great." 17 17 18 if ! grep "backup-media-type iso" /tmp/mondo-restore.cfg ; then18 if ! grep "backup-media-type iso" /tmp/mondo-restore.cfg 2 > /dev/null ; then 19 19 LogIt "Config file is fine, BTW." 20 20 exit 0 … … 22 22 23 23 LogIt "Re-jigging mondo-restore.cfg because you backed up to ISOs and then burned them to CDs" 1 24 mv -f /tmp/mondo-restore.cfg /tmp/mrco 25 sed 's/backup-media-type iso/backup-media-type cdr/' /tmp/mrco > /tmp/mondo-restore.cfg 24 sed -i 's/backup-media-type iso/backup-media-type cdr/' /tmp/mondo-restore.cfg 26 25 LogIt "Done re-jigging. Yay." 27 26 exit 0 -
branches/2.2.7/mindi/rootfs/sbin/ide-opt
r1982 r1983 18 18 if [ "$cdrom_lives_here" = "$dev" ] ; then 19 19 # -c 1 20 hdparm -u 1 -d 1 /dev/$dev &> /tmp/oid1.log20 hdparm -u 1 -d 1 /dev/$dev > /tmp/oid1.log 2> /dev/null 21 21 else 22 22 # -X34 -X66 23 hdparm -u1 -d1 -c1 -m8 -W1 /dev/$dev &> /tmp/oid1.log23 hdparm -u1 -d1 -c1 -m8 -W1 /dev/$dev > /tmp/oid1.log 2> /dev/null 24 24 fi 25 25 cat /tmp/oid1.log >> /tmp/oid.log … … 30 30 #fi 31 31 32 #echo "'ide-opt' has tried to optimize IDE access. If you saw lots of warnings,"33 #echo "optimization failed (not important, really); otherwise, it succeeded."32 echo "'ide-opt' has tried to optimize IDE access. If you saw lots of warnings," 33 echo "optimization failed (not important, really); otherwise, it succeeded." 34 34 35 35 exit 0 -
branches/2.2.7/mindi/rootfs/sbin/init
r1968 r1983 104 104 cd $GROOVY 105 105 [ "$1" != "" ] && tapedev=$1 106 [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg | tr -s ' ' ' ' | cut -d' ' -f2`106 [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg 2>/dev/null | tr -s ' ' ' ' | cut -d' ' -f2` 107 107 mt -f $tapedev rewind 108 108 mt -f $tapedev fsf 2 … … 111 111 if [ "$res" -eq "0" ] ; then 112 112 # Store the dev name in case we changed it interactively 113 sed -i "s/^media-dev .*$/media-dev $tapedev/" /tmp/mondo-restore.cfg 114 115 #grep -v media-dev /tmp/mondo-restore.cfg > /tmp/mr.cfg 116 #echo "media-dev $tapedev" >> /tmp/mr.cfg 117 #cp -f /tmp/mr.cfg /tmp/mondo-restore.cfg 113 if [ -f "/tmp/mondo-restore.cfg" ]; then 114 sed -i "s/^media-dev .*$/media-dev $tapedev/" /tmp/mondo-restore.cfg 115 fi 118 116 fi 119 117 cd $old_pwd … … 453 451 local res 454 452 mount | grep /mnt/cdrom && return 0 455 [ "`grep "backup_media_type" /tmp/mondo-restore.cfg | grep "cdstream"`" ] && return453 [ "`grep "backup_media_type" /tmp/mondo-restore.cfg 2> /dev/null | grep "cdstream"`" ] && return 456 454 LogIt "Trying to mount CD-ROM a 2nd time..." 457 455 find-and-mount-cdrom --second-try … … 594 592 export DENY_MODS=" " 595 593 fi 596 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg `" ]; then594 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2> /dev/null`" ]; then 597 595 # Do not try to load usb storage when dealing with OBDR it makes the modprobe hang :-( 598 596 export DENY_MODS="usb-storage $DENY_MODS" … … 636 634 fi 637 635 638 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg `" ] || [ "`grep -i ' udev' /tmp/mondo-restore.cfg`" ]; then636 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2>/dev/null`" ] || [ "`grep -i ' udev' /tmp/mondo-restore.cfg 2>/dev/null`" ]; then 639 637 HandleTape 640 638 ExtractDataDisksAndLoadModules … … 647 645 CD_MOUNTED_OK=yes 648 646 ExtractDataDisksAndLoadModules 649 elif [ "`grep -i usb= /proc/cmdline`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg | grep media-type`" ]; then647 elif [ "`grep -i usb= /proc/cmdline`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg 2>/dev/null | grep media-type`" ]; then 650 648 . /sbin/start-usb 651 649 … … 718 716 dmesg >> $LOGFILE 719 717 720 #------------------------------- 721 #ABSORBENTANDYELLOWANDPOROUSISHE#;# --- don't touch this either :) 722 #------------------------------- 718 ide-opt 723 719 724 720 #ctrlaltdel soft -
branches/2.2.7/mindi/rootfs/sbin/post-init
r1967 r1983 105 105 106 106 mondoopt="" 107 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg `" ]; then107 if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2> /dev/null`" ]; then 108 108 mondoopt="$mondoopt -o -d $TAPEDEV" 109 109 fi … … 120 120 mondorestore $mondoopt -Z nuke 121 121 elif [ "$expert" ] ; then 122 if [ "`grep tapedev /tmp/mondo-restore.cfg `" ] ; then122 if [ "`grep tapedev /tmp/mondo-restore.cfg 2> /dev/null`" ] ; then 123 123 LogIt "-------------------TAPE MODE-------------------" 1 124 124 loc=`which mondorestore 2> /dev/null` … … 133 133 fi 134 134 fi 135 elif [ "`grep using-cdstream /tmp/mondo-restore.cfg `" ] ; then135 elif [ "`grep using-cdstream /tmp/mondo-restore.cfg 2> /dev/null`" ] ; then 136 136 LogIt "------------------CDSTREAM MODE------------------" 1 137 137 loc=`which mondorestore 2> /dev/null` -
branches/2.2.7/mindi/rootfs/sbin/start-nfs
r1927 r1983 11 11 12 12 # Get info from config file 13 ipdev=`grep nfs-dev /tmp/mondo-restore.cfg | cut -d' ' -f2-`14 ipaddress=`grep nfs-client-ipaddr /tmp/mondo-restore.cfg | cut -d' ' -f2-`15 ipnetmask=`grep nfs-client-netmask /tmp/mondo-restore.cfg | cut -d' ' -f2-`16 ipbroadcast=`grep nfs-client-broadcast /tmp/mondo-restore.cfg | cut -d' ' -f2-`17 ipgateway=`grep nfs-client-defgw /tmp/mondo-restore.cfg | cut -d' ' -f2-`13 ipdev=`grep nfs-dev /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 14 ipaddress=`grep nfs-client-ipaddr /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 15 ipnetmask=`grep nfs-client-netmask /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 16 ipbroadcast=`grep nfs-client-broadcast /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 17 ipgateway=`grep nfs-client-defgw /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 18 18 ipconf="" 19 export nfsmount=`grep nfs-server-mount /tmp/mondo-restore.cfg | cut -d' ' -f2-`20 export imgname=`grep iso-prefix /tmp/mondo-restore.cfg | cut -d' ' -f2-`19 export nfsmount=`grep nfs-server-mount /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 20 export imgname=`grep iso-prefix /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 21 21 if [ "$imgname" = "" ]; then 22 22 export imgname="mondorescue" 23 23 fi 24 export dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg | cut -d' ' -f2-`24 export dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 25 25 if [ "$dirimg" = "" ]; then 26 26 export dirimg="/" -
branches/2.2.7/mindi/rootfs/sbin/start-usb
r1787 r1983 7 7 8 8 # Get info from config file 9 usbdev=`grep usb-dev /tmp/mondo-restore.cfg | cut -d' ' -f2-`9 usbdev=`grep usb-dev /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-` 10 10 11 11 # info from cmdline are predominent -
branches/2.2.7/mondo/src/common/libmondo-devices.c
r1972 r1983 134 134 135 135 if (is_this_a_ramdisk) { 136 if (!does_file_exist("/THIS-IS-A-RAMDISK") 137 && !does_file_exist("/tmp/mountlist.txt.sample")) { 136 if (!does_file_exist("/THIS-IS-A-RAMDISK")) { 138 137 log_to_screen 139 138 ("Using /dev/root is stupid of you but I'll forgive you."); -
branches/2.2.7/mondo/src/restore-scripts/mondo/Makefile.am
r1323 r1983 1 restoremondodir 1 restoremondodir = $(pkgdatadir)/restore-scripts/mondo 2 2 restoremondo_SCRIPTS = ISO ask-me-a-question compare-subroutine-me \ 3 edit-mountlist grub-MR hack-fstab hack-grub hack-lilo hack-elilo \ 4 ide-opt ide-opt-off label-partitions-as-necessary \ 5 make-me-bootable mount-me mount-subroutine-me raw-MR \ 6 restore-bigfiles-from-iso stabgrub-me stablilo-me stabelilo-me \ 7 stabraw-me unmount-me unmount-subroutine-me 3 edit-mountlist grub-MR hack-fstab hack-grub hack-lilo hack-elilo \ 4 label-partitions-as-necessary \ 5 make-me-bootable mount-me mount-subroutine-me raw-MR \ 6 restore-bigfiles-from-iso stabgrub-me stablilo-me stabelilo-me \ 7 stabraw-me unmount-me unmount-subroutine-me 8 format-and-kludge-vfat
Note:
See TracChangeset
for help on using the changeset viewer.