Ignore:
Timestamp:
Apr 17, 2008, 12:32:36 PM (12 years ago)
Author:
Bruno Cornec
Message:
  • MakeModuleLoadingScript? (mindi), MyInsmod?, InsertEssentialModules? (init) removed
  • Simplification of modules handling when not using udev, which makes code cleaner and more common with the udev code.
  • Usage of modprobe systematically.
  • Do not mess with modules.conf anymore. Just use what is in deplist.txt
Location:
branches/2.2.6/mindi/rootfs
Files:
2 deleted
1 edited

Legend:

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

    r1910 r1922  
    7979    openvt 7 /bin/sh /sbin/wait-for-petris
    8080    openvt 8 /usr/bin/tail -f $LOGFILE
     81    # May avoid shell error messages
     82    chmod 666 /dev/tty* /dev/console
    8183}
    8284
     
    162164    fi
    163165    echo "Activating a potential USB Storage device"
    164     if [ -f usb-storage.ko ] || [ -f usb-storage.ko.gz ]; then
    165         if [ -e "/tmp/USE-UDEV" ] ; then
    166             modprobe -q usb-storage
    167         else
    168             insmod usb-storage.ko*
    169         fi
    170     fi
     166    modprobe -q usb-storage
    171167    for i in 1 2 3 4 5 6 7 8 9 10 ; do
    172168        sleep 1
     
    199195HowMuchFreeSpaceOnRamdisk() {
    200196   df -m -P | grep /dev/ram | head -n1 | tr -s '\t' ' ' | cut -d' ' -f4
    201 }
    202 
    203 
    204 
    205 InsertEssentialModules() {
    206 #   Load the VIA IDE module first thing if it exists (requires ide-core).
    207 #   This is to ensure that DMA is working for VIA chipsets with 2.6 kernels.
    208     for module in /ide-core.ko* /via82cxxx.ko*; do
    209         [ -f "$module" ] && MyInsmod $module > /dev/null 2> /dev/null
    210     done
    211 #   Then load the remaining modules in normal (i.e. arbitrary) order.
    212     for j in 1 2 3 4 5 ; do
    213         for i in `ls /*.*o* 2> /dev/null` ; do
    214             [ -f "$i" ] && MyInsmod $i > /dev/null 2> /dev/null
    215         done
    216     done
    217197}
    218198
     
    314294    fi
    315295    create_dev_makedev
    316     # May avoid shell error messages
    317     chmod 644 /dev/tty*
    318296    if [ -x /sbin/udevsettle ]; then
    319297        /sbin/udevsettle
     
    389367    return
    390368fi
    391 if [ -e "/tmp/USE-UDEV" ] ; then
    392     if [ -f uhcd_hci.ko ] || [ -f uhcd_hci.ko.gz ]; then
    393         modprobe -q uhcd_hci
    394     fi
    395     if [ -f usbhid.ko ] || [ -f usbhid.ko.gz ]; then
    396         modprobe -q usbhid
    397     fi
    398 else
    399     if [ -f uhcd_hci.ko ]; then
    400         insmod uhcd_hci.ko
    401     fi
    402     if [ -f usbhid.ko ]; then
    403         insmod usbcore.ko
    404         insmod usbhid.ko
    405     fi
    406 fi
     369modprobe -q uhcd_hci
     370modprobe -q usbhid
    407371}
    408372
     
    413377        LogIt "Scanning LVM's..." 1
    414378        if which lvm ; then
    415             MyInsmod dm-mod
    416             MyInsmod dm_mod
     379            modprobe -q dm-mod
     380            modprobe -q dm_mod
    417381            lvm vgscan --mknodes
    418382        else
     
    566530ModprobeAllModules() {
    567531
    568     for m in `find /lib/modules -name '*.ko*'`; do
     532    for m in `find /lib/modules -name '*\.ko*' -o -name '*\.o*'`; do
    569533        j=`basename $m | sed 's/\.ko.*$//'`
     534        j=`basename $m | sed 's/\.o.*$//'`
    570535        echo "$DENY_MODS" | grep -q "$j "
    571536        if [ $? -eq 0 ]; then
     
    584549    PKLVL=`cut -f1 /proc/sys/kernel/printk`
    585550    echo 0 > /proc/sys/kernel/printk
    586     if [ ! -e "/tmp/USE-UDEV" ] ; then
    587         echo "Inserting modules ..."
    588         insert-all-my-modules >> $LOGFILE 2>> $LOGFILE
    589         for i in $FORCE_MODS; do
    590             MyInsmod $i
    591         done
    592     else
    593         ModprobeAllModules
    594     fi
     551    ModprobeAllModules
    595552    echo $PKLVL > /proc/sys/kernel/printk
    596553}
     
    654611PKLVL=`cut -f1 /proc/sys/kernel/printk`
    655612echo 0 > /proc/sys/kernel/printk
    656 if [ ! -e "/tmp/USE-UDEV" ] ; then
    657     InsertEssentialModules
    658 else
    659     ModprobeAllModules
    660 fi
     613ModprobeAllModules
    661614echo $PKLVL > /proc/sys/kernel/printk
    662615
Note: See TracChangeset for help on using the changeset viewer.