Ignore:
Timestamp:
Oct 30, 2007, 1:18:55 PM (12 years ago)
Author:
bruno
Message:
  • Solve problem on tmpfs in restore init (Problem of inexistant symlink and busybox)
  • Create MONDO_CACHE and use it everywhere + creation at start
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi/rootfs/sbin/init

    r1741 r1747  
    88
    99CaughtSoftReset() {
    10     trap SIGTERM
    11     reboot
     10    trap SIGTERM
     11    reboot
    1212}
    1313
    1414
    1515ConfigureLoggingDaemons() {
    16     echo -en "Running klogd..."
    17     klogd -c 2 > /dev/null 2> /dev/null
    18     echo -en "Done.\nRunning syslogd..."
    19     syslogd > /dev/null 2> /dev/null
    20     echo "Done."
    21     LogIt "klogd and syslogd have been started."
     16    echo -en "Running klogd..."
     17    klogd -c 2 > /dev/null 2> /dev/null
     18    echo -en "Done.\nRunning syslogd..."
     19    syslogd > /dev/null 2> /dev/null
     20    echo "Done."
     21    LogIt "klogd and syslogd have been started."
    2222}
    2323
     
    2525
    2626CopyBootDevEntry() {
    27     local outfile devfile
    28     devfile=/dev/boot_device
    29     outfile=`cat /BOOTLOADER.DEVICE 2> /dev/null`
    30     [ ! "$outfile" ] && return 0
    31     echo -en "Copying boot device to $outfile..."
    32     if [ -e "$outfile" ] ; then
     27    local outfile devfile
     28    devfile=/dev/boot_device
     29    outfile=`cat /BOOTLOADER.DEVICE 2> /dev/null`
     30    [ ! "$outfile" ] && return 0
     31    echo -en "Copying boot device to $outfile..."
     32    if [ -e "$outfile" ] ; then
    3333        echo "OK."
    3434        return 0
    35     fi
    36     mkdir -p $outfile
    37     rmdir $outfile
    38     cp -pRdf $devfile $outfile
    39     if [ "$?" -ne "0" ] ; then
     35    fi
     36    mkdir -p $outfile
     37    rmdir $outfile
     38    cp -pRdf $devfile $outfile
     39    if [ "$?" -ne "0" ] ; then
    4040        echo "Failed."
    4141        return 1
    42     else
     42    else
    4343        echo "OK."
    4444        return 0
    45     fi
     45    fi
    4646}
    4747
     
    4949
    5050Die() {
    51     LogIt "Fatal error! $1" 1
    52     exit 1
     51    LogIt "Fatal error! $1" 1
     52    exit 1
    5353}
    5454
     
    5656
    5757ExtractDevTarballs() {
    58     cd /
    59     for fname in ataraid.tgz ida.tgz i2o.tgz rd.tgz raw.tgz cciss.tgz nst.tgz dm.tgz vc.tgz ; do
    60         if [ ! -e "/$fname" ] ; then
    61             LogIt "/$fname not found; cannot extract to /." 1
    62         else
    63             echo -en "\rExtracting /$fname...     "
    64             tar -zxf /$fname || LogIt "Error occurred while extracting /$fname"
    65         fi
    66     done
    67     echo -en "\r"
    68     LogIt "Extracted additional /dev entries OK.     " 1
     58    cd /
     59    for fname in ataraid.tgz ida.tgz i2o.tgz rd.tgz raw.tgz cciss.tgz nst.tgz dm.tgz vc.tgz ; do
     60        if [ ! -e "/$fname" ] ; then
     61            LogIt "/$fname not found; cannot extract to /." 1
     62        else
     63            echo -en "\rExtracting /$fname...     "
     64            tar -zxf /$fname || LogIt "Error occurred while extracting /$fname"
     65        fi
     66    done
     67    echo -en "\r"
     68    LogIt "Extracted additional /dev entries OK.     " 1
    6969}
    7070
     
    7272
    7373LaunchTerminals() {
    74     openvt 2 /bin/sh
    75     openvt 3 /bin/sh
    76     openvt 4 /bin/sh
    77     openvt 5 /bin/sh
    78     openvt 6 /bin/sh
    79     openvt 7 /bin/sh /sbin/wait-for-petris
     74    openvt 2 /bin/sh
     75    openvt 3 /bin/sh
     76    openvt 4 /bin/sh
     77    openvt 5 /bin/sh
     78    openvt 6 /bin/sh
     79    openvt 7 /bin/sh /sbin/wait-for-petris
    8080}
    8181
    8282
    8383LoadKeymap() {
    84     local fname
    85     fname=`cat /tmp/KEYMAP-LIVES-HERE 2> /dev/null`
    86     [ "$fname" = "" ] && return
    87     if which loadkeys > /dev/null 2> /dev/null ; then
    88         loadkeys $fname
     84    local fname
     85    fname=`cat /tmp/KEYMAP-LIVES-HERE 2> /dev/null`
     86    [ "$fname" = "" ] && return
     87    if which loadkeys > /dev/null 2> /dev/null ; then
     88        loadkeys $fname
    8989# loadkmap != loadkeys
    9090#    elif which loadkmap > /dev/null 2> /dev/null ; then
    9191#        loadkmap < $fname
    92     else
    93         LogIt "Using default keyboard map." 1
    94     fi
     92    else
     93        LogIt "Using default keyboard map." 1
     94    fi
    9595}
    9696
    9797
    9898UntarTapeStuff() {
    99     local old_pwd res
    100     old_pwd=`pwd`
    101     cd $GROOVY
    102     [ "$1" != "" ] && tapedev=$1
    103     [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg | tr -s ' ' ' ' | cut -d' ' -f2`
     99    local old_pwd res
     100    old_pwd=`pwd`
     101    cd $GROOVY
     102    [ "$1" != "" ] && tapedev=$1
     103    [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg | tr -s ' ' ' ' | cut -d' ' -f2`
    104104#    tar -zxf $tapedev
    105     dd if=$tapedev bs=32k count=1024 | tar -zx
    106     res=$?
    107     if [ "$res" -eq "0" ] ; then
     105    dd if=$tapedev bs=32k count=1024 | tar -zx
     106    res=$?
     107    if [ "$res" -eq "0" ] ; then
    108108        grep -v media-dev /tmp/mondo-restore.cfg > /tmp/mr.cfg
    109109        echo "media-dev $tapedev" >> /tmp/mr.cfg
    110         cp -f /tmp/mr.cfg /tmp/mondo-restore.cfg
    111     fi
    112     cd $old_pwd
    113     return $res
     110        cp -f /tmp/mr.cfg /tmp/mondo-restore.cfg
     111    fi
     112    cd $old_pwd
     113    return $res
    114114}
    115115
    116116HandleTape() {
    117     local res tapedev
    118     tapedev="" ; # will be set by UntarTapeStuff()
    119     cd $GROOVY
    120     UntarTapeStuff $tapedev || UntarTapeStuff /dev/st0 || UntarTapeStuff /dev/osst0 || UntarTapeStuff /dev/ht0
    121     res=$?
    122     while [ "$res" -ne "0" ] ; do
    123         LogIt "$tapedev failed to act as extended data disk for booting." 1
    124         LogIt "Please specify an alternate tape device," 1
    125         LogIt "or hit <Enter> to boot from CD/floppies." 1
    126         echo -en "---> "
    127         read tapedev
    128         if [ "$tapedev" ] ; then
    129             LogIt "User specified $tapedev instead"
    130             UntarTapeStuff $tapedev
    131             res=$?
    132         else
    133             LogIt "User opted not to specify an alternate tapedev"
    134             res=1
     117    local res tapedev
     118    tapedev="" ; # will be set by UntarTapeStuff()
     119    cd $GROOVY
     120    UntarTapeStuff $tapedev || UntarTapeStuff /dev/st0 || UntarTapeStuff /dev/osst0 || UntarTapeStuff /dev/ht0
     121    res=$?
     122    while [ "$res" -ne "0" ] ; do
     123        LogIt "$tapedev failed to act as extended data disk for booting." 1
     124        LogIt "Please specify an alternate tape device," 1
     125        LogIt "or hit <Enter> to boot from CD/floppies." 1
     126        echo -en "---> "
     127        read tapedev
     128        if [ "$tapedev" ] ; then
     129            LogIt "User specified $tapedev instead"
     130            UntarTapeStuff $tapedev
     131            res=$?
     132        else
     133            LogIt "User opted not to specify an alternate tapedev"
     134            res=1
    135135        break
    136         fi
    137     done
    138 
    139     if [ "$res" -ne "0" ] ; then
     136        fi
     137    done
     138
     139    if [ "$res" -ne "0" ] ; then
    140140        cd /
    141141        LogIt "Failed to use tape as extended datadisk. Reverting to floppies." 1
    142142        HandleCDROMorFloppies
    143143        res=$?
    144     else
     144    else
    145145#       clear
    146146        LogIt "Using tape as extended datadisk. Good." 3
    147147        echo "Using tape as extd ddisk." > /tmp/TAPEDEV-HAS-DATA-DISKS
    148148        res=0
    149         CD_MOUNTED_OK=yes
    150     fi
    151     return $res
     149        CD_MOUNTED_OK=yes
     150    fi
     151    return $res
    152152}
    153153
     
    155155
    156156HandleCDROMorFloppies() {
    157     find-and-mount-cdrom
    158     res=$?
    159     if [ "$res" -ne "0" ] ; then
     157    find-and-mount-cdrom
     158    res=$?
     159    if [ "$res" -ne "0" ] ; then
    160160        LogIt "First call to find-and-mount-cdrom failed." 1
    161161        LogIt "Sleeping for 3 seconds and trying again." 1
     
    163163        find-and-mount-cdrom
    164164        res=$?
    165     fi
    166     if [ "$res" -eq "0" ] ; then
     165    fi
     166    if [ "$res" -eq "0" ] ; then
    167167        LogIt "OK, I am running on a CD-ROM. Good." 3
    168         CD_MOUNTED_OK=yes
    169     elif [ "$res" -eq "1" ] ; then
     168        CD_MOUNTED_OK=yes
     169    elif [ "$res" -eq "1" ] ; then
    170170        LogIt "OK, I am running on floppies. Good." 3
    171171        CD_MOUNTED_OK=""
    172     else
     172    else
    173173        LogIt "OK, I am falling back to floppy mode." 3
    174         LogIt "That means you'll have to copy the data disk images from" 3
    175         LogIt "the CD/hard disk/whatever to physical 1.44MB disks and" 3
    176         LogIt "insert them, one after the other. Please see the manual." 3
    177         LogIt "The images are in /images on the CD, or /root/images/mindi" 3
    178         LogIt "on your hard disk. Your archives are probably fine but" 3
    179         LogIt "your tape streamer and/or CD-ROM drive are eccentric. :-)" 3
     174        LogIt "That means you'll have to copy the data disk images from" 3
     175        LogIt "the CD/hard disk/whatever to physical 1.44MB disks and" 3
     176        LogIt "insert them, one after the other. Please see the manual." 3
     177        LogIt "The images are in /images on the CD, or /root/images/mindi" 3
     178        LogIt "on your hard disk. Your archives are probably fine but" 3
     179        LogIt "your tape streamer and/or CD-ROM drive are eccentric. :-)" 3
    180180        CD_MOUNTED_OK=""
    181     fi
    182     return 0
     181    fi
     182    return 0
    183183}
    184184
     
    193193#   Load the VIA IDE module first thing if it exists (requires ide-core).
    194194#   This is to ensure that DMA is working for VIA chipsets with 2.6 kernels.
    195     for module in /ide-core.ko /via82cxxx.ko; do
    196         [ -f "$module" ] && MyInsmod $module > /dev/null 2> /dev/null
    197     done
     195    for module in /ide-core.ko /via82cxxx.ko; do
     196        [ -f "$module" ] && MyInsmod $module > /dev/null 2> /dev/null
     197    done
    198198#   Then load the remaining modules in normal (i.e. arbitrary) order.
    199     for j in 1 2 3 4 5 ; do
    200         for i in `ls /*.*o* 2> /dev/null` ; do
    201             [ -f "$i" ] && MyInsmod $i > /dev/null 2> /dev/null
    202         done
    203     done
     199    for j in 1 2 3 4 5 ; do
     200        for i in `ls /*.*o* 2> /dev/null` ; do
     201            [ -f "$i" ] && MyInsmod $i > /dev/null 2> /dev/null
     202        done
     203    done
    204204}
    205205
     
    207207
    208208PauseForRaids() {
    209     if [ "`dmesg | grep -i "RAID Controller"`" != "" ] || [ "`dmesg | grep -i "Vendor: 3ware"`" != "" ] ; then
    210         LogIt "RAID controller(s) detected. Pausing 10 seconds to let them warm up." 1
    211         echo -en "Pausing..."
    212         for i in 1 2 3 4 5 6 7 8 9 10 ; do
    213             sleep 1
    214             echo -en "$(($i*10))%..."
    215         done
    216         echo "Done."
    217     fi
     209    if [ "`dmesg | grep -i "RAID Controller"`" != "" ] || [ "`dmesg | grep -i "Vendor: 3ware"`" != "" ] ; then
     210        LogIt "RAID controller(s) detected. Pausing 10 seconds to let them warm up." 1
     211        echo -en "Pausing..."
     212        for i in 1 2 3 4 5 6 7 8 9 10 ; do
     213            sleep 1
     214            echo -en "$(($i*10))%..."
     215        done
     216        echo "Done."
     217    fi
    218218}
    219219
     
    224224#                config file path compiled into devfsd
    225225RunDevfsd() {
    226     loc=`which devfsd 2> /dev/null`
    227     if [ "$loc" != "" ] ; then
     226    loc=`which devfsd 2> /dev/null`
     227    if [ "$loc" != "" ] ; then
    228228    LogIt "Devfs found. Testing kernel support..."
    229229    if [ ! -e "/dev/.devfsd" ] ; then
    230230        mount -t devfs devfs /dev 2>> $LOGFILE
    231             if [ "$?" -ne "0" ] ; then
     231            if [ "$?" -ne "0" ] ; then
    232232        LogIt "Error while trying to mount devfs"
    233233        else
     
    249249        LogIt "No devfs kernel support."
    250250    fi
    251     fi
     251    fi
    252252}
    253253
     
    301301
    302302SpaceTests() {
    303     [ -e "/tmp/filelist.full" ] && cp /tmp/filelist.full /tmp/FLF
    304     if [ "`HowMuchFreeSpaceOnRamdisk`" -le "3" ] ; then
    305         LogIt "Ramdisk is a bit smaller than I would like." 1
    306         LogIt "Please re-run Mondo/Mindi but edit /usr/local/mindi first" 1
    307         LogIt "and set EXTRA_SPACE to something high, e.g. 8000" 1
    308         Die "Aborting. Please reboot."
    309     fi
    310     rm -f /tmp/FLF
     303    [ -e "/tmp/filelist.full" ] && cp /tmp/filelist.full /tmp/FLF
     304    if [ "`HowMuchFreeSpaceOnRamdisk`" -le "3" ] ; then
     305        LogIt "Ramdisk is a bit smaller than I would like." 1
     306        LogIt "Please re-run Mondo/Mindi but edit /usr/local/mindi first" 1
     307        LogIt "and set EXTRA_SPACE to something high, e.g. 8000" 1
     308        Die "Aborting. Please reboot."
     309    fi
     310    rm -f /tmp/FLF
    311311}
    312312
     
    314314
    315315StartLvms() {
    316     if [ -e "/tmp/i-want-my-lvm" ] ; then
    317         LogIt "Scanning LVM's..." 1
     316    if [ -e "/tmp/i-want-my-lvm" ] ; then
     317        LogIt "Scanning LVM's..." 1
    318318        if which lvm ; then
    319319            MyInsmod dm-mod
     
    323323            vgscan
    324324        fi
    325         grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed "s/^#[ ]*//" > /tmp/start-lvm
    326         chmod +x /tmp/start-lvm
    327         echo -en "Starting LVM's..."
    328         /tmp/start-lvm &
    329         for i in 1 2 3 4 5 ; do
     325        grep -E "^#.*vgchange" /tmp/i-want-my-lvm | sed "s/^#[ ]*//" > /tmp/start-lvm
     326        chmod +x /tmp/start-lvm
     327        echo -en "Starting LVM's..."
     328        /tmp/start-lvm &
     329        for i in 1 2 3 4 5 ; do
    330330            echo -en "."
    331331            sleep 1
    332         done
    333         echo "Done."
    334     fi
     332        done
     333        echo "Done."
     334    fi
    335335# If necessary, cannibalize 'analyze-my-lvm'; copy some of its code here,
    336336# pipe vgscan's output, strip it, run 'vgchange' on its output, etc.etc.
    337     LogIt "LVM's have been started."
     337    LogIt "LVM's have been started."
    338338}
    339339
    340340
    341341StartRaids() {
    342     local raid_devices i
    343 
    344     raid_devices=`grep /dev/md /tmp/mountlist.txt | cut -d' ' -f1`
     342    local raid_devices i
     343
     344    raid_devices=`grep /dev/md /tmp/mountlist.txt | cut -d' ' -f1`
    345345    if which raidstart > /dev/null 2> /dev/null ; then
    346         for i in $raid_devices ; do
    347             if grep `basename $i` /proc/mdstat > /dev/null 2> /dev/null ; then
    348                 LogIt "$i is started already; no need to run 'raidstart $i'" 1
    349             else
     346        for i in $raid_devices ; do
     347            if grep `basename $i` /proc/mdstat > /dev/null 2> /dev/null ; then
     348                LogIt "$i is started already; no need to run 'raidstart $i'" 1
     349            else
    350350                LogIt "Running 'raidstart $i'" 1
    351351                raidstart $i
    352             fi
    353         done
     352            fi
     353        done
    354354    elif which mdrun > /dev/null 2> /dev/null ; then
    355355        LogIt "Running 'mdrun'" 1
     
    358358        LogIt "Running 'mdadm'" 1
    359359        for i in $raid_devices ; do
    360             if grep `basename $i` /proc/mdstat > /dev/null 2> /dev/null ; then
    361                 LogIt "$i is started already; no need to run 'mdadm $i'" 1
    362             else
     360            if grep `basename $i` /proc/mdstat > /dev/null 2> /dev/null ; then
     361                LogIt "$i is started already; no need to run 'mdadm $i'" 1
     362            else
    363363                if [ -f /etc/mdadm.conf ] ; then
    364364                    LogIt "Running 'mdadm $i' with user supplied /etc/mdadm.conf" 1
     
    371371                    mdadm -Ac partitions -m dev $i
    372372                fi
    373             fi
    374         done
     373            fi
     374        done
    375375    else
    376376        LogIt "Warning: Neither 'raidstart' nor 'mdrun''found. RAID devices may not have started." 1
     
    381381
    382382TryAgainToFindCD() {
    383     local res
    384     mount | grep /mnt/cdrom && return 0
    385     [ "`grep "backup_media_type" /tmp/mondo-restore.cfg | grep "cdstream"`" ] && return
    386     LogIt "Trying to mount CD-ROM a 2nd time..."
    387     find-and-mount-cdrom --second-try
    388     res=$?
    389     if [ "$res" -eq "0" ] ; then
    390         CD_MOUNTED_OK=yes
    391         LogIt "CD-ROM drive mounted successfully." 1
    392     else
    393         LogIt "I still cannot find or mount the CD-ROM drive, by the way."
    394     fi
     383    local res
     384    mount | grep /mnt/cdrom && return 0
     385    [ "`grep "backup_media_type" /tmp/mondo-restore.cfg | grep "cdstream"`" ] && return
     386    LogIt "Trying to mount CD-ROM a 2nd time..."
     387    find-and-mount-cdrom --second-try
     388    res=$?
     389    if [ "$res" -eq "0" ] ; then
     390        CD_MOUNTED_OK=yes
     391        LogIt "CD-ROM drive mounted successfully." 1
     392    else
     393        LogIt "I still cannot find or mount the CD-ROM drive, by the way."
     394    fi
    395395}
    396396
     
    399399UseTmpfs()
    400400{
    401     local mount_cmd
    402     echo -en "Mounting /tmp/tmpfs..."
    403     mkdir -p /tmp/tmpfs
     401    local mount_cmd
     402    echo -en "Mounting /tmp/tmpfs..."
     403    mkdir -p /tmp/tmpfs
    404404# For technical reasons, some sets are as large as 16MB.
    405405# I am allowing 32MB because selective restore occupies a lot of space.
    406     for size in 64m 48m 40m 32m ; do
    407         mount_cmd="mount /dev/shm -t tmpfs -o size=$size" ; # was 34m until 04/2003
    408         LogIt "Trying '$mount_cmd'"
    409     $mount_cmd /tmp/tmpfs 2>> $LOGFILE
    410     res=$?
    411     [ "$res" -eq "0" ] && break
    412     done
    413     if [ "$res" -ne "0" ] ; then
    414         LogIt "Failed. I could not run '$mount_cmd /tmp/tmpfs'. Your kernel is BROKEN or you do not have enough RAM." 1
    415         umount /tmp/tmpfs > /dev/null 2> /dev/null
    416     rmdir /tmp/tmpfs
    417         ln -sf /mnt/RESTORING/tmp /tmp/tmpfs; # used by mondo-restore
    418     LogIt "Failed to mount /tmp/tmpfs; using ugly softlink instead"
    419     else
    420         LogIt "Great. Pivot succeeded w/ size=$size" 1
    421         echo -en "Pivoting /tmp..."
    422         umount /tmp/tmpfs
    423         mkdir -p /tmp.old
    424         mv -f /tmp/* /tmp.old/
    425         $mount_cmd /tmp
    426         mv /tmp.old/* /tmp/
    427         rmdir /tmp.old
    428         mkdir -p /tmp/tmpfs
    429         mkdir -p $GROOVY
     406    for size in 64m 48m 40m 32m ; do
     407        mount_cmd="mount /dev/shm -t tmpfs -o size=$size" ; # was 34m until 04/2003
     408        LogIt "Trying '$mount_cmd'"
     409        $mount_cmd /tmp/tmpfs 2>> $LOGFILE
     410        res=$?
     411        [ "$res" -eq "0" ] && break
     412    done
     413    if [ "$res" -ne "0" ] ; then
     414        LogIt "Failed. I could not run '$mount_cmd /tmp/tmpfs'. Your kernel is BROKEN or you do not have enough RAM." 1
     415        umount /tmp/tmpfs > /dev/null 2> /dev/null
     416        rmdir /tmp/tmpfs
     417        ln -sf /mnt/RESTORING/tmp /tmp/tmpfs; # used by mondo-restore
     418        LogIt "Failed to mount /tmp/tmpfs; using ugly softlink instead"
     419    else
     420        LogIt "Great. Pivot succeeded w/ size=$size" 1
     421        echo -en "Pivoting /tmp..."
     422        umount /tmp/tmpfs
     423        mkdir -p /tmp.old
     424        cp /tmp/* /tmp.old/
     425        rm -f /tmp/*
     426        $mount_cmd /tmp
     427        cp /tmp.old/* /tmp/
     428        rm -rf /tmp.old
     429        mkdir -p /tmp/tmpfs
     430        mkdir -p $GROOVY
    430431    echo "Done."
    431432    LogIt "Successfully mounted dynamic /tmp ramdisk"
     
    433434#        mv -f /var/log /tmp/tmpfs/var/log
    434435#        ln -sf /tmp/tmpfs/var/log /var/log
    435     fi
     436    fi
    436437}
    437438
     
    439440WelcomeMessage()
    440441{
    441     echo "********************************************************************"
    442     echo "MINDI-LINUX by Mondo Dev Team - web site: http://www.mondorescue.org"
    443     echo "Boot disk based on AlfaLinux & Trinux. BusyBox by Erik Andersen."
     442    echo "********************************************************************"
     443    echo "MINDI-LINUX by Mondo Dev Team - web site: http://www.mondorescue.org"
     444    echo "Boot disk based on AlfaLinux & Trinux. BusyBox by Erik Andersen."
    444445which petris > /dev/null 2> /dev/null && echo "Petris was written by Peter Seidler <p.seidler@mail1.stofanet.dk>."
    445     echo "Executables and source code are covered by the GNU GPL. No warranty."
    446     echo "running on $ARCH"
    447     echo "********************************************************************"
     446    echo "Executables and source code are covered by the GNU GPL. No warranty."
     447    echo "running on $ARCH"
     448    echo "********************************************************************"
    448449}
    449450
    450451
    451452EnableCcissIfAppropriate() {
    452     local i fname
    453     for i in 0 1 2 3 ; do
     453    local i fname
     454    for i in 0 1 2 3 ; do
    454455        fname="/proc/driver/cciss/cciss$i"
    455456        if [ -e "$fname" ] ; then
     
    458459            LogIt "...result=$?"
    459460        fi
    460     done
     461    done
    461462}
    462463
     
    489490[ ! "$GROOVY" ] && Die "I'm not groovy!"
    490491for i in $GROOVY /mnt/floppy /mnt/cdrom /mnt/isodir /var/local/petris /tmp/isodir; do
    491     mkdir -p $i
     492    mkdir -p $i
    492493done
    493494#/bin/update
     
    506507
    507508if [ -e "/tmp/USE-UDEV" ] ; then
    508     RunUdevd
     509    RunUdevd
    509510else
    510511    ExtractDevTarballs
     
    524525UseTmpfs
    525526if [ ! -e "/tmp/mondo-restore.cfg" ] ; then
    526     LogIt "Warning - /tmp/mondo-restore.cfg not found"
     527    LogIt "Warning - /tmp/mondo-restore.cfg not found"
    527528fi
    528529
    529530if [ "`grep -i 'tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev /tmp/mondo-restore.cfg`" ]; then
    530     HandleTape
     531    HandleTape
    531532    ExtractDataDisksAndLoadModules
    532533elif [ "`grep -i pxe /proc/cmdline`" ]; then
    533534    # We need to get here exported variables from start-nfs
    534     . /sbin/start-nfs
     535    . /sbin/start-nfs
    535536
    536537    # Simulate a local CD
    537538    echo "/mnt/cdrom" > /tmp/CDROM-LIVES-HERE
    538     CD_MOUNTED_OK=yes
     539    CD_MOUNTED_OK=yes
    539540    ExtractDataDisksAndLoadModules
    540541elif [ "`grep -i usb= /proc/cmdline`" ] || [ "`grep -i usb /tmp/mondo-restore.cfg | grep media-type`" ]; then
    541542    # We need to get here exported variables from start-nfs
    542     . /sbin/start-usb
     543    . /sbin/start-usb
    543544
    544545    # Simulate a local CD
    545546    echo "/mnt/cdrom" > /tmp/CDROM-LIVES-HERE
    546     CD_MOUNTED_OK=yes
     547    CD_MOUNTED_OK=yes
    547548    ExtractDataDisksAndLoadModules
    548549else
     
    550551    ExtractDataDisksAndLoadModules
    551552    # We need to get here exported variables from start-nfs
    552     . /sbin/start-nfs
     553    . /sbin/start-nfs
    553554fi
    554555res=$?
    555556ConfigureLoggingDaemons
    556557if [ -e "/tmp/USE-DEVFS" ] ; then
    557     umount /mnt/cdrom 2> /dev/null
    558     mv /dev/cdrom /cdrom.lnk 2> /dev/null
    559     CD_MOUNTED_OK=""
    560     RunDevfsd
     558    umount /mnt/cdrom 2> /dev/null
     559    mv /dev/cdrom /cdrom.lnk 2> /dev/null
     560    CD_MOUNTED_OK=""
     561    RunDevfsd
    561562fi
    562563echo "Starting potential Raid/LVMs ..."
     
    570571#clear
    571572if [ -e "/dev/md0" ] && [ ! -e "/dev/md/0" ] && [ "`grep /dev/md/ /tmp/mountlist.txt`" != "" ] ; then
    572     LogIt "Creating /dev/md/* softlinks just in case." 1
    573     mkdir -p /dev/md
    574     cp -af /dev/md0 /dev/md/0 2> /dev/null
    575     cp -af /dev/md1 /dev/md/1 2> /dev/null
    576     cp -af /dev/md2 /dev/md/2 2> /dev/null
     573    LogIt "Creating /dev/md/* softlinks just in case." 1
     574    mkdir -p /dev/md
     575    cp -af /dev/md0 /dev/md/0 2> /dev/null
     576    cp -af /dev/md1 /dev/md/1 2> /dev/null
     577    cp -af /dev/md2 /dev/md/2 2> /dev/null
    577578fi
    578579export ARCH=`uname -m`
     
    617618#ctrlaltdel soft
    618619for path in /usr.bin /usr/bin ; do
    619     fname=$path/nano
    620     [ -e "$fname" ] && ln -sf $fname /usr/bin/pico
     620    fname=$path/nano
     621    [ -e "$fname" ] && ln -sf $fname /usr/bin/pico
    621622done
    622623res=`which nano 2> /dev/null`
    623624[ "$res" ] && ln -sf /usr/bin/
    624625for i in null stdout stdin stderr ; do
    625     cp -af /dev/$i /tmp
     626    cp -af /dev/$i /tmp
    626627done
    627628if grep "backup-media-type" /tmp/mondo-restore.cfg > /dev/null 2> /dev/null ; then
    628     LogIt "backup-media-type is specified in config file - great."
    629     LogIt "Calling post-init $mountlist"
    630     post-init
     629    LogIt "backup-media-type is specified in config file - great."
     630    LogIt "Calling post-init $mountlist"
     631    post-init
    631632else
    632     LogIt "backup-media-type is not specified in config file."
    633     LogIt "I think this CD/floppy has no archives on it."
     633    LogIt "backup-media-type is not specified in config file."
     634    LogIt "I think this CD/floppy has no archives on it."
    634635fi
    635636if grep "RESTORE" /proc/cmdline > /dev/null 2> /dev/null ; then
Note: See TracChangeset for help on using the changeset viewer.