编译内核

1、首先下载安装包
asciidoc-8.4.5-4.1.el6.noarch.rpm
Lvs-fullnat-synproxy.tar.gz
kernel-2.6.32-220.23.1.el6.src.rpm
slang-devel-2.2.1-1.el6.x86_64.rpm
newt-devel-0.52.11-3.el6.x86_64.rpm
2、安装
(1)rpm -ivh kernel-2.6.32-220.23.1.el6.src.rpm
这里写图片描述
(2)

[root@server2 ~]# ls
kernel-2.6.32-220.23.1.el6.src.rpm  rpmbuild
[root@server2 ~]# cd rpmbuild/
[root@server2 rpmbuild]# s
-bash: s: command not found
[root@server2 rpmbuild]# ls
SOURCES  SPECS
[root@server2 rpmbuild]# cd SOURCES/
[root@server2 SOURCES]# ls
check-kabi              config-i686-nodebug-rhel     config-s390x               config-x86_64-generic-rhel         linux-kernel-test.patch
config-debug            config-i686-rhel             config-s390x-debug         config-x86_64-nodebug              Makefile.common
config-debug-rhel       config-ia64-generic-rhel     config-s390x-debug-rhel    config-x86_64-nodebug-rhel         Makefile.config
config-framepointer     config-nodebug               config-s390x-generic-rhel  config-x86-generic                 merge.pl
config-generic          config-nodebug-rhel          config-s390x-kdump         config-x86-generic-rhel            Module.kabi_i686
config-generic-rhel     config-powerpc64             config-s390x-kdump-rhel    extrakeys.pub                      Module.kabi_ppc64
config-i686             config-powerpc64-kdump       config-s390x-rhel          find-provides                      Module.kabi_s390x
config-i686-debug       config-powerpc64-rhel        config-x86_64-debug        genkey                             Module.kabi_x86_64
config-i686-debug-rhel  config-powerpc-generic       config-x86_64-debug-rhel   kabitool                           perf
config-i686-nodebug     config-powerpc-generic-rhel  config-x86_64-generic      linux-2.6.32-220.23.1.el6.tar.bz2  perf-archive
[root@server2 SOURCES]# cd ..
[root@server2 rpmbuild]# ls
SOURCES  SPECS

(3)

[root@server2 rpmbuild]# cd SPECS/
[root@server2 SPECS]# ls
kernel.spec

(4)[root@server2 SPECS]# yum install -y rpm-build
这里写图片描述
(5)[root@server2 SPECS]# rpmbuild -bp kernel.spec 时发现缺少很多东西
这里写图片描述
安装缺少的部分
[root@server2 SPECS]# yum install -y gcc redhat-rpm-config patchutils xmlto asciidoc elfutils-libelf-devel zlib-devel binutils-devel newt-devel python-devel hmaccalc perl-ExtUtils-Embed
这里写图片描述
信息显示还缺少两个安装包 asciidoc 和 newt-devel
[root@server2 mnt]# yum install -u newt-devel-0.52.11-3.el6.x86_64.rpm slang-devel-2.2.1-1.el6.x86_64.rpm asciidoc-8.4.5-4.1.el6.noarch.rpm
这里写图片描述
(6)[root@server2 mnt]# yum install -y newt-devel-0.52.11-3.el6.x86_64.rpm slang-devel-2.2.1-1.el6.x86_64.rpm asciidoc-8.4.5-4.1.el6.noarch.rpm
这里写图片描述
(7)

[root@server2 mnt]# cd
[root@server2 ~]# ls
kernel-2.6.32-220.23.1.el6.src.rpm  rpmbuild
[root@server2 ~]# cd rpmbuild/
[root@server2 rpmbuild]# ls
BUILD  BUILDROOT  RPMS  SOURCES  SPECS  SRPMS
[root@server2 rpmbuild]# cd SPECS/
[root@server2 SPECS]# ls
kernel.spec
[root@server2 SPECS]# rpmbuild -bp kernel.spec 

这里写图片描述
中间停止不动时重新打开一个窗口连接主机
[root@server2 ~]# yum install -y rng-tools
这里写图片描述
再输入这个命令,刚才停止的就会退出
[root@server2 ~]# rngd -r /dev/urandom
(8)

[root@server2 mnt]# tar zxf Lvs-fullnat-synproxy.tar.gz 
[root@server2 mnt]# cd lvs-fullnat-synproxy/
[root@server2 lvs-fullnat-synproxy]# ls
lvs-2.6.32-220.23.1.el6.patch  lvs-tools.tar.gz  README  toa-2.6.32-220.23.1.el6.patch
[root@server2 lvs-fullnat-synproxy]# cp lvs-2.6.32-220.23.1.el6.patch /root/rpmbuild/
BUILD/     BUILDROOT/ RPMS/      SOURCES/   SPECS/     SRPMS/     
[root@server2 lvs-fullnat-synproxy]# cp lvs-2.6.32-220.23.1.el6.patch /root/rpmbuild/BUILD/kernel-2.6.32-220.23.1.el6/linux-2.6.32-220.23.1.el6.x86_64/
[root@server2 lvs-fullnat-synproxy]# cd /root/rpmbuild/BUILD/kernel-2.6.32-220.23.1.el6/linux-2.6.32-220.23.1.el6.x86_64/
[root@server2 linux-2.6.32-220.23.1.el6.x86_64]# ls
arch                      config-nodebug-rhel          config-x86_64-generic       init                           perf
block                     config-powerpc64             config-x86_64-generic-rhel  ipc                            pubring.gpg
check-kabi                config-powerpc64-kdump       config-x86_64-nodebug       kabitool                       random_seed
config-debug              config-powerpc64-rhel        config-x86_64-nodebug-rhel  Kbuild                         README
config-debug-rhel         config-powerpc-generic       config-x86-generic          kernel                         REPORTING-BUGS
config-framepointer       config-powerpc-generic-rhel  config-x86-generic-rhel     kernel.pub                     samples
config-generic            configs                      COPYING                     kernel.pub~                    scripts
config-generic-rhel       config-s390x                 CREDITS                     kernel.sec                     secring.gpg
config-i686               config-s390x-debug           crypto                      lib                            security
config-i686-debug         config-s390x-debug-rhel      Documentation               lvs-2.6.32-220.23.1.el6.patch  sound
config-i686-debug-rhel    config-s390x-generic-rhel    drivers                     MAINTAINERS                    temp-i686-debug-final
config-i686-nodebug       config-s390x-kdump           extract.pub                 Makefile                       temp-i686-final
config-i686-nodebug-rhel  config-s390x-kdump-rhel      extrakeys.pub               Makefile.common                tools
config-i686-rhel          config-s390x-rhel            firmware                    merge.pl                       trustdb.gpg
config-ia64-generic-rhel  config-x86_64-debug          fs                          mm                             usr
config-nodebug            config-x86_64-debug-rhel     include                     net                            virt

(9)[root@server2 linux-2.6.32-220.23.1.el6.x86_64]# patch -p1 < lvs-2.6.32-220.23.1.el6.patch
这里写图片描述
(10)[root@server2 linux-2.6.32-220.23.1.el6.x86_64]# vim Makefile
(11)make进行编译
[root@server2 linux-2.6.32-220.23.1.el6.x86_64]# make

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值