Changeset 1075 in MondoRescue for branches/stable/mindi/mindi


Ignore:
Timestamp:
Jan 25, 2007, 4:18:59 PM (17 years ago)
Author:
Bruno Cornec
Message:

Improvements for USB support in mindi when called from mondo
Changelogs in C files removed from common

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/mindi

    r1073 r1075  
    213213    echo "Added kbd map $mappath" >> $LOGFILE
    214214    if [ ! -e "$mappath" ] ; then
    215         mappath=`find $KEYDIR/keymaps | grep "i[3-8]86" | grep "$locale[^r][^/]" | grep -vx " *#.*"`
     215            mappath=`grep "i[3-8]86" $MINDI_TMP/keymaps.find | grep "$locale[^r][^/]" | grep -vx " *#.*"`
    216216        if [ ! -e "$mappath" ] ; then
    217217            LogIt "Cannot add $mappath: kbd map file not found"
     
    231231    for included_item in $included_list ; do
    232232        if [ ! -e "$included_item" ] ; then
    233             sss=`find $KEYDIR/keymaps | grep -F "${included_item}.inc"`
    234             [ "$sss" = "" ] && sss=`find $KEYDIR/keymaps | grep -F "$included_item"`
     233                sss=`grep -F "${included_item}.inc" $MINDI_TMP/keymaps.find`
     234            [ "$sss" = "" ] && sss=`grep -F "$included_item" $MINDI_TMP/keymaps.find`
    235235            for ii in $sss ; do
    236236                [ -e "$ii" ] && AddKeyboardMappingFile $ii
     
    409409    mkdir -p $mountpoint
    410410    dd if=/dev/zero of=$imagefile bs=1k count=1440 &> /dev/null || LogIt "Cannot dd (CODI)"
     411    echo "Creating ext2 filesystem on $imagefile" >> $LOGFILE
    411412    mke2fs -N 12 -F $imagefile >> $LOGFILE 2>> $LOGFILE
    412413    mount -t ext2 -o loop $imagefile $mountpoint || Die "Can't loopmount $imagefile to $mountpoint! The reason may be missing support for loopfs or ext2 (or both) in the running kernel."
     
    545546    [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'`        # Slackware
    546547    echo "locale=$locale" >> $LOGFILE
    547     mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | grep -F "/${locale}." | grep -vx " *#.*"`
    548     [ ! "$mp" ] && mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | grep "$locale[^r][^/]" | grep -vx " *#.*"`
     548    #
     549    # Process the keymaps dir once for all
     550    # AddKeyboardMappingFile will use it recursively
     551    #
     552    find $KEYDIR/keymaps > $MINDI_TMP/keymaps.find
     553    mp=`grep "i[3-8]86" $MINDI_TMP/keymaps.find | grep -F "/${locale}." | grep -vx " *#.*"`
     554    [ ! "$mp" ] && mp=`grep "i[3-8]86" $MINDI_TMP/keymaps.find | grep "$locale[^r][^/]" | grep -vx " *#.*"`
    549555    # If we have multiple keymaps then log it !!
    550556    echo "$mp" | grep -q " "
     
    15491555    if [ _"$MONDO_SHARE" != _"" ]; then
    15501556        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
     1557        cp $MINDI_TMP/mindi.rdz $MONDO_ROOT/initrd.img 2> /dev/null || Die "Cannot copy mindi.rdz ($MINDI_TMP/mindi.rdz) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?"
     1558
    15521559    fi
    15531560    [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur"
    15541561    cd $MINDI_TMP/iso/isolinux
    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?"
     1562    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?"
    15561563    if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    15571564        perl -pi -e 's/interactive/iso/' isolinux.cfg
    15581565    fi
    15591566    if [ "$ARCH" != "ia64" ] ; then
    1560         cp $ISOLINUX isolinux.bin 2> /dev/null || Die "Cannot copy isolinux.bin ($ISOLINUX) to tmp_root - did you run out of disk space?"
     1567        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?"
    15611568        cp $ISOLINUX ../ 2>> $LOGFILE
    15621569    fi
     
    15641571    if [ "$ARCH" != "ia64" ] ; then
    15651572        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
     1573            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?"
     1574            cp -f $MONDO_SHARE/autorun . 2>> $LOGFILE
    15681575        fi
    15691576        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
     
    15991606    echo -en "Transforming $USBDEV in a Bootable device "
    16001607    echo -en "."
     1608    echo "Transforming $USBDEV in a Bootable device"  >> $LOGFILE
    16011609    echo "Checking $USBDEV" >> $LOGFILE
    16021610    $FDISK -l $USBDEV 2>&1 >> $LOGFILE
     
    16761684    if [ _"$MONDO_SHARE" != _"" ]; then
    16771685        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
     1686        cp $MINDI_TMP/mindi.rdz $MONDO_ROOT/initrd.img 2> /dev/null || Die "Cannot copy mindi.rdz ($MINDI_TMP) to mondo root ($MONDO_ROOT/initrd.img). Did you run out of disk space?"
     1687
    16791688    fi
    16801689    echo -en "."
    16811690    [ -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?"
     1691    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?"
    16831692    echo -en "."
    16841693    if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
     
    16861695    fi
    16871696    cd $old_pwd
    1688     umount $MINDI_TMP/usb
    16891697    echo -en "."
    16901698    if [ "$ARCH" != "ia64" ] ; then
    16911699        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
     1700            cp -f $MINDI_TMP/usb/{syslinux.cfg,initrd.img,vmlinuz,message.txt} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
     1701            cp -f $MONDO_SHARE/autorun $MONDO_ROOT 2>> $LOGFILE
     1702        fi
     1703        umount $MINDI_TMP/usb
    16951704        syslinux $USBPART 2>> $MINDI_TMP/syslinux.log
    16961705    else
    16971706        echo "No USB boot support for ia64" | tee -a $LOGFILE
     1707        umount $MINDI_TMP/usb
    16981708        MindiExit -1
    16991709    fi
     
    17581768    mtpt=$MINDI_TMP/$rand1.$rand2.mtpt
    17591769    dd if=/dev/zero of=$image bs=1k count=$disksize &> /dev/null
     1770    echo "Creating ext2 filesystem on $image" >> $LOGFILE
    17601771    mke2fs -N 26 -F $image &> /dev/null
    17611772    mkdir -p $mtpt
     
    18981909        t=vfat
    18991910    else
     1911        echo "Creating ext2 filesystem on $imagefile" >> $LOGFILE
    19001912        mke2fs -N 26 -m 0 -F $imagefile >> $LOGFILE 2>> $LOGFILE
    19011913        t=ext2
     
    20702082    else
    20712083        dd if=/dev/zero of=$imagefile bs=1k count=$disksize &> /dev/null || Die "Cannot dd blank file"
     2084        echo "Creating vfat filesystem on $imagefile" >> $LOGFILE
    20722085        mkfs.vfat $imagefile >> $LOGFILE 2>> $LOGFILE
    20732086        syslinux $imagefile >> $LOGFILE 2>> $LOGFILE
     
    26342647    dd if=/dev/zero of=$tempfile bs=1k count=$ramdisk_size &> /dev/null || Die "Not enough room for temporary ramdisk (TurnTgzIntoRdz)"
    26352648    echo -en "..."
     2649    echo "Creating ext2 filesystem on $tempfile" >> $LOGFILE
    26362650    mke2fs -b 1024 -m 1 -i 2048 -F $tempfile >> $LOGFILE 2>> $LOGFILE
    26372651    echo -en "..."
     
    29502964done
    29512965
     2966#
     2967# If we have a USB device we need to store info
     2968# and remove it from the parameters line
     2969#
     2970if [ "$#" -ne "0" ] ; then
     2971    if [ "$1" = "--usb" ] ; then
     2972        shift
     2973        USBDEV=$1
     2974        if [ _"$USBDEV" = _"" ]; then
     2975            Die "No USB device specified"
     2976        fi
     2977        shift
     2978    fi
     2979fi
     2980
     2981#
     2982# Deal with parameters
     2983#
    29522984if [ "$#" -ne "0" ] ; then
    29532985    if [ "$1" = "--findkernel" ] ; then
     
    29632995        MakeMountlist $2
    29642996        MindiExit $?
    2965     elif [ "$1" = "--usb" ] ; then
    2966         shift
    2967         USBDEV=$1
    2968         if [ _"$USBDEV" = _"" ]; then
    2969             Die "No USB device specified"
    2970         fi
    2971         LogIt "Generating Bootable USB device on $USBDEV"
    2972         shift
    29732997    elif [ "$1" = "-V" ] || [ "$1" = "-v" ] || [ "$1" = "--version" ] || [ "$1" = "-version" ] ; then
    29742998        echo "Mindi v$MINDI_VERSION"
     
    29923016        kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath=""
    29933017###
    2994 ### Sq-Modification...
    29953018### Attempt to locate kernel specific module path
    29963019### if module path is found then use it other wise use uname -r to set it...
    29973020###
     3021        if [ "$kernelpath" = "" ]; then
     3022            kernelpath=`TryToFindKernelPath`
     3023        fi
    29983024        kernelname=`echo $kernelpath | cut -d'-' -f2-`
    29993025        LogIt "kernelname = $kernelname"
     
    30073033           LogIt "Using modules for kernel: ${kernelname}"
    30083034        fi
    3009 ###
    3010 ### end of Sq-Modification
    3011 ###
    30123035        TAPEDEV=$5
    30133036        TAPESIZE=$6
     
    30383061        [ "$NOT_BOOT" = "" ] && NOT_BOOT=no
    30393062        [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine."
    3040         [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath`
    3041         kernelname=`echo $kernelpath | cut -d'-' -f2-`
    3042         if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ]
    3043         then
    3044            LogIt "Module path for ${kernelpath} not found..."
    3045            LogIt "using running kernel\'s modules."
    3046            kernelname=`uname -r`
    3047         else
    3048            LogIt "Using modules for kernel: ${kernelname}"
    3049         fi
    30503063        [ "$CDRECOVERY" = "yes" ] && [ "$TAPEDEV" != "" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time"
    30513064        MONDO_ROOT=`echo $CACHE_LOC | sed 's/\(.*\)\/.*/\1/'`
     
    31093122fi
    31103123
     3124if [ _"$USBDEV" != _"" ]; then
     3125    LogIt "Including the generation of a Bootable USB device on $USBDEV"
     3126fi
    31113127if [ "$kernelpath" = "" ] ; then
    31123128    if [ _"$MONDO_SHARE" != _"" ]; then
Note: See TracChangeset for help on using the changeset viewer.