构建 arm-linux 仿真运行环境 (skyeye + arm-linux + NFS)

一 前言
本文旨在将 arm-linux 在 skyeye 上搭建起来,并在 arm-linux 上能成功 mount
NFS 为目标, 最终我们能在 arm-linux 里运行我们自己的应用程序. 其实在 skyeye 上移
植 arm-linux 并非难事,网上也有不少资料, 只是大都遗漏细节, 以致细微之处卡壳,所以本
文力求详实清析, 希望能对大家有点用处。


二 安装 Skyeye
我们选定 skyeye 的 1.2.4 这个版本, 为了能让它上面运行的 arm-linx 能挂接 NFS,我
们需要修改 device/net/dev_net_cs8900a.c (修改后的文件在附件里), 再编译 skyeye。
操作如下, 先解压源码包:
#tar xzf skyeye-1.2.4_Rel.tar.gz
#cd skyeye-1.2.4

请用附件里的 dev_net_cs8900a.c 替换 device/net/dev_net_cs8900a.c 后执行编译:
#make NO_DBCT=1 NO_BFD=1

nandflash/nandflash_smallblock.c: 在函数‘nandflash_sb_setup’中:

nandflash/nandflash_smallblock.c:521: 警告: 隐式声明与内建函数‘free’不兼容

nandflash/nandflash_smallblock.c:528: 警告: 隐式声明与内建函数‘free’不兼容

nandflash/nandflash_smallblock.c:550: 警告: 隐式声明与内建函数‘free’不兼容

nandflash/nandflash_smallblock.c:555: 警告: 格式‘%d’需要类型‘int’,但实参 2 的 类型为‘__off64_t’

nandflash/nandflash_smallblock.c:559: 警告: 隐式声明与内建函数‘free’不兼容

nandflash/nandflash_smallblock.c:539: 警告: 忽略声明有 warn_unused_result 属性 的‘write’的返回值

nandflash/nandflash_smallblock.c: 在函数‘nandflash_sb_uninstall’中:

nandflash/nandflash_smallblock.c:612: 警告: 隐式声明与内建函数‘free’不兼容

在函数‘open’中,

内联自‘nandflash_sb_setup’于 nandflash/nandflash_smallblock.c:519:

/usr/include/bits/fcntl2.h:51: 错误: 调用‘__open_missing_mode’,声明有错误属性 :open with O_CREAT in second argument needs 3 arguments

make[2]: *** [nandflash_smallblock.o] 错误 1

make[2]:正在离开目录 `/home/rambo/fc/skyeye-1.2.6_rc1/device'

make[1]: *** [all-recursive] 错误 1

make[1]:正在离开目录 `/home/rambo/fc/skyeye-1.2.6_rc1'

make: *** [all] 错误 2

搜到的解决方法

sudo rm /usr/bin/gcc (删除GCC,它只是个到gcc-4.3.2的软连接文件)

sudo ln -s /usr/bin/gcc-4.1 /usr/bin/gcc (建立GCC到gcc-4.1的软连接)

2)

/usr/include/bits/fcntl2.h:51: 错误: 调用‘__open_missing_mode’,声明有错误属性:open with O_CREAT in second argument needs 3 arguments

打 开错误提示的 ./device/nandflash/nandflash_smallblock.c 文件,约在519行的 if ((nf->fdump= open(dev->dump, FILE_FLAG)) 0),open在调用的时候只有两个参数,赶紧给加上个0777,代码成了 if ((nf->fdump= open(dev->dump, FILE_FLAG,0777)) > 0)

编译完后生成的 skyeye 在 binary 下,将其拷贝至 /usr/local/bin/ 下:
#cp binary/skyeye /usr/local/bin


三 编译内核
我们选定 linux-2.6.14.tar.bz2 这个版本, 交叉编译器用 arm-linux-gcc 3.4.1 (对
2.6 内核用 3.4 以下的版本编译经常会出现问题)。操作步骤如下:

1.假定内核源码包在 /root 下, 首先解压源码:
#cd /root
#tar xjf linux-2.6.14.tar.bz2

2.进入内核目录:
#cd linux-2.6.14

修改此目录下的 Makefile, 将
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?=
改为
ARCH ?= arm
CROSS_COMPILE ?= /usr/local/arm/3.4.1/bin/arm-linux-

3.生成默认的内核配置文件(for s3c2410):
#make smdk2410_defconfig

4.为内核添加 cs8900(见附件) 网卡驱动,以支持 NFS 挂接:
(1)复制 cs8900 驱动到 drivers/net/arm 目录
#cp cs8900.c drivers/net/arm
#cp cs8900.h drivers/net/arm

