我正在尝试为 Ubuntu 13.04 构建内核模块,但没有任何运气,这张卡与 12.10 和 3.5.0-27-generic 内核一起工作得很好,但自从升级到 13.04 后,没有任何新内核可以构建该模块。
# dkms build rr2680/1.9 -k 3.8.0-25-generic
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area....
make KERNELRELEASE=3.8.0-25-generic -C product/rr2680/linux/ KERNELDIR=/lib/modules/3.8.0-25-generic/build....(bad exit status: 2)
ERROR (dkms apport): binary package for rr2680: 1.9 not found
Error! Bad return status for module build on kernel: 3.8.0-25-generic (x86_64)
Consult /var/lib/dkms/rr2680/1.9/build/make.log for more information.
这是make.log:
DKMS make.log for rr2680-1.9 for kernel 3.8.0-25-generic (x86_64)
Fri Jun 14 22:09:56 CST 2013
grep: /lib/modules/3.8.0-25-generic/build/include/linux/version.h: No such file or directory
expr: syntax error
grep: /lib/modules/3.8.0-25-generic/build/include/linux/version.h: No such file or directory
expr: syntax error
make: Entering directory `/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux'
../../../inc/linux_32mpa/Makefile.def:87: *** Only kernel 2.4/2.6/3.x is supported but you use .. Stop.
make: Leaving directory `/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux'
我是如何在 12.10 中构建模块的: http://www.sudoseth.com/blog/2013/01/highpoint-raid-we-meet-again/
有人能指点一下吗?
第一个答案有点帮助,但并没有起到什么作用,我换了另一个答案,$(KERNELDIR)/include/linux/version.h
然后 $(KERNELDIR)/include/generated/uapi/linux/version.h
产生了这个错误:
DKMS make.log for rr2680-1.9 for kernel 3.8.0-26-generic (x86_64)
Mon Jul 8 14:55:11 CST 2013
make: Entering directory `/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux'
make[1]: Entering directory `/usr/src/linux-headers-3.8.0-26-generic'
CC [M] /var/lib/dkms/rr2680/1.9/build/product/rr2680/linux/.build/os_linux.o
CC [M] /var/lib/dkms/rr2680/1.9/build/product/rr2680/linux/.build/osm_linux.o
/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux/.build/osm_linux.c: In function ‘scsicmd_buf_get’:
/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux/.build/osm_linux.c:452:39: error: ‘KM_BIO_SRC_IRQ’ undeclared (first use in this function)
/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux/.build/osm_linux.c:452:39: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux/.build/osm_linux.c:452:2: error: too many arguments to function ‘kmap_atomic’
In file included from include/linux/pagemap.h:10:0,
from include/linux/blkdev.h:13,
from /var/lib/dkms/rr2680/1.9/build/osm/linux/osm_linux.h:61,
from /var/lib/dkms/rr2680/1.9/build/product/rr2680/linux/.build/osm_linux.c:6:
include/linux/highmem.h:66:21: note: declared here
/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux/.build/osm_linux.c: In function ‘scsicmd_buf_put’:
/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux/.build/osm_linux.c:482:55: error: macro "kunmap_atomic" passed 2 arguments, but takes just 1
/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux/.build/osm_linux.c:482:2: error: ‘kunmap_atomic’ undeclared (first use in this function)
make[2]: *** [/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux/.build/osm_linux.o] Error 1
make[1]: *** [_module_/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux/.build] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-26-generic'
make: *** [rr2680.ko] Error 2
make: Leaving directory `/var/lib/dkms/rr2680/1.9/build/product/rr2680/linux'
干杯!
答案1
您可以在这里找到答案: http://ubuntuforums.org/showthread.php?t=2158769&p=12746043 简而言之,您需要删除传递给“kmap_atomic”的第二个参数。这些都是常量“HPT_KMAP_TYPE”。该函数在 osm_linux.c 和 os_linux.c 中调用,HPT_KMAP_TYPE 在 osm_linux.h 中定义,也可以删除。
答案2
我的 rr2320 也遇到了同样的问题!文件的位置似乎version.h
已经改变。但将 中的那行更改Makefile
为新位置 ( /lib/modules/3.8.0-25-generic/build/include/generated/uapi/linux/version.h
) 并不能解决问题。
找到我的问题的解决方案!请看这里: 更新了 Highpoint RocketRAID 2230 补丁。