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

时间:2022-11-28 04:46:14

一 前言
  本文旨在将 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: Nosuch file or directory

In file included frominclude/libbb.h:13,

frominclude/busybox.h:10,

fromapplets/applets.c:11:

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

include/platform.h:107:21: endian.h: Nosuch 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 frominclude/busybox.h:10,

fromapplets/applets.c:11:

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

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

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

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

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

include/libbb.h:20:20: mntent.h: Nosuch file or directory

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

In file included frominclude/libbb.h:62,

frominclude/busybox.h:10,

fromapplets/applets.c:11:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

In file included frominclude/libbb.h:63,

frominclude/busybox.h:10,

fromapplets/applets.c:11:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

In file included frominclude/libbb.h:67,

frominclude/busybox.h:10,

fromapplets/applets.c:11:

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

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

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

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

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

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

In file included frominclude/busybox.h:10,

fromapplets/applets.c:11:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

include/libbb.h:294: warning: datadefinition 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: `structsockaddr' declared inside parameter list

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

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

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

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

include/libbb.h:321: warning: datadefinition 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 errorbefore "sa_family_t"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

In file included frominclude/libbb.h:510,

frominclude/busybox.h:10,

fromapplets/applets.c:11:

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

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

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

In file included frominclude/libbb.h:510,

frominclude/busybox.h:10,

fromapplets/applets.c:11:

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

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

include/xatonum.h:158: warning: noprevious 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: (Eachundeclared identifier is reported only once

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

In file included frominclude/busybox.h:10,

fromapplets/applets.c:11:

include/libbb.h: At top level:

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

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

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

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

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

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

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

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

include/libbb.h:531: warning: shadoweddeclaration is here

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

include/libbb.h:987: warning: shadoweddeclaration is here

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

include/libbb.h:1007: warning: shadoweddeclaration is here

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

In file included fromapplets/applets.c:11:

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

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

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

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

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

include/busybox.h:33: warning: datadefinition 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] Error1

make: *** [applets] Error 2

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

 

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

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

 

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

sudo skyeye -e vmlinux

 

OK!!!