Changeset 1830 for branches/2.2.5


Ignore:
Timestamp:
Dec 2, 2007, 12:24:17 AM (12 years ago)
Author:
bruno
Message:
  • start-nfs should NOT do exit => kernel panix as init exits

-some other fixes for init on denymods

Location:
branches/2.2.5/mindi/rootfs/sbin
Files:
2 edited

Legend:

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

    r1829 r1830  
    157157HandleCDROMorFloppies() {
    158158    # Just in case we have an iLO ensure we will map it correctly
    159     grep -q "usb-storage " $DENY_MODS
     159    echo "$DENY_MODS" | grep -q "usb-storage "
    160160    if [ $? -eq 0 ]; then
    161161        return
     
    393393# Prepare minimal USB env in case we have USB kbd such as with iLO
    394394[ -d /proc/bus/usb ] && ! grep -q /proc/bus/usb /proc/mounts && mount -t usbfs none /proc/bus/usb
    395 grep -Eq 'uhcd_hci |usbhid |usbcore ' $DENY_MODS
     395echo "$DENY_MODS" | grep -Eq 'uhcd_hci |usbhid |usbcore '
    396396if [ $? -eq 0 ]; then
    397397    return
     
    576576    for m in `find /lib/modules -name '*.ko*'`; do
    577577        j=`basename $m | sed 's/\.ko.*$//'`
    578         grep -q '$j ' $DENY_MODS
     578        echo "$DENY_MODS" | grep -q "$j "
    579579        if [ $? -eq 0 ]; then
     580            echo "Denying $j..."
    580581            continue
    581582        fi
     
    594595        echo "Inserting modules ..."
    595596        insert-all-my-modules >> $LOGFILE 2>> $LOGFILE
    596         for i in $FORCE_MODS do;
     597        for i in $FORCE_MODS; do
    597598            MyInsmod $i
    598599        done
     
    631632if [ "`grep -i denymods /proc/cmdline`" ]; then
    632633    export DENY_MODS="`cat /proc/cmdline | sed 's~.*denymods=\"\(.*\)\".*~\1~'` mondonone"
     634else
     635    export DENY_MODS=" "
    633636fi
    634637
    635638if [ "`grep -i forcemods /proc/cmdline`" ]; then
    636639    export FORCE_MODS="`cat /proc/cmdline | sed 's~.*forcemods=\"\(.*\)\".*~\1~'` mondonone"
     640else
     641    export FORCE_MODS=" "
    637642fi
    638643
  • branches/2.2.5/mindi/rootfs/sbin/start-nfs

    r1754 r1830  
    3535done
    3636
    37 if [ "$ipdev" = "" ] && [ "$ipconf" = "" ]; then
    38     # No network configuration neither stored during archive
    39     # nor on cmdline so no network wanted => exiting
    40     exit 0
    41 else
     37if [ "$ipdev" != "" ] || [ "$ipconf" != "" ]; then
     38    # Network configuration stored during archive
     39    # or on cmdline so network wanted => starting it
    4240    LogIt "Starting Network..."
     41
     42    # Activate loobback
     43    ifconfig lo 127.0.0.1
     44
     45    echo "$ipconf" | grep -q "dhcp"
     46    if [ $? -eq 0 ]; then
     47        ipdev=`echo $ipconf | cut -d: -f1`
     48        LogIt "Making DHCP request on $ipdev"
     49        udhcpc -i $ipdev
     50    else
     51        if [ "$ipconf" != "" ]; then
     52            ipdev=`echo $ipconf | cut -d: -f1`
     53            ipaddress=`echo $ipconf | cut -d: -f2`
     54            ipnetmask=`echo $ipconf | cut -d: -f3`
     55            ipbroadcast=`echo $ipconf | cut -d: -f4`
     56            ipgateway=`echo $ipconf | cut -d: -f5`
     57        fi
     58        LogIt "Configuring $ipdev statically ($ipaddress/$ipnetmask)"
     59        ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast $ipbroadcast
     60        route add default gw $ipgateway
     61    fi
     62
     63    # ping server helps waking interface up
     64    LogIt "Pinging NFS server..."
     65    nfs_server_ipaddr=`echo $nfsmount | cut -d: -f1`
     66    ping -c $ipcount $nfs_server_ipaddr
     67
     68    # Finally mounts the NFS share
     69    LogIt "Mounting NFS share ($nfsmount) on /tmp/isodir..."
     70    mount -t nfs -o nolock $nfsmount /tmp/isodir
     71   
     72    LogIt "Mounting NFS image ${imgname}-1.iso in $dirimg on /mnt/cdrom in loopback"
     73    mount -o ro -t iso9660 /tmp/isodir/$dirimg/${imgname}-1.iso /mnt/cdrom
    4374fi
    44 
    45 # Activate loobback
    46 ifconfig lo 127.0.0.1
    47 
    48 echo "$ipconf" | grep -q "dhcp"
    49 if [ $? -eq 0 ]; then
    50     ipdev=`echo $ipconf | cut -d: -f1`
    51     LogIt "Making DHCP request on $ipdev"
    52     udhcpc -i $ipdev
    53 else
    54     if [ "$ipconf" != "" ]; then
    55         ipdev=`echo $ipconf | cut -d: -f1`
    56         ipaddress=`echo $ipconf | cut -d: -f2`
    57         ipnetmask=`echo $ipconf | cut -d: -f3`
    58         ipbroadcast=`echo $ipconf | cut -d: -f4`
    59         ipgateway=`echo $ipconf | cut -d: -f5`
    60     fi
    61     LogIt "Configuring $ipdev statically ($ipaddress/$ipnetmask)"
    62     ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast $ipbroadcast
    63     route add default gw $ipgateway
    64 fi
    65 
    66 # ping server helps waking interface up
    67 LogIt "Pinging NFS server..."
    68 nfs_server_ipaddr=`echo $nfsmount | cut -d: -f1`
    69 ping -c $ipcount $nfs_server_ipaddr
    70 
    71 # Finally mounts the NFS share
    72 LogIt "Mounting NFS share ($nfsmount) on /tmp/isodir..."
    73 mount -t nfs -o nolock $nfsmount /tmp/isodir
    74 
    75 LogIt "Mounting NFS image ${imgname}-1.iso in $dirimg on /mnt/cdrom in loopback"
    76 mount -o ro -t iso9660 /tmp/isodir/$dirimg/${imgname}-1.iso /mnt/cdrom
Note: See TracChangeset for help on using the changeset viewer.