Changeset 1829 for branches/2.2.5


Ignore:
Timestamp:
Dec 1, 2007, 10:44:48 PM (12 years ago)
Author:
bruno
Message:

Adds boot options denymods (for udev) and forcemods (if not udev)

File:
1 edited

Legend:

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

    r1826 r1829  
    157157HandleCDROMorFloppies() {
    158158    # Just in case we have an iLO ensure we will map it correctly
     159    grep -q "usb-storage " $DENY_MODS
     160    if [ $? -eq 0 ]; then
     161        return
     162    fi
    159163    echo "Activating a potential USB Storage device"
    160     if [ -e "/tmp/USE-UDEV" ] ; then
    161         if [ -f usb-storage.ko ] || [ -f usb-storage.ko.gz ]; then
     164    if [ -f usb-storage.ko ] || [ -f usb-storage.ko.gz ]; then
     165        if [ -e "/tmp/USE-UDEV" ] ; then
    162166            modprobe -q usb-storage
    163         fi
    164     else
    165         if [ -f usb-storage.ko ] || [ -f usb-storage.ko.gz ]; then
     167        else
    166168            insmod usb-storage.ko*
    167169        fi
     
    391393# Prepare minimal USB env in case we have USB kbd such as with iLO
    392394[ -d /proc/bus/usb ] && ! grep -q /proc/bus/usb /proc/mounts && mount -t usbfs none /proc/bus/usb
     395grep -Eq 'uhcd_hci |usbhid |usbcore ' $DENY_MODS
     396if [ $? -eq 0 ]; then
     397    return
     398fi
    393399if [ -e "/tmp/USE-UDEV" ] ; then
    394400    if [ -f uhcd_hci.ko ] || [ -f uhcd_hci.ko.gz ]; then
     
    570576    for m in `find /lib/modules -name '*.ko*'`; do
    571577        j=`basename $m | sed 's/\.ko.*$//'`
     578        grep -q '$j ' $DENY_MODS
     579        if [ $? -eq 0 ]; then
     580            continue
     581        fi
     582        echo "Probing $j..."
    572583        modprobe -q $j
    573584    done
     
    583594        echo "Inserting modules ..."
    584595        insert-all-my-modules >> $LOGFILE 2>> $LOGFILE
     596        for i in $FORCE_MODS do;
     597            MyInsmod $i
     598        done
    585599    else
    586600        ModprobeAllModules
     
    614628[ -d /proc/vmware ] && ! grep -q /vmfs /proc/mounts && mount -t vmfs /vmfs /vmfs
    615629rm -f /foozero
     630
     631if [ "`grep -i denymods /proc/cmdline`" ]; then
     632    export DENY_MODS="`cat /proc/cmdline | sed 's~.*denymods=\"\(.*\)\".*~\1~'` mondonone"
     633fi
     634
     635if [ "`grep -i forcemods /proc/cmdline`" ]; then
     636    export FORCE_MODS="`cat /proc/cmdline | sed 's~.*forcemods=\"\(.*\)\".*~\1~'` mondonone"
     637fi
    616638
    617639echo "Activating a potential USB keyboard/mouse"
Note: See TracChangeset for help on using the changeset viewer.