Debian lenny — Compile Linux Kernel in Debian

來源:互聯網
上載者:User
 Debian lenny Compile kernel from source

Install Kernel
  安裝好正常編譯需要的東西以後安裝這個
  # apt-get install build-essential
  # apt-get install libncurses5-dev
若需要打補丁,還需要安裝patch包:
  # apt-get install patch

  (網上有的文章說什麼debian標準安裝核心的方式,我不喜歡,因為我常切換各個發行版編譯安裝核心,所以我喜歡下面這種我常用的方式)
 
1: Get Latest Linux kernel code
  # cd /tmp
  # wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.y.z.tar.bz2
 
  ###Note: Replace x.y.z with actual version number.
 
2: Extract tar (.tar.bz2) file
  # tar -xjvf linux-2.6.23.tar.bz2 -C /usr/src
  # cd /usr/src
 
3: Configure kernel
  # make menuconfig
 
4: Compile and Install kernel
  # make
  # make modules_install
  # make install
 
5: Create an initrd image
  查看自己的那個版本的資訊,我這裡編譯的是相容核心,顯示如下:
  # ls /lib/modules/
  2.6.18-6-686  2.6.23-uk0.2.1  2.6.24-1-686
 
  # cd /boot
執行:
  # mkinitrd -o initrd.img-2.6.23-uk0.2.1 /lib/modules/2.6.23-uk0.2.1
  或者:
  # mkinitramfs -o initrd.img-2.6.23-uk0.2.1 2.6.23-uk0.2.1

6: Modify Grub configuration file - /boot/grub/menu.lst
  Open file using vi:
  # vi /boot/grub/menu.lst

title           Debian GNU/Linux, kernel 2.6.23 uk0.2.1
root            (hd0,3)
kernel          /vmlinuz-2.6.23-uk0.2.1 root=/dev/sda3 ro  
initrd          /initrd.img-2.6.23-uk0.2.1
savedefault
boot

  # update-grub
 
  reboot your system,ok!
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.