(2)修改 drivers/net/arm 目录下的 Kconfig 文件, 在最后添加:
config ARM_CS8900
tristate "CS8900 support"
depends on NET_ETHERNET && ARM && ARCH_SMDK2410
help
Support for CS8900A chipset based Ethernet cards. If you have a network
(Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available
from as well as .To compile this driver as a module, choose M here and read.
The module will be called cs8900.o.

注:在运行 make menuconfig 命令时就会出现: [ ] CS8900 support 这一选项

(3)修改 drivers/net/arm 目录下的Makefile文件,在最后添加如下内容:
obj-$(CONFIG_ARM_CS8900) += cs8900.o

注:2.6 版本内核的 Makefile 也与 2.4 的有所不同, 添加以上语句, 就会使内核在
编译的时候根据配置将cs8900A的驱动程序以模块或静态的方式编译到内核当中。

(4)修改 arch/arm/mach-s3c2410/mach-smdk2410.c
在此文件中找到 smdk2410_iodesc[] 结构数组,添加如下如下内容:

{vSMDK2410_ETH_IO,pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE}

修改之后变成:

static struct map_desc smdk2410_iodesc[] __initdata = {
/* nothing here yet */
/* Map the ethernet controller CS8900A */
{vSMDK2410_ETH_IO,pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE}
};

并且添加一个头文件引用:
#include <asm-arm/arch-s3c2410/smdk2410.h>

(5)在 include/asm-arm/arch-s3c2410 目录下创建文件 smdk2410.h
#ifndef _INCLUDE_SMDK2410_H_
#define _INCLUDE_SMDK2410_H_

#include <linux/config.h>
#define pSMDK2410_ETH_IO 0x19000000
#define vSMDK2410_ETH_IO 0xE0000000
#define SMDK2410_ETH_IRQ IRQ_EINT9

#endif

5.参照 http://skyeye.wiki.sourceforge.net/Linux 修改内核文件
修改 include/asm-arm/arch-s3c2410/map.h
#define S3C2410_CS6 (0x30000000UL)
to
#define S3C2410_CS6 (0xC0000000UL)

修改 include/asm-arm/arch-s3c2410/memory.h
#define PHYS_OFFSET (0x30000000UL)
to
#define PHYS_OFFSET (0xC0000000UL)

6.裁剪/定制内核
(1)#make menuconfig
(2)设置内核启动参数
Boot options ---> Default kernel command string:
mem=32M console=ttySAC0 root=/dev/ram initrd=0xc0800000,0x00800000 ramdisk_size=8192 rw
(3)设置 CS8900 的支持
Device Drivers --->
Network device support --->
Ethernet (10 or 100Mbit) ---> [] CS8900 support
选中 [*] CS8900 support
(4)设置 initrd 的支持
Device Drivers ---> Block devices ---> [ ] RAM disk support
下面三项必须设置:
1.确保 RAM disk support 被选中
2.相应的将默认的 (4096) Default RAM disk size (kbytes) 改成 8192;
3.Initial RAM disk (initrd) support 一定要选中, 切记!
(5)设置 NFS 的支持
File systems ---> Network File Systems --->
至少确保下面两项被选中:
[*] NFS file system support
[*] Provide NFSv3 client support
(6)设置 ROM file system 的支持
File systems ---> [*] ROM file system support
确保 [*] ROM file system support 被选中
(7)设置 ext2 的支持
File systems ---> [*] Second extended fs support
确保 [*] Second extended fs support 被选中

7.编译
#make
编译完成后会有个 vmlinux 在当前目录下, 这就是我们要的 arm-linux 内核了


四 制作根文件系统 initrd.img(Initial RAM disk)
我们选定 busybox-1.9.2.tar.bz2 这个版本, 以静态方式编译, 即生成的 busybox 不需
要共享库的支持就能运行。这样做我们就不需要布署程序库了。缺点是自己写的 arm-linux 程序在
这个根文件系统中是不能运行的,因为缺少共享程序库的支持。不过别担心,我们会解决这个问题的,稍
后你将看到,通过在 arm-linux 里以挂接 NFS 的方式, 将宿主机的 arm-linux-gcc 编译器的
库文件挂到 arm-linux 的 /lib 下, 就可完美的运行我们自己的程序了。好,一步步来,先来看看
根文件系统的制作:

1.解压源码包
#tar xjf busybox-1.9.2.tar.bz2
#cd busybox-1.9.2
2.修改 Makefile, 将
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?=
改为
ARCH ?= arm
CROSS_COMPILE ?= /usr/local/arm/3.3.2/bin/arm-linux-

注:这个版本的 busybox 用 3.4.1 的 arm-linux-gcc 编译有些问题, 用 3.3.2 版则可顺利编译。
3.定制 busybox
#make menuconfig

设置静态编译方式
Busybox Settings ---> Build Options ---> [*] Build BusyBox as a static binary (no shared libs)
确保 [*] Build BusyBox as a static binary (no shared libs) 被选中
4.执行 make 编译
#make

编译出错, 信息如下:
applets/applets.c:15:2: warning: #warning Static linking against glibc produces buggy executables
applets/applets.c:16:2: warning: #warning (glibc does not cope well with ld --gc-sections).
applets/applets.c:17:2: warning: #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
applets/applets.c:18:2: warning: #warning Note that glibc is unsuitable for static linking anyway.
applets/applets.c:19:2: warning: #warning If you still want to do it, remove -Wl,--gc-sections
applets/applets.c:20:2: warning: #warning from scripts/trylink and remove this warning.
applets/applets.c:21:2: error: #error Aborting compilation.
make[1]: *** [applets/applets.o] Error 1

按照提示,修改 scripts/trylink, 将此文件里面有 -Wl,--gc-sections 的行都删除掉,
然后重新 make
#make

还是出错, 信息如下:
root@hukq-desktop:~/busybox/busybox-1.9.2# make
CC applets/applets.o
applets/applets.c:15:2: warning: #warning Static linking against glibc produces buggy executables
applets/applets.c:16:2: warning: #warning (glibc does not cope well with ld --gc-sections).
applets/applets.c:17:2: warning: #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
applets/applets.c:18:2: warning: #warning Note that glibc is unsuitable for static linking anyway.
applets/applets.c:19:2: warning: #warning If you still want to do it, remove -Wl,--gc-sections
applets/applets.c:20:2: warning: #warning from scripts/trylink and remove this warning.
applets/applets.c:21:2: error: #error Aborting compilation.
make[1]: *** [applets/applets.o] Error 1
make: *** [applets] Error 2

修改文件 applets/applets.c 第 21 行, 将
#error Aborting compilation.
注释掉:
/*#error Aborting compilation.*/

执行 make 重新编译
#make

编译通过, busybox 被生成了, 然后执行
#make install

busybox 就被安装到默认的临时目录 _install 下了
5.制作 initrd.img
有了 busybox 后制作 initrd.img 就容易多了,只是说起来比较烦琐。以命令演示如下:

创建映像文件并挂到 initrd 目录
#mkdir initrd
#dd if=/dev/zero of=initrd.img bs=1k count=4096
#mke2fs -F -v initrd.img
#mount -o loop initrd.img initrd

将添加 busybox 到此映像文件
#cd initrd
#cp -r ../_install/* .

#创建必要的目录
#mkdir proc lib etc dev root home var tmp
#chmod 777 tmp

建立设备文件
#cd dev
#mknod -m 644 console c 5 1
#mknod -m 644 null c 1 3
#mknod -m 640 ram b 1 1
#mknod -m 644 mem c 1 1
#cd ..

创建脚本文件 etc/inittab, 内容如下:
::sysinit:/etc/init.d/rcS
::askfirst:-/bin/sh
::restart:/sbin/init
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a

设置此脚本执行权限
#chmod 644 etc/inittab

创建脚本文件 etc/init.d/rcS, 内容如下:
#!/bin/sh
/bin/mount -t proc none /proc
/sbin/ifconfig lo 127.0.0.1 up
/sbin/ifconfig eth0 10.0.0.2 netmask 255.0.0.0 up
hostname skyeye
mkdir /var/tmp
mkdir /var/log
mkdir /var/run
mkdir /var/lock
/bin/ash

设置此脚本执行权限
#chmod 755 etc/init.d/rcS

最后一步,执行实际的写入操作,生成 initrd.img
cd ..
umount initrd


五 运行 arm-linux
现在我们有了内核 vmlinux, 映像文件 initrd.img, 模拟程序 skyeye, 我们还需要一个
配置文件 skyeye.conf 进行 arm-linux 的仿真运行。

#mkdir /root/test
#cd /root/test

将 vmlinux, initrd.img 都拷贝到此目录, 在此目录下建立一个 skyeye 的配制文件
skyeye.conf, 文件内容如下:
cpu: arm920t
mach: s3c2410x

# physical memory
mem_bank: map=M, type=RW, addr=0xc0000000, size=0x00800000
mem_bank: map=M, type=RW, addr=0xc0800000, size=0x00800000, file=./initrd.img
mem_bank: map=M, type=RW, addr=0xc1000000, size=0x01000000

# all peripherals I/O mapping area
mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000

mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020
net: type=cs8900a, base=0x19000300, size=0x20,int=9, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1

lcd: type=s3c2410x, mod=gtk
#dbct:state=on


好了,试运行吧:
skyeye -e vmlinux

看到你的 arm-linux 运行了吗 :-)


