[教学] ubuntu 2.6.22 内核树建立

内核编译和嵌入式产品的设计与开发
chengfangquan
帖子: 7
注册时间: 2008-04-26 14:34

#16

帖子 chengfangquan » 2008-04-26 21:44

fangquan@fangquan-desktop:~/driver$ make
make -C /lib/modules/2.6.20.3-ubuntu1/build M=/home/fangquan/driver modules
make[1]: Entering directory `/usr/src/linux-source-2.6.20'
scripts/Makefile.build:17: /home/fangquan/driver/Makefile: No such file or directory
make[2]: *** 没有规则可以创建目标“/home/fangquan/driver/Makefile”。 停止。
make[1]: *** [_module_/home/fangquan/driver] 错误 2
make[1]: Leaving directory `/usr/src/linux-source-2.6.20'
make: *** [modules] 错误 2
fangquan@fangquan-desktop:~/driver$


我编译的时候遇到这样的错误,请问知道是什么原因么,望告知一下,谢谢!
头像
天浩
帖子: 146
注册时间: 2007-04-14 0:41
来自: 武汉
联系:

#17

帖子 天浩 » 2008-05-03 5:06

谢谢谢谢,我也是驱动开发的初学者,网上有很多文章,还是楼主说的到位、适合初学者的口味
haichuan2127
帖子: 2
注册时间: 2008-02-25 11:53

#18

帖子 haichuan2127 » 2008-05-11 18:59

haibo@arasor:~$ make
make -C /lib/modules/2.6.23.14/build M=/home/haibo modules
make[1]: Entering directory `/usr/src/linux-2.6.23.14'
Makefile:1498: ..tmp_kallsyms1.o.cmd: Permission denied
Makefile:1498: ..tmp_kallsyms2.o.cmd: Permission denied
Makefile:1498: ..tmp_vmlinux1.cmd: Permission denied
Makefile:1498: ..tmp_vmlinux2.cmd: Permission denied
Makefile:1498: .vmlinux.cmd: Permission denied
Makefile:1498: .vmlinux.o.cmd: Permission denied

ERROR: Kernel configuration is invalid.
include/linux/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.

make[2]: stat: include/config/auto.conf: Permission denied
CC [M] /home/haibo/hello.o
cc1: error: ./include/linux/autoconf.h: Permission denied
In file included from include/linux/prefetch.h:14,
from include/linux/list.h:8,
from include/linux/module.h:9,
from /home/haibo/hello.c:2:
include/asm/processor.h:83: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function)
include/asm/processor.h:83: error: requested alignment is not a constant
In file included from include/linux/slab_def.h:44,
from include/linux/slab.h:120,
from include/linux/percpu.h:5,
from include/asm/desc.h:11,
from include/asm/elf.h:50,
from include/linux/elf.h:7,
from include/linux/module.h:14,
from /home/haibo/hello.c:2:
include/linux/kmalloc_sizes.h:5:5: warning: "CONFIG_X86_L1_CACHE_SHIFT" is not defined
include/linux/kmalloc_sizes.h:9:5: warning: "CONFIG_X86_L1_CACHE_SHIFT" is not defined
In file included from include/linux/module.h:20,
from /home/haibo/hello.c:2:
include/asm/module.h:64:2: error: #error unknown processor family
make[2]: *** [/home/haibo/hello.o] Error 1
make[1]: *** [_module_/home/haibo] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.23.14'
make: *** [modules] Error 2
我在make时遇到这样的问题,请楼主和高手帮忙解决 在此非常感谢!!!!!!!!!
头像
dwl301
帖子: 1131
注册时间: 2007-04-14 11:17

#19

帖子 dwl301 » 2008-05-18 22:02

好极了!
关注!
顶!

谢谢LZ!
condor-china
帖子: 5
注册时间: 2008-04-29 13:07
来自: china

#20

帖子 condor-china » 2008-05-22 13:49

楼主,是我的偶像呀,我搞hello 搞了好久,就一个错呀, 嘻嘻
condor-china
帖子: 5
注册时间: 2008-04-29 13:07
来自: china

#21

帖子 condor-china » 2008-05-22 20:21

那个 M=$(PWD),中的M是啥意识呀, 实在搞不明白, info make 也没有 看 build里的Makefile 也没找到 M的使用 纳闷 ,忘答复一下
头像
coolwin
帖子: 271
注册时间: 2008-03-17 17:47

#22

帖子 coolwin » 2008-05-24 16:30

好文章,学习了
头像
lxvison
帖子: 117
注册时间: 2008-03-27 19:04

#23

帖子 lxvison » 2008-05-26 23:45

呵呵,不错,可以我在ubuntu8.04下,编译环境都建不起,编译uclinux老出错。。。
linfeng41
帖子: 3
注册时间: 2008-04-08 22:39

我的内核搞不定

#24

帖子 linfeng41 » 2008-06-01 11:12

我的也是linux-header-2.6.22-14-generic,但是按照楼主的方式编译后的内核是2.6.22.9的。而且,我在编译linux设备驱动程序三中的源代码时,总是出错,不知道为什么?
还有就是我的内核编译完之后,在lib/modules 下有两个文件,分别是2.6.22-14-generic和2.6.22.9,这是怎么回事呢?
头像
haolll230
帖子: 77
注册时间: 2007-11-02 18:17
来自: 广东潮州
联系:

#25

帖子 haolll230 » 2008-06-16 22:25

太好了,第一次编译成功内核,太谢谢楼主了!
keendawn
帖子: 16
注册时间: 2007-07-02 21:48

#26

帖子 keendawn » 2008-06-18 10:27

楼主,我太他妈的爱你了,这这正是我需要的,这个问题困扰了我好久了,由于时间不充足一直在缓慢的前进。
太感谢你了!
luctionli
帖子: 15
注册时间: 2008-06-16 11:36

#27

帖子 luctionli » 2008-06-18 15:47

我照着你的做法做了。好像没有结果阿。

代码: 全选

root@jack-desktop:/home/jack/driver# make
make -C /lib/modules/2.6.24.3/build M=/home/jack/driver modules
make[1]: Entering directory `/usr/src/linux-source-2.6.24'
  Building modules, stage 2.
  MODPOST 0 modules
make[1]: Leaving directory `/usr/src/linux-source-2.6.24'
root@jack-desktop:/home/jack/driver#
源程序用的帖主的。Makefile也是。不知道是不是我有那些软件包没有安装。
hanvy_xia
帖子: 11
注册时间: 2008-01-28 9:55

#28

帖子 hanvy_xia » 2008-07-10 9:46

太感谢你了! 这个东东都搞了我半天了 原来是没有源码
crossie
帖子: 241
注册时间: 2008-05-25 20:35

#29

帖子 crossie » 2008-08-26 10:46

会自动设置menu.lst的吗?
头像
Angus_Yann
帖子: 1736
注册时间: 2008-03-20 23:29
来自: ZJU

#30

帖子 Angus_Yann » 2008-08-26 12:28

Yizer 写了:留个脚印。。
日后研究
80后俊男一枚,Arch党,软件洁癖,标准果粉,萝莉控
欢迎Follow我的Twitter:@AngusYann <--点击前请自学[穿·墙·术]
回复