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

  • 相关阅读:
    系统维护-安全-测试等方面的开源项目
    linux命令学习
    Rancher + k8s + docker 部署资料
    个人java框架 技术分析
    java十年,需要学会的Java开发体系
    IdentityServer4 经典文章
    .net core 资料网站 和 开源项目
    Java 学习资料网站集合
    spring cloud资料汇总
    秦九韶公式 【多项式】
  • 原文地址:https://www.cnblogs.com/yuboyue/p/2109854.html
Copyright © 2011-2022 走看看