六 在 arm-linux 里运行我们自己的程序
现在 arm-linux 在 skyeye 上跑起来了, 我们能运行里面的命令, 但这些都是 busybox
的,是系统程序。怎样才能在 arm-linux 里运行我们自己的程序呢? 有两种方案,我们不妨讨论一
下,择优而录之:

1.在制作根文件系统 initrd.img 的时候把我们自己的程序加进去,比如放在 /usr/bin 里
目录下,然后重新生成 initrd.img,并用这个新的根文件系统来运行 arm-linux。其实这
是我们的产品在 arm-linux 上发布的最终方式,但这有个缺点: 在产品开发/调试阶段这么
做比较麻烦,每修改一次代码就得 build 一次根文件系统。

2.利用挂接 NFS(Network file system) 的方式,我们访问/执行一个网络文件系统上的文件
就像它在本地一样,显然这么做能避免第一种方案的弊端! 如何实现呢? 随我来:

(1)在 arm-linux 的宿主机里配置 NFS Server (我用是 ubuntu,而且是在 vmware 里)
#apt-get install nfs-kernel-server
#apt-get install nfs-common
(2)编辑文件 /etc/exports, 内容如下(具体需求由你而定):
/test *(rw,sync,no_root_squash)
/usr/local/arm/3.3.2/lib *(ro,sync,no_root_squash)
(3)配置宿主机的 ip
#ifconfig eth1 down
#ifconfig eth1 10.0.0.1 netmask 255.0.0.0 up
注:你的可能是 eth0, 另外 ip 地址你也可自己定义,只要能和 arm-liux 通信
(4)重启 nfs server
#/usr/sbin/exportfs -r
#/etc/init.d/nfs-kernel-server restart
#/etc/init.d/portmap restart
注:可用 showmount -e 来验证你的配置是否成功
(5)在 skyeye 运行 arm-linux,为其配置 ip
#ifconfig lo down
#ifconfig eth0 down
#ifconfig lo 127.0.0.1 up
#ifconfig eth0 10.0.0.2 netmask 255.0.0.0 up
注:可将这几个命令加到 rcS 脚本里,让 arm-linux 启动时帮你做
(6)在 skyeye 上运行 arm-linux,演示 nfs 挂接
#mount -o nolock 10.0.0.1:/usr/local/arm/3.3.2/lib /lib
#export LD_LIBRARY_PATH=/lib
#mount -o nolock 10.0.0.1:/test /tmp

