This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Stopping Wifi module loading from udev in rcS for 2.6.37 kernel?

Other Parts Discussed in Thread: DM385

Hi Guys,


As i'm working on DM385 IPNC RDK 3.5, i have to optimize kernel load modules after some initial application running, all the modules name which can be modprobe from etc/modules is removed so modutils.sh will load initially only necessary modules, i have removed wifi related/dependent modules to avoid loading at filesystem initialization but some how wifi module still loading at initial stage only. after putting some debug log in rcS run level script, wifi module is loading from S03udev, can anyone check and tell me how to avoid loading of wifi modules.

NOTE: R8.4 wl18xx wifi modules is builded from external source. merge into my filesystem.

i'm attaching S03udev file please have a look.

1488.S03udev.txt
#!/bin/sh -e

### BEGIN INIT INFO
# Provides:          udev
# Required-Start:    mountvirtfs
# Required-Stop:     
# Default-Start:     S
# Default-Stop:
# Short-Description: Start udevd, populate /dev and load drivers.
### END INIT INFO

export TZ=/etc/localtime

[ -d /sys/class ] || exit 1
[ -r /proc/mounts ] || exit 1
[ -x /sbin/udevd ] || exit 1
[ -f /etc/default/udev ] && . /etc/default/udev
[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf

kill_udevd() {
        if [ -x /sbin/pidof ]; then
                pid=`/sbin/pidof -x udevd`
                [ -n "$pid" ] && kill $pid
        fi
}

export ACTION=add
# propagate /dev from /sys
echo "Starting udev"

# mount the tmpfs on /dev, if not already done
LANG=C awk "\$2 == \"/dev\" && \$3 == \"tmpfs\" { exit 1 }" /proc/mounts && {
        mount -n -o mode=0755,size=1M,nr_inodes=8192 -t tmpfs none "/dev"
        mkdir -m 0755 /dev/pts
        mkdir -m 1777 /dev/shm
}

if [ "$DEVCACHE" != "" ]; then
	# Invalidate udev cache if the kernel or its bootargs/cmdline have changed
	[ -x /bin/uname ] && /bin/uname -mrspv > /tmp/uname || touch /tmp/uname
	[ -r /proc/cmdline ] && cat /proc/cmdline > /tmp/cmdline || touch /tmp/cmdline
	[ -r /proc/devices ] && cat /proc/devices > /tmp/devices || touch /tmp/devices
	[ -r /proc/atags ] && cat /proc/atags > /tmp/atags || touch /tmp/atags
	if [ -e $DEVCACHE ] && \
	   cmp -s /tmp/uname /etc/udev/saved.uname && \
	   cmp -s /tmp/cmdline /etc/udev/saved.cmdline && \
	   cmp -s /tmp/devices /etc/udev/saved.devices && \
	   cmp -s /tmp/atags /etc/udev/saved.atags; then
		(cd /; tar xf $DEVCACHE > /dev/null 2>&1)
		not_first_boot=1
	fi
fi

if [ ! -e "/lib/modules/$(uname -r)"/modules.dep ] ; then
	mkdir -p /lib/modules/$(uname -r)
	depmod -ae
fi

# make_extra_nodes
kill_udevd > "/dev/null" 2>&1

        # trigger the sorted events
        echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
        /sbin/udevd -d

        /sbin/udevadm control --env STARTUP=1
		if [ "$not_first_boot" != "" ];then
			/sbin/udevadm trigger --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus  --subsystem-nomatch=graphics  --subsystem-nomatch=backlight --subsystem-nomatch=video4linux  --subsystem-nomatch=platform
			(/sbin/udevadm settle --timeout=8; /sbin/udevadm control --env STARTUP=)&
		else
			/sbin/udevadm trigger
			/sbin/udevadm settle
		fi

exit 0

I believe udevadm trigger is starting the wifi module,

/sbin/udevadm trigger --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus  --subsystem-nomatch=graphics  --subsystem-nomatch=backlight --subsystem-nomatch=video4linux  --subsystem-nomatch=platform
                        (/sbin/udevadm settle --timeout=8; /sbin/udevadm control --env STARTUP=)&

to avoid udeveadm trigger to start wifi  i have added  --subsystem-nomatch=net   but it is of no use. can anyone suggest how to avoid udevadm triggering.

Thanks & regards,

Ganesh

   

  • Hi Ganesh,

    Do you mean that wl18xx.ko module is auto loaded and you want to remove this auto load procedure and load it manually?

    Where exactly your wl18xx.ko module is located in your rootfs? If you move this ko file in other place, I think the auto loading will fail with warning message and rest of the things will go forward.

    Can you check also rootfs/lib/modules/2.6.37/modules.dep file, what you have there?

    Regards,
    Pavel
  • Hi Pavel,

    Do you mean that wl18xx.ko module is auto loaded and you want to remove this auto load procedure and load it manually?

    yes i want to remove autoload.

    Where exactly your wl18xx.ko module is located in your rootfs? 
    If you move this ko file in other place, I think the auto loading 
    will fail with warning message and rest of the things will go forward.
    

    filesys/lib/modules/2.6.37_DM385_3.50.00/extra

    compat/      drivers/      net/

    i can't change wl18xx.ko path from extra as i have to modprobe also after my initial application runs.

    Can you check also rootfs/lib/modules/2.6.37/modules.dep file, what you have there?

    extra/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko: extra/compat/compat.ko
    
    extra/drivers/net/wireless/ti/wl18xx/wl18xx.ko: extra/drivers/net/wireless/ti/wlcore/wlcore.ko extra/net/mac80211/mac80211.ko extra/net/wireless/cfg80211.ko extra/compat/compat.ko kernel/net/ipv6/ipv6.ko
    
    extra/drivers/net/wireless/ti/wlcore/wlcore.ko: extra/net/mac80211/mac80211.ko extra/net/wireless/cfg80211.ko extra/compat/compat.ko kernel/net/ipv6/ipv6.ko
    
    extra/drivers/net/wireless/ti/wl12xx/wl12xx.ko: extra/drivers/net/wireless/ti/wlcore/wlcore.ko extra/net/mac80211/mac80211.ko extra/net/wireless/cfg80211.ko extra/compat/compat.ko kernel/net/ipv6/ipv6.ko
    
    extra/net/wireless/cfg80211.ko: extra/compat/compat.ko
    
    extra/net/mac80211/mac80211.ko: extra/net/wireless/cfg80211.ko extra/compat/compat.ko kernel/net/ipv6/ipv6.ko
    
    extra/compat/compat.ko:

  • Ganesh Biradar said:

    filesys/lib/modules/2.6.37_DM385_3.50.00/extra

    compat/      drivers/      net/

    i can't change wl18xx.ko path from extra as i have to modprobe also after my initial application runs.

    By default modprobe will look under /lib/modules/2.6.37/ to find kernel objects. Can you place the wl18xx.ko file in filesys/home/root/ and try with insmod?

    Ganesh Biradar said:
    extra/drivers/net/wireless/ti/wl18xx/wl18xx.ko

    If you remove this line from the modules.dep file, what is the result?

    Regards,
    Pavel

  • Hi Pavel,

    my problem is not loading, but rather how to avoid autoload. udevadm trigger is loading the modules.

    modutils.sh will look at etc/modules to modprobe automatically at filesystem initialization but as i have removed all modules name from etc/modules still wifi is loading where as other removed modules are loading when i want i.e after my application runs.

    regards,
    Ganesh
  • Ganesh,

    Ganesh Biradar said:
    my problem is not loading, but rather how to avoid autoload

    "i can't change wl18xx.ko path from extra as i have to modprobe also after my initial application runs."

    These two statements from you are in contradiction. You state that the problem is not loading, and at the same time you state that you have problem with loading!

    With the methods provided in my previous post (1 or 2) you should be able to avoid autoload. If no, please provide console log, thus I can see what exactly is the issue.

    1.  Remove ti81xx.ko from  /lib/modules/2.6.37/ and place it in /home/root/ - this should avoid autoload

    2.  Remove "extra/drivers/net/wireless/ti/wl18xx/wl18xx.ko" from modules.dep file - this should avoid autoload

    P.S. You do not need to make both, just one of these (1 or 2) should be enough.

    Regards,
    Pavel

  • HI Pavel,

    i will clarify your doubt,

    My requirement is: I have to load few loadable modules at start of file system and then need to run an application, once application fully run i have to load remaining loadable modules.

    remaining loadable module includes wl18xx.

    In etc/modules, i have listed out what are the modules need to load at file system initialization which can be done through modprobe(modutils.sh --> S45modutils) and later loadable module names are removed from etc/modules including wl18xx.

    But still wl18xx modules are loading at file system initialization, other modules which need to be load after application runs are loading properly.

    I can perform step 1 or 2 as you recommended but it is not a solution.

    what i want is why wl18xx is loading from S03udev?

    In rcS script, autoload of module has to be done by modprobe through modutils.sh(S45modutils) where as wl18xx is loading from S03udev.


    NOTE: To overcome above problem, I have done a workaround, the wl18xx module which are autoloading i made them backlist now all wl18xx and its dependent modules are not loading at filesystem initialization, once application running fully i'm modprobing the wl18xx. and wifi is working properly without any issue.

    still i need an answer for my question.

    Regards,
    Ganesh
  • Hi Ganesh,

    What makes you think wifi driver module is loaded from S03udev.sh ? It is not generally done that way. Can you check in /etc/udev/rules.d and check if there is any rule is defined to load wifi module(search specific word like wifi wl18xx etc). I am suspecting, you have not completely removed the wifi modules and other modules that depend on wl18xx.ko from your list. If that is not done, then it is bound that wl18xx.ko to be autoloaded. Check lsmod and see the depedency when wl18xx.ko is loaded.
  • Ginesh,

    Ganesh Biradar said:
    what i want is why wl18xx is loading from S03udev?

    I found that udev is used for wl18xx.ko loading, because udev is also responsible for wl81xx firmware download/loading. But more info you can get in the  WiLink™ WiFi + Bluetooth Forum

    Regards,
    Pavel

  • Hi Pavel,

    i will continue to look for answer in wifi forum, if i got an answer i will link that answer to these post.

    thanks & regards,

    Ganesh