Introduction to compile the rhel kernel.

 

1)get kernel source code from longriver:

   cd /pbdf/ISO/redhat/betas/rhel5.5rc2/Server/SRC/DVD                           //RHEL5.5rc2 source code

2) Mount -o loop RHEL5.4-Server-20090819.0-SRPMS-DVD.iso /mnt

Cd /mnt/SRPM

[root@rx2660-1 SRPMS]# find * | grep kernel

kernel-2.6.18-164.el5.src.rpm                                                                                //this is the kernel source codes

Rpm -ivh kernel-2.6.18-164.el5.src.rpm //will get kernel source code and patches in SOURCE folder, and a spec in SPEC folder

3) rpmbuild -ba --target=x86_64 kernel-2.6.spec                                               //do everything

rpmbuild -bp --target=ia64 kernel-2.6.spec //only unpack the kernel and apply the patches.will put all of things into BUILD/kernel-2.6.18 folder

4)cd  /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.ia64

vi Makefile                                                                                                              //modify EXTRAVERSION to add  joe characters

5)  make menuconfig                                                                                                // add  ncurses-devel  rpm package

6)  make all                                                                                                                  //create the kernel image. Pay attention to a "make rpm" command

7)make modules_install                                                                                          //in /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.ia64 folder

   //create  /lib/modules/2.6.18-prep-joe folder and  build ->/usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.ia64

8)make install                                                                                                        //copy vmlinuz-2.6.18-prep-joe System.map-2.6.18-prep-joe to /boot folder.

//copy initrd-2.6.18-prep-joe.img to /boot/efi/efi/redhat folder.

9)modify elilo.conf file                                                                                        //move vmlinuz-2.6.18-prep-joe from /boot to /boot/efi/efi/redhat folder

Exmaple: elilo.conf

prompt

timeout=20

relocatable

default=linux-joe

image=vmlinuz-2.6.18-194.el5

        label=linux

        initrd=initrd-2.6.18-194.el5.img

        read-only

        append="rhgb quiet root=LABEL=/1"

image=vmlinuz-2.6.18-prep-joe

        label=linux-joe

        initrd=initrd-2.6.18-prep-joe.img

        read-only

        append="rhgb quiet root=LABEL=/1"

10)make distclean   //clean

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值