zoukankan      html  css  js  c++  java
  • how to compile and install linux kernel

    by Torstan  2011-7-3 13:20

    In this weekend, I just want to try compiling and installing linux kernel. The root cause is I am a programmer having 3 years working experience图片. After 2 days, I succeeded. I am so happy. Now I am recording the flow.

    Before all steps, I describe the environment I used. I have installed a ubuntu on VMware which works on window XP. So I decided to install another linux version on the VMware.

    On Saturday, I intended to install the latest linux version, 2.6.39.2. After getting the source code form www.kernel.org, I followed the instructions in the README in the extracted file. However, I failed to boot the system with the newest kernel. Then I googled the error messages, and found that I made a big mistake, no initrd file generated. After I used mkinitramfs to generate it, I failed again. I guessed everything seemed ok except the grub file, menu.lst under /boot/grub. I googled the meanings of all the items in grub file, such as root, and root of kernel. I recompiled code and installed kernel several times, and failed on and on. Fortunately, I used update-grub command, which automatically updated menu.lst for me. I believe it more reasonable than what I wrote. I still failed...In the evening, I noticed that I had installed several kernels by automatic update, for example, 2.6.24-16-generic, 2.6.24-24-generic and 2.6.24-29-generic. All of them are at brach 2.6.24, so I guessed I should try 2.6.24 version of code. What's more, make config is not easy.

    On sunday moring, I succeeded, after a lot of failure. Here are the steps.
    1) download version 2.6.24 from http://www.kernel.org/pub/linux/kernel/v2.6/
    2) extract file by using tar xjvf linux-2.6.24.tar.bz2
    3) cd linux-2.6.24/
       make mrproper
      cp /boot/config-2.6.24-16-generic .config
      make oldconfig
      make
      sudo make modules_install install
      sudo update-initramfs -c -k 2.6.24
      edit menu.lst in /boot/grub to add an option of 2.6.24
    4) reboot and express ESC to choose kernel 2.6.24.
    5)done

    Finally, I checked what kernel is used.
    图片torstan@stan:~$ uname -r
    2.6.24


  • 相关阅读:
    [NOIP 2012] 疫情控制
    [HDU 6315] Naive Operations
    [BZOJ 3363] Cow Marathon
    单片机的模块化编程
    QT中定时器的使用方法
    47: error: undefined reference to `QWebView::QWebView(QWidget*)'
    如何分析一个QT类
    个人收集的一些库、工具、技术介绍
    点阵字体显示系列之二:汉字显示
    点阵字体显示系列之一:ASCII码字库的显示
  • 原文地址:https://www.cnblogs.com/Torstan/p/2357703.html
Copyright © 2011-2022 走看看