Changeset 1063 in MondoRescue for branches/stable


Ignore:
Timestamp:
Jan 20, 2007, 11:37:55 PM (17 years ago)
Author:
Bruno Cornec
Message:
  • USB device support for mindi (Tested and Working)
  • Begining of USB device support for mondo (maybe not even compiling)
  • FindDistroFailsafe build process support
  • makemount list doesn't issue weird messages anymore around LVM
Location:
branches/stable
Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/analyze-my-lvm

    r963 r1063  
    33# $Id$
    44#
    5 
    6 #------------------------- ANALYZE-MY-LVM ----------------------- Hugo Rabson
    7 # 07/14
    8 # - no longer blank first 4k of /dev/mdX
    9 #
    10 # 06/14/2004
    11 # - fixed "n >= 2.00" bug (shell doesn't handle floating points properly)
    12 # - handle dm_mod as well as dm-mod
    13 #
    14 # 02/18/2004
    15 # - nice patch to fix ListAllVolumeGroups() --- J. Richard
    16 # - patch to support LVM2 by Takeru Komoriya
    17 #
    18 # 10/15/2003
    19 # - fixed '-L'-handling to allow for floating-point gigabyte values
    20 #
    21 # 01/15/2003
    22 # - patch (LVM) by Brian Borgeson
    23 #
    24 # 12/10/2002
    25 # - patch by Benjamin Mampaey
    26 #
    27 # 09/05/2002
    28 # - additional patch by Ralph Gruwe
    29 #
    30 # 08/30/2002
    31 # - modified by Ralph Gruwe
    32 #
    33 # 10/01/2001
    34 # - last modified by Hugo :)
    35 #------------------------------------------------------------------------------
    365
    376Die() {
     
    186155ListAllLogicalVolumes() {
    187156    if [ $lvmversion = 2 ]; then
    188         $LVMCMD lvscan | grep "'" | cut -d"'" -f2
    189     else
    190         lvscan | grep '"' | cut -d'"' -f2
     157        $LVMCMD lvscan 2> /dev/null | grep "'" | cut -d"'" -f2
     158    else
     159        lvscan 2> /dev/null | grep '"' | cut -d'"' -f2
    191160    fi
    192161}
  • branches/stable/mindi/distributions/conf/mindi.conf.dist

    r1061 r1063  
    4141#
    4242mindi_write_cd="no"
     43
     44#
     45# Write mindi USB (yes|no) ?
     46#
     47mindi_write_usb="no"
    4348
    4449#
  • branches/stable/mindi/distributions/debian/FindDistroFailsafe

    r1062 r1063  
    1 # /usr/lib/mindi/DebFindFailsafe
     1#!/bin/bash
    22#
    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
    47#
    58# Approach:
  • branches/stable/mindi/install.sh

    r1060 r1063  
    100100
    101101cp -af rootfs aux-tools $locallib/mindi
     102if [ -e FindDistroFailsafe ]; then
     103    cp -af FindDistroFailsafe $locallib/mindi
     104fi
    102105chmod 755 $locallib/mindi/rootfs/sbin/*
    103106chmod 755 $locallib/mindi/aux-tools/sbin/*
  • branches/stable/mindi/mindi

    r1062 r1063  
    3838if [ ! -f $MINDI_CONFIG_DIST ]; then
    3939    echo "Unable to find $MINDI_CONFIG_DIST. Please reinstall mindi"
    40     MindiExit -1
     40    exit -1
    4141fi
    4242md5sum --status -c "$MINDI_CONF/mindi.conf.dist.md5"
    4343if [ $? -ne 0 ]; then
    4444    echo "$MINDI_CONF/mindi.conf.dist md5 checksum incorrect. Please reinstall mindi"
    45 MindiExit -1
     45    exit -1
    4646fi
    4747. $MINDI_CONFIG_DIST
     
    5858# Manages defaults coming from conf files
    5959#
     60INTERACTIVE="$mindi_interactive"
     61
     62if [ $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"
     80fi
     81
    6082EXTRA_SPACE=$mindi_extra_space
    6183IA64_BOOT_SIZE=$mindi_ia64_boot_size
     
    6486WRITE_BOOT_FLOPPIES="$mindi_write_boot_floppy"
    6587PROMPT_MAKE_CD_IMAGE="$mindi_write_cd"
     88PROMPT_MAKE_USB_IMAGE="$mindi_write_usb"
    6689USE_OWN_KERNEL="$mindi_use_own_kernel"
    6790CACHE_LOC="$mindi_images_dir"
     
    7295MY_FSTAB="$mindi_etc_fstab"
    7396LOGFILE="$mindi_log_file"
    74 INTERACTIVE="$mindi_interactive"
    75 
    76 if [ $INTERACTIVE == "yes" ]; then
    77     # do you want to be prompted to write
    78     # floppy images out to floppy disks?
    79     # if 'no', images will not be written to floppies
    80     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 automatically
    84     PROMPT_MAKE_CD_IMAGE="yes"
    85 
    86     # If set to "no", you will be prompted for whether or not
    87     # 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 fi
    91 
    9297FLOPPY_MODS="$mindi_floppy_mods"
    9398TAPE_MODS="$mindi_tape_mods"
     
    756761        [ "$modres" -eq "3" ] && echo -en "\t|"
    757762    done
    758     if [ "$MONDO_SHARE" ] ; then
     763    if [ _"$MONDO_SHARE" != _"" ]; then
    759764        mkdir -p $bigdir/tmp
    760765        mkdir -p $bigdir/sbin
     
    15121517OfferToMakeBootableISO() {
    15131518    local i old_pwd
    1514     if [ "$PROMPT_MAKE_CD_IMAGE" = "yes" ] && [ ! "$MONDO_SHARE" ] ; then
     1519    if [ "$PROMPT_MAKE_CD_IMAGE" = "yes" ] && [ _"$MONDO_SHARE" = _"" ]; then
    15151520        echo -en "Shall I make a bootable CD image? (y/[n]) "
    15161521        read i
     
    15341539            cp -f $j $k 2> /dev/null || Die "Failed to copy $j to $k"
    15351540            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
    15371544        fi
    15381545    done
    15391546    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?"
    15421548    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
    15441553    [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur"
    15451554    cd $MINDI_TMP/iso/isolinux
    15461555    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?"
    15471556    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
    15501558    fi
    15511559    if [ "$ARCH" != "ia64" ] ; then
     
    15551563    cd $MINDI_TMP/iso
    15561564    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     fi
    1559     [ "$MONDO_SHARE" ] && cp -f $MONDO_SHARE/autorun .    2>> $LOGFILE
    1560     if [ "$ARCH" != "ia64" ] ; then
     1565        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
    15611569        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
    15621570    else
     
    15771585
    15781586
     1587OfferToMakeBootableUSB() {
     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
     1611d
     1612d
     1613d
     1614d
     1615n
     1616p
     16171
     1618
     1619
     1620t
     1621b
     1622a
     16231
     1624w
     1625EOF
     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
    15791713PluralOrNot() {
    15801714    [ "$1" -gt "1" ] && echo -en "s"
     
    15911725    fi
    15921726    if [ "$disksize" -gt "2880" ] ; then
    1593         if [ "$MONDO_SHARE" ] ; then
     1727        if [ _"$MONDO_SHARE" != _"" ]; then
    15941728            if [ "$CDRECOVERY" != "yes" ] ; then
    15951729                if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
     
    16861820    if [ "$CDRECOVERY" = "yes" ] ; then
    16871821        echo -en "default=RESTORE\n"
    1688     elif [ "$disksize" -gt "2880" ] && [ "$MONDO_SHARE" ] ; then
     1822    elif [ "$disksize" -gt "2880" ] && [ _"$MONDO_SHARE" != _"" ]; then
    16891823        if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    16901824            echo -en "default=iso\n"
     
    17071841        options="RESTORE expert"
    17081842    elif [ "$disksize" -gt "2880" ] ; then
    1709         if [ "$MONDO_SHARE" ] ; then
     1843        if [ _"$MONDO_SHARE" != _"" ]; then
    17101844            if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    17111845                options="iso"
     
    19292063    cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $mountpoint > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root"
    19302064    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
    19332066    fi
    19342067    cd $old_pwd
     
    20582191    FindAndAddUserKeyboardMappingFile
    20592192    mkdir -p $bigdir/tmp
    2060     if [ "$MONDO_SHARE" ] ; then
     2193    if [ _"$MONDO_SHARE" != _"" ]; then
    20612194        MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg
    20622195        cp -f $MINDI_TMP/mondo-restore.cfg $bigdir/tmp &> /dev/null
     
    20962229        tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "WARNING - error occurred while unzipping x11-tools.tgz"
    20972230    fi
    2098     if [ -e "$MONDO_SHARE/restore-scripts" ] ; then
     2231    if [ -e "$MONDO_SHARE/restore-scripts" ]; then
    20992232        cp -Rdf $MONDO_SHARE/restore-scripts/* . 2>> $LOGFILE
    21002233        [ "$?" -ne "0" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
     
    21102243    mkdir -p $minidir_root/$noof_disks/tmp
    21112244    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
    21132248    [ $LVM != "false" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm || LVM="false"
    21142249    cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
     
    25722707    dd if=/dev/zero of=$mountpoint/zero &> /dev/null
    25732708    rm -f $mountpoint/zero
    2574     if [ "$MONDO_SHARE" ] ; then
     2709    if [ _"$MONDO_SHARE" != _"" ]; then
    25752710        MakeMondoConfigFile $mountpoint/tmp/mondo-restore.cfg
    25762711        cp -f $mountpoint/tmp/mondo-restore.cfg $MINDI_TMP &> /dev/null
     
    26302765    cd $minidir_root/all
    26312766    size_of_all_tools=`du -sk . | cut -f1`
    2632     if [ "$MONDO_SHARE" ] ; then
     2767    if [ _"$MONDO_SHARE" != _"" ]; then
    26332768        for q in filelist.full.gz biggielist.txt ; do
    26342769            [ ! -e "$MINDI_TMP/$q" ] && Die "Cannot find $MINDI_TMP/$q"
     
    26532788
    26542789
    2655 if [ "$1" = "-printvar" ] ; then
     2790if [ "$1" = "--printvar" ] ; then
    26562791    shift
    26572792    if [ _"$1" != _"" ] ; then
    26582793        set | egrep "^$1" | cut -d= -f2
    26592794    fi
    2660     exit 0
     2795    MindiExit 0
    26612796fi
    26622797
     
    28052940        MakeMountlist $2
    28062941        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
    28072950    elif [ "$1" = "-V" ] || [ "$1" = "-v" ] || [ "$1" = "--version" ] || [ "$1" = "-version" ] ; then
    28082951        echo "Mindi v$MINDI_VERSION"
    28092952        MindiExit 0
    28102953    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
    28122957        MONDO_TMP=$2
    28132958        # Change MINDI_TMP for the one provided by mondo
     
    29033048
    29043049[ -e "$iso_cfg_file" ] || Die "Cannot find $iso_cfg_file"
    2905 if [ ! "$MONDO_SHARE" ] ; then
     3050if [ _"$MONDO_SHARE" = _"" ]; then
    29063051    LogIt "Mindi Linux mini-distro generator v$MINDI_VERSION"
    29073052    LogIt "Latest Mindi is available from http://www.mondorescue.org"
    29083053    LogIt "BusyBox sources are available from http://www.busybox.net"
    2909     LogIt "------------------------------------------------------------------------------"
    29103054else
    29113055    echo "You are using Mindi-Linux v$MINDI_VERSION to make boot+data disks" >> /var/log/mondo-archive.log
     
    29433087
    29443088if [ "$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
    29503098    fi
    29513099    if [ "$USE_OWN_KERNEL" = "yes" ]; then
     
    29603108    fi
    29613109fi
    2962 if [ ! "$MONDO_SHARE" ] && [ $INTERACTIVE = "yes" ]; then
     3110if [ _"$MONDO_SHARE" = _"" ] && [ $INTERACTIVE = "yes" ]; then
    29633111    echo -en "Would you like to use LILO (instead of syslinux)\nfor your boot CD/floppies (y/[n]) ?"
    29643112    read ch
     
    30383186...Or type 'memtest' to test your PC's RAM thoroughly.\n"
    30393187
    3040 if [ ! "$MONDO_SHARE" ] ; then
     3188if [ _"$MONDO_SHARE" = _"" ]; then
    30413189    ListImagesForUser $CACHE_LOC
    30423190    boot_dev=/dev/fd0u1722
     
    30483196    fi
    30493197    OfferToMakeBootableISO $CACHE_LOC
     3198    if [ _"$USBDEV" != _"" ] ; then
     3199        OfferToMakeBootableUSB $CACHE_LOC
     3200    fi
    30503201    LogIt "Finished."
    30513202elif [ "$TAPEDEV" ] ; then
     
    30573208        Die "Cannot find all.tar.gz, to be written to tape"
    30583209    fi
     3210elif [ _"$USBDEV" != _"" ] ; then
     3211    OfferToMakeBootableUSB $CACHE_LOC
    30593212else
    30603213    OfferToMakeBootableISO $CACHE_LOC
  • branches/stable/mondo-doc/mindi.8

    r1060 r1063  
    3232.br
    3333.BI "mindi --makemountlist "file
     34.br
     35.BI "mindi --usb "device
    3436.br
    3537.BI "mindi --printvar "variable
     
    7274.BI "--makemountlist "file
    7375.RI "Creates a mount list and writes it to file "file ".
     76.TP
     77.BI "--usb "device
     78.RI Create a bootable USB device
    7479.TP
    7580.BI "--printvar "variable
  • branches/stable/mondo-doc/mondoarchive.8

    r998 r1063  
    135135.B For experienced users only.
    136136
     137.TP
     138.BI "-U "
     139Use a generic USB device as backup device. Use this if you want to write
     140your backup to a USB key or USB disk, which will be make bootable.
     141The 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
    137144.SH MAJOR OPTIONS
    138145.TP 13
     
    170177.TP
    171178.BI "-d " "dev|dir"
    172 Specify the backup device (CD/tape) or directory (NFS/ISO). For CD-R[W] drives,
     179Specify the backup device (CD/tape/USB) or directory (NFS/ISO). For CD-R[W] drives,
    173180this 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,
     181users, this is the tape streamers /dev entry, e.g. '/dev/st0'. For USB users,
     182this is the device name of your key or external disk. For ISO users,
    175183this is the directory where the ISO images are stored. For NFS users, this is
    176184the directory within the NFS mount where the backups are stored. The default
     
    240248.BI "-F "
    241249Do 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,
     250The images will remain in /var/cache/mindi until your next backup run,
    243251however.
    244252
     
    412420.I "mondoarchive -Ow 4 -I \*(lq/home /etc\*(rq"
    413421
     422.BI USB:
     423Backup to your USB key, using gzip compression:
     424.br
     425.I "mondoarchive -OU -d /dev/sda -G"
     426
    414427.BI NFS:
    415428Backup to an NFS mount:
  • branches/stable/mondo/src/common/libmondo-archive.c

    r1049 r1063  
    187187#include "libmondo-archive.h"
    188188#include "lib-common-externs.h"
     189
     190#include "mr_mem.h"
    189191#include <sys/sem.h>
    190192#include <sys/types.h>
     
    694696    char *tmp;
    695697    char *tmp1 = NULL;
     698    char *tmp2 = NULL;
    696699    char *scratchdir;
    697700    char *command;
     
    946949        strcpy(value, "dvd");
    947950        break;
     951    case usb:
     952        strcpy(value, "usb");
     953        break;
    948954    default:
    949955        fatal_error("Unknown backup_media_type");
     
    10041010    log_msg(1, "lines_in_filelist = %ld", lines_in_filelist);
    10051011
     1012    if (bkpinfo->backup_media_type == usb) {
     1013        asprintf(&tmp2, "--usb %s", bkpinfo->media_device);
     1014    } else {
     1015        asprintf(&tmp2,"");
     1016    }
     1017
    10061018    sprintf(command,
    10071019/*     "mindi --custom 2=%s 3=%s/images 4=\"%s\" 5=\"%s\" \
    100810206=\"%s\" 7=%ld 8=\"%s\" 9=\"%s\" 10=\"%s\" \
    1009102111=\"%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' \
    10111023'%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
    10131027            bkpinfo->scratchdir,    // parameter #3
    10141028            bkpinfo->kernel_path,   // parameter #4
    1015             tape_device,        // parameter #5
    1016             tape_size_sz,       // parameter #6
    1017             lines_in_filelist,  // parameter #7 (INT)
    1018             use_lzo_sz,         // parameter #8
    1019             cd_recovery_sz,     // parameter #9
     1029            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
    10201034            bkpinfo->image_devs,    // parameter #10
    1021             broken_bios_sz,     // parameter #11
     1035            broken_bios_sz,         // parameter #11
    10221036            last_filelist_number,   // parameter #12 (STRING)
    10231037            estimated_total_noof_slices,    // parameter #13 (INT)
    1024             devs_to_exclude,    // parameter #14
    1025             use_comp_sz,        // parameter #15
    1026             use_lilo_sz,        // parameter #16
    1027             use_star_sz,        // parameter #17
     1038            devs_to_exclude,        // parameter #14
     1039            use_comp_sz,            // parameter #15
     1040            use_lilo_sz,            // parameter #16
     1041            use_star_sz,            // parameter #17
    10281042            bkpinfo->internal_tape_block_size,  // parameter #18 (LONG)
    10291043            bkpinfo->differential,  // parameter #19 (INT)
    1030             use_gzip_sz);       // parameter #20 (STRING)
     1044            use_gzip_sz);           // parameter #20 (STRING)
     1045
     1046    mr_free(tmp2);
    10311047
    10321048// Watch it! This next line adds a parameter...
  • branches/stable/mondo/src/common/libmondo-devices.c

    r958 r1063  
    18641864    case cdrw:
    18651865    case dvd:
     1866    case usb:
    18661867        if (archiving_to_media) {
    1867             if (bkpinfo->backup_media_type != dvd) {
     1868            if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
    18681869                if (ask_me_yes_or_no
    18691870                    ("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?"))
     
    18841885                sprintf(sz_size, "%d", DEFAULT_DVD_DISK_SIZE);  // 4.7 salesman's GB = 4.482 real GB = 4582 MB
    18851886                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");
    18861890            } else {
    18871891                strcpy(bkpinfo->media_device, VANILLA_SCSI_CDROM);
     
    18901894                log_msg(1, "Setting to CD defaults");
    18911895            }
    1892             if (bkpinfo->backup_media_type != dvd) {
     1896            if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
    18931897                if (!popup_and_get_string("Speed", comment, tmp, 4)) {
    18941898                    log_to_screen("User has chosen not to backup the PC");
  • branches/stable/mondo/src/common/libmondo-string.c

    r841 r1063  
    11561156        strcpy(type_of_backup, "nfs");
    11571157        break;
     1158    case usb:
     1159        strcpy(type_of_backup, "USB");
     1160        break;
    11581161    default:
    11591162        strcpy(type_of_backup, "ISO");
  • branches/stable/mondo/src/common/mondostructures.h

    r998 r1063  
    184184    nfs,                        ///< Back up to an NFS mount on the local subnet.
    185185    tape,                       ///< Back up to tapes.
     186    usb,                        ///< Back up to USB devices.
    186187    udev                        ///< Back up to another unsupported device; just send a stream of bytes.
    187188} t_bkptype;
     
    323324   * The device we're backing up to.
    324325   * 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.
    326327   * If backup_media_type is anything else, this should be blank.
    327328   */
  • branches/stable/mondo/src/mondoarchive/mondo-cli.c

    r999 r1063  
    372372    i = flag_set['c'] + flag_set['i'] + flag_set['n'] +
    373373        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'];
    375375    if (i == 0) {
    376376        retval++;
     
    555555    }
    556556
     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
    557568    if (flag_set['r'])          // DVD
    558569    {
     
    617628            }
    618629        }
    619     } else {                    /* CD size */
     630    } else {                    /* CD|USB size */
    620631        if (flag_set['s']) {
    621632            if (process_the_s_switch(bkpinfo, flag_val['s'])) {
     
    667678    if (flag_set['w']) {
    668679        bkpinfo->backup_media_type = cdrw;
     680    }
     681    if (flag_set['U']) {
     682        bkpinfo->backup_media_type = usb;
    669683    }
    670684    if (flag_set['z']) {
     
    791805
    792806
    793     if (flag_set['d']) {        /* backup directory (if ISO/NFS) */
     807    if (flag_set['d']) {        /* backup directory (if ISO/NFS/USB) */
    794808        if (flag_set['i']) {
    795809            strncpy(bkpinfo->isodir, flag_val['d'], MAX_STR_LEN / 4);
     
    802816            strncpy(bkpinfo->nfs_remote_dir, flag_val['d'], MAX_STR_LEN);
    803817        } else {                /* backup device (if tape/CD-R/CD-RW) */
    804 
    805818            strncpy(bkpinfo->media_device, flag_val['d'], MAX_STR_LEN / 4);
    806819        }
     
    820833
    821834    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'])) {
    823836        if (g_kernel_version >= 2.6) {
    824837            if (popup_and_get_string
     
    10331046    while ((opt =
    10341047            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"))
    10361049           != -1) {
    10371050        if (opt == '?') {
  • branches/stable/tools/build2pkg

    r1042 r1063  
    5656    pv=`basename $src .tar.gz`
    5757    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
    5864
    5965    if [  _"$dtype" = _"rpm" ]; then
  • branches/stable/tools/svn2build

    r1051 r1063  
    8080                exit -1
    8181            fi
    82             echo "Using $inc customization to build SPEC file"
    8382
    8483            $TOOLHOME/mkchangelog.pl $dtype $p $MONDOTMP/$p.spec
Note: See TracChangeset for help on using the changeset viewer.