|
发表于 2022-8-15 15:37:14
只看该作者
7#
安装好了
我要安装一个 ch343 驱动,在insmod的时候一直报错:
insmode: ERROR: could not insert module ch343.ko ,Invalid module format
Makefile:
ifeq ($(KERNELRELEASE), )
KERNELDIR := /lib/modules/$(shell uname -r)/build
PWD :=$(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD)
clean:
rm -rf *.mk .tmp_versions Module.symvers *.mod.c *.o *.ko .*.cmd Module.markers modules.order
load:
insmod ch343.ko
unload:
rmmod ch343
install: default
mkdir -p /lib/modules/$(shell uname -r)/kernel/drivers/usb/serial/
cp -f ./ch343.ko /lib/modules/$(shell uname -r)/kernel/drivers/usb/serial/
depmod -a
uninstall:
rm -rf /lib/modules/$(shell uname -r)/kernel/drivers/usb/serial/ch343.ko
depmod -a
else
obj-m := ch343.o
endif
|
|