Changeset 1063 in MondoRescue
- Timestamp:
- Jan 20, 2007, 11:37:55 PM (18 years ago)
- Location:
- branches/stable
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/analyze-my-lvm
r963 r1063 3 3 # $Id$ 4 4 # 5 6 #------------------------- ANALYZE-MY-LVM ----------------------- Hugo Rabson7 # 07/148 # - no longer blank first 4k of /dev/mdX9 #10 # 06/14/200411 # - fixed "n >= 2.00" bug (shell doesn't handle floating points properly)12 # - handle dm_mod as well as dm-mod13 #14 # 02/18/200415 # - nice patch to fix ListAllVolumeGroups() --- J. Richard16 # - patch to support LVM2 by Takeru Komoriya17 #18 # 10/15/200319 # - fixed '-L'-handling to allow for floating-point gigabyte values20 #21 # 01/15/200322 # - patch (LVM) by Brian Borgeson23 #24 # 12/10/200225 # - patch by Benjamin Mampaey26 #27 # 09/05/200228 # - additional patch by Ralph Gruwe29 #30 # 08/30/200231 # - modified by Ralph Gruwe32 #33 # 10/01/200134 # - last modified by Hugo :)35 #------------------------------------------------------------------------------36 5 37 6 Die() { … … 186 155 ListAllLogicalVolumes() { 187 156 if [ $lvmversion = 2 ]; then 188 $LVMCMD lvscan | grep "'" | cut -d"'" -f2189 else 190 lvscan | grep '"' | cut -d'"' -f2157 $LVMCMD lvscan 2> /dev/null | grep "'" | cut -d"'" -f2 158 else 159 lvscan 2> /dev/null | grep '"' | cut -d'"' -f2 191 160 fi 192 161 } -
branches/stable/mindi/distributions/conf/mindi.conf.dist
r1061 r1063 41 41 # 42 42 mindi_write_cd="no" 43 44 # 45 # Write mindi USB (yes|no) ? 46 # 47 mindi_write_usb="no" 43 48 44 49 # -
branches/stable/mindi/distributions/debian/FindDistroFailsafe
r1062 r1063 1 # /usr/lib/mindi/DebFindFailsafe1 #!/bin/bash 2 2 # 3 # DebFindFailsafe - Find correct FAILSAFE kernel to use on Debian systems. 3 # $Id$ 4 # 5 # FindDistroFailsafe - Find correct FAILSAFE kernel to use on Debian systems. 6 # (c) A. Leidenfrost 4 7 # 5 8 # Approach: -
branches/stable/mindi/install.sh
r1060 r1063 100 100 101 101 cp -af rootfs aux-tools $locallib/mindi 102 if [ -e FindDistroFailsafe ]; then 103 cp -af FindDistroFailsafe $locallib/mindi 104 fi 102 105 chmod 755 $locallib/mindi/rootfs/sbin/* 103 106 chmod 755 $locallib/mindi/aux-tools/sbin/* -
branches/stable/mindi/mindi
r1062 r1063 38 38 if [ ! -f $MINDI_CONFIG_DIST ]; then 39 39 echo "Unable to find $MINDI_CONFIG_DIST. Please reinstall mindi" 40 MindiExit -140 exit -1 41 41 fi 42 42 md5sum --status -c "$MINDI_CONF/mindi.conf.dist.md5" 43 43 if [ $? -ne 0 ]; then 44 44 echo "$MINDI_CONF/mindi.conf.dist md5 checksum incorrect. Please reinstall mindi" 45 MindiExit -145 exit -1 46 46 fi 47 47 . $MINDI_CONFIG_DIST … … 58 58 # Manages defaults coming from conf files 59 59 # 60 INTERACTIVE="$mindi_interactive" 61 62 if [ $INTERACTIVE == "yes" ]; then 63 # do you want to be prompted to write 64 # floppy images out to floppy disks? 65 # if 'no', images will not be written to floppies 66 PROMPT_WRITE_BOOT_FLOPPIES="yes" 67 68 # Ask if you want to make a CD Image to be written? 69 # if this is set to 'no', then the image will be created automatically 70 PROMPT_MAKE_CD_IMAGE="yes" 71 72 # Ask if you want to make a USB Image to be written? 73 # if this is set to 'no', then the image will be created automatically 74 PROMPT_MAKE_USB_IMAGE="yes" 75 76 # If set to "no", you will be prompted for whether or not 77 # you want to use your own kernel, or the supplied default. 78 # If "yes" mindi will automatically use your own kernel. 79 USE_OWN_KERNEL="no" 80 fi 81 60 82 EXTRA_SPACE=$mindi_extra_space 61 83 IA64_BOOT_SIZE=$mindi_ia64_boot_size … … 64 86 WRITE_BOOT_FLOPPIES="$mindi_write_boot_floppy" 65 87 PROMPT_MAKE_CD_IMAGE="$mindi_write_cd" 88 PROMPT_MAKE_USB_IMAGE="$mindi_write_usb" 66 89 USE_OWN_KERNEL="$mindi_use_own_kernel" 67 90 CACHE_LOC="$mindi_images_dir" … … 72 95 MY_FSTAB="$mindi_etc_fstab" 73 96 LOGFILE="$mindi_log_file" 74 INTERACTIVE="$mindi_interactive"75 76 if [ $INTERACTIVE == "yes" ]; then77 # do you want to be prompted to write78 # floppy images out to floppy disks?79 # if 'no', images will not be written to floppies80 PROMPT_WRITE_BOOT_FLOPPIES="yes"81 82 # Ask if you want to make a CD Image to be written?83 # if this is set to 'no', then the image will be created automatically84 PROMPT_MAKE_CD_IMAGE="yes"85 86 # If set to "no", you will be prompted for whether or not87 # you want to use your own kernel, or the supplied default.88 # If "yes" mindi will automatically use your own kernel.89 USE_OWN_KERNEL="no"90 fi91 92 97 FLOPPY_MODS="$mindi_floppy_mods" 93 98 TAPE_MODS="$mindi_tape_mods" … … 756 761 [ "$modres" -eq "3" ] && echo -en "\t|" 757 762 done 758 if [ "$MONDO_SHARE" ]; then763 if [ _"$MONDO_SHARE" != _"" ]; then 759 764 mkdir -p $bigdir/tmp 760 765 mkdir -p $bigdir/sbin … … 1512 1517 OfferToMakeBootableISO() { 1513 1518 local i old_pwd 1514 if [ "$PROMPT_MAKE_CD_IMAGE" = "yes" ] && [ ! "$MONDO_SHARE" ]; then1519 if [ "$PROMPT_MAKE_CD_IMAGE" = "yes" ] && [ _"$MONDO_SHARE" = _"" ]; then 1515 1520 echo -en "Shall I make a bootable CD image? (y/[n]) " 1516 1521 read i … … 1534 1539 cp -f $j $k 2> /dev/null || Die "Failed to copy $j to $k" 1535 1540 cp -f $j $MINDI_TMP 2> /dev/null || Die "Failed to copy $j to $MINDI_TMP" 1536 [ "$MONDO_SHARE" ] && cp -f $j $MONDO_ROOT 2>> $LOGFILE || Die "Failed to copy $j to $MONDO_ROOT" 1541 if [ _"$MONDO_SHARE" != _"" ]; then 1542 cp -f $j $MONDO_ROOT 2>> $LOGFILE || Die "Failed to copy $j to $MONDO_ROOT" 1543 fi 1537 1544 fi 1538 1545 done 1539 1546 MakeSyslinuxMessageFile $MINDI_TMP/iso/isolinux/message.txt 1540 cp $kernelpath $MINDI_TMP/iso/isolinux/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MINDI_TMP/iso/isolinux/vmlinuz). Did you run out of disk space?" 1541 [ "$MONDO_SHARE" ] && cp $kernelpath $MONDO_ROOT/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?" 1547 cp $kernelpath $MINDI_TMP/iso/isolinux/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/iso/isolinux/vmlinuz). Did you run out of disk space?" 1542 1548 cp $MINDI_TMP/mindi.rdz $MINDI_TMP/iso/isolinux/initrd.img 2>> $LOGFILE 1543 [ "$MONDO_SHARE" ] && cp $MINDI_TMP/mindi.rdz $MONDO_ROOT/initrd.img 2>> $LOGFILE 1549 if [ _"$MONDO_SHARE" != _"" ]; then 1550 cp $kernelpath $MONDO_ROOT/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?" 1551 cp $MINDI_TMP/mindi.rdz $MONDO_ROOT/initrd.img 2>> $LOGFILE 1552 fi 1544 1553 [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur" 1545 1554 cd $MINDI_TMP/iso/isolinux 1546 1555 cat $iso_cfg_file | HackSyslinuxFile $ramdisk_size $MINDI_TMP/iso > isolinux.cfg || Die "Cannot copy isolinux.cfg from mindi_home to tmp_root - did you run out of disk space?" 1547 1556 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1548 mv isolinux.cfg isolinux.cfg.old 1549 sed s/interactive/iso/ isolinux.cfg.old > isolinux.cfg 1557 perl -pi -e 's/interactive/iso/' isolinux.cfg 1550 1558 fi 1551 1559 if [ "$ARCH" != "ia64" ] ; then … … 1555 1563 cd $MINDI_TMP/iso 1556 1564 if [ "$ARCH" != "ia64" ] ; then 1557 [ "$MONDO_SHARE" ] && cp -f $MINDI_TMP/iso/isolinux/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2> /dev/null || Die "Cannot copy core files to ramdisk for boot disk. Did you run out of disk space?"1558 fi1559 [ "$MONDO_SHARE" ] &&cp -f $MONDO_SHARE/autorun . 2>> $LOGFILE1560 if [ "$ARCH" != "ia64" ] ; then1565 if [ _"$MONDO_SHARE" != _"" ]; then 1566 cp -f $MINDI_TMP/iso/isolinux/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2> /dev/null || Die "Cannot copy core files to ramdisk for boot disk. Did you run out of disk space?" 1567 cp -f $MONDO_SHARE/autorun . 2>> $LOGFILE 1568 fi 1561 1569 mkisofs -U -J -r -o $CACHE_LOC/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log 1562 1570 else … … 1577 1585 1578 1586 1587 OfferToMakeBootableUSB() { 1588 local i old_pwd 1589 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ _"$MONDO_SHARE" = _"" ]; then 1590 echo "Shall I make a bootable USB image ?" 1591 echo -en "WARNING: This will erase all content on $USBDEV (y/[n]) " 1592 read i 1593 [ "$i" != "y" ] && [ "$i" != "Y" ] && return 0 1594 fi 1595 rm -Rf $MINDI_TMP/usb 1596 mkdir -p $MINDI_TMP/usb 1597 USBPART="${USBDEV}1" 1598 1599 echo -en "Transforming $USBDEV in a Bootable device " 1600 echo -en "." 1601 echo "Checking $USBDEV" >> $LOGFILE 1602 $FDISK -l $USBDEV 2>&1 >> $LOGFILE 1603 if [ $? -ne 0 ]; then 1604 echo "Unable to access $USBDEV" | tee -a $LOGFILE 1605 echo "Make sure your USB device is pluged in" | tee -a $LOGFILE 1606 MindiExit -1 1607 fi 1608 echo -en "." 1609 echo "Erasing $USBDEV" >> $LOGFILE 1610 $FDISK $USBDEV 2>&1 >> $LOGFILE << EOF 1611 d 1612 d 1613 d 1614 d 1615 n 1616 p 1617 1 1618 1619 1620 t 1621 b 1622 a 1623 1 1624 w 1625 EOF 1626 if [ $? -ne 0 ]; then 1627 echo "Unable to create a vfat Filesystem on $USBDEV" | tee -a $LOGFILE 1628 echo "Make sure your USB device is pluged in" | tee -a $LOGFILE 1629 $FDISK -l $USBDEV 2>&1 | tee -a $LOGFILE 1630 MindiExit -1 1631 fi 1632 echo -en "." 1633 echo "Creating a vfat filesystem on $USBPART" >> $LOGFILE 1634 mkfs -t vfat $USBPART 2>&1 >> $LOGFILE 1635 if [ $? -ne 0 ]; then 1636 echo "Unable to create a vfat filesystem on $USBPART" | tee -a $LOGFILE 1637 echo "Make sure your USB device is pluged in and partitioned ($USBPART must exist on it)" | tee -a $LOGFILE 1638 $FDISK -l $USBDEV 2>&1 | tee -a $LOGFILE 1639 MindiExit -1 1640 fi 1641 echo -en "." 1642 echo "Mounting $USBPART on $MINDI_TMP/usb" >> $LOGFILE 1643 mount $USBPART $MINDI_TMP/usb 2>> $LOGFILE 1644 if [ $? -ne 0 ]; then 1645 echo "Unable to mount $USBPART on $MINDI_TMP/usb" | tee -a $LOGFILE 1646 echo "Make sure your USB device is pluged in, partitioned and formated ($USBPART must exist on it)" | tee -a $LOGFILE 1647 $FDISK -l $USBDEV 2>&1 | tee -a $LOGFILE 1648 MindiExit -1 1649 fi 1650 echo -en "." 1651 mkdir -p $MINDI_TMP/usb/{images,archives} 1652 cp -f $1/*.img $1/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogIt "OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/iso/images" 1653 echo -en "." 1654 old_pwd=`pwd` 1655 cd $MINDI_TMP/usb 1656 echo "mindi_lib = $MINDI_LIB" >> $LOGFILE 1657 for i in memdisk memtest.bin memtest.img ; do 1658 j=$MINDI_LIB/$i 1659 k=$MINDI_TMP/usb 1660 if [ -e "$j" ] ; then 1661 LogIt "Copying $j to $k" 1662 cp -f $j $k 2> /dev/null || Die "Failed to copy $j to $k" 1663 cp -f $j $MINDI_TMP 2> /dev/null || Die "Failed to copy $j to $MINDI_TMP" 1664 if [ _"$MONDO_SHARE" != _"" ]; then 1665 cp -f $j $MONDO_ROOT 2>> $LOGFILE || Die "Failed to copy $j to $MONDO_ROOT" 1666 fi 1667 fi 1668 done 1669 echo -en "." 1670 MakeSyslinuxMessageFile $MINDI_TMP/usb/message.txt 1671 echo -en "." 1672 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?" 1673 echo -en "." 1674 cp $MINDI_TMP/mindi.rdz $MINDI_TMP/usb/initrd.img 2>> $LOGFILE 1675 echo -en "." 1676 if [ _"$MONDO_SHARE" != _"" ]; then 1677 cp $kernelpath $MONDO_ROOT/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?" 1678 cp $MINDI_TMP/mindi.rdz $MONDO_ROOT/initrd.img 2>> $LOGFILE 1679 fi 1680 echo -en "." 1681 [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur" 1682 cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $MINDI_TMP/usb > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root - did you run out of disk space?" 1683 echo -en "." 1684 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1685 perl -pi -e 's/interactive/iso/' syslinux.cfg 1686 fi 1687 cd $old_pwd 1688 umount $MINDI_TMP/usb 1689 echo -en "." 1690 if [ "$ARCH" != "ia64" ] ; then 1691 if [ _"$MONDO_SHARE" != _"" ]; then 1692 cp -f $MINDI_TMP/usb/syslinux/{syslinux.cfg,initrd.img,vmlinuz,message.txt} $MONDO_ROOT 2> /dev/null || Die "Cannot copy core files to ramdisk for boot disk. Did you run out of disk space?" 1693 cp -f $MONDO_SHARE/autorun . 2>> $LOGFILE 1694 fi 1695 syslinux $USBPART 2>> $MINDI_TMP/syslinux.log 1696 else 1697 echo "No USB boot support for ia64" | tee -a $LOGFILE 1698 MindiExit -1 1699 fi 1700 echo -en "." 1701 if [ "$?" -ne "0" ] ; then 1702 echo "----------- syslinux's errors --------------" |tee -a $LOGFILE 1703 cat $MINDI_TMP/syslinux.log |tee -a $LOGFILE 1704 LogIt "Failed to create USB image." 1705 else 1706 echo -e "$DONE" 1707 echo "Created bootable USB image on $USBDEV" >> $LOGFILE 1708 fi 1709 rm -f $MINDI_TMP/syslinux.log 1710 } 1711 1712 1579 1713 PluralOrNot() { 1580 1714 [ "$1" -gt "1" ] && echo -en "s" … … 1591 1725 fi 1592 1726 if [ "$disksize" -gt "2880" ] ; then 1593 if [ "$MONDO_SHARE" ]; then1727 if [ _"$MONDO_SHARE" != _"" ]; then 1594 1728 if [ "$CDRECOVERY" != "yes" ] ; then 1595 1729 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then … … 1686 1820 if [ "$CDRECOVERY" = "yes" ] ; then 1687 1821 echo -en "default=RESTORE\n" 1688 elif [ "$disksize" -gt "2880" ] && [ "$MONDO_SHARE" ]; then1822 elif [ "$disksize" -gt "2880" ] && [ _"$MONDO_SHARE" != _"" ]; then 1689 1823 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1690 1824 echo -en "default=iso\n" … … 1707 1841 options="RESTORE expert" 1708 1842 elif [ "$disksize" -gt "2880" ] ; then 1709 if [ "$MONDO_SHARE" ]; then1843 if [ _"$MONDO_SHARE" != _"" ]; then 1710 1844 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1711 1845 options="iso" … … 1929 2063 cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $mountpoint > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root" 1930 2064 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1931 mv syslinux.cfg syslinux.cfg.orig 1932 sed s/interactive/iso/ syslinux.cfg.orig > syslinux.cfg 2065 perl -pi -e 's/interactive/iso/' syslinux.cfg 1933 2066 fi 1934 2067 cd $old_pwd … … 2058 2191 FindAndAddUserKeyboardMappingFile 2059 2192 mkdir -p $bigdir/tmp 2060 if [ "$MONDO_SHARE" ]; then2193 if [ _"$MONDO_SHARE" != _"" ]; then 2061 2194 MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg 2062 2195 cp -f $MINDI_TMP/mondo-restore.cfg $bigdir/tmp &> /dev/null … … 2096 2229 tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "WARNING - error occurred while unzipping x11-tools.tgz" 2097 2230 fi 2098 if [ -e "$MONDO_SHARE/restore-scripts" ] 2231 if [ -e "$MONDO_SHARE/restore-scripts" ]; then 2099 2232 cp -Rdf $MONDO_SHARE/restore-scripts/* . 2>> $LOGFILE 2100 2233 [ "$?" -ne "0" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts" … … 2110 2243 mkdir -p $minidir_root/$noof_disks/tmp 2111 2244 cp -f $MINDI_TMP/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt 2> /dev/null || Die "Cannot copy mountlist.txt from $MINDI_TMP to data disk" 2112 [ "$MONDO_SHARE" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MINDI_TMP/. 2>> $LOGFILE 2245 if [ _"$MONDO_SHARE" != _"" ]; then 2246 cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MINDI_TMP/. 2>> $LOGFILE 2247 fi 2113 2248 [ $LVM != "false" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm || LVM="false" 2114 2249 cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE … … 2572 2707 dd if=/dev/zero of=$mountpoint/zero &> /dev/null 2573 2708 rm -f $mountpoint/zero 2574 if [ "$MONDO_SHARE" ]; then2709 if [ _"$MONDO_SHARE" != _"" ]; then 2575 2710 MakeMondoConfigFile $mountpoint/tmp/mondo-restore.cfg 2576 2711 cp -f $mountpoint/tmp/mondo-restore.cfg $MINDI_TMP &> /dev/null … … 2630 2765 cd $minidir_root/all 2631 2766 size_of_all_tools=`du -sk . | cut -f1` 2632 if [ "$MONDO_SHARE" ]; then2767 if [ _"$MONDO_SHARE" != _"" ]; then 2633 2768 for q in filelist.full.gz biggielist.txt ; do 2634 2769 [ ! -e "$MINDI_TMP/$q" ] && Die "Cannot find $MINDI_TMP/$q" … … 2653 2788 2654 2789 2655 if [ "$1" = "- printvar" ] ; then2790 if [ "$1" = "--printvar" ] ; then 2656 2791 shift 2657 2792 if [ _"$1" != _"" ] ; then 2658 2793 set | egrep "^$1" | cut -d= -f2 2659 2794 fi 2660 exit 02795 MindiExit 0 2661 2796 fi 2662 2797 … … 2805 2940 MakeMountlist $2 2806 2941 MindiExit $? 2942 elif [ "$1" = "--usb" ] ; then 2943 shift 2944 USBDEV=$1 2945 if [ _"$USBDEV" = _"" ]; then 2946 Die "No USB device specified" 2947 fi 2948 LogIt "Generating Bootable USB device on $USBDEV" 2949 shift 2807 2950 elif [ "$1" = "-V" ] || [ "$1" = "-v" ] || [ "$1" = "--version" ] || [ "$1" = "-version" ] ; then 2808 2951 echo "Mindi v$MINDI_VERSION" 2809 2952 MindiExit 0 2810 2953 elif [ "$#" -ge "9" ] && [ "$1" = "--custom" ] ; then 2811 [ ! "$MONDO_SHARE" ] && Die "--custom is reserved for mondoarchive calls" 2954 if [ _"$MONDO_SHARE" = _"" ]; then 2955 Die "--custom is reserved for mondoarchive calls" 2956 fi 2812 2957 MONDO_TMP=$2 2813 2958 # Change MINDI_TMP for the one provided by mondo … … 2903 3048 2904 3049 [ -e "$iso_cfg_file" ] || Die "Cannot find $iso_cfg_file" 2905 if [ ! "$MONDO_SHARE" ]; then3050 if [ _"$MONDO_SHARE" = _"" ]; then 2906 3051 LogIt "Mindi Linux mini-distro generator v$MINDI_VERSION" 2907 3052 LogIt "Latest Mindi is available from http://www.mondorescue.org" 2908 3053 LogIt "BusyBox sources are available from http://www.busybox.net" 2909 LogIt "------------------------------------------------------------------------------"2910 3054 else 2911 3055 echo "You are using Mindi-Linux v$MINDI_VERSION to make boot+data disks" >> /var/log/mondo-archive.log … … 2943 3087 2944 3088 if [ "$kernelpath" = "" ] ; then 2945 [ "$MONDO_SHARE" ] && Die "Please use -k <path> to specify kernel." 2946 echo -en "Do you want to use your own kernel to build the boot disk ([y]/n) ?" 2947 read ch 2948 if [ "$ch" != "n" ] && [ "$ch" != "N" ] ; then 2949 USE_OWN_KERNEL="yes" 3089 if [ _"$MONDO_SHARE" != _"" ]; then 3090 Die "Please use -k <path> to specify kernel." 3091 fi 3092 if [ $INTERACTIVE == "yes" ]; then 3093 echo -en "Do you want to use your own kernel to build the boot disk ([y]/n) ?" 3094 read ch 3095 if [ "$ch" != "n" ] && [ "$ch" != "N" ] ; then 3096 USE_OWN_KERNEL="yes" 3097 fi 2950 3098 fi 2951 3099 if [ "$USE_OWN_KERNEL" = "yes" ]; then … … 2960 3108 fi 2961 3109 fi 2962 if [ ! "$MONDO_SHARE" ] && [ $INTERACTIVE = "yes" ]; then3110 if [ _"$MONDO_SHARE" = _"" ] && [ $INTERACTIVE = "yes" ]; then 2963 3111 echo -en "Would you like to use LILO (instead of syslinux)\nfor your boot CD/floppies (y/[n]) ?" 2964 3112 read ch … … 3038 3186 ...Or type 'memtest' to test your PC's RAM thoroughly.\n" 3039 3187 3040 if [ ! "$MONDO_SHARE" ]; then3188 if [ _"$MONDO_SHARE" = _"" ]; then 3041 3189 ListImagesForUser $CACHE_LOC 3042 3190 boot_dev=/dev/fd0u1722 … … 3048 3196 fi 3049 3197 OfferToMakeBootableISO $CACHE_LOC 3198 if [ _"$USBDEV" != _"" ] ; then 3199 OfferToMakeBootableUSB $CACHE_LOC 3200 fi 3050 3201 LogIt "Finished." 3051 3202 elif [ "$TAPEDEV" ] ; then … … 3057 3208 Die "Cannot find all.tar.gz, to be written to tape" 3058 3209 fi 3210 elif [ _"$USBDEV" != _"" ] ; then 3211 OfferToMakeBootableUSB $CACHE_LOC 3059 3212 else 3060 3213 OfferToMakeBootableISO $CACHE_LOC -
branches/stable/mondo-doc/mindi.8
r1060 r1063 32 32 .br 33 33 .BI "mindi --makemountlist "file 34 .br 35 .BI "mindi --usb "device 34 36 .br 35 37 .BI "mindi --printvar "variable … … 72 74 .BI "--makemountlist "file 73 75 .RI "Creates a mount list and writes it to file "file ". 76 .TP 77 .BI "--usb "device 78 .RI Create a bootable USB device 74 79 .TP 75 80 .BI "--printvar "variable -
branches/stable/mondo-doc/mondoarchive.8
r998 r1063 135 135 .B For experienced users only. 136 136 137 .TP 138 .BI "-U " 139 Use a generic USB device as backup device. Use this if you want to write 140 your backup to a USB key or USB disk, which will be make bootable. 141 The USB device should be attached to the system ir order for this to work. 142 .B WARNING: All the data on the related devices will be removed. 143 137 144 .SH MAJOR OPTIONS 138 145 .TP 13 … … 170 177 .TP 171 178 .BI "-d " "dev|dir" 172 Specify the backup device (CD/tape ) or directory (NFS/ISO). For CD-R[W] drives,179 Specify the backup device (CD/tape/USB) or directory (NFS/ISO). For CD-R[W] drives, 173 180 this is the SCSI node where the drive may be found, e.g. '0,1,0'. For tape 174 users, this is the tape streamers /dev entry, e.g. '/dev/st0'. For ISO users, 181 users, this is the tape streamers /dev entry, e.g. '/dev/st0'. For USB users, 182 this is the device name of your key or external disk. For ISO users, 175 183 this is the directory where the ISO images are stored. For NFS users, this is 176 184 the directory within the NFS mount where the backups are stored. The default … … 240 248 .BI "-F " 241 249 Do not offer to write boot+data floppy disk images to 3.5-inch floppy disks. 242 The images will remain in / root/images/mindi until your next backup run,250 The images will remain in /var/cache/mindi until your next backup run, 243 251 however. 244 252 … … 412 420 .I "mondoarchive -Ow 4 -I \*(lq/home /etc\*(rq" 413 421 422 .BI USB: 423 Backup to your USB key, using gzip compression: 424 .br 425 .I "mondoarchive -OU -d /dev/sda -G" 426 414 427 .BI NFS: 415 428 Backup to an NFS mount: -
branches/stable/mondo/src/common/libmondo-archive.c
r1049 r1063 187 187 #include "libmondo-archive.h" 188 188 #include "lib-common-externs.h" 189 190 #include "mr_mem.h" 189 191 #include <sys/sem.h> 190 192 #include <sys/types.h> … … 694 696 char *tmp; 695 697 char *tmp1 = NULL; 698 char *tmp2 = NULL; 696 699 char *scratchdir; 697 700 char *command; … … 946 949 strcpy(value, "dvd"); 947 950 break; 951 case usb: 952 strcpy(value, "usb"); 953 break; 948 954 default: 949 955 fatal_error("Unknown backup_media_type"); … … 1004 1010 log_msg(1, "lines_in_filelist = %ld", lines_in_filelist); 1005 1011 1012 if (bkpinfo->backup_media_type == usb) { 1013 asprintf(&tmp2, "--usb %s", bkpinfo->media_device); 1014 } else { 1015 asprintf(&tmp2,""); 1016 } 1017 1006 1018 sprintf(command, 1007 1019 /* "mindi --custom 2=%s 3=%s/images 4=\"%s\" 5=\"%s\" \ 1008 1020 6=\"%s\" 7=%ld 8=\"%s\" 9=\"%s\" 10=\"%s\" \ 1009 1021 11=\"%s\" 12=%s 13=%ld 14=\"%s\" 15=\"%s\" 16=\"%s\" 17=\"%s\" 18=%ld 19=%d",*/ 1010 "mindi --custom %s %s/images'%s' '%s' \1022 "mindi %s --custom '%s' '%s/images' '%s' '%s' \ 1011 1023 '%s' %ld '%s' '%s' '%s' \ 1012 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'", bkpinfo->tmpdir, // parameter #2 1024 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'", 1025 tmp2, 1026 bkpinfo->tmpdir, // parameter #2 1013 1027 bkpinfo->scratchdir, // parameter #3 1014 1028 bkpinfo->kernel_path, // parameter #4 1015 tape_device, // parameter #51016 tape_size_sz, // parameter #61017 lines_in_filelist, // parameter #7 (INT)1018 use_lzo_sz, // parameter #81019 cd_recovery_sz, // parameter #91029 tape_device, // parameter #5 1030 tape_size_sz, // parameter #6 1031 lines_in_filelist, // parameter #7 (INT) 1032 use_lzo_sz, // parameter #8 1033 cd_recovery_sz, // parameter #9 1020 1034 bkpinfo->image_devs, // parameter #10 1021 broken_bios_sz, // parameter #111035 broken_bios_sz, // parameter #11 1022 1036 last_filelist_number, // parameter #12 (STRING) 1023 1037 estimated_total_noof_slices, // parameter #13 (INT) 1024 devs_to_exclude, // parameter #141025 use_comp_sz, // parameter #151026 use_lilo_sz, // parameter #161027 use_star_sz, // parameter #171038 devs_to_exclude, // parameter #14 1039 use_comp_sz, // parameter #15 1040 use_lilo_sz, // parameter #16 1041 use_star_sz, // parameter #17 1028 1042 bkpinfo->internal_tape_block_size, // parameter #18 (LONG) 1029 1043 bkpinfo->differential, // parameter #19 (INT) 1030 use_gzip_sz); // parameter #20 (STRING) 1044 use_gzip_sz); // parameter #20 (STRING) 1045 1046 mr_free(tmp2); 1031 1047 1032 1048 // Watch it! This next line adds a parameter... -
branches/stable/mondo/src/common/libmondo-devices.c
r958 r1063 1864 1864 case cdrw: 1865 1865 case dvd: 1866 case usb: 1866 1867 if (archiving_to_media) { 1867 if ( bkpinfo->backup_media_type != dvd) {1868 if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) { 1868 1869 if (ask_me_yes_or_no 1869 1870 ("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?")) … … 1884 1885 sprintf(sz_size, "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB 1885 1886 log_msg(1, "Setting to DVD defaults"); 1887 } else if (bkpinfo->backup_media_type == usb) { 1888 strcpy(bkpinfo->media_device, VANILLA_USB_DEVICE); 1889 strcpy(sz_size, "512"); 1886 1890 } else { 1887 1891 strcpy(bkpinfo->media_device, VANILLA_SCSI_CDROM); … … 1890 1894 log_msg(1, "Setting to CD defaults"); 1891 1895 } 1892 if ( bkpinfo->backup_media_type != dvd) {1896 if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) { 1893 1897 if (!popup_and_get_string("Speed", comment, tmp, 4)) { 1894 1898 log_to_screen("User has chosen not to backup the PC"); -
branches/stable/mondo/src/common/libmondo-string.c
r841 r1063 1156 1156 strcpy(type_of_backup, "nfs"); 1157 1157 break; 1158 case usb: 1159 strcpy(type_of_backup, "USB"); 1160 break; 1158 1161 default: 1159 1162 strcpy(type_of_backup, "ISO"); -
branches/stable/mondo/src/common/mondostructures.h
r998 r1063 184 184 nfs, ///< Back up to an NFS mount on the local subnet. 185 185 tape, ///< Back up to tapes. 186 usb, ///< Back up to USB devices. 186 187 udev ///< Back up to another unsupported device; just send a stream of bytes. 187 188 } t_bkptype; … … 323 324 * The device we're backing up to. 324 325 * If backup_media_type is @b cdr, @b cdrw, or @b cdstream, this should be the SCSI node (e.g. 0,1,0). 325 * If backup_media_type is @b dvd, @b tape, or @b udev, this should be a /dev entry.326 * If backup_media_type is @b dvd, @b tape, @b usb or @b udev, this should be a /dev entry. 326 327 * If backup_media_type is anything else, this should be blank. 327 328 */ -
branches/stable/mondo/src/mondoarchive/mondo-cli.c
r999 r1063 372 372 i = flag_set['c'] + flag_set['i'] + flag_set['n'] + 373 373 flag_set['t'] + flag_set['u'] + flag_set['r'] + 374 flag_set['w'] + flag_set['C'] ;374 flag_set['w'] + flag_set['C'] + flag_set['U']; 375 375 if (i == 0) { 376 376 retval++; … … 555 555 } 556 556 557 if (flag_set['U']) // USB 558 { 559 if (! flag_set['d']) { 560 fatal_error 561 ("You need to specify a device file with -d for bootable USB device creation"); 562 } 563 if (!flag_set['s']) { 564 fatal_error("You did not specify a size (-s) for your USB device. Aborting"); 565 } 566 } 567 557 568 if (flag_set['r']) // DVD 558 569 { … … 617 628 } 618 629 } 619 } else { /* CD size */630 } else { /* CD|USB size */ 620 631 if (flag_set['s']) { 621 632 if (process_the_s_switch(bkpinfo, flag_val['s'])) { … … 667 678 if (flag_set['w']) { 668 679 bkpinfo->backup_media_type = cdrw; 680 } 681 if (flag_set['U']) { 682 bkpinfo->backup_media_type = usb; 669 683 } 670 684 if (flag_set['z']) { … … 791 805 792 806 793 if (flag_set['d']) { /* backup directory (if ISO/NFS ) */807 if (flag_set['d']) { /* backup directory (if ISO/NFS/USB) */ 794 808 if (flag_set['i']) { 795 809 strncpy(bkpinfo->isodir, flag_val['d'], MAX_STR_LEN / 4); … … 802 816 strncpy(bkpinfo->nfs_remote_dir, flag_val['d'], MAX_STR_LEN); 803 817 } else { /* backup device (if tape/CD-R/CD-RW) */ 804 805 818 strncpy(bkpinfo->media_device, flag_val['d'], MAX_STR_LEN / 4); 806 819 } … … 820 833 821 834 if (!flag_set['d'] 822 && (flag_set['c'] || flag_set['w'] || flag_set['C'] )) {835 && (flag_set['c'] || flag_set['w'] || flag_set['C'] || flag_set['U'])) { 823 836 if (g_kernel_version >= 2.6) { 824 837 if (popup_and_get_string … … 1033 1046 while ((opt = 1034 1047 getopt(argc, argv, 1035 "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T: VWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"))1048 "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z")) 1036 1049 != -1) { 1037 1050 if (opt == '?') { -
branches/stable/tools/build2pkg
r1042 r1063 56 56 pv=`basename $src .tar.gz` 57 57 PVER=`echo $pv | sed "s|^$p-||" | cut -d- -f1` 58 59 if [ _"$p" = _"mindi" ]; then 60 # Copy FindDistroFailsafe if it makes sense for that distro 61 tar xfz $src $p-${PVER}/distributions/${ddir}-$dver/FindDistroFailsafe 2> /dev/null 62 ln $p-${PVER}/distributions/${ddir}-$dver/FindDistroFailsafe $p-${PVER} 2> /dev/null 63 fi 58 64 59 65 if [ _"$dtype" = _"rpm" ]; then -
branches/stable/tools/svn2build
r1051 r1063 80 80 exit -1 81 81 fi 82 echo "Using $inc customization to build SPEC file"83 82 84 83 $TOOLHOME/mkchangelog.pl $dtype $p $MONDOTMP/$p.spec
Note:
See TracChangeset
for help on using the changeset viewer.