Ok6410 Cannot uninstall the rmmod module.

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.