Changeset 287 in MondoRescue for branches/2.06


Ignore:
Timestamp:
Jan 6, 2006, 12:05:49 PM (18 years ago)
Author:
andree
Message:

Modified and streamlined init:

  • new function 'ExtractDataDisksAndLoadModules()' loads files from floppy or <n>.tar.gz images and subsequently loads modules to take advantage of the modules previously loaded
  • removed now unnecessary second general module loading phase which speeds booting up somewhat
  • start NFS only once all possible modules are loaded - for PXE this is immediately as beofre because everything is in the initrd, for ordinary NFS this is after the images and then the modules have been loaded

The long-term solution as disucssed on the mailing-list will probably be
to make the contents of mindi's 'NET_MODS' variable complete and
dynamic. Until this happens the above change will do.

File:
1 edited

Legend:

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

    r241 r287  
    582582
    583583
     584ExtractDataDisksAndLoadModules() {
     585    echo "Installing additional tools ..."
     586    install-additional-tools
     587    echo "Inserting modules ..."
     588    insert-all-my-modules > $LOGFILE 2> $LOGFILE
     589}
    584590
    585591# ------------------------ main -----------------------
     
    613619#-------------------------------
    614620UseTmpfs
    615 # Allows PXE boot by starting NFS earlier
    616 StartNfs
    617621if [ ! -e "/tmp/mondo-restore.cfg" ] ; then
    618622    LogIt "Warning - /tmp/mondo-restore.cfg not found"
     
    623627#el
    624628if [ "`grep -i 'tape ' /tmp/mondo-restore.cfg`" ] || [ "`grep -i udev /tmp/mondo-restore.cfg`" ] ; then
    625     HandleTape
     629        HandleTape
     630    ExtractDataDisksAndLoadModules
     631elif [ -e "/sbin/start-nfs" ] && [ "`grep -i pxe /proc/cmdline`" ]; then
     632    StartNfs
     633    imgname=`grep iso-prefix /tmp/mondo-restore.cfg | cut -d' ' -f2-`
     634    if [ "$imgname" = "" ]; then
     635        imgname="mondorescue"
     636    fi
     637    if [ "`grep -i prefix /proc/cmdline`" ] ; then
     638        for i in `cat /proc/cmdline` ; do
     639            if [ "`echo $i | grep -i prefix`" ] ; then
     640                imgname=`echo $i | cut -d'=' -f2`
     641            fi
     642        done
     643    fi
     644    dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg | cut -d' ' -f2-`
     645    if [ "$dirimg" = "" ]; then
     646        dirimg="/"
     647    fi
     648    LogIt "Mounting NFS image $imgname-1.iso in $dirimg on /mnt/cdrom in loopback"
     649    losetup /dev/loop7 /tmp/isodir/$dirimg/$imgname-1.iso
     650    mount -t iso9660 /dev/loop7 /mnt/cdrom
     651    # Simulate a local CD
     652    echo "/mnt/cdrom" > /tmp/CDROM-LIVES-HERE
     653        CD_MOUNTED_OK=yes
     654    ExtractDataDisksAndLoadModules
    626655else
     656    HandleCDROMorFloppies
     657    ExtractDataDisksAndLoadModules
    627658    if [ -e "/sbin/start-nfs" ]; then
    628         if [ "`grep -i pxe /proc/cmdline`" ]; then
    629             LogIt "PXE boot found"
    630         fi
    631         imgname=`grep iso-prefix /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    632         if [ "$imgname" = "" ]; then
    633             imgname="mondorescue"
    634         fi
    635         if [ "`grep -i prefix /proc/cmdline`" ] ; then
    636             for i in `cat /proc/cmdline` ; do
    637                 if [ "`echo $i | grep -i prefix`" ] ; then
    638                     imgname=`echo $i | cut -d'=' -f2`
    639                 fi
    640             done
    641         fi
    642         dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    643         if [ "$dirimg" = "" ]; then
    644             dirimg="/"
    645         fi
    646         LogIt "Mounting NFS image $imgname-1.iso in $dirimg on /mnt/cdrom in loopback"
    647         losetup /dev/loop7 /tmp/isodir/$dirimg/$imgname-1.iso
    648         mount -t iso9660 /dev/loop7 /mnt/cdrom
    649         # Simulate a local CD
    650         echo "/mnt/cdrom" > /tmp/CDROM-LIVES-HERE
    651         CD_MOUNTED_OK=yes
    652     else
    653             HandleCDROMorFloppies
     659        StartNfs
    654660    fi
    655661fi
    656662res=$?
    657 echo "Inserting modules ..."
    658 insert-all-my-modules > $LOGFILE 2> $LOGFILE
    659 echo "Installing additional tools ..."
    660 install-additional-tools
    661663SwapTheMountExecs
    662664ConfigureLoggingDaemons
    663 echo "Inserting modules again ..."
    664 insert-all-my-modules > $LOGFILE 2> $LOGFILE
    665665if [ -e "/tmp/USE-DEVFS" ] ; then
    666666    umount /mnt/cdrom 2> /dev/null
Note: See TracChangeset for help on using the changeset viewer.