Fedora 8 环境 2.6内核编译步骤

第一次编译2.6的内核,十分不顺手,老是有问题。(Fedora 8,内核2.6.25 )

开始的时候我用的是2.6.26的内核在root目录下解压,在make menuconfig之后没有位子可以选择arm的,在网上查了后输入命令make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig,但这也有问题,因为你在menuconfig的选项都没有被保存下来,它还是要让你一个一个的慢慢的选择,这太麻烦了,想办法。在2.6.26的目录下修改Makefile,主要是以下2项:

ARCH=arm

CROSS_COMPILE=/usr/local/arm/3.4.1/bin/arm-linux

(/usr/local/arm/3.4.1/bin/arm-linux是你编译器的地址)

这样修改后直接make menuconfig就行了。可是make以后马上就出问题了如下:

include/asm/page.h:111:2: #error Unknown user operations model

make[1]: *** [arch/arm/kernel/asm-offsets.s] 错误 1

make: *** [prepare0] 错误 2

make[1]: *** [arch/arm/kernel/asm-offsets.s] 错误 1

make: *** [prepare0] 错误 2

这个问题我搞了3天也没搞好。

后来把内核放在/usr/src目录下重新编译,没有arch/arm/kernel/asm-offsets.s这个问题了,可是又有新的问题了:

drivers/gpio/gpiolib.c: In function `gpiolib_dbg_show':

drivers/gpio/gpiolib.c:1060: error: implicit declaration of function `gpio_to_irq'

make[2]: *** [drivers/gpio/gpiolib.o] 错误 1

make[1]: *** [drivers/gpio] 错误 2

make: *** [drivers] 错误 2

我到drivers/gpio/目录下修改makefile把gpiolib.c给屏蔽了。但是新的问题又来了:

scripts/kconfig/mconf arch/arm/Kconfig

#

# using defaults found in /boot/config-2.6.25.6-27.fc8

#

/boot/config-2.6.25.6-27.fc8:1622:warning: symbol value 'm' invalid for IWL4965

/boot/config-2.6.25.6-27.fc8:1769:warning: symbol value 'm' invalid for ISDN

Your display is too small to run Menuconfig!

t must be at least 19 lines by 80 columns.

make[1]: *** [menuconfig] 错误 1

make: *** [menuconfig] 错误 2

没办法我换了个版本,2.6.25重新来过,可在make之后问题又来了:

include/asm/glue.h:119:2: #error Unknown data abort handler type

In file included from include/linux/mm_types.h:13,

from include/linux/sched.h:61,

from arch/arm/kernel/asm-offsets.c:13:

include/asm/page.h:103:2: #error Unknown user operations model

In file included from include/asm/semaphore.h:13,

from include/linux/sched.h:64,

from arch/arm/kernel/asm-offsets.c:13:

include/asm/locks.h:15:5: warning: "__LINUX_ARM_ARCH__" is not defined

make[1]: *** [arch/arm/kernel/asm-offsets.s] 错误 1

make: *** [prepare0] 错误 2

换版本2.6.27,在make之后:

arch/arm/plat-s3c24xx/gpiolib.c:254: undefined reference to `gpiochip_add'

make: *** [.tmp_vmlinux1] 错误 1

我把gpiolib给屏蔽了但还是出现错误:

rivers/gpio/gpiolib.c: In function `gpiolib_dbg_show':

drivers/gpio/gpiolib.c:1060: error: implicit declaration of function `gpio_to_irq'

make[2]: *** [drivers/gpio/gpiolib.o] 错误 1

make[1]: *** [drivers/gpio] 错误 2

make: *** [drivers] 错误 2

换版本,因为我个人感觉我用的这些版本里对arm的支持太多了,像我选的arm2410的支持就同时支持2440,2400等好几个。所以我用了2.6.15在make之后:

drivers/media/radio/radio-maestro.c:294: warning: comparison is always true due to limited range of data type

drivers/media/radio/radio-maestro.c:294: warning: comparison is always true due to limited range of data type

drivers/media/radio/radio-maestro.c:297: warning: comparison is always true due to limited range of data type

drivers/media/radio/radio-maestro.c:297: warning: comparison is always true due to limited range of data type

make[3]: *** [drivers/media/radio/radio-maestro.o] 错误 1

make[2]: *** [drivers/media/radio] 错误 2

make[1]: *** [drivers/media] 错误 2

make: *** [drivers] 错误 2

老方法修改当前目录的makefile。在编译:

make[3]: *** [drivers/video/console/vgacon.o] 错误 1

make[2]: *** [drivers/video/console] 错误 2

make[1]: *** [drivers/video] 错误 2

make: *** [drivers] 错误 2

在make menuconfig时Graphics support ->console display driver support->vga text console(不选这个)在编译:

usr/local/arm/3.4.1/bin/arm-linux-ld: no machine record defined

make: *** [.tmp_vmlinux1] 错误 1

在 google 查到的都是说arch/arm/kernel/vmlinux.lds的最后两行(如下),给注释起来,但是没说为什么

ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")

ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined"

后来自己到 arch/arm/kernel/vmlinux.lds 看注释才知道

These must never be empty

If you have to comment these two assert statements out, your

binutils is too old (for other reasons as well)

在编译通过。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wzygwy.html