编译内核

编译内核
rpm -ivh kernel-2.6.32-220.23.1.el6.src.rpm
tar -zxvf Lvs-fullnat-synproxy.tar.gz
cd /~/rpmbuild/SPECS
yum install rpm-build -y
rpmbuild -bp kernel.spec
yum install gcc redhat-rpm-config patchutils xmlto asciidoc elfutils-libelf-devel zlib-devel binutils-devel newt-devel python-devel hmaccalc perl-ExtUtils-Embed -y
yum install 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 -y
rpmbuild -bp kernel.spec
另一个终端上:
yum install rng-tools -y
rngd -r /dev/urandom
*****************************************  --准备编译环境
cd BUILD
cd kernel-2.6.32-220.23.1.el6/linux-2.6.32-220.23.1.el6.x86_64/
cp /mnt/lvs-fullnat-synproxy/lvs-2.6.32-220.23.1.el6.patch .
patch -p1 < lvs-2.6.32-220.23.1.el6.patch
vim Makefile
make
make modules_install
make install
*****************************************  --进行编译
vim /boot/grub/grub.conf
#boot=/dev/vda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu

reboot
*****************************************  --选择启动内核
cd lvs-fullnat-synproxy/
tar -zxvf lvs-tools.tar.gz
cd tools/keepalived/
yum install openssl-devel popt-devel -y
./configure --with-kernel-dir="/lib/modules/`uname -r`/build"
make
make install
*****************************************  --制作软链接
ln -s /usr/local/sbin/keepalived /sbin/
ln -s /usr/local/etc/sysconfig/keepalived /etc/sysconfig/
ln -s /usr/local/etc/rc.d/init.d/keepalived /etc/init.d/
ln -s /usr/local/etc/keepalived/ /etc/
chmod +x /usr/local/etc/rc.d/init.d/keepalived
*****************************************
cd tools/ipvsadm
make

make install

编译内核_第1张图片

你可能感兴趣的:(编译内核)