How to compile a kernel from kernel.org in Fedora 14


This quick guide will show you how to compile and install a kernel from kernel.org in Fedora 14.

Start


Open a terminal and work through the below list of commands . Modify where appropriate.


Install the following packages

su -c 'yum install rpmdevtools yum-utils gcc make ncurses-devel'


Setup your build environment

rpmdev-setuptree


Download and extract your Kernel source


cd ~/rpmbuild/SOURCES

wget http://www.kernel.org/pub/linux/kernel/v2.6/linux- 2.6.37 .tar.gz

tar -xf linux- 2.6.37 .tar.gz


Configure and Compile it

cd linux- 2.6.37

make menuconfig

export CONCURRENCY_LEVEL= 3

time make rpm


General rule for concurrency level = number of processor cores + 1


Install it

cd ~/rpmbuild/RPMS/ x86_64

su -c 'rpm -ivh --force kernel- 2.6.37 -1. x86_64 .rpm'

cd /boot

su -c 'mkinitrd initramfs- 2.6.37 .img 2.6.37 '

su -c 'vi grub/grub.conf'


Fedora 32-bit users replace x86_64 with i386

Edit your grub.conf file and add an entry for your new kernel. Just copy your first kernel entry and modify it.

Note: Please do not copy this grub.conf, it is for illustrative purposes only.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/sda1
#          initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda1
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu

title Fedora ( 2.6.37 )
        root (hd0,0)
        kernel /boot/vmlinuz- 2.6.37 ro root=UUID=162b11c2-d9a1-4487-86d5-6ade5c5ee055 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb quiet
        initrd /boot/initramfs- 2.6.37 .img

title Fedora (2.6.35.10-74.fc14.x86_64)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.35.10-74.fc14.x86_64 ro root=UUID=162b11c2-d9a1-4487-86d5-6ade5c5ee055 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb quiet
        initrd /boot/initramfs-2.6.35.10-74.fc14.x86_64.img

title Fedora (2.6.35.6-45.fc14.x86_64)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.35.6-45.fc14.x86_64 ro root=UUID=162b11c2-d9a1-4487-86d5-6ade5c5ee055 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb quiet
        initrd /boot/initramfs-2.6.35.6-45.fc14.x86_64.img

title Other
        rootnoverify (hd0,4)
        chainloader +1


Boot from your new kernel


Restart your system and enjoy your new kernel.

转自:http://linuxtweaking.blogspot.com/2011/01/how-to-compile-kernel-from-kernelorg-in.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值