cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
3,239 Views
Registered: ‎10-11-2011

Microblaze LE rmmod problem

Jump to solution

I'm developing a loadable i2c protocol driver for a device, and testing it in Microblaze Linux running on the Digilent Atlys board.  My system uses AXI so I'm using the initramfs_minimal_le.cpio.gz filesystem located on the Xilinx Wiki (from the microblaze v2.0 tools).

 

I'm able to instantiate my module with insmod, and it shows in lsmod with a major and minor number.  However, when I go to remove it, I get the following error:

rmmod: chdir(/lib/modules): No such file or directory

Understandably that directory doesn't exist in the filesystem from the initramfs.  I found an older solution here, but it doesn't work for my system.  Instead I get this error:

 

rmmod: chdir(3.0.0-01299-g684dabf-dirty): No such file or directory

So instead I tried creating the directory /lib/modules/3.0.0, but I still received the same error.  The module is still present in the lsmod output after both cases.

 

I'm not sure what's going on here.  It seems like the folders rmmod uses are missing from the filesystem, but I don't know enough about the inner workings of rmmod to determine what it's trying to do that's causing the problem.  The second rmmod error I received looks like it's listing a kernel version folder, but I'm not sure where it's looking to try and find it.  I'm pretty certain the problem isn't related to my driver code, because I get the same error when I comment out everything except the module's init and exit functions.

 

Does anyone have any suggestions for a solution to this problem?  Thanks in advance.

 

UPDATE : I ended up adding the directory 3.0.0-01299.... under /lib/modules, and the module's exit function does get called and the module is removed from lsmod.  I still get the message "rmmod: module 'module name' not found" after the exit function runs its course, but I figure that may be related to my code not having anything of substance, so the problem is solved for now.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
3,963 Views
Registered: ‎10-11-2011

I found a little more "permanent" solution than the one I listed in the update to my original post (creating the folder /lib/modules/3.0.0-01299-blahblah), and it's similar to the solution fk5747 posted.

 

I extracted the initramfs_minimal_le.cpio.gz archive, and in the filesystem, created the folder /lib/modules/3.0.0+ (the '+' needs to be in the name), then rebuilt the archive.  Then in the Linux configuration, under General Setup, I turned off "Automatically append version information to the version string."

 

If the version information is left in the string, each time the kernel is rebuilt, the folder in the filesystem at /lib/modules has to be updated to the new version (for example, 3.0.0-01293-blahblah), whether manually after boot or inside the initramfs archive.  This solution prevents having to update the folder each time, which makes things a bit faster when having to rebuild the kernel.

 

I still get the "rmmod: module 'module name' not found" message when I remove the module, but it still seems to be performing the exit and remove functions so it doesn't seem to be a problem.

View solution in original post

0 Kudos
2 Replies
Highlighted
Anonymous
Not applicable
3,223 Views

hi

I had this error before and makind the /lib/modules/3.0.0 solved my problem. I also have this error "rmmod: module 'whatever' not found" whenever I remove my module but I think it's not important to consider.

0 Kudos
Highlighted
Adventurer
Adventurer
3,964 Views
Registered: ‎10-11-2011

I found a little more "permanent" solution than the one I listed in the update to my original post (creating the folder /lib/modules/3.0.0-01299-blahblah), and it's similar to the solution fk5747 posted.

 

I extracted the initramfs_minimal_le.cpio.gz archive, and in the filesystem, created the folder /lib/modules/3.0.0+ (the '+' needs to be in the name), then rebuilt the archive.  Then in the Linux configuration, under General Setup, I turned off "Automatically append version information to the version string."

 

If the version information is left in the string, each time the kernel is rebuilt, the folder in the filesystem at /lib/modules has to be updated to the new version (for example, 3.0.0-01293-blahblah), whether manually after boot or inside the initramfs archive.  This solution prevents having to update the folder each time, which makes things a bit faster when having to rebuild the kernel.

 

I still get the "rmmod: module 'module name' not found" message when I remove the module, but it still seems to be performing the exit and remove functions so it doesn't seem to be a problem.

View solution in original post

0 Kudos