在宿主机的 /test 下建立文件 hello.c,用 arm-linux-gcc 3.3.2 编译
#cd /test
#arm-linux-gcc -o hello hello.c

在 arm-linux 的 /tmp 下看看,是不是有 hello.c 和 hello 这两个文件了? 试着运行看看:
#cd /tmp
#./hello

注:为了确认 arm-linux 能和宿主机通信, 可尝试以下手段:
(1)在宿主机上 ping 你的 arm-linux
#ping 10.0.0.2 -c 2
(2)在 arm-linux 里 ping 你的宿主机
#ping 10.0.0.1 -c 2
(3)如果相互都 ping 不通过,可这样做:
重新设置一下 arm-linux 的网络:
#ifconfig eth0 down
#ifconfig eth0 up

再重新设置一下宿主机的网络:
#ifconfig eth1 down
#ifconfig eth1 up

然后再像上一步那样,相互 ping 对方,直至 ping 通为止。能说的就这么多了,祝你好运!

自己在编译busybox时出错

<!-- @page { margin: 0.79in } P { margin-bottom: 0.08in } -->

yan@yan-laptop:~/Downloads/busybox-1.9.2$ make > busybox

applets/applets.c:10:20: assert.h: No such file or directory

In file included from include/libbb.h:13,

from include/busybox.h:10,

from applets/applets.c:11:

include/platform.h:106:23: byteswap.h: No such file or directory

include/platform.h:107:21: endian.h: No such file or directory

include/platform.h:113:7: warning: "__BYTE_ORDER" is not defined

include/platform.h:113:23: warning: "__BIG_ENDIAN" is not defined

include/platform.h:139:24: arpa/inet.h: No such file or directory

include/platform.h:186:5: warning: "__BIG_ENDIAN__" is not defined

include/platform.h:305:23: sys/mount.h: No such file or directory

In file included from include/busybox.h:10,

from applets/applets.c:11:

include/libbb.h:15:19: ctype.h: No such file or directory

include/libbb.h:16:20: dirent.h: No such file or directory

include/libbb.h:17:19: errno.h: No such file or directory

include/libbb.h:18:19: fcntl.h: No such file or directory

include/libbb.h:19:22: inttypes.h: No such file or directory

include/libbb.h:20:20: mntent.h: No such file or directory

include/libbb.h:21:19: netdb.h: No such file or directory

include/libbb.h:22:20: setjmp.h: No such file or directory

include/libbb.h:23:20: signal.h: No such file or directory

include/libbb.h:24:19: stdio.h: No such file or directory

include/libbb.h:25:20: stdlib.h: No such file or directory

include/libbb.h:28:20: string.h: No such file or directory

include/libbb.h:29:22: sys/poll.h: No such file or directory

include/libbb.h:30:23: sys/ioctl.h: No such file or directory

include/libbb.h:31:22: sys/mman.h: No such file or directory

include/libbb.h:32:24: sys/socket.h: No such file or directory

include/libbb.h:33:22: sys/stat.h: No such file or directory

include/libbb.h:34:24: sys/statfs.h: No such file or directory

include/libbb.h:35:22: sys/time.h: No such file or directory

include/libbb.h:36:23: sys/types.h: No such file or directory

include/libbb.h:37:22: sys/wait.h: No such file or directory

include/libbb.h:38:21: termios.h: No such file or directory

include/libbb.h:39:18: time.h: No such file or directory

include/libbb.h:40:20: unistd.h: No such file or directory

include/libbb.h:41:19: utime.h: No such file or directory

include/libbb.h:44:23: sys/param.h: No such file or directory

include/libbb.h:57:20: locale.h: No such file or directory

In file included from include/libbb.h:62,

from include/busybox.h:10,

from applets/applets.c:11:

include/pwd_.h:37: error: parse error before "uid_t"

include/pwd_.h:37: warning: no semicolon at end of struct or union

include/pwd_.h:38: warning: type defaults to `int' in declaration of `pw_gid'

include/pwd_.h:38: warning: data definition has no type or storage class

include/pwd_.h:42: error: parse error before '}' token

include/pwd_.h:75: error: parse error before '*' token

include/pwd_.h:75: warning: function declaration isn't a prototype

