|
我机子上装的是Ubuntu 内核版本是2.6.22 因为学习需要要编译内核 2.6.17
把许多内核编译需要的包都装上了 像gcc的build-essential kernel-package initrd-tools..
gcc --version 显示的是4.1.3
步骤是
make mrproper
问题1: make menuconfig
说到这里我想问一下了 他那个默认是本来源码包里面就有了的呢 还是从系统中的配置文件导进来的。
因为我帅上了这些警告。。
/boot/config-2.6.22-14-generic:3065:warning: symbol value 'm' invalid for WAN_ROUTER_DRIVERS
/boot/config-2.6.22-14-generic:3076:warning: trying to assign nonexistent symbol WLAN_80211
/boot/config-2.6.22-14-generic:3077:warning: trying to assign nonexistent symbol WLAN_PRE80211
/boot/config-2.6.22-14-generic:3096:warning: trying to assign nonexistent symbol ZD1211RW
/boot/config-2.6.22-14-generic:3097:warning: trying to assign nonexistent symbol ZD1211RW_DEBUG
这个是怎么回事?
make
make modules_install
make install
问题2:
可是这样的话连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
问题3:
重启
可是刚过了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!
问题4:
GCC版本同学的更新过了 比我高 他是4.2.3 我是4.1.3
可是 我装了4.2.1了,但是gcc --version显示的还是4.1.3 要怎么样才能替换成高版本 直接更新也不行 (源里面有这个包的)
我是一个菜鸟。帮帮忙吧 |
|