Changeset 181 for trunk/mindi


Ignore:
Timestamp:
Dec 13, 2005, 1:35:27 AM (14 years ago)
Author:
bcornec
Message:

merge -r177:180 $SVN_M/branches/2.05

Location:
trunk/mindi
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi/install.sh

    r158 r181  
    1 #!/bin/sh
     1#!/bin/bash
    22
    33if [ ! -f "mindi" ] ; then
     
    55    exit 1
    66fi
    7 local=/usr
    8 # local=/usr/local
     7
     8if [ "_$PREFIX" = "_" ]; then
     9    local=$PREFIX/usr
     10    if [ -f /usr/local/sbin/mindi ]; then
     11        echo "WARNING: /usr/local/sbin/mindi exists. You should probably remove it !"
     12    fi
     13    conf=$PREFIX/etc/mindi
     14else
     15    local=/usr/local
     16    if [ -f /usr/sbin/mindi ]; then
     17        echo "WARNING: /usr/sbin/mindi exists. You should probably remove the mindi package !"
     18    fi
     19    conf=$local/etc/mindi
     20fi
     21
    922if uname -a | grep Knoppix > /dev/null || [ -e "/ramdisk/usr" ] ; then
    1023    local=/ramdisk/usr
     
    1225fi
    1326
    14 mkdir -p $local/share/mindi
     27echo "mindi will be installed under $local"
     28
     29echo "Creating target directories ..."
     30mkdir -p $local/lib/mindi
     31mkdir -p $local/share/doc/mindi
    1532mkdir -p $local/share/man/man8
    1633mkdir -p $local/sbin
     34mkdir -p $conf
    1735
    18 #for i in aux-tools dev rootfs ; do
    19 #    [ -e "$i.tgz" ] && continue
    20 #    cd $i
    21 #    tar -c * | gzip -9 > ../$i.tgz
    22 #    cd ..
    23 #    rm -Rf $i
    24 #done
     36echo "Copying files ..."
     37cp deplist.txt $conf
     38cp -af rootfs aux-tools isolinux.cfg msg-txt sys-disk.raw.gz isolinux-H.cfg parted2fdisk.pl syslinux.cfg syslinux-H.cfg dev.tgz Mindi $local/lib/mindi
     39chmod 755 $local/lib/mindi/rootfs/bin/*
     40chmod 755 $local/lib/mindi/rootfs/sbin/*
     41chmod 755 $local/lib/mindi/aux-tools/sbin/*
    2542
    26 cp --parents -pRdf * $local/share/mindi/
    27 ln -sf $local/share/mindi/mindi $local/sbin/
    28 chmod +x $local/sbin/mindi
     43cp -af analyze-my-lvm parted2fdisk.pl $local/sbin
     44if [ "$RPMBUILDMINDI" = "true" ]; then
     45    sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=/usr~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=/etc/mindi~" mindi > $local/sbin/mindi
     46else
     47    sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=$local~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=$conf~" mindi > $local/sbin/mindi
     48fi
     49chmod 755 $local/sbin/mindi
     50chmod 755 $local/sbin/analyze-my-lvm
     51chmod 755 $local/sbin/parted2fdisk.pl
     52
    2953cp -a mindi.8 $local/share/man/man8
     54cp -a CHANGES COPYING README README.busybox README.ia64 README.pxe TODO INSTALL $local/share/doc/mindi
     55
    3056echo $PATH | grep $local/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add $local/sbin to your PATH."
    31 ( cd $local/share/mindi/rootfs && tar -xzf symlinks.tgz )
     57
     58echo "Extracting symlinks ..."
     59( cd $local/lib/mindi/rootfs && tar -xzf symlinks.tgz )
     60
    3261ARCH=`/bin/arch`
    3362echo $ARCH | grep -x "i[0-9]86" &> /dev/null && ARCH=i386
    3463export ARCH
    35 ( cd $local/share/mindi/rootfs && mv bin/busybox-$ARCH bin/busybox)
     64
     65if [ -f $local/lib/mindi/rootfs/bin/busybox-$ARCH ]; then
     66        echo "Installing busybox ..."
     67        mv $local/lib/mindi/rootfs/bin/busybox-$ARCH $local/lib/mindi/rootfs/bin/busybox
     68else
     69        echo "WARNING: no busybox found, mindi will not work on this arch ($ARCH)"
     70fi
     71
    3672if [ "$ARCH" = "i386" ] ; then
    37     ( cd $local/share/mindi/rootfs && mv bin/busybox-$ARCH.net bin/busybox.net)
     73    if [ -f $local/lib/mindi/rootfs/bin/busybox-$ARCH.net ]; then
     74        echo "Installing busybox.net ..."
     75        mv $local/lib/mindi/rootfs/bin/busybox-$ARCH.net $local/lib/mindi/rootfs/bin/busybox.net
     76    else
     77        echo "WARNING: no busybox.net found, mindi will not work on this arch ($ARCH) with network"
     78    fi
    3879fi
     80
    3981if [ "$ARCH" = "ia64" ] ; then
    40     make -f Makefile.parted2fdisk
    41     make -f Makefile.parted2fdisk install
    42     ( cd $local/share/mindi/rootfs && mv sbin/parted2fdisk-ia64 sbin/parted2fdisk)
     82    make -f Makefile.parted2fdisk DEST=$local/lib/mindi install
     83    if [ -f $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH ]; then
     84        echo "Installing parted2fdisk ..."
     85        mv $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/lib/mindi/rootfs/sbin/parted2fdisk
     86    else
     87        echo "WARNING: no parted2fdisk found, mindi will not work on this arch ($ARCH)"
     88    fi
    4389else
    44     ( cd $local/share/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk)
     90    echo "Symlinking fdisk to parted2fdisk"
     91    ( cd $local/lib/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk)
    4592fi
    46 ls /etc/mindi/* > /dev/null 2>/dev/null
    47 [ "$?" -ne "0" ] && rm -Rf /etc/mindi
     93
    4894exit 0
  • trunk/mindi/mindi

    r149 r181  
    11#!/bin/bash
    22
     3# $Id$
     4#
    35#-----------------------------------------------------------------------------
    46# mindi - mini-Linux distro based on the user's filesystem & distribution
     
    2527
    2628MINDI_VERSION=1.04_berlios
     29MINDI_PREFIX=XXX
     30MINDI_CONF=YYY
     31MINDI_SBIN=${MINDI_PREFIX}/sbin
     32MINDI_LIB=${MINDI_PREFIX}/lib/mindi
    2733
    2834EXTRA_SPACE=24576         ; # increase if you run out of ramdisk space
     
    4349    # you want to use your own kernel, or the supplied default.
    4450    # If "yes" mindi will automatically use your own kernel.
    45 MINDI_CONFIG="/etc/mindi/mindi.conf"
     51MINDI_CONFIG="$MINDI_CONF/mindi.conf"
    4652if [ -f $MINDI_CONFIG ]; then
    4753    . $MINDI_CONFIG
     
    104110        incoming=`ReadLine`
    105111    done
    106     if [ -e "$MINDI_HOME/memtest.img" ] ; then
     112    if [ -e "$MINDI_LIB/memtest.img" ] ; then
    107113#        echo -en "label memtest\n  kernel memtest.bin\n\n"
    108114        echo -en "label memtest\n  kernel memdisk\n  append initrd=memtest.img\n\n"
     
    126132    which afio > /dev/null 2> /dev/null || LogIt "afio not found... mindi doesn't need afio but Mondo does... Be aware...\n"
    127133    [ ! -e "/etc/issue.net" ] && > /etc/issue.net
    128     FDISK=$MINDI_HOME/parted2fdisk.pl
     134    FDISK=$MINDI_SBIN/parted2fdisk.pl
    129135    FDISKLOG=/tmp/parted2fdisk.log
    130136    touch $FDISKLOG
     
    214220    mappath=$1
    215221    KBDEPTH=$(($KBDEPTH+1))
    216     [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_HOME/mindi and disable FindAndAddUserKeyboardMappingFile (line 1170, approx.)"
     222    [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 1170, approx.)"
    217223    if [ -e "$bigdir/$mappath" ] ; then
    218224    echo "$mappath already added" >> $LOGFILE
     
    622628
    623629           if [ $SYMLINK -ne 1 ] ; then
    624               if [ -d "$mh/mindi" ] && [ -e "$mh/mindi/aux-tools" ] ; then
    625               [ "$MINDI_HOME" ] && Die "You have multiple instances of Mindi - one at $MINDI_HOME and one at $mh/mindi"
    626                       MINDI_HOME=$mh/mindi
    627               fi
    628630          if [ -d "$mh/mondo" ] && [ -e "$mh/mondo/restore-scripts" ] ; then
    629631              [ "$MONDO_HOME" ] && Die "You have multiple instances of Mondo - one at $MONDO_HOME and one at $mh/mondo"
     
    635637# end patch
    636638
    637 #   for mh in /usr/share /usr/local /usr/local/share /usr/share/local /opt /opt/share /usr ; do
    638 #       if [ -d "$mh/mindi" ] && [ -e "$mh/mindi/aux-tools" ] ; then
    639 #       [ "$MINDI_HOME" ] && Die "You have multiple instances of Mindi - one at $MINDI_HOME and one at $mh/mindi"
    640 #       MINDI_HOME=$mh/mindi
    641 #       fi
    642 #       if [ -d "$mh/mondo" ] && [ -e "$mh/mondo/restore-scripts" ] ; then
    643 #       [ "$MONDO_HOME" ] && Die "You have multiple instances of Mondo - one at $MONDO_HOME and one at $mh/mondo"
    644 #       MONDO_HOME=$mh/mondo
    645 #       fi
    646 #   done
    647 
    648     [ "$MINDI_HOME" = "" ] && Die "Unable to locate Mindi's home directory"
    649     echo "MINDI_HOME = $MINDI_HOME" >> $LOGFILE
     639    [ "$MINDI_PREFIX" = "XXX" ] && Die "Mindi has not been installed correctly."
     640    echo "MINDI_LIB = $MINDI_LIB" >> $LOGFILE
     641    echo "MINDI_SBIN = $MINDI_SBIN" >> $LOGFILE
     642    [ "$MINDI_CONF" = "YYY" ] && Die "Mindi has not been installed correctly."
     643    echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE
    650644    echo "MONDO_HOME = $MONDO_HOME" >> $LOGFILE
    651     [ -e "/etc/mindi" ] && MINDI_CONF=/etc/mindi || MINDI_CONF=$MINDI_HOME
    652     echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE
    653645    mkdir -p $CACHE_LOC
    654646}
     
    13411333    if [ -d "/proc/lvm" ] || [ -d "/dev/mapper" ]; then
    13421334    echo -en "\rAnalyzing LVM...\r"
    1343     all_partitions=`$MINDI_HOME/analyze-my-lvm | fgrep ">>>" | cut -d' ' -f2-32`
     1335    all_partitions=`$MINDI_SBIN/analyze-my-lvm | fgrep ">>>" | cut -d' ' -f2-32`
    13441336    fi
    13451337    all_partitions="$all_partitions `ListAllPartitions 2> /dev/null`"
     
    15051497    echo -en "  " > $1
    15061498    if [ "`cat /etc/issue.net 2> /dev/null | fgrep -i "debian"`" ] ; then
    1507         cat $MINDI_HOME/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cat /etc/issue.net | cut -d ' ' -f 3` `hostname`"% | sed s/KKKKK/"Kernel `uname  -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ >> $1.tmp
    1508     else
    1509         cat $MINDI_HOME/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`cat /etc/issue.net | grep -i "linux" | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`cat /etc/issue.net | grep -i "kernel" | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' '\\r' 'on' 'an' '\/' '`uname -r`' 'on' 'an' '`uname -m`/ >> $1.tmp
     1499        cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cat /etc/issue.net | cut -d ' ' -f 3` `hostname`"% | sed s/KKKKK/"Kernel `uname  -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ >> $1.tmp
     1500    else
     1501        cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`cat /etc/issue.net | grep -i "linux" | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`cat /etc/issue.net | grep -i "kernel" | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' '\\r' 'on' 'an' '\/' '`uname -r`' 'on' 'an' '`uname -m`/ >> $1.tmp
    15101502    fi
    15111503    cat $1.tmp | sed s/%r/"`uname -r`"/ | sed s/%t/"`hostname`"/ > $1
     
    15161508        elif [ ! "$MONDO_TMP" ] ; then
    15171509            echo -en "FYI, this is _not_ a Mondo Rescue CD.\n" >> $1
    1518             if [ -e "$MINDI_HOME/memtest.img" ] ; then
     1510            if [ -e "$MINDI_LIB/memtest.img" ] ; then
    15191511                echo -en "Type 'memtest' <Enter> to test your PC's memory intensively.\nJust press <Enter> to go to the main test menu.\n" >> $1
    15201512            fi
     
    16091601    cd $TMP_ROOT/iso
    16101602    mkdir -p $MONDO_ROOT/iso/isolinux
    1611     echo "mindi_home = $MINDI_HOME" >> $LOGFILE
    1612     cp $MINDI_HOME/mem{test,disk}* $MONDO_ROOT 2>> $LOGFILE
     1603    echo "mindi_lib = $MINDI_LIB" >> $LOGFILE
     1604    cp $MINDI_LIB/mem{test,disk}* $MONDO_ROOT 2>> $LOGFILE
    16131605    for i in memdisk memtest.bin memtest.img ; do
    1614     j=$MINDI_HOME/$i
     1606    j=$MINDI_LIB/$i
    16151607    k=$TMP_ROOT/iso/isolinux
    16161608    if [ -e "$j" ] ; then
     
    16741666    disksize=$1
    16751667    if [ "`cat /etc/issue.net 2> /dev/null | fgrep -i "debian"`" ] ; then
    1676         cat $MINDI_HOME/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cat /etc/issue.net | cut -d ' ' -f 3` `hostname`"% | sed s/KKKKK/"Kernel `uname  -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/
    1677     else
    1678         cat $MINDI_HOME/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`cat /etc/issue.net | grep -i "linux" | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`cat /etc/issue.net | grep -i "kernel" | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' 'r' 'on' 'an' 'm/' '`uname -r`' 'on' 'an' '`uname -m`/
     1668        cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cat /etc/issue.net | cut -d ' ' -f 3` `hostname`"% | sed s/KKKKK/"Kernel `uname  -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/
     1669    else
     1670        cat $MINDI_LIB/msg-txt | sed s/ZZZZZ/$MINDI_VERSION/ | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`cat /etc/issue.net | grep -i "linux" | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`cat /etc/issue.net | grep -i "kernel" | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' 'r' 'on' 'an' 'm/' '`uname -r`' 'on' 'an' '`uname -m`/
    16791671    fi
    16801672    if [ "$disksize" -gt "2880" ] ; then
     
    17331725    rdev -r vmlinuz 49152
    17341726
    1735     tar -zxf $MINDI_HOME/dev.tgz || LogIt "Cannot untar dev.tgz\n"
     1727    tar -zxf $MINDI_LIB/dev.tgz || LogIt "Cannot untar dev.tgz\n"
    17361728    losetup /dev/loop0 > /dev/null 2> /dev/null
    17371729    [ "$?" -eq "0" ] || losetup /dev/loop0 -d || Die "Please free up /dev/loop0 by typing 'losetup /dev/loop0 -d'.\nReboot if necessary.\n"
     
    18601852
    18611853
    1862 #MINDI_HOME=/usr/share/mindi
    1863 #rm -f /tmp/boot.img*
    1864 #write_full_floppy_of_kernel /usr/share/mindi/vmlinuz /tmp/boot.img 1440
    1865 #exit $?
    1866 
    1867 
    1868 
    1869 
    1870 
    18711854PrepareBootDiskImage_LILO() {
    18721855    local disksize imagesdir dev imagefile mountpoint fname i kernelpath ramdisksize cfg_file testpath options retval outstr old_pwd ooo max_kernel_size liloconf
     
    18791862    [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel"
    18801863    echo -en "Making "$disksize"KB boot disk..."
    1881     TurnTgzIntoRdz $MINDI_HOME/rootfs $TMP_ROOT/mindi.rdz $ramdisksize $disksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"
     1864    TurnTgzIntoRdz $MINDI_LIB/rootfs $TMP_ROOT/mindi.rdz $ramdisksize $disksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"
    18821865    if [ "$ARCH" != "ia64" ] ; then
    18831866        [ "$disksize" != "1722" ] && [ "$disksize" != "2880" ] && [ "$disksize" != "5760" ] && Die "PDBI - disksize is $disksize - bad size"
     
    19081891    cd $mountpoint
    19091892    if [ "$ARCH" != "ia64" ] ; then
    1910         tar -zxf $MINDI_HOME/dev.tgz || LogIt "Cannot untar dev.tgz\n"
     1893        tar -zxf $MINDI_LIB/dev.tgz || LogIt "Cannot untar dev.tgz\n"
    19111894    fi
    19121895    cd $old_pwd
     
    19311914    mkdir -p $mountpoint/tmp
    19321915    cp -f $TMP_ROOT/mondo-restore.cfg $mountpoint/tmp &> /dev/null
    1933     if [ -e "$MINDI_HOME/memtest.img" ] ; then
     1916    if [ -e "$MINDI_LIB/memtest.img" ] ; then
    19341917        echo -en "image=/memtest.bin\nlabel=memtest\nn" >> $liloconf
    19351918        echo -en "image=/memdisk\nlabel=memtest\nappend=\"initrd=memtest.img\"\n" >> $liloconf
     
    19721955# make it bootable
    19731956    rm -f $mountpoint/zero
    1974     [ -e "$MINDI_HOME/memdisk" ] && cp -f $MINDI_HOME/memdisk $mountpoint
     1957    [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint
    19751958    if [ "$disksize" -gt "2880" ] && [ ! "$KERN_DISK_MADE" ] ; then
    19761959        if [ "$ARCH" != "ia64" ] ; then
     
    20312014    [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel"
    20322015    echo -en "Making "$disksize"KB boot disk..."
    2033     TurnTgzIntoRdz $MINDI_HOME/rootfs $TMP_ROOT/mindi.rdz $ramdisksize $disksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"
     2016    TurnTgzIntoRdz $MINDI_LIB/rootfs $TMP_ROOT/mindi.rdz $ramdisksize $disksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"
    20342017    [ "$disksize" != "1722" ] && [ "$disksize" != "2880" ] && [ "$disksize" != "5760" ] && Die "PDBI - disksize is $disksize - bad size"
    20352018    echo -en "..."
     
    20442027# play nicely and I don't care. :) I have worked around the problem. -Hugo, 06/27/2002
    20452028    if [ "$disksize" = "1722" ] ; then
    2046         gzip -dc $MINDI_HOME/sys-disk.raw.gz > $imagefile || Die "Cannot dd blank file"
     2029        gzip -dc $MINDI_LIB/sys-disk.raw.gz > $imagefile || Die "Cannot dd blank file"
    20472030    else
    20482031        dd if=/dev/zero of=$imagefile bs=1k count=$disksize &> /dev/null || Die "Cannot dd blank file"
     
    20562039    cd $mountpoint
    20572040    [ -e "$sys_cfg_file" ] || Die "Obi Wan, word up?"
    2058 #    tar -zxf $MINDI_HOME/dev.tgz || LogIt "Cannot untar dev.tgz\n" <--- present for LILO; is it nec. for SYSLINUX too?
     2041#    tar -zxf $MINDI_LIB/dev.tgz || LogIt "Cannot untar dev.tgz\n" <--- present for LILO; is it nec. for SYSLINUX too?
    20592042    cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $mountpoint > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root"
    20602043    if [ -e "$MONDO_TMP/start-nfs" ] ; then
     
    21102093    rm -f $mountpoint/zero
    21112094    mkdir -p $mountpoint/etc
    2112     [ -e "$MINDI_HOME/memdisk" ] && cp -f $MINDI_HOME/memdisk $mountpoint
     2095    [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint
    21132096    umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)"
    21142097    echo -en "..."
     
    22162199
    22172200# more stuff
    2218 #    cp -f $MINDI_HOME/embleer* $bigdir
     2201#    cp -f $MINDI_LIB/embleer* $bigdir
    22192202    old_pwd=`pwd`
    22202203    cd $bigdir
    22212204
    2222     [ -e "$MINDI_HOME/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'."
    2223     cp -Rdf $MINDI_HOME/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n"
    2224     if [ -e "$MINDI_HOME/x11-tools.tgz" ] ; then
    2225     tar -zxf $MINDI_HOME/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n"
     2205    [ -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'."
     2206    cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n"
     2207    if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then
     2208    tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n"
    22262209    fi
    22272210    if [ -e "$MONDO_HOME/restore-scripts" ] ; then
    22282211        cp -Rdf $MONDO_HOME/restore-scripts/* . 2>> $LOGFILE
    2229         [ "$?" -ne "0" ] && [ "`DidMondoCallMe`" ] && Die "Cannot find/install $MINDI_HOME/restore-scripts"
     2212        [ "$?" -ne "0" ] && [ "`DidMondoCallMe`" ] && Die "Cannot find/install $MINDI_LIB/restore-scripts"
    22302213    fi
    22312214    [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state .
     
    22462229    cp -f $TMP_ROOT/mountlist.txt $CACHE_LOC
    22472230    [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDO_TMP/.
    2248     [ -d "/proc/lvm" ] && $MINDI_HOME/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
    2249     [ -d "/dev/mapper" ] && $MINDI_HOME/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
     2231    [ -d "/proc/lvm" ] && $MINDI_SBIN/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
     2232    [ -d "/dev/mapper" ] && $MINDI_SBIN/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
    22502233    cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
    22512234    ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks
     
    27282711    old_pwd=`pwd`
    27292712    cd $mountpoint
    2730 #    [ -e "$MINDI_HOME/memtest.img" ] && echo "Yep, this is a multi-function CD" > MULTIFUNC
     2713#    [ -e "$MINDI_LIB/memtest.img" ] && echo "Yep, this is a multi-function CD" > MULTIFUNC
    27312714    cp -Rdf $tgz_dir_fname/* . 2>> $LOGFILE >> $LOGFILE
    27322715    tar -zxf symlinks.tgz || Die "Cannot untar symlinks.tgz"
     
    28202803#   done
    28212804#    fi
    2822     if [ ! -e "/sbin/devfsd" ] || [ "$disksize" -lt "2880" ] || [ "$kernelpath" = "$MINDI_HOME/vmlinuz" ] ; then
     2805    if [ ! -e "/sbin/devfsd" ] || [ "$disksize" -lt "2880" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then
    28232806        echo "Deleting devfsd daemon from ramdisk" >> $LOGFILE
    28242807        [ ! -e "/sbin/devfsd" ] && echo "...because /sbin/devfsd not found" >> $LOGFILE
    28252808        [ "$disksize" -lt "2880" ] && echo "...because disksize = $disksize" >> $LOGFILE
    2826         [ "$kernelpath" = "$MINDI_HOME/vmlinuz" ] && echo "...because kernel is failsafe" >> $LOGFILE
     2809        [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] && echo "...because kernel is failsafe" >> $LOGFILE
    28272810#        ls -l $mountpoint/sbin/devfsd &> /dev/null || Die "Can't find devfsd daemon on ramdisk"
    28282811        rm -f $mountpoint/sbin/devfsd
     
    29822965fi
    29832966FixPathIfBroken
    2984 [ -f "$MINDI_HOME/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_HOME/vmlinuz 2> /dev/null | grep "2\.4" | cut -d' ' -f1`
     2967[ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | grep "2\.4" | cut -d' ' -f1`
    29852968AbortIfMkfsVfatMissing
    29862969### BCO
     
    31083091[ "$CDRECOVERY" = "yes" ] || CDRECOVERY=no
    31093092if [ "$CDRECOVERY" = "yes" ] ; then
    3110     iso_cfg_file=$MINDI_HOME/isolinux-H.cfg
    3111     sys_cfg_file=$MINDI_HOME/syslinux-H.cfg
     3093    iso_cfg_file=$MINDI_LIB/isolinux-H.cfg
     3094    sys_cfg_file=$MINDI_LIB/syslinux-H.cfg
    31123095else
    3113     iso_cfg_file=$MINDI_HOME/isolinux.cfg
    3114     sys_cfg_file=$MINDI_HOME/syslinux.cfg
     3096    iso_cfg_file=$MINDI_LIB/isolinux.cfg
     3097    sys_cfg_file=$MINDI_LIB/syslinux.cfg
    31153098fi
    31163099
     
    31343117mkdir -p $imagesdir
    31353118if [ ! "`DidMondoCallMe`" ] ; then
    3136     LogIt "Mindi Linux mini-distro generator v$MINDI_VERSION by Hugo Rabson"
    3137     LogIt "Latest Mindi is available from http://www.mondorescue.org"
     3119    LogIt "Mindi Linux mini-distro generator v$MINDI_VERSION"
     3120    LogIt "Latest Mindi is available from http://mondorescue.berlios.de"
    31383121    LogIt "BusyBox sources are available from http://www.busybox.net"
    31393122    LogIt "------------------------------------------------------------------------------"
     
    31973180fi
    31983181if [ "$YOUR_KERNEL_SUCKS" != "" ] || [ "$kernelpath" = "" ] || [ "$kernelpath" = "SUCKS" ] || [ "$kernelpath" = "FAILSAFE" ] ; then
    3199     kernelpath=$MINDI_HOME/vmlinuz
     3182    kernelpath=$MINDI_LIB/vmlinuz
    32003183    LogIt "I shall include Mindi's failsafe kernel, not your kernel, in the boot disks."
    32013184    LogIt "However, you are still running your kernel. If Mindi fails to create your"
     
    32033186    pwd=`pwd`
    32043187    cd $TMP_ROOT
    3205     bzip2 -dc $MINDI_HOME/lib.tar.bz2 | tar -x || Die "Cannot unzip lib.tar.bz2"
     3188    bzip2 -dc $MINDI_LIB/lib.tar.bz2 | tar -x || Die "Cannot unzip lib.tar.bz2"
    32063189    cd $pwd
    32073190    YOUR_KERNEL_SUCKS="Your kernel sucks"
     
    32473230
    32483231
    3249 [ -e "$MINDI_HOME/memtest.img" ] && BOOT_MEDIA_MESSAGE="$BOOT_MEDIA_MESSAGE\n\
     3232[ -e "$MINDI_LIB/memtest.img" ] && BOOT_MEDIA_MESSAGE="$BOOT_MEDIA_MESSAGE\n\
    32503233...Or type 'memtest' to test your PC's RAM thoroughly.\n"
    32513234
  • trunk/mindi/mindi.spec

    r158 r181  
    6363
    6464%{__rm} -rf $RPM_BUILD_ROOT
    65 MINDIDIR=$RPM_BUILD_ROOT%{_datadir}/mindi
    66 
    67 %{__mkdir_p} $MINDIDIR $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_sysconfdir}/mindi $RPM_BUILD_ROOT%{_sbindir} $RPM_BUILD_ROOT/%{_mandir}/man8
    68 %{__cp} deplist.txt $RPM_BUILD_ROOT%{_sysconfdir}/mindi/
    69 %{__cp} -af * $MINDIDIR
    70 %{__cp} -af mindi.8 $RPM_BUILD_ROOT/%{_mandir}/man8
    71 
    72 %ifarch ia64
    73     %{__make} -f Makefile.parted2fdisk DEST=${MINDIDIR}/ install
    74     %{__mv} $MINDIDIR/rootfs/bin/busybox-ia64 $MINDIDIR/rootfs/bin/busybox
    75     %{__mv} $MINDIDIR/rootfs/sbin/parted2fdisk-ia64 $MINDIDIR/rootfs/sbin/parted2fdisk
    76 %else
    77     %{__mv} $MINDIDIR/rootfs/bin/busybox-i386 $MINDIDIR/rootfs/bin/busybox
    78     %{__mv} $MINDIDIR/rootfs/bin/busybox-i386.net $MINDIDIR/rootfs/bin/busybox.net
    79     %{__ln_s} fdisk $MINDIDIR/rootfs/sbin/parted2fdisk
    80 %endif
     65MINDIDIR=$RPM_BUILD_ROOT%{_libdir}/mindi
     66export PREFIX=${RPM_BUILD_ROOT}
     67export RPMBUILDMINDI="true"
     68
     69./install.sh
     70
    8171%{__rm} -f $MINDIDIR/rootfs/bin/busybox-ia64 $MINDIDIR/rootfs/sbin/parted2fdisk-ia64 $MINDIDIR/rootfs/bin/busybox-i386 $MINDIDIR/rootfs/bin/busybox-i386.net
    82 
    83 #
    84 # These are installed twice if not removed here
    85 #
    86 ( cd $MINDIDIR
    87 %{__rm} -f CHANGES INSTALL COPYING README TODO README.ia64 README.pxe mindi.8
    88 )
    89 
    90 # Symlinks
    91 
    92 cd $RPM_BUILD_ROOT%{_sbindir}
    93 %{__ln_s} -f %{_datadir}/mindi/mindi .
    94 %{__ln_s} -f %{_datadir}/mindi/analyze-my-lvm .
    95 %ifarch ia64
    96 %{__ln_s} -f %{_datadir}/mindi/parted2fdisk.pl .
    97 %endif
    9872
    9973%clean
     
    10175
    10276%post
     77if [ -f /usr/local/sbin/mindi ]; then
     78    echo "WARNING: /usr/local/sbin/mindi exists. You should probably remove your manual mindi installation !"
     79fi
     80
    10381%ifarch ia64
    10482    %{__mkdir_p} /usr/local/bin
     
    10684        %{__cp} /sbin/fdisk /sbin/fdisk.mondosav
    10785        %{__mv} /sbin/fdisk /usr/local/bin/fdisk
    108         %{__ln_s} -f /usr/share/mindi/parted2fdisk.pl /sbin/fdisk
     86        %{__ln_s} -f /usr/sbin/parted2fdisk.pl /sbin/fdisk
    10987        echo "Warning: you fdisk binary is now under /usr/local/bin"
    11088    fi
     
    11492%defattr(644,root,root,755)
    11593%config(noreplace) %{_sysconfdir}/mindi/deplist.txt
    116 %doc CHANGES INSTALL COPYING README TODO README.ia64 README.pxe
    117 %attr(755,root,root) %{_sbindir}/mindi
    118 %attr(755,root,root) %{_sbindir}/analyze-my-lvm
    119 %{_datadir}/mindi
     94%doc CHANGES INSTALL COPYING README TODO README.ia64 README.pxe README.busybox
     95%{_sbindir}
     96%{_libdir}/mindi
    12097%{_mandir}
    121 %attr(755,root,root) %{_datadir}/mindi/analyze-my-lvm
    122 %attr(755,root,root) %{_datadir}/mindi/mindi
    123 %attr(755,root,root) %{_datadir}/mindi/parted2fdisk.pl
    124 %attr(755,root,root) %{_datadir}/mindi/aux-tools/sbin/*
    125 %attr(755,root,root) %{_datadir}/mindi/rootfs/bin/*
    126 %attr(755,root,root) %{_datadir}/mindi/rootfs/sbin/*
    12798
    12899%changelog
     100* Fri Nov 05 2005 Bruno Cornec <bcornec@users.berlios.de> 1.05
     101- ia64 is now working
     102- use install.sh script
     103- use libdir for binary data
     104
    129105* Tue Sep 06 2005 Bruno Cornec <bcornec@users.berlios.de> 1.04_berlios
    130106- Merge of patches mentionned on mondo ML + ia64 updates
  • trunk/mindi/rootfs/etc/bashrc

    r30 r181  
    1 PATH=/mondo:/usr/share/mondo:/usr/share/mindi:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:.
     1PATH=/mondo:/usr/lib/mondo:/usr/lib/mindi:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:.
    22HOSTNAME="mondo"
    33TERM=linux
  • trunk/mindi/rootfs/sbin/init

    r149 r181  
    622622#    HandleCDROMorFloppies
    623623#el
    624 if [ "`| grep -i 'tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev /tmp/mondo-restore.cfg`" ] ; then
     624if [ "`grep -i 'tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev /tmp/mondo-restore.cfg`" ] ; then
    625625    HandleTape
    626626else
Note: See TracChangeset for help on using the changeset viewer.