全部博文(1493)
分类:
2012-09-25 13:55:30
原文地址:LINUX内核移植遇到的问题解决 作者:rojian
问题一:linux2.6.30内核编译『zImage』出现Error: unrecognized/unsupported machine ID
解决方法一
======================================================
Linux 内核启动时出现:bad machine ID,原因大致是u-boot 传递给
内核的machine ID错误,可以手动在内核源代码中添加machine ID.
解决方法一:
在u-boot 命令行中输入bdinfo
查看板卡信息,我的输出如下:
FS2410# bdinfo
arch_number = 0x000000C1
env_t = 0x00000000
boot_params = 0x30000100
DRAM bank = 0x00000000
-> start = 0x30000000
-> size = 0x04000000
ethaddr = 08:00:3E:26:0A:5B
ip_addr = 10.1.8.245
baudrate = 115200 bps
修改内核的arch/arm/kernel/head.S,直接将s3c2410的参数赋给内核
# cd linux-2.6.19
# vi arch/arm/kernel/head.S +72
----------------------------------------------
70 __INIT
71 .type stext, %function
72 ENTRY(stext)
修改arch/arm/plat-s3c24xx/common-smdk.c中111行的static struct mtd_partition smdk_default_nand_part[]的nandflash分区为:
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "Rojian_Boot",
.size = 0x00040000,
.offset = 0x00000000,
},
[1] = {
.name = " Rojian_param",
.offset = 0x00040000,
.size =0x00020000,
},
[2] = {
.name = " Rojian_kernel",
.offset = 0x00200000,
.size = 0x00300000,
},
[3] = {
.name = " Rojian_yaff2",
.offset = 0x00500000,
.size = MTDPART_SIZ_FULL,
}
};
然后修改“drivers/mtd/nand/s3c2410.c”文件的752行(Linux-2.6.30.4)或者669行(Linux-2.6.25.8),将原来的内容改为如下所示:
chip->ecc.mode =NAND_ECC_NONE;
最后在终端输入#make menuconfig配置相关选项。
问题四:编译内核时出现问题[drivers/video/console/vgacon.o]
drivers/video/console/vgacon.o:987:warning:comparison is always true due to limited range of data type
make[3]:***[drivers/video/console/vgacon.o] error 1
make[2]:***[drivers/video/console2] error 2
make[1]:***[drivers/video1] error 2
make:***[drivers] error 2
解决方法:
在make menuconfig 时
Graphics support ->
console display driver support->
vga text console(不选这个)
问题五:red hat在哪里设置机器IP
可以进入/etc/sysconfig/network-scripts。找到ifcfg-eth0.编辑它如下:
DEVICE = eth0
ONBOOT = yes
BOOTPROTO = static
IPADDR= 10.9.100.221(你需要的固定ip)
NETMASK=255.0.0.0
GATEWAY=10.255.255.254
如果需要动态分配IP,那么
DEVICE = eth0
ONBOOT = yes
USERCTL = yes
BOOTPROTO = dhcp
改了再运行/etc/rc.d/init.d/network restart
问题六:编译busybox-1.13.0错误解决
In file included from /opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/linux/if_tunnel.h:5,
from /opt/EmbedSky/BusyBox-1.2.0/networking/libiproute/iptunnel.c:32:
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/linux/ip.h:85: error: redefinition of 'struct iphdr'
make[1]: *** [/opt/EmbedSky/BusyBox-1.2.0/networking/libiproute/iptunnel.o] Error 1
make: *** [_all] Error 2
解决办法:
make menuconfig找到下面的这一个设置项:
networking utilites->ip tunnel
在[ *] ip tunnel用空格键取消 *即变成 [ ] ip tunnel 保存即可