linux设备安装模块后,无法卸载,显示找不到目录 ,网上查了好多资料,都是创建/lib/modules,但是我发现我的设备是有这个目录的,还是不行,那就继续创建了,在/lib/modules目录下创建响应的目录即可
[root@xxx/home]# insmod helloworld.ko
HELLO WORLD enter!
[root@xxx /home]# rmmod helloworld.ko
rmmod: can't change directory to '3.18.0+': No such file or directory
[root@xxx /home]# ls /lib/modules
4.15.8
安装驱动模块后,卸载该模块时,linux提示没有/lib/modules目录或者3.18.0+
解决方法:没有该目录,则创建它
[root@xxx /home]#mkdir /lib/modules/$(uname -r)
[root@xxx /home]#ls /lib/modules/
3.18.0+ 4.15.8
再卸载就可以了。
[root@xxx /home]# rmmod helloworld.ko
HELLO WORLD exit!