include/pwd_.h:79: error: parse error before "FILE"

include/pwd_.h:79: warning: function declaration isn't a prototype

include/pwd_.h:82: error: parse error before "__uid"

include/pwd_.h:82: warning: function declaration isn't a prototype

include/pwd_.h:99: error: parse error before "__uid"

include/pwd_.h:102: warning: function declaration isn't a prototype

include/pwd_.h:111: error: parse error before '*' token

include/pwd_.h:114: warning: function declaration isn't a prototype

include/pwd_.h:119: error: parse error before "__uid"

include/pwd_.h:119: warning: function declaration isn't a prototype

In file included from include/libbb.h:63,

from include/busybox.h:10,

from applets/applets.c:11:

include/grp_.h:37: error: parse error before "gid_t"

include/grp_.h:37: warning: no semicolon at end of struct or union

include/grp_.h:39: error: parse error before '}' token

include/grp_.h:44: warning: type defaults to `int' in declaration of `gid_t'

include/grp_.h:44: error: parse error before '*' token

include/grp_.h:44: warning: function declaration isn't a prototype

include/grp_.h:78: error: parse error before '*' token

include/grp_.h:78: warning: function declaration isn't a prototype

include/grp_.h:82: error: parse error before "FILE"

include/grp_.h:82: warning: function declaration isn't a prototype

include/grp_.h:85: error: parse error before "__gid"

include/grp_.h:85: warning: function declaration isn't a prototype

include/grp_.h:103: error: parse error before "__gid"

include/grp_.h:105: warning: function declaration isn't a prototype

include/grp_.h:115: error: parse error before '*' token

include/grp_.h:118: warning: function declaration isn't a prototype

include/grp_.h:123: error: parse error before "gid_t"

include/grp_.h:124: warning: function declaration isn't a prototype

include/grp_.h:129: error: parse error before "gid_t"

include/grp_.h:129: warning: function declaration isn't a prototype

In file included from include/libbb.h:67,

from include/busybox.h:10,

from applets/applets.c:11:

include/shadow_.h:87: error: parse error before '*' token

include/shadow_.h:87: warning: function declaration isn't a prototype

include/shadow_.h:90: error: parse error before "FILE"

include/shadow_.h:90: warning: function declaration isn't a prototype

include/shadow_.h:104: error: parse error before '*' token

include/shadow_.h:106: warning: function declaration isn't a prototype

In file included from include/busybox.h:10,

from applets/applets.c:11:

include/libbb.h:215: error: parse error before "mode"

include/libbb.h:215: warning: function declaration isn't a prototype

include/libbb.h:216: warning: `struct stat' declared inside parameter list

include/libbb.h:216: warning: its scope is only this definition or declaration, which is probably not what you want

include/libbb.h:227: warning: `struct stat' declared inside parameter list

include/libbb.h:228: warning: `struct stat' declared inside parameter list

include/libbb.h:234: error: parse error before "bb_copyfd_eof"

include/libbb.h:234: warning: type defaults to `int' in declaration of `bb_copyfd_eof'

include/libbb.h:234: warning: data definition has no type or storage class

include/libbb.h:235: error: parse error before "bb_copyfd_size"

include/libbb.h:235: error: parse error before "off_t"

include/libbb.h:235: warning: type defaults to `int' in declaration of `bb_copyfd_size'

include/libbb.h:235: warning: function declaration isn't a prototype

include/libbb.h:235: warning: data definition has no type or storage class

include/libbb.h:236: error: parse error before "off_t"

include/libbb.h:236: warning: function declaration isn't a prototype

include/libbb.h:239: error: parse error before "sz"

include/libbb.h:239: warning: function declaration isn't a prototype

include/libbb.h:258: error: parse error before '*' token

include/libbb.h:258: warning: type defaults to `int' in declaration of `xopendir'

include/libbb.h:258: warning: data definition has no type or storage class

include/libbb.h:259: error: parse error before '*' token

include/libbb.h:259: warning: type defaults to `int' in declaration of `warn_opendir'

include/libbb.h:259: warning: data definition has no type or storage class

include/libbb.h:278: error: parse error before "gid"

include/libbb.h:278: warning: function declaration isn't a prototype

include/libbb.h:279: error: parse error before "uid"

include/libbb.h:279: warning: function declaration isn't a prototype

include/libbb.h:283: warning: `struct stat' declared inside parameter list

include/libbb.h:289: error: parse error before "xlseek"

include/libbb.h:289: error: parse error before "off_t"

include/libbb.h:289: warning: type defaults to `int' in declaration of `xlseek'

include/libbb.h:289: warning: function declaration isn't a prototype

include/libbb.h:289: warning: data definition has no type or storage class

include/libbb.h:290: error: parse error before "fdlength"

include/libbb.h:290: warning: type defaults to `int' in declaration of `fdlength'

include/libbb.h:290: warning: data definition has no type or storage class

include/libbb.h:293: error: parse error before "socktype_t"

include/libbb.h:293: warning: type defaults to `int' in declaration of `socktype_t'

include/libbb.h:293: warning: data definition has no type or storage class

include/libbb.h:294: error: parse error before "family_t"

include/libbb.h:294: warning: type defaults to `int' in declaration of `family_t'

