源码编译

1、百度搜索:“Linux 内核编译”,搜到一些网址,可用于参考,基本分为 两个种类:

  1.1、使用 https://www.kernel.org/ 中下载的源码

  1.2、使用 http://vault.centos.org/ 中下载的源码    --> 这个是 CentOS源码

 

2、使用 https://www.kernel.org/ 中下载的源码

  内核源码下载地址,基本就是这个地址,举例为 :https://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.25.tar.xz

  于是下载网址就是:https://www.kernel.org/pub/linux/kernel/

 

  2.1、参考网址:

    2.1.1、http://www.centoscn.com/CentOS/config/2015/0112/4484.html

    2.1.2、http://jingyan.baidu.com/article/414eccf61296c16b421f0a63.html

    2.1.3、http://blog.csdn.net/reblue520/article/details/50786092

    2.1.4、http://blog.sina.com.cn/s/blog_8588208901018xzc.html

    2.1.5、http://www.linuxidc.com/Linux/2013-08/89325.htm

    2.1.6、http://www.169it.com/article/4877013198040215633.html

    2.1.7、http://www.2cto.com/os/201411/348377.html

 

3、CentOS

  CentOS6.5下编译src.rpm包的内核

  http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=26299634&id=5214329

CentOS6.5原生内核版本是
Linux 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux


在网上下载对应版本的src.rpm包:kernel-2.6.32-431.el6.src.rpm
http://rpm.pbone.net/index.php3/stat/4/idpl/24668468/dir/scientific_linux_6/com/kernel-devel-2.6.32-431.el6.x86_64.rpm.html

1.解压src.rpm包:
# rpm -ivh kernel-2.6.32-431.el6.src.rpm 
----------------------------------------
错误提示:
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
执行下面两个命令:
# groupadd mockbuild
# useradd mockbuild -g mockbuild

 

  3.1、"rpm -ivh kernel-2.6.32-358.el6.src.rpm" 之后,在 "/root/"下生成 目录 "/root/rpmbuild/SOURCES"和"/root/rpmbuild/SPECS"。

    ZC: 但是 貌似不是这么弄的...

  3.2、应该这样的操作步骤:

    ZC: 注意,最好 新建一个空目录,来做下面的操作,∵ 会在当前目录 出现很多的文件...

    3.2.1、"rpm2cpio kernel-2.6.32-358.el6.src.rpm | cpio -idv" 会生成“linux-2.6.32-358.el6.tar.bz2”

    3.2.2、"tar zxvf linux-2.6.32-358.el6.tar.bz2" 会出现 目录“linux-2.6.32-358.el6”,这里面就是源码

4、

5、

 

转载于:https://www.cnblogs.com/LinuxCode/p/5805435.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值