运行:rpmbuild --target=i686 -ba kernel-2.6.spec
取centos 5 内核源码
kernel-2.6.spec 为修改后的文件
[root@love SPECS]# diff kernel-2.6.spec kernel-2.6.spec.20081130
29c29
< %define with_debuginfo %{?_without_debuginfo: 0} %{!?_without_debuginfo: 0}
---
> %define with_debuginfo %{?_without_debuginfo: 0} %{!?_without_debuginfo: 1}
37c37
< %define with_baseonly %{?_with_baseonly: 1} %{?!_with_baseonly: 1}
---
> %define with_baseonly %{?_with_baseonly: 1} %{?!_with_baseonly: 0}
49c49
< %define debugbuildsenabled 0
---
> %define debugbuildsenabled 1
166,167d165
< %define with_doc 1
< %define buildsource 1
174d171
< %define with_headers 1
-------------------------------------------
doc,buildsource的修改位置
# only package docs noarch
%ifnarch noarch
%define with_doc 0
%endif
%define with_doc 1
%define buildsource 1
-------------------------------------------
headers 的修改位置
%ifarch i586 i686 ppc64iseries
%define with_headers 0
%endif
%define with_headers 1
-------------------------------------------
最后得到的文件
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/kernel-2.6.18-92.1.18.el5-root
Wrote: /usr/src/redhat/SRPMS/kernel-2.6.18-92.1.18.el5.src.rpm
Wrote: /usr/src/redhat/RPMS/i686/kernel-2.6.18-92.1.18.el5.i686.rpm
Wrote: /usr/src/redhat/RPMS/i686/kernel-devel-2.6.18-92.1.18.el5.i686.rpm
Wrote: /usr/src/redhat/RPMS/i686/kernel-doc-2.6.18-92.1.18.el5.i686.rpm
Wrote: /usr/src/redhat/RPMS/i686/kernel-headers-2.6.18-92.1.18.el5.i686.rpm
--------------------------
上面的buildsource项是看一位前辈的文章,本想编译出kernel-source*rpm包。但结果是编译出kernel*src.rpm包(也就是我们原先下载的文件)
所以还是以去了吧!
最后的内核源码就在这个文件夹 /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686
由于文件是编译过的,所以比较大(2.1G)。
阅读(2551) | 评论(2) | 转发(0) |