Ok6410 Cannot uninstall the rmmod module.
This problem once made me very strange...
It can be seen that rmmod is useless, and that module is there... I used rmmod_by_eof and it will be okay ~
Method 1:
This development board's built-in file system's rmmod command does not work, with the help of bloger kindly, re-compile
# Include <stdio. h> # include <stdlib. h> # include <unistd. h> # include <fcntl. h> # include <string. h> # include <errno. h> int main (INT argc, char * argv []) {const char * modname = argv [1]; int ret =-1; int maxtry = 10; while (maxtry --> 0) {ret = delete_module (modname, o_nonblock | o_excl); // The system calls sys_delete_moduleif (Ret <0 & errno = eagain) usleep (500000 ); elsebreak;} If (Ret! = 0) printf ("unable to unload driver module \" % s \ ": % s \ n", modname, strerror (errno ));}
Use the arm-Linux-GCC cross-compilation tool to compile the program and place it on the Development Board to uninstall the module.
Method 2:
The root cause is that the zimage kernel module of ok6410 is in the permanent mode.
This problem was mentioned on a foreign website.
Even if the kernel can be detached from the. config file, it is useless. The module's internal source file must define a macro -- use_immediate at the beginning.
After the kernel in premanent mode loads the module, it is permanently loaded, and rmmod is not fixed. At this time, you need to add the use_immediate macro definition in the module's source file.
Demo:
#include <linux/module.h>#include <linux/init.h>#define USE_IMMEDIATEMODULE_LICENSE("Dual BSD/GPL");static int hello_init(void){printk(KERN_ALERT "defined Macro USE_IMMEDIATE\n");printk(KERN_ALERT "hello world!\n");return 0;}static void hello_exit(void){printk(KERN_ALERT "I am back.kernel in planet Linux!\n");}module_init(hello_init);module_exit(hello_exit);
The problem is that there will be an error in rmmod: module 'xx' not found, which is related to the implementation of rmmod ~
Try another busybox later. Now ~ Now, update the kernel later.
Ok6410 Cannot uninstall the rmmod module.