$ wget https://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.1.tar.gz -O linux-2.6.32.1.tar.gz $ tar -xvf linux-2.6.32.1.tar.gz
首先要安装一些依赖库以及qemu。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
$ cd linux-2.6.32.1/ $ sudo apt-get install libncurses5-dev $ sudo apt-get install qemu qemu-system $ make menuconfig $ make $ make all make bzImage $ make modules 64位安32位
make ARCH=i386 menuconfig make ARCH=i386 make ARCH=i386 modules_install make ARCH=i386 install
arch/x86/kernel/ptrace.c:1472:17: error: conflicting types for ‘syscall_trace_enter’ asmregparm long syscall_trace_enter(struct pt_regs *regs) ^ In file included from /home/muhe/linux_kernel/linux-2.6.32.1/arch/x86/include/asm/vm86.h:130:0, from /home/muhe/linux_kernel/linux-2.6.32.1/arch/x86/include/asm/processor.h:10, from /home/muhe/linux_kernel/linux-2.6.32.1/arch/x86/include/asm/thread_info.h:22, from include/linux/thread_info.h:56, from include/linux/preempt.h:9, from include/linux/spinlock.h:50, from include/linux/seqlock.h:29, from include/linux/time.h:8, from include/linux/timex.h:56, from include/linux/sched.h:56, from arch/x86/kernel/ptrace.c:11: /home/muhe/linux_kernel/linux-2.6.32.1/arch/x86/include/asm/ptrace.h:145:13: note: previous declaration of ‘syscall_trace_enter’ was here extern long syscall_trace_enter(struct pt_regs *); ^ arch/x86/kernel/ptrace.c:1517:17: error: conflicting types for ‘syscall_trace_leave’ asmregparm void syscall_trace_leave(struct pt_regs *regs) ^ In file included from /home/muhe/linux_kernel/linux-2.6.32.1/arch/x86/include/asm/vm86.h:130:0, from /home/muhe/linux_kernel/linux-2.6.32.1/arch/x86/include/asm/processor.h:10, from /home/muhe/linux_kernel/linux-2.6.32.1/arch/x86/include/asm/thread_info.h:22, from include/linux/thread_info.h:56, from include/linux/preempt.h:9, from include/linux/spinlock.h:50, from include/linux/seqlock.h:29, from include/linux/time.h:8, from include/linux/timex.h:56, from include/linux/sched.h:56, from arch/x86/kernel/ptrace.c:11: /home/muhe/linux_kernel/linux-2.6.32.1/arch/x86/include/asm/ptrace.h:146:13: note: previous declaration of ‘syscall_trace_leave’ was here extern void syscall_trace_leave(struct pt_regs *); ^ make[2]: *** [arch/x86/kernel/ptrace.o] 错误 1 make[1]: *** [arch/x86/kernel] 错误 2 make: *** [arch/x86] 错误 2