zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    C++ template —— 模板中的名称(三)
    关于烂代码的那些事(下)
    关于烂代码的那些事(中)
    关于烂代码的那些事(上)
    比尔的村庄:创业是选择做赚钱的事,还是值钱的事?
    C++ template —— 深入模板基础(二)
    依赖倒置,控制反转,依赖注入
    JAVA中限制接口流量、并发的方法
    SVN同步时忽略特定文件或文件夹
    MySQL中查询表及索引大小的方法
  • 原文地址:https://www.cnblogs.com/yuboyue/p/2109854.html
Copyright © 2011-2022 走看看