Ubuntu18.04配置livesuit环境时报错insmod: ERROR: could not insert module awusb.ko: Invalid module format
-
如题
linxiaoyan@WP:~/sunxi-livesuite-master$ cd awusb/ linxiaoyan@WP:~/sunxi-livesuite-master/awusb$ ls awusb.c awusb.mod awusb.mod.o dkms.conf modules.order awusb.ko awusb.mod.c awusb.o Makefile Module.symvers linxiaoyan@WP:~/sunxi-livesuite-master/awusb$ sudo insmod awusb.ko [sudo] linxiaoyan 的密码: insmod: ERROR: could not insert module awusb.ko: Invalid module format linxiaoyan@WP:~/sunxi-livesuite-master/awusb$
-
@ary_ye
一般是linux kernel header 版本跟你正在使用的kernel 版本不同
用 modinfo 檢查編譯出來的 awusb.ko -
linxiaoyan@WP:~/sunxi-livesuite-master/awusb$ modinfo ./awusb.ko filename: /home/linxiaoyan/sunxi-livesuite-master/awusb/./awusb.ko license: GPL description: AW USB driver author: Jojo srcversion: E085DDDF9EB284306C544FA alias: usb:v1F3ApEFE8d*dc*dsc*dp*ic*isc*ip*in* depends: retpoline: Y name: awusb vermagic: 5.15.0-41-generic SMP mod_unload modversions linxiaoyan@WP:~/sunxi-livesuite-master/awusb$ uname -r 5.15.0-41-generic linxiaoyan@WP:~/sunxi-livesuite-master/awusb$ sudo insmod ./awusb.ko [sudo] linxiaoyan 的密码: insmod: ERROR: could not insert module ./awusb.ko: Invalid module format linxiaoyan@WP:~/sunxi-livesuite-master/awusb$
内核版本对的上,livesuit上说重新安装dkms我也照做了,还是用不了,奇怪了
-
@ary_ye 在 Ubuntu18.04配置livesuit环境时报错insmod: ERROR: could not insert module awusb.ko: Invalid module format 中说:
linxiaoyan@WP:~/sunxi-livesuite-master/awusb$ modinfo ./awusb.ko filename: /home/linxiaoyan/sunxi-livesuite-master/awusb/./awusb.ko license: GPL description: AW USB driver author: Jojo srcversion: E085DDDF9EB284306C544FA alias: usb:v1F3ApEFE8d*dc*dsc*dp*ic*isc*ip*in* depends: retpoline: Y name: awusb vermagic: 5.15.0-41-generic SMP mod_unload modversions linxiaoyan@WP:~/sunxi-livesuite-master/awusb$ uname -r 5.15.0-41-generic linxiaoyan@WP:~/sunxi-livesuite-master/awusb$ sudo insmod ./awusb.ko [sudo] linxiaoyan 的密码: insmod: ERROR: could not insert module ./awusb.ko: Invalid module format linxiaoyan@WP:~/sunxi-livesuite-master/awusb$
内核版本对的上,livesuit上说重新安装dkms我也照做了,还是用不了,奇怪了
這樣我就也搞不懂了,我遇過的是版本對不上,livesuit 上的Makefile & dkms.conf 有問題
當系統kernel 升級的時候,它dkms 可能在前一個版本執行,uname -r 會有問題
要修改,我回答你問題的時候就發現我用5.15.0-116-generic 但是它會變成用5.15.0-113-generic
重新編譯才正常
你的系統有沒有開Secure Boot? 有的話只能用dkms 去編譯跟簽名
下面是我改過得 Makefile & dkms.conf
Makefilecode_text obj-m := awusb.o KDIR ?= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: $(MAKE) -C $(KDIR) M=$(PWD) modules clean: $(MAKE) -C $(KDIR) M=$(PWD) clean rm -rf Module.markers module.order module.sysvers
dkms.conf
code_text PACKAGE_NAME="awdev" PACKAGE_VERSION="0.5" CLEAN="make clean" MAKE[0]="make default KERNELVERSION=$kernelver KDIR=/lib/modules/$kernelver/build" BUILT_MODULE_NAME[0]="awusb" DEST_MODULE_LOCATION[0]="/updates" AUTOINSTALL="yes"
-
@kunyi 好的,谢谢你的帮助。
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号