LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I swap kernel modules ?? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-swap-kernel-modules-377816/)

ozymandias 10-28-2005 01:51 PM

How do I swap kernel modules ??
 
I have written a (very) simple script to swap two sets of driver modules for my wireless card. One set allows promioscusous mode (foruse with Kismet etc.) the other does not (as required by xsupplicant).
Once the new drivers have been copied to /lib/modules/etc etc I have to reboot to allow the changes to take effect.
Is there an elegant way to do this? Should I be looking to modprobe -r the driver modules, then reinsert the new ones, or is there some command to reload all modules?
Will the kernel take this sort of abuse, or is it the equivalent of having the carpet pulled out from under it?!

Tino27 10-28-2005 02:16 PM

That all depends on whether module unloading has been compiled into your kernel. I have unloaded kernel modules before without too many ill effects. It probably also depends on the frequency with which you will be switching modules. Once a day vs. once every fifteen minutes could be a HUGE difference.

ozymandias 10-28-2005 02:49 PM

I'm using Debian 2.6.12 kernel (should have said, sorry)

The changes wouldn't be too often...

Tino27 10-28-2005 03:39 PM

Is it a kernel you compiled yourself or is it a stock Debian kernel?

Actually, you'll know if your kernel supports unloading by trying to remove a module using "rmmod" and then the kernel module name. If it fails (assuming you actually specified a module that was loaded :)), then perhaps your kernel doesn't support it as is.

ozymandias 10-28-2005 05:17 PM

When I try to use rmmod orinoco or rmmod orinoco_cs (the modules for my wireless driver) i'm told they're in use. How do I stop them and replace them is the question (without rebooting)!

Oz.

ozymandias 10-28-2005 05:19 PM

Oh yes, and it's a standard install Debian kernel (being a newbie I'm not up to compiling my own, just yet!!)

Tino27 10-28-2005 09:46 PM

Now you've reached my limit for helping you since you are using Debian. In Slack, you would issue a

#/etc/rc.d/rc.pcmcia stop

command. This would stop the PCMCIA card and then I would imagine you could unload the appropriate modules. I'm not sure how to tell the PCMCIA system to stop in Debian. Perhaps Google can help you out here.


All times are GMT -5. The time now is 07:17 AM.