日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

ubuntu编译linux kernel v2.6.30 各种错误排除

發布時間:2024/8/1 linux 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubuntu编译linux kernel v2.6.30 各种错误排除 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、資源準備

1、下載一個較穩定的老版本,2.6.30, 并解壓源碼:

1 wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.xz 2 tar Jxf linux-2.6.30.tar.xz 3 cd linux-2.6.30/

2、生成基本的配置信息:

make defconfig

二、工具配置

接下來要對內核默認配置文件進行修改,有3中方式,gconfig、xconfig和menuconfig, 分別依賴與gtk+2.0、qt3和libncurses5-dev。 通過相應命令安裝依賴的包后,就可一進行配置了;

1、使用menuconfig進行配置

1 sudo apt-get install libncurses5-dev 2 make menuconfig

2、使用gconfig進行配置

make gconfig * * Unable to find the GTK+ installation. Please make sure that * the GTK+ 2.0 development package is correctly installed... * You need gtk+-2.0, glib-2.0 and libglade-2.0. * make[1]: *** No rule to make target `scripts/kconfig/.tmp_gtkcheck', needed by `scripts/kconfig/gconf.o'. Stop. make: *** [gconfig] Error 2

需要安裝以下軟件包,然后重新開始:

1 sudo apt-get install libgtk2.0-dev libglib2.0-dev libglade2-dev 2 make gconfig

3、使用xconfig進行配置

這個對qt3依賴,已經安裝了qt3-dev-tools也不行呢,沒有找到解決方案,所以放棄折騰了;誰有好方法解決請告知哇。

$make gconfigHOSTCC scripts/kconfig/gconf.o In file included from /usr/include/gtk-2.0/gtk/gtk.h:236:0,from /usr/include/libglade-2.0/glade/glade-xml.h:26,from /usr/include/libglade-2.0/glade/glade.h:28,from scripts/kconfig/gconf.c:16: /usr/include/gtk-2.0/gtk/gtkitemfactory.h:47:1: warning: function declaration isn’t a prototype scripts/kconfig/gconf.c: In function ‘text_insert_help’: scripts/kconfig/gconf.c:469:3: warning: format not a string literal and no format arguments scripts/kconfig/gconf.c: In function ‘on_introduction1_activate’: scripts/kconfig/gconf.c:754:6: warning: format not a string literal and no format arguments scripts/kconfig/gconf.c: In function ‘on_about1_activate’: scripts/kconfig/gconf.c:772:6: warning: format not a string literal and no format arguments scripts/kconfig/gconf.c: In function ‘on_license1_activate’: scripts/kconfig/gconf.c:791:6: warning: format not a string literal and no format arguments scripts/kconfig/gconf.c: At top level: scripts/kconfig/images.c:6:20: warning: ‘xpm_load’ defined but not used scripts/kconfig/images.c:36:20: warning: ‘xpm_save’ defined but not used scripts/kconfig/images.c:66:20: warning: ‘xpm_back’ defined but not used scripts/kconfig/images.c:175:20: warning: ‘xpm_symbol_no’ defined but not used scripts/kconfig/images.c:192:20: warning: ‘xpm_symbol_mod’ defined but not used scripts/kconfig/images.c:209:20: warning: ‘xpm_symbol_yes’ defined but not used scripts/kconfig/images.c:226:20: warning: ‘xpm_choice_no’ defined but not used scripts/kconfig/images.c:243:20: warning: ‘xpm_choice_yes’ defined but not used scripts/kconfig/images.c:277:20: warning: ‘xpm_menu_inv’ defined but not used scripts/kconfig/images.c:294:20: warning: ‘xpm_menuback’ defined but not used scripts/kconfig/gconf.c:957:13: warning: ‘renderer_toggled’ defined but not usedHOSTLD scripts/kconfig/gconf scripts/kconfig/gconf arch/x86/Kconfig

三、錯誤排除

1、出現錯誤syscall_trace_leave

