+ -
当前位置:首页 → 问答吧 → linux2.6.38的linux/arch/mach-s3c2410目录下怎么没有cpu.c文件啊?

linux2.6.38的linux/arch/mach-s3c2410目录下怎么没有cpu.c文件啊?

时间:2011-11-10

来源:互联网

最近编译了一遍内核,但是碰到关于版本不匹配的问题:
首先,
uname -r: 2.6.31-14-generic
apt-get install linux-source-2.6.31, 得到一个压缩包linux-source-2.6.31.tar.bz2
解压以后进去
make oldconfig
make
生成vmlinux
但是,在/libs/modules/下生成了一个2.6.31.12的目录,同时也有一个2.6.31-14-generic的目录

root@jarvis-laptop:/lib/modules# ls -l
total 12
drwxr-xr-x 3 root root 4096 2011-11-09 11:30 2.6.31.12
drwxr-xr-x 5 root root 4096 2010-08-02 10:51 2.6.31-14-generic
drwxr-xr-x 2 root root 4096 2010-08-02 18:18 2.6.31-22-generic

第一个应该是我编译内核生成的,后面两个是原来就有的. 其中第一个中的build目录link到内核代码的目录.
root@jarvis-laptop:/lib/modules# ls -l 2.6.31.12/build
lrwxrwxrwx 1 root root 28 2011-11-09 11:08 2.6.31.12/build -> /usr/src/linux-source-2.6.31
root@jarvis-laptop:/lib/modules# ls -l 2.6.31-14-generic/build
lrwxrwxrwx 1 root root 40 2010-07-24 12:22 2.6.31-14-generic/build -> /usr/src/linux-headers-2.6.31-14-generic

这样,当我编译我自己写的模块的时候,-C如果指定目录/libs/modules/2.6.31.12, insmod的时候就会出错
root@jarvis-laptop:/home/jarvis# insmod hello.ko
insmod: error inserting 'hello.ko': -1 Invalid module format

cat 一下/var/log/syslog
Nov 10 10:56:17 jarvis-laptop kernel: [ 3029.419778] hello: disagrees about version of symbol module_layout. 应该是说我编译出来的hello.ko因为版本问题拒绝被加载.

可是如果我-C指定目录/libs/modules/2.6.31-14-generic, 一切都OK. 可是我没有在/usr/src/linux-headers-2.6.31-14-generic下面编译过内核啊.

不知道怎么回事,求帮助.
谢谢

作者: liu.jarvis   发布时间: 2011-11-10