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


Ignore:
Timestamp:
Dec 21, 2006, 8:04:22 PM (17 years ago)
Author:
Bruno Cornec
Message:

Remove useless functions
Solve some MINDI_TMP issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/mindi

    r1009 r1010  
    6363
    6464# ide-probe-mod
    65 IDE_MODS="ide ide-generic ide-detect ide-mod ide-disk ide-cd ide_cd ide-cs ide-core ide_core libata edd paride ata_piix libata via82cxxx generic nvidia"
     65IDE_MODS="ide ide-generic ide-detect ide-mod ide-disk ide-cd ide_cd ide-cs ide-core ide_core libata edd paride ata_piix libata via82cxxx generic nvidia ahci"
    6666PCMCIA_MODS="pcmcia_core ds yenta_socket"
    6767USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage hid uhci_hcd ehci_hcd uhci-hcd ehci-hcd usbkbd usbhid"
     
    127127        echo -en "label memtest\n  kernel memdisk\n  append initrd=memtest.img\n\n"
    128128    fi
    129 }
    130 
    131 
    132 AbortIfYourDistroIsAPieceOfStercus() {
    133     which which > /dev/null 2> /dev/null || Die "Please install 'which'."
    134     which strings > /dev/null 2> /dev/null || Die "Please install binutils and libbinutils; you have no 'strings' executable."
    135     which gawk > /dev/null 2> /dev/null || Die "Gawk is missing from your computer. Please install gawk. You may find the package on Debian's website. How did I know you're running Debian? Because only Debian would be stupid enough not to include gawk in your distribution."
    136     which gawk > /dev/null 2> /dev/null && AWK=`which gawk 2>/dev/null` || AWK="`which awk 2>/dev/null`"
    137     if which awk &> /dev/null ; then
    138         if ! which gawk &> /dev/null ; then
    139             LogIt "You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n"
    140         fi
    141     fi
    142     which mke2fs > /dev/null 2> /dev/null || Die "Please put mke2fs in system path"
    143     [ ! -e "$FDISK" ] && Die "Cannot find (s)fdisk"
    144 }
    145 
    146 
    147 AbortIfMkfsVfatMissing() {
    148     #if grep -F "vfat" /etc/fstab &> /dev/null ; then
    149         if ! which mkfs.vfat &> /dev/null ; then
    150             Die "mkfs.vfat missing from your filesystem - please install your dosfstools RPM or DEB package. Perhaps your PATH environmental variable is broken, too?"
    151         fi
    152     #fi
    153129}
    154130
     
    598574
    599575
    600 FindHomeOfMindiAndMondo() {
    601     [ "$MINDI_PREFIX" = "XXX" ] && Die "Mindi has not been installed correctly."
    602     echo "MINDI_LIB = $MINDI_LIB" >> $LOGFILE
    603     echo "MINDI_SBIN = $MINDI_SBIN" >> $LOGFILE
    604     [ "$MINDI_CONF" = "YYY" ] && Die "Mindi has not been installed correctly."
    605     echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE
    606     echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE
    607 }
    608 
    609 
    610576FindIsolinuxBinary() {
    611577    ISOLINUX=/usr/lib/isolinux.bin
     
    630596    else
    631597        LILO_EXE=`which false`
    632     fi
    633 }
    634 
    635 
    636 FindELiloBinary() {
    637     if which elilo &> /dev/null ; then
    638         LILO_EXE=elilo
    639     else
    640         LILO_EXE=`which false`
    641     fi
    642 }
    643 
    644 
    645 FixPathIfBroken() {
    646     if [ -e "/sbin/mkfs" ] && ! which mkfs &> /dev/null ; then
    647         PATH=$PATH:/sbin:/usr/sbin
    648         export PATH
    649         echo "Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily." >> $LOGFILE
    650         echo "However, you may wish to ask your vendor to provide a permanent fix..." >> $LOGFILE
    651         echo "You might like to call 'su -' instead of 'su', for example." >> $LOGFILE
    652598    fi
    653599}
     
    15861532    old_pwd=`pwd`
    15871533    cd $MINDI_TMP/iso
    1588     mkdir -p $MONDO_ROOT/iso/isolinux
    15891534    echo "mindi_lib = $MINDI_LIB" >> $LOGFILE
    15901535    for i in memdisk memtest.bin memtest.img ; do
     
    15991544    done
    16001545    MakeSyslinuxMessageFile $MINDI_TMP/iso/isolinux/message.txt
    1601     cp $kernelpath $MINDI_TMP/iso/isolinux/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/isolinux/vmlinuz). Did you run out of disk space?"
     1546    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?"
     1547    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?"
    16021548    cp $MINDI_TMP/mindi.rdz $MINDI_TMP/iso/isolinux/initrd.img 2>> $LOGFILE
    1603     cp $MINDI_TMP/mindi.rdz $CACHE_LOC/initrd.img 2>> $LOGFILE
     1549    cp $MINDI_TMP/mindi.rdz $MONDO_ROOT/initrd.img 2>> $LOGFILE
    16041550    [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur"
    16051551    cd $MINDI_TMP/iso/isolinux
     
    27262672[ -e "/sbin/mkdosfs" ] && [ ! -e "/sbin/mkfs.vfat" ] && ln -sf /sbin/mkdosfs /sbin/mkfs.vfat
    27272673
    2728 FindHomeOfMindiAndMondo
     2674# Log some capital variables
     2675[ "$MINDI_PREFIX" = "XXX" ] && Die "Mindi has not been installed correctly."
     2676echo "MINDI_LIB = $MINDI_LIB" >> $LOGFILE
     2677echo "MINDI_SBIN = $MINDI_SBIN" >> $LOGFILE
     2678[ "$MINDI_CONF" = "YYY" ] && Die "Mindi has not been installed correctly."
     2679echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE
     2680echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE
     2681
    27292682trap AbortHere SIGTERM SIGHUP SIGQUIT SIGKILL SIGABRT SIGINT
    2730 AbortIfYourDistroIsAPieceOfStercus
     2683
     2684# Sanity checks
     2685which which > /dev/null 2> /dev/null || Die "Please install 'which'."
     2686which strings > /dev/null 2> /dev/null || Die "Please install binutils and libbinutils; you have no 'strings' executable."
     2687which gawk > /dev/null 2> /dev/null || Die "Gawk is missing from your computer. Please install gawk. You may find the package on Debian's website. How did I know you're running Debian? Because only Debian would be stupid enough not to include gawk in your distribution."
     2688which gawk > /dev/null 2> /dev/null && AWK=`which gawk 2>/dev/null` || AWK="`which awk 2>/dev/null`"
     2689if which awk &> /dev/null ; then
     2690    if ! which gawk &> /dev/null ; then
     2691        LogIt "You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n"
     2692    fi
     2693fi
     2694which mke2fs > /dev/null 2> /dev/null || Die "Please put mke2fs in system path"
     2695[ ! -e "$FDISK" ] && Die "Cannot find (s)fdisk"
     2696
    27312697[ "`uname -r | grep "2.4.[0-6]" | grep -v "2.4.[0-9][0-9]"`" != "" ] &&  echo "WARNING! Your kernel may have buggy loopfs code. Consider upgrading to 2.4.7"
    27322698# If we have a 2.6 kernel, the system uses module-init-tools which means that we
     
    27442710    [ ! -e "/etc/modules.conf" ] && Die "/etc/modules.conf not found; you may have to create a softlink from /etc/conf.modules to /etc/modules.conf; of course, all good distros use modules.conf anyway..."
    27452711fi
    2746 FixPathIfBroken
     2712
     2713# Update the PATH variable if incomplete
     2714if [ -e "/sbin/mkfs" ] && ! which mkfs &> /dev/null ; then
     2715    PATH=$PATH:/sbin:/usr/sbin
     2716    export PATH
     2717    echo "Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily." >> $LOGFILE
     2718    echo "However, you may wish to ask your vendor to provide a permanent fix..." >> $LOGFILE
     2719    echo " Or you might like to call 'su -' instead of 'su', for example." >> $LOGFILE
     2720fi
     2721
    27472722[ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | grep -E "2\.[46]" | cut -d' ' -f1`
    2748 AbortIfMkfsVfatMissing
     2723
     2724if ! which mkfs.vfat &> /dev/null ; then
     2725    Die "mkfs.vfat missing from your filesystem - please install your dosfstools RPM or DEB package. Perhaps your PATH environmental variable is broken, too?"
     2726fi
     2727
    27492728### BERLIOS
    27502729### Fix as it's not mandatory on ia64
    27512730if [ "$ARCH" = "ia64" ] ; then
    2752     FindELiloBinary
     2731    if which elilo &> /dev/null ; then
     2732        LILO_EXE=elilo
     2733    else
     2734        LILO_EXE=`which false`
     2735    fi
    27532736else
    27542737    FindIsolinuxBinary
     
    27632746MAX_COMPRESSED_SIZE=1300
    27642747kernelpath=""
    2765 MONDO_ROOT=$TMPMONDO/mondo-root
     2748MONDO_ROOT=/var/cache/mondo
    27662749mkdir -p $MONDO_ROOT
    27672750
     
    28132796        # Change MINDI_TMP for the one provided by mondo
    28142797        # So that it can get back the built files
    2815         rm -rf $MINDI_TMP
     2798        mv $MINDI_TMP/* $MINDI_TMP/.??* $MONDO_TMP 2> /dev/null
     2799        rmdir $MINDI_TMP
    28162800        MINDI_TMP=$MONDO_TMP
    28172801        mkdir -p $MINDI_TMP
     2802        # This is the scratch dir in mondo
    28182803        CACHE_LOC=$3
    28192804        if [ _"$CACHE_LOC" != _"" ]; then
Note: See TracChangeset for help on using the changeset viewer.