arch/x86/include/asm/ptrace.h:146:13: note: previous declaration of 'syscall_trace_leave' was here make[2]: *** [arch/x86/kernel/ptrace.o] Error 1 make[1]: *** [arch/x86/kernel] Error 2 make: *** [arch/x86] Error 2

解決方案參考這個補丁:?https://patchwork.kernel.org/patch/1301031/

Patch--- linux-2.6.32.59/arch/x86/include/asm/ptrace.h +++ fix_ptrace.o_compile_error/arch/x86/include/asm/ptrace.h @@ -130,6 +130,7 @@ #ifdef __KERNEL__#include <linux/init.h> +#include <linux/linkage.h>struct cpuinfo_x86;struct task_struct; @@ -142,8 +143,8 @@ int error_code, int si_code);void signal_fault(struct pt_regs *regs, void __user *frame, char *where);-extern long syscall_trace_enter(struct pt_regs *); -extern void syscall_trace_leave(struct pt_regs *); +extern asmregparm long syscall_trace_enter(struct pt_regs *); +extern asmregparm void syscall_trace_leave(struct pt_regs *);static inline unsigned long regs_return_value(struct pt_regs *regs){

2、錯誤gcc不識別-m參數

gcc: error: unrecognized command line option ‘-m’ gcc: error: elf_i386: No such file or directory make[1]: *** [arch/x86/vdso/vdso32-int80.so.dbg] Error 1

由于我現在用的是ubuntu 12.10 使用的是gcc-4.7,發現了一個新版本的移植的問題,所以安裝gcc-4.5,然后重新鏈接就搞定了,可以繼續編譯:

sudo apt-get install gcc-4.5 cd /usr/bin sudo ln -s -f gcc-4.5 gcc

繼續編譯中:

#使用-j4指定4個線程編譯 make -j4

四、編譯成功

基本使用的默認設置,就是第一步的make defconfig后的配置參數,然后make -j4,好像編譯的挺快的,后面在詳細研究以下各種參數,已經如何啟用這個自己編譯的內核 :)。

CHK include/linux/version.hCHK include/linux/utsrelease.hSYMLINK include/asm -> include/asm-x86CALL scripts/checksyscalls.shCHK include/linux/compile.hVDSOSYM arch/x86/vdso/vdso32-int80-syms.ldsVDSOSYM arch/x86/vdso/vdso32-sysenter-syms.ldsVDSOSYM arch/x86/vdso/vdso32-syms.ldsLD arch/x86/vdso/built-in.oLD vmlinux.oMODPOST vmlinux.o WARNING: modpost: Found 3 section mismatch(es). To see full details build your kernel with: 'make CONFIG_DEBUG_SECTION_MISMATCH=y'GEN .versionCHK include/linux/compile.hUPD include/linux/compile.hCC init/version.oLD init/built-in.oLD .tmp_vmlinux1KSYM .tmp_kallsyms1.SAS .tmp_kallsyms1.oLD .tmp_vmlinux2KSYM .tmp_kallsyms2.SAS .tmp_kallsyms2.oLD .tmp_vmlinux3KSYM .tmp_kallsyms3.SAS .tmp_kallsyms3.oLD vmlinuxSYSMAP System.mapSYSMAP .tmp_System.mapOBJCOPY arch/x86/boot/compressed/vmlinux.binGZIP arch/x86/boot/compressed/vmlinux.bin.gzLD arch/x86/boot/compressed/piggy.oLD arch/x86/boot/compressed/vmlinuxOFFSETS arch/x86/boot/offsets.hAS arch/x86/boot/header.oCC arch/x86/boot/version.oLD arch/x86/boot/setup.elfOBJCOPY arch/x86/boot/setup.binOBJCOPY arch/x86/boot/vmlinux.binBUILD arch/x86/boot/bzImage Root device is (8, 11) Setup is 10060 bytes (padded to 10240 bytes). System is 3539 kB CRC d3a625ec Kernel: arch/x86/boot/bzImage is ready (#2)Building modules, stage 2.MODPOST 2 modules

總結

以上是生活随笔為你收集整理的ubuntu编译linux kernel v2.6.30 各种错误排除的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。