内核编译后 重启进入系统出现错误
我机子上装的是Ubuntu 内核版本是2.6.22 因为学习需要要编译内核 2.6.17
把许多内核编译需要的包都装上了 像gcc的build-essential kernel-package initrd-tools..
gcc --version 显示的是4.1.3
步骤是
make mrproper
make menuconfig
make
make modules_install
make install
可是这样的话连make都过不了 出现下面的错误
init/built-in.o: In function `try_name':
do_mounts.c: (.text+0x47f): undefined reference to `__stack_chk_fail'
init/built-in.o: In function `name_to_dev_t':
(.text+0x6de): undefined reference to `__stack_chk_fail'
init/built-in.o: In function `change_floppy':
(.init.text+0x851): undefined reference to `__stack_chk_fail'
init/built-in.o: In function `mount_block_root':
(.init.text+0xa6c) : undefined reference to `__stack_chk_fail'
init/built-in.o: In function `do_header':
initramfs.c: (.init.text+0x417c): undefined reference to `__stack_chk_fail'
arch/i386/kernel/built-in.o: (.text+0x48a0) : more undefined references to `__stack_chk_fail' follow
make: *** [.tmp_vmlinux1] 错误 1
同学的机子上和我是同一张盘装的 他没问题 编译成功的
然后去百度了一下 在CFLAGS 后多另了-fno-stack-protector选项(不知道为什么) 这样一来编译倒是通过了
但是在编译模块的时候 警告是满屏幕的闪过 不管了
然后一步一步做下去 mkinitrd -o /boot/initrd.img-2.6.17xxx 2.6.17xxx
重启
可是刚过了Grub就出现下面的问题。。没辙了 到这来向大家请教了
[17179569:552000] PCI: BIOS Bug : MCFG area not E820-reserved
[17179569:552000] PCI: Not using MMCONFIG
[17179570:440000] padlock: VIA PadLock not detected
mount: unknown file system type "devfs"
unmount: devfs : not mounted
/scripts/ext3-add-journal sh: 27 : arith : syntax error "0x"
/sbin/init:426:arith: syntax error : "0x"
[17179572:556000] Kernel panic-not syncing : Attempted to kill init!