include/libbb.h:294: warning: data definition has no type or storage class

include/libbb.h:298: error: `SOCK_STREAM' undeclared here (not in a function)

include/libbb.h:299: error: `SOCK_DGRAM' undeclared here (not in a function)

include/libbb.h:300: error: `SOCK_RDM' undeclared here (not in a function)

include/libbb.h:301: error: `SOCK_SEQPACKET' undeclared here (not in a function)

include/libbb.h:302: error: `SOCK_RAW' undeclared here (not in a function)

include/libbb.h:305: error: `AF_UNSPEC' undeclared here (not in a function)

include/libbb.h:306: error: `AF_INET' undeclared here (not in a function)

include/libbb.h:307: error: `AF_INET6' undeclared here (not in a function)

include/libbb.h:308: error: `AF_UNIX' undeclared here (not in a function)

include/libbb.h:309: error: `AF_PACKET' undeclared here (not in a function)

include/libbb.h:312: error: `AF_NETLINK' undeclared here (not in a function)

include/libbb.h:317: warning: `struct sockaddr' declared inside parameter list

include/libbb.h:319: warning: `struct sockaddr' declared inside parameter list

include/libbb.h:320: error: parse error before "xsendto"

include/libbb.h:321: warning: `struct sockaddr' declared inside parameter list

include/libbb.h:321: warning: type defaults to `int' in declaration of `xsendto'

include/libbb.h:321: warning: data definition has no type or storage class

include/libbb.h:335: error: field `sa' has incomplete type

include/libbb.h:336: error: field `sin' has incomplete type

include/libbb.h:338: error: field `sin6' has incomplete type

include/libbb.h:345: error: field `sa' has incomplete type

include/libbb.h:346: error: field `sin' has incomplete type

include/libbb.h:348: error: field `sin6' has incomplete type

include/libbb.h:385: error: parse error before "sa_family_t"

include/libbb.h:385: warning: function declaration isn't a prototype

include/libbb.h:386: error: parse error before "sa_family_t"

include/libbb.h:386: warning: function declaration isn't a prototype

include/libbb.h:415: error: parse error before "send_to_from"

include/libbb.h:417: warning: type defaults to `int' in declaration of `send_to_from'

include/libbb.h:417: warning: data definition has no type or storage class

include/libbb.h:418: error: parse error before "recv_from_to"

include/libbb.h:420: warning: type defaults to `int' in declaration of `recv_from_to'

include/libbb.h:420: warning: data definition has no type or storage class

include/libbb.h:448: error: parse error before "safe_read"

include/libbb.h:448: warning: type defaults to `int' in declaration of `safe_read'

include/libbb.h:448: warning: data definition has no type or storage class

include/libbb.h:449: error: parse error before "full_read"

include/libbb.h:449: warning: type defaults to `int' in declaration of `full_read'

include/libbb.h:449: warning: data definition has no type or storage class

include/libbb.h:457: error: parse error before "read_close"

include/libbb.h:457: warning: type defaults to `int' in declaration of `read_close'

include/libbb.h:457: warning: data definition has no type or storage class

include/libbb.h:458: error: parse error before "open_read_close"

include/libbb.h:458: warning: type defaults to `int' in declaration of `open_read_close'

include/libbb.h:458: warning: data definition has no type or storage class

include/libbb.h:461: error: parse error before "safe_write"

include/libbb.h:461: warning: type defaults to `int' in declaration of `safe_write'

include/libbb.h:461: warning: data definition has no type or storage class

include/libbb.h:462: error: parse error before "full_write"

include/libbb.h:462: warning: type defaults to `int' in declaration of `full_write'

include/libbb.h:462: warning: data definition has no type or storage class

include/libbb.h:466: error: parse error before '*' token

include/libbb.h:466: warning: function declaration isn't a prototype

include/libbb.h:467: error: parse error before '*' token

include/libbb.h:467: warning: function declaration isn't a prototype

include/libbb.h:469: error: parse error before '*' token

include/libbb.h:469: warning: function declaration isn't a prototype

include/libbb.h:471: error: parse error before '*' token

include/libbb.h:471: warning: function declaration isn't a prototype

include/libbb.h:472: error: parse error before '*' token

include/libbb.h:472: warning: function declaration isn't a prototype

include/libbb.h:473: error: parse error before '*' token

include/libbb.h:473: warning: function declaration isn't a prototype

include/libbb.h:477: error: parse error before '*' token

include/libbb.h:477: warning: function declaration isn't a prototype

include/libbb.h:478: error: parse error before '*' token

include/libbb.h:478: warning: type defaults to `int' in declaration of `xfopen'

include/libbb.h:478: warning: data definition has no type or storage class

include/libbb.h:480: error: parse error before '*' token

include/libbb.h:480: warning: type defaults to `int' in declaration of `fopen_or_warn'

include/libbb.h:480: warning: data definition has no type or storage class

include/libbb.h:482: error: parse error before '*' token

include/libbb.h:482: warning: type defaults to `int' in declaration of `fopen_or_warn_stdin'

include/libbb.h:482: warning: data definition has no type or storage class

include/libbb.h:488: error: parse error before "nfds_t"

include/libbb.h:488: warning: `struct pollfd' declared inside parameter list

include/libbb.h:488: warning: function declaration isn't a prototype

In file included from include/libbb.h:510,

from include/busybox.h:10,

from applets/applets.c:11:

include/xatonum.h:99: error: parse error before "xatou32"

include/xatonum.h:100: warning: return type defaults to `int'

include/xatonum.h:100: warning: no previous prototype for `xatou32'

In file included from include/libbb.h:510,

from include/busybox.h:10,

from applets/applets.c:11:

include/xatonum.h:157: error: parse error before "bb_strtou32"

include/xatonum.h:158: warning: return type defaults to `int'

include/xatonum.h:158: warning: no previous prototype for `bb_strtou32'

include/xatonum.h: In function `bb_strtou32':

include/xatonum.h:159: error: `uint32_t' undeclared (first use in this function)

include/xatonum.h:159: error: (Each undeclared identifier is reported only once

include/xatonum.h:159: error: for each function it appears in.)

In file included from include/busybox.h:10,

from applets/applets.c:11:

include/libbb.h: At top level:

include/libbb.h:518: error: parse error before "xatou16"

include/libbb.h:518: warning: type defaults to `int' in declaration of `xatou16'

include/libbb.h:518: warning: data definition has no type or storage class

include/libbb.h:530: error: parse error before "uid_t"

include/libbb.h:530: warning: no semicolon at end of struct or union

include/libbb.h:531: warning: type defaults to `int' in declaration of `gid'

include/libbb.h:531: warning: data definition has no type or storage class

include/libbb.h:544: warning: declaration of `gid' shadows a global declaration

include/libbb.h:531: warning: shadowed declaration is here

include/libbb.h:546: error: parse error before "uid"

include/libbb.h:546: warning: function declaration isn't a prototype

include/libbb.h:547: error: parse error before "gid"

include/libbb.h:547: warning: function declaration isn't a prototype

include/libbb.h:572: error: parse error before "spawn"

include/libbb.h:572: warning: type defaults to `int' in declaration of `spawn'

include/libbb.h:572: warning: data definition has no type or storage class

include/libbb.h:573: error: parse error before "xspawn"

include/libbb.h:573: warning: type defaults to `int' in declaration of `xspawn'

include/libbb.h:573: warning: data definition has no type or storage class

include/libbb.h:592: error: parse error before "jmp_buf"

include/libbb.h:592: warning: no semicolon at end of struct or union

include/libbb.h:595: error: parse error before "option_mask32"

include/libbb.h:595: warning: type defaults to `int' in declaration of `option_mask32'

include/libbb.h:595: warning: data definition has no type or storage class

include/libbb.h:598: error: parse error before '}' token

include/libbb.h:664: error: parse error before "option_mask32"

include/libbb.h:664: warning: type defaults to `int' in declaration of `option_mask32'

include/libbb.h:664: warning: data definition has no type or storage class

include/libbb.h:665: error: parse error before "getopt32"

include/libbb.h:665: warning: type defaults to `int' in declaration of `getopt32'

include/libbb.h:665: warning: data definition has no type or storage class

include/libbb.h:705: error: parse error before "die_jmp"

include/libbb.h:705: warning: type defaults to `int' in declaration of `die_jmp'

include/libbb.h:705: warning: data definition has no type or storage class

include/libbb.h:797: warning: `struct mntent' declared inside parameter list

include/libbb.h:800: error: parse error before "speed"

include/libbb.h:800: warning: function declaration isn't a prototype

include/libbb.h:801: error: parse error before "tty_value_to_baud"

include/libbb.h:801: warning: type defaults to `int' in declaration of `tty_value_to_baud'

include/libbb.h:801: warning: data definition has no type or storage class

include/libbb.h:818: error: parse error before "mode_t"

include/libbb.h:818: warning: function declaration isn't a prototype

include/libbb.h:917: warning: `struct stat' declared inside parameter list

include/libbb.h:918: warning: `struct stat' declared inside parameter list

include/libbb.h:977: error: parse error before "DIR"

include/libbb.h:977: warning: no semicolon at end of struct or union

include/libbb.h:978: warning: type defaults to `int' in declaration of `shift_pages_to_bytes'

include/libbb.h:978: warning: data definition has no type or storage class

include/libbb.h:979: error: parse error before "shift_pages_to_kb"

include/libbb.h:979: warning: type defaults to `int' in declaration of `shift_pages_to_kb'

include/libbb.h:979: warning: data definition has no type or storage class

include/libbb.h:992: error: conflicting types for `gid'

include/libbb.h:531: error: previous declaration of `gid'

include/libbb.h:1009: error: parse error before '}' token

include/libbb.h:1009: warning: type defaults to `int' in declaration of `procps_status_t'

include/libbb.h:1009: warning: data definition has no type or storage class

include/libbb.h:1036: error: parse error before '*' token

include/libbb.h:1036: warning: type defaults to `int' in declaration of `alloc_procps_scan'

include/libbb.h:1036: warning: data definition has no type or storage class

include/libbb.h:1037: error: parse error before '*' token

include/libbb.h:1037: warning: function declaration isn't a prototype

include/libbb.h:1038: error: parse error before '*' token

include/libbb.h:1038: error: parse error before '*' token

include/libbb.h:1038: warning: type defaults to `int' in declaration of `procps_scan'

include/libbb.h:1038: warning: function declaration isn't a prototype

include/libbb.h:1038: warning: data definition has no type or storage class

include/libbb.h:1041: warning: declaration of `pid' shadows a global declaration

include/libbb.h:987: warning: shadowed declaration is here

include/libbb.h:1041: warning: declaration of `comm' shadows a global declaration

include/libbb.h:1007: warning: shadowed declaration is here

include/libbb.h:1042: error: parse error before '*' token

include/libbb.h:1042: warning: type defaults to `int' in declaration of `find_pid_by_name'

include/libbb.h:1042: warning: data definition has no type or storage class

include/libbb.h:1043: error: parse error before '*' token

include/libbb.h:1043: error: parse error before '*' token

include/libbb.h:1043: warning: type defaults to `int' in declaration of `pidlist_reverse'

include/libbb.h:1043: warning: function declaration isn't a prototype

include/libbb.h:1043: warning: data definition has no type or storage class

include/libbb.h:1051: error: parse error before "uint32_t"

include/libbb.h:1051: warning: no semicolon at end of struct or union

include/libbb.h:1052: warning: type defaults to `int' in declaration of `hash'

include/libbb.h:1052: warning: data definition has no type or storage class

include/libbb.h:1053: error: parse error before "wbuf"

include/libbb.h:1053: warning: type defaults to `int' in declaration of `wbuf'

include/libbb.h:1053: warning: data definition has no type or storage class

include/libbb.h:1054: error: parse error before '}' token

include/libbb.h:1054: warning: type defaults to `int' in declaration of `sha1_ctx_t'

include/libbb.h:1054: warning: data definition has no type or storage class

include/libbb.h:1055: error: parse error before '*' token

include/libbb.h:1055: warning: function declaration isn't a prototype

include/libbb.h:1056: error: parse error before "sha1_ctx_t"

include/libbb.h:1056: warning: function declaration isn't a prototype

include/libbb.h:1057: error: parse error before "sha1_ctx_t"

include/libbb.h:1057: warning: function declaration isn't a prototype

include/libbb.h:1060: error: parse error before "uint32_t"

include/libbb.h:1060: warning: no semicolon at end of struct or union

include/libbb.h:1061: warning: type defaults to `int' in declaration of `B'

include/libbb.h:1061: warning: data definition has no type or storage class

include/libbb.h:1062: error: parse error before "C"

include/libbb.h:1062: warning: type defaults to `int' in declaration of `C'

include/libbb.h:1062: warning: data definition has no type or storage class

include/libbb.h:1063: error: parse error before "D"

include/libbb.h:1063: warning: type defaults to `int' in declaration of `D'

include/libbb.h:1063: warning: data definition has no type or storage class

include/libbb.h:1064: error: parse error before "total"

include/libbb.h:1064: warning: type defaults to `int' in declaration of `total'

include/libbb.h:1064: warning: data definition has no type or storage class

include/libbb.h:1065: error: parse error before "buflen"

include/libbb.h:1065: warning: type defaults to `int' in declaration of `buflen'

include/libbb.h:1065: warning: data definition has no type or storage class

include/libbb.h:1067: error: parse error before '}' token

include/libbb.h:1067: warning: type defaults to `int' in declaration of `md5_ctx_t'

include/libbb.h:1067: warning: data definition has no type or storage class

include/libbb.h:1068: error: parse error before '*' token

include/libbb.h:1068: warning: function declaration isn't a prototype

include/libbb.h:1069: error: parse error before "md5_ctx_t"

include/libbb.h:1069: warning: function declaration isn't a prototype

include/libbb.h:1070: error: parse error before "md5_ctx_t"

include/libbb.h:1070: warning: function declaration isn't a prototype

include/libbb.h:1072: error: parse error before '*' token

include/libbb.h:1072: error: parse error before '*' token

include/libbb.h:1072: warning: type defaults to `int' in declaration of `crc32_filltable'

include/libbb.h:1072: warning: function declaration isn't a prototype

include/libbb.h:1072: warning: data definition has no type or storage class

In file included from applets/applets.c:11:

include/busybox.h:32: error: parse error before "applet_nameofs"

include/busybox.h:32: warning: type defaults to `int' in declaration of `applet_nameofs'

include/busybox.h:32: warning: data definition has no type or storage class

include/busybox.h:33: error: parse error before "applet_install_loc"

include/busybox.h:33: warning: type defaults to `int' in declaration of `applet_install_loc'

include/busybox.h:33: warning: data definition has no type or storage class

include/busybox.h:32: warning: array `applet_nameofs' assumed to have one element

include/busybox.h:33: warning: array `applet_install_loc' assumed to have one element

make[1]: *** [applets/applets.o] Error 1

make: *** [applets] Error 2

于是将arm-linux-换成3.4.1,编译成功!!

编译的内核启动总是提示eth0没有启动,报错

failed to setup_module (name:net, type:cs8900a)

查了好久,原来第一次运行时要用超级权限!

sudo skyeye -e vmlinux

OK!!!

你可能感兴趣的:(linux)