Ubuntu 11.04下編譯kernel

來源:互聯網
上載者:User


Ubuntu 11.04下編譯kernel 1. 下載並解壓Linux核心原始碼, 核心源碼為www.kernel.org,查看當前核心版本命令為uname -r。下載後解壓至目錄/usr/src.2. 解壓完成後在終端下進入/usr/src/linux-2.6.34.13目錄(其中2.6.34.13為我使用的版本號碼)3. 輸入命令make mrproper,此命令用於清除以前編譯產生的.o等其它檔案,若為第一次編譯此步驟可省略.  www.2cto.com  4. 運行make menuconfig報錯,提示需要安裝ncurses的庫:   apt-get install libncurses5-dev 5. make menuconfig6. make 編譯:1)在/usr/src/linux-2.6.34.13/arch/x86/boot/下產生bzImage, vmlinux.bin, setup.elf, setup.bin, tools/build。 2)編譯modules, MODPOST.   www.2cto.com  7. make modules_install, make install 此時核心各模組便安裝完成,grub啟動項也會自動修改(?)8. mkinitramfs -o /boot/initrd.img-source_version -v source_version      For my example, mkinitramfs -o /boot/initrd.img-2.6.34.13 -v 2.6.34.13 執行此命令將產生剛剛編譯核心的鏡像。其中命令mkinitramfs可分拆為“make init ram FileSystem”理解,2.6.34.13為正在編譯的核心版本,不可隨意更改。但“initrd.img-2.6.34.13”為所產生的核心鏡像檔案名,可根據自己需要進行修改、區別。 9. update-grub: 遍曆/boot/目錄下的檔案,更新/boot/grub/grub.cfg10. reboot.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.