1、ubuntu下面修改更新源 sudo gedit /etc/apt/sources.list
2、編譯內核:
(1) cd 到/usr/src/下,解壓下載的內核源代碼包
(2) make mrproper 清理生成的文件(貌似對第一次編譯內核沒有必要)
(3) make menuconfig (如果不行,需要安裝libncurses5-dev,使用命令 sudo apt-get install
libncurses5-dev,搜索相關文件使用sudo apt-cache search
文件名)
我在安裝時遇到問題:The following packages have unmet dependencies:
libncurses5-dev : Depends: libncurses5 (= 5.9-4) but 5.9-10ubuntu1 is to be installed
Depends: libtinfo-dev (= 5.9-4) but it is not going to be installed
Depends: ncurses-bin (= 5.9-4) but 5.9-10ubuntu1 is to be installed
解決是在http://packages.ubuntu.com/網站上直接下載了 libncurses5、libtinfo-dev和ncurses-bin的5.9.4版本,然後用dpkg命令進行了安裝。
(4)
make bzImage -jn (n為cpu個數)
(5)
make modules
(6)make
modules_install
(7)make
install
制作啟動盤#
sudo mkinitramfs 3.19.3 -o /boot/initrd.img-3.19.3
更新grub2#
sudo update-grub2
編譯2.6.38內核錯誤
arch/x86/kernel/entry_32.S: Assembler messages:
arch/x86/kernel/entry_32.S:1422: Error: .size expression for apf_page_fault does not evaluate to a constant
make[2]: *** [arch/x86/kernel/entry_32.o] 錯誤 1
make[1]: *** [arch/x86/kernel] 錯誤 2
make: *** [arch/x86] 錯誤 2
解決:
- --- entry_32.S.original 2011-03-18 08:21:51.000000000 -0400 +++ entry_32.S 2011-03-20 10:37:00.000000000 -0400 @@ -343,7 +343,7 @@ # int/exception return? jne work_pending jmp restore_all - -END(ret_from_exception) +END(resume_userspace) #ifdef CONFIG_PREEMPT ENTRY(resume_kernel) @@ -1413,7 +1413,7 @@ CFI_ADJUST_CFA_OFFSET 4 jmp error_code CFI_ENDPROC - -END(apf_page_fault) +END(async_page_fault) #endif