分页: 1 / 2

编译内核2.6.33.2出错

发表于 : 2010-04-07 17:34
黄美姬
浪费了1个钟头,晕,当前版本不匹配

代码: 全选

make[1]:正在离开目录 `/home/janker/linux-2.6.33.2'                                       
test ! -e scripts/package/builddeb || mv -f scripts/package/builddeb scripts/package/builddeb.kpkg-dist                                                                           
test ! -e scripts/package/Makefile || test -f scripts/package/Makefile.kpkg-dist || (mv -f scripts/package/Makefile scripts/package/Makefile.kpkg-dist && (echo "# Dummy file "; echo "help:") >  scripts/package/Makefile)                                                
COLUMNS=150 dpkg -l 'gcc*' perl dpkg 'libc6*' binutils make dpkg-dev |\                  
         awk '$1 ~ /[hi]i/ { printf("%s-%s\n", $2, $3) }'> debian/buildinfo              
uname -a >> debian/buildinfo                                                             
echo using the compiler: >> debian/buildinfo                                             
grep LINUX_COMPILER include/linux/compile.h | \                                          
           sed -e 's/.*LINUX_COMPILER "//' -e 's/"$//' >> debian/buildinfo
grep: include/linux/compile.h: 没有那个文件或目录
echo applied kernel patches: >> debian/buildinfo
echo done > debian/stamp/build/kernel
/usr/bin/make -f ./debian/rules         debian/stamp/binary/pre-linux-image-2.6.33.2-custom0
make[1]: 正在进入目录 `/home/janker/linux-2.6.33.2'
====== making target debian/stamp/install/linux-image-2.6.33.2-custom0 [new prereqs: ]======
This is kernel package version 11.015.
echo "The UTS Release version in include/linux/version.h"; echo "          \"\" "; echo "does not match current version:"; echo "           \"2.6.33.2-custom0\" "; echo "Please correct this."; exit 2
The UTS Release version in include/linux/version.h
           ""
does not match current version:
           "2.6.33.2-custom0"
Please correct this.
make[1]: *** [debian/stamp/install/linux-image-2.6.33.2-custom0] 错误 2
make[1]:正在离开目录 `/home/janker/linux-2.6.33.2'
make: *** [kernel_image] 错误 2
janker@soul ~/linux-2.6.33.2 $

Re: 编译内核2.6.33.2出错

发表于 : 2010-04-07 18:21
黄美姬

代码: 全选

你这个错误可以这样解决:

1. 修改debian/ruleset/misc/version_vars.mk文件(找不到就搜索一下)
在其中把
UTS_RELEASE_HEADER=$(call doit,if [ -f include/linux/utsrelease.h ]; then \
echo include/linux/utsrelease.h; \
else \
echo include/linux/version.h ; \
fi)
改成
UTS_RELEASE_HEADER=$(call doit,if [ -f include/generated/utsrelease.h ]; then \
echo include/generated/utsrelease.h; \
else \
echo include/generated/version.h ; \
fi)
2. 直接在include/generated下复制utsrelease.h为version.h搞定
3. 再次运行编译,这样应该可以顺利完成编译产生连个.deb文件了
难道又要从头开始,我可是花一个小时了,能否在修改后继续

Re: 编译内核2.6.33.2出错

发表于 : 2010-04-07 18:27
黄美姬

代码: 全选

grep: include/linux/compile.h: 没有那个文件或目录
晕倒什么是这个,目录下应是compiler.h,少个“r“,genereted/下倒是有compile.h

Re: 编译内核2.6.33.2出错

发表于 : 2010-04-07 20:22
黄美姬
经验证,还是不行。又花我1小时 :em06

代码: 全选

====== making target debian/stamp/install/linux-image-                              2.6.33.2-custom0 [new prereqs: ]======
This is kernel package version 11.015.
echo "The UTS Release version in include/linux/version                              .h"; echo "        \"\" "; echo "does not match curren                              t version:"; echo "        \"2.6.33.2-custom0\" "; ech                              o "Please correct this."; exit 2
The UTS Release version in include/linux/version.h
           ""
does not match current version:
           "2.6.33.2-custom0"
Please correct this.
make[1]: *** [debian/stamp/install/linux-image-2.6.33.                              2-custom0] 错误 2
make[1]:正在离开目录 `/home/janker/linux-2.6.33.2'
make: *** [kernel_image] 错误 2
janker@soul ~/linux-2.6.33.2 $

Re: 编译内核2.6.33.2出错

发表于 : 2010-04-07 23:55
kamui0523
不用重头开始
debian/ruleset/misc/version_vars.mk 这个文件是在你执行
sudo ake-kpkg --initrd kernel_image kernel-headers
之后才有的
修改完毕version_vars.mk后再执行sudo ake-kpkg --initrd kernel_image kernel-headers就好了

Re: 编译内核2.6.33.2出错

发表于 : 2010-04-08 6:26
黄美姬
难怪,我改后
又sudo make mrproper了,它就没有了
害我又浪费1小时,
现在生成大便包了 :em04,383M,晕,那个文件夹有7.3G :em04 :em04

Re: 编译内核2.6.33.2出错

发表于 : 2010-04-08 9:17
kamui0523
你编译的东西太多了,.config可以从老的内核的配置文件CP过来再编译,我当时第一次编译也是那么大的,呵呵
在设备那里你可以去掉点模块,比如出你设备以外的声卡,网卡,显卡,反正我的.config文件最后控制在92K左右,编译出来的内核比原来的小些,不过initrd这个文件要小很多,少了3M.然后速度很快,因为选了些优化选项,呵呵

Re: 编译内核2.6.33.2出错

发表于 : 2010-04-09 4:36
黄美姬
用系统老.config,104K,还精简了不少选项,编出来也有340M,就小了40M。晕 :em06 :em06
1.config.tar.gz
(26.55 KiB) 已下载 52 次

Re: 编译内核2.6.33.2出错

发表于 : 2010-04-12 6:57
fb8fb8
看这个帖子的相关部分:
http://tchdavid.com/blog/?p=203

总结起来就是:
//打开你的kernel里的version_vars.mk
sudo (你的路径)/linux-2.6.33.2/debian/ruleset/misc/version_vars.mk
//然后找到“UTS_RELEASE_HEADER”, 把“echo include/linux/version.h” 改成 “echo include/generated/utsrelease.h”. 注意这一块有两个“echo include/linux/version.h”,都需要改成“echo include/generated/utsrelease.h”。
//然后直接执行
sudo make-kpkg -initrd --initrd --append-to-version=2.6.33.2-custom0 kernel_image kernel-headers
//这样继续编译,千万别执行sudo make-kpkg clean。这样就节省时间了。

Re: 编译内核2.6.33.2出错

发表于 : 2010-04-12 9:14
jmw778s
某编译编译的kernel 33.2 在30M左右。。。 :em01

Re: 编译内核2.6.33.2出错

发表于 : 2010-04-30 12:41
RayWach
菜鸟求助:看到你的帖子关于2.6.33.2内核编译。按照上面的说法编译通过了,然后装上了新内核。后来,把源码稍改了一下(加了点变量做实验。。。),又重新编译的内核。。。结果,生成deb包后,安装失败,不知道为什么?

后来,查看一下源码文件夹,突然发现,大小成了原来的两倍多。磁盘空间所剩无几?你好像也说到这个了?能否细讲一下你是怎么处理的么? 谢谢啦 :em01

Re: 编译内核2.6.33.2出错

发表于 : 2010-05-01 9:41
RayWach
搞定了, :em01 ,继续进行。。。

Re: 编译内核2.6.33.2出错

发表于 : 2010-05-03 15:31
KOSKERS
:em04 学习了

Re: 编译内核2.6.33.2出错

发表于 : 2010-05-15 17:13
valshen
kamui0523 写了:你编译的东西太多了,.config可以从老的内核的配置文件CP过来再编译,我当时第一次编译也是那么大的,呵呵
在设备那里你可以去掉点模块,比如出你设备以外的声卡,网卡,显卡,反正我的.config文件最后控制在92K左右,编译出来的内核比原来的小些,不过initrd这个文件要小很多,少了3M.然后速度很快,因为选了些优化选项,呵呵
麻烦问下.config老的内核的配置文件放哪了。我在/usr/local/src下根本都找不到老的内核源码。。。

Re: 编译内核2.6.33.2出错

发表于 : 2010-05-15 17:21
Wolf's Head
在/boot/下

这个无需手动复制,编译时会自动复制过来

配置内核的时候,到kernel hacking下面,把kernel debug选项关闭