- 下载最新的版本为busybox-1.20.0
-
修改busybox的makefile:
CROSS_COMPILE ?= arm-linux-
ARCH ?= arm
-
Make menuconfig配置busybox
Busybox Settings --->
Build Options --->
Installation Options ("make install" behavior) --->
Busybox Library Tuning --->
-
编译busybox执行
Make install
这时候会提示一个错误提示说:
miscutils/ubi_tools.c:63:26: error: mtd/ubi-user.h: No such file or directory
miscutils/ubi_tools.c: In function 'ubi_tools_main':
miscutils/ubi_tools.c:133: error: 'UBI_DEV_NUM_AUTO' undeclared (first use in this function)
miscutils/ubi_tools.c:133: error: (Each undeclared identifier is reported only once
miscutils/ubi_tools.c:133: error: for each function it appears in.)
miscutils/ubi_tools.c:134: error: 'UBI_VOL_NUM_AUTO' undeclared (first use in this function)
miscutils/ubi_tools.c:153: error: storage size of 'req' isn't known
miscutils/ubi_tools.c:161: error: 'UBI_IOCATT' undeclared (first use in this function)
miscutils/ubi_tools.c:153: warning: unused variable 'req'
make[1]: *** [miscutils/ubi_tools.o] 错误 1
make: *** [miscutils] 错误 2
出现这么多的错误,核心问题就是出现在miscutils/ubi_tools.c:63:26: error: mtd/ubi-user.h: No such file or directory这个上面,无法找到mtd/ubi-user.h头文件,查阅了相关资料后,原来这是一个Linux下新支持的UBI文件系统,需要手 工加入。从Linux3.3.5的include\mtd\ubi-user.h拷贝到busybox下的include\mtd下,如果 busybox下的include没有mtd文件夹,那就先建立一个mtd文件夹,然后复制了。这样做了之后,编译就OK了。出现下面的信息就说明编译成 功了。
-
建立根目录,这里我们直接写一个脚本程序运create_rootfs.sh行就可以了,脚本的内容如下:
#!/bin/sh
echo "------Create rootfs directons start...--------"
mkdir rootfs
cd rootfs
echo "--------Create root,dev....----------"
mkdir root dev etc boot tmp var sys proc lib mnt home usr
mkdir etc/init.d etc/rc.d etc/sysconfig
mkdir usr/sbin usr/bin usr/lib usr/modules
echo "make node in dev/console dev/null"
mknod -m 600 dev/console c 5 1
mknod -m 600 dev/null c 1 3
mkdir mnt/etc mnt/jffs2 mnt/yaffs mnt/data mnt/temp
mkdir var/lib var/lock var/run var/tmp
chmod 777 tmp
chmod 777 var/tmp
echo "-------make direction done---------"运行脚本执行:
./ create_rootfs.sh
ls rootfs
boot dev etc home lib mnt proc root sys tmp usr var
-
etc/inittab 系统init进程配置文件,并更改权限 chmod +x inittab
::sysinit:/etc/init.d/rcS
::askfirst:-/bin/sh #没有这就不行,就不能打开console控制台。
::restart:/sbin/init
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff –a -
etc/init.d/rcS系统启动加载项文件,并更改权限chmod +x etc/init.d/rcS
#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
runlevel=S
prevlevel=N
umask 022
export PATH runlevel prevlevel
mount -a
mkdir /dev/pts
mount -t devpts devpts /dev/pts #用于telnet登录时使用echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s
mkdir -p /var/lock
/bin/hostname -F /etc/sysconfig/HOSTNAME -
etc/fstab 系统挂载文件系统列表文件
#device mount-point type option dump fsck order
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
mdev /dev ramfs defaults 0 0
none /var ramfs defaults 0 0
none /tmp ramfs defaults 0 0 -
etc/profile用户环境配置文件
# Ash profile
# vim: syntax= sh
# No core file by defaults
# ulimit - S - c 0> / dev/ null 2> & 1USER="id -un"
LOGNAME=$USER
PS1="[\u@\h \w]#" #\w 目录将显示全路径
PATH=$PATH
HOSTNAME= '/bin/hostname'
alias cls="clear"
export USER LOGNAME PS1 PATH -
/etc/passwd shadow 用户文件以及密码
把主机的passwd shadow 文件拷贝到/etc下
# cp /etc/passwd rootfs/etc
# cp /etc/group rootfs/etc
# cp /etc/shadow rootfs/etc -
etc/sysconfig/HOSTNAME的内容为你自己的名字即可,内容为"Pillar"
gedit /etc/sysconfig/HOSTNAME 然后键入 Pillar
-
在busybox目录下会看见 _install目录,里面有/bin /sbin l inuxr三个文件
将这三个目录或文件拷到第一步所建的rootfs文件夹下。#cp bin/ sbin/ linuxrc /home/rootfs -ra
在把_install目录的usr里面的bin,sbin也按照刚才的方法拷贝到rootfs目录下
切记一定要带上-a的参数,因为bin目录里大部分都是链接,如果不带-a的参数,拷过去之后会做相应的复制,不再是链接的形式
将交叉编译器下的lib下的库拷贝到lib文件夹下
cp /usr/local/arm/4.2.2-eabi/lib/* ./ -
这时候rootfs目录下的tree应该是这个样子的:
.
├── bin
│ ├── addgroup -> busybox
│ ├── adduser -> busybox
│ ├── ash -> busybox
│ ├── base64 -> busybox
│ ├── busybox
│ ├── cat -> busybox
│ ├── catv -> busybox
│ ├── chattr -> busybox
│ ├── chgrp -> busybox
│ ├── chmod -> busybox
│ ├── chown -> busybox
│ ├── conspy -> busybox
│ ├── cp -> busybox
│ ├── cpio -> busybox
│ ├── cttyhack -> busybox
│ ├── date -> busybox
│ ├── dd -> busybox
│ ├── delgroup -> busybox
│ ├── deluser -> busybox
│ ├── df -> busybox
│ ├── dmesg -> busybox
│ ├── dnsdomainname -> busybox
│ ├── dumpkmap -> busybox
│ ├── echo -> busybox
│ ├── ed -> busybox
│ ├── egrep -> busybox
│ ├── false -> busybox
│ ├── fdflush -> busybox
│ ├── fgrep -> busybox
│ ├── fsync -> busybox
│ ├── getopt -> busybox
│ ├── grep -> busybox
│ ├── gunzip -> busybox
│ ├── gzip -> busybox
│ ├── hostname -> busybox
│ ├── hush -> busybox
│ ├── ionice -> busybox
│ ├── iostat -> busybox
│ ├── ip -> busybox
│ ├── ipaddr -> busybox
│ ├── ipcalc -> busybox
│ ├── iplink -> busybox
│ ├── iproute -> busybox
│ ├── iprule -> busybox
│ ├── iptunnel -> busybox
│ ├── kill -> busybox
│ ├── linux32 -> busybox
│ ├── linux64 -> busybox
│ ├── ln -> busybox
│ ├── login -> busybox
│ ├── ls -> busybox
│ ├── lsattr -> busybox
│ ├── lzop -> busybox
│ ├── makemime -> busybox
│ ├── mkdir -> busybox
│ ├── mknod -> busybox
│ ├── mktemp -> busybox
│ ├── more -> busybox
│ ├── mount -> busybox
│ ├── mountpoint -> busybox
│ ├── mpstat -> busybox
│ ├── mt -> busybox
│ ├── mv -> busybox
│ ├── netstat -> busybox
│ ├── nice -> busybox
│ ├── pidof -> busybox
│ ├── ping -> busybox
│ ├── ping6 -> busybox
│ ├── pipe_progress -> busybox
│ ├── powertop -> busybox
│ ├── printenv -> busybox
│ ├── ps -> busybox
│ ├── pwd -> busybox
│ ├── reformime -> busybox
│ ├── rev -> busybox
│ ├── rm -> busybox
│ ├── rmdir -> busybox
│ ├── rpm -> busybox
│ ├── run-parts -> busybox
│ ├── scriptreplay -> busybox
│ ├── sed -> busybox
│ ├── setarch -> busybox
│ ├── setserial -> busybox
│ ├── sh -> busybox
│ ├── sleep -> busybox
│ ├── stat -> busybox
│ ├── stty -> busybox
│ ├── su -> busybox
│ ├── sync -> busybox
│ ├── tar -> busybox
│ ├── touch -> busybox
│ ├── true -> busybox
│ ├── umount -> busybox
│ ├── uname -> busybox
│ ├── usleep -> busybox
│ ├── vi -> busybox
│ ├── watch -> busybox
│ └── zcat -> busybox
├── boot
├── dev
│ ├── console
│ └── null
├── etc
│ ├── fstab
│ ├── group
│ ├── init.d
│ │ └── rcS
│ ├── inittab
│ ├── passwd
│ ├── profile
│ ├── rc.d
│ ├── resolv.conf
│ ├── shadow
│ └── sysconfig
│ └── HOSTNAME
├── home
├── lib
├── linuxrc -> bin/busybox
├── mnt
│ ├── data
│ ├── etc
│ ├── jffs2
│ ├── temp
│ └── yaffs
├── proc
├── root
├── sbin
│ ├── acpid -> ../bin/busybox
│ ├── adjtimex -> ../bin/busybox
│ ├── arp -> ../bin/busybox
│ ├── blkid -> ../bin/busybox
│ ├── blockdev -> ../bin/busybox
│ ├── bootchartd -> ../bin/busybox
│ ├── depmod -> ../bin/busybox
│ ├── devmem -> ../bin/busybox
│ ├── fbsplash -> ../bin/busybox
│ ├── fdisk -> ../bin/busybox
│ ├── findfs -> ../bin/busybox
│ ├── freeramdisk -> ../bin/busybox
│ ├── fsck -> ../bin/busybox
│ ├── fsck.minix -> ../bin/busybox
│ ├── getty -> ../bin/busybox
│ ├── halt -> ../bin/busybox
│ ├── hdparm -> ../bin/busybox
│ ├── hwclock -> ../bin/busybox
│ ├── ifconfig -> ../bin/busybox
│ ├── ifdown -> ../bin/busybox
│ ├── ifenslave -> ../bin/busybox
│ ├── ifup -> ../bin/busybox
│ ├── init -> ../bin/busybox
│ ├── insmod -> ../bin/busybox
│ ├── klogd -> ../bin/busybox
│ ├── loadkmap -> ../bin/busybox
│ ├── logread -> ../bin/busybox
│ ├── losetup -> ../bin/busybox
│ ├── lsmod -> ../bin/busybox
│ ├── makedevs -> ../bin/busybox
│ ├── man -> ../bin/busybox
│ ├── mdev -> ../bin/busybox
│ ├── mkdosfs -> ../bin/busybox
│ ├── mke2fs -> ../bin/busybox
│ ├── mkfs.ext2 -> ../bin/busybox
│ ├── mkfs.minix -> ../bin/busybox
│ ├── mkfs.vfat -> ../bin/busybox
│ ├── mkswap -> ../bin/busybox
│ ├── modinfo -> ../bin/busybox
│ ├── modprobe -> ../bin/busybox
│ ├── nameif -> ../bin/busybox
│ ├── pivot_root -> ../bin/busybox
│ ├── poweroff -> ../bin/busybox
│ ├── raidautorun -> ../bin/busybox
│ ├── reboot -> ../bin/busybox
│ ├── rmmod -> ../bin/busybox
│ ├── route -> ../bin/busybox
│ ├── runlevel -> ../bin/busybox
│ ├── setconsole -> ../bin/busybox
│ ├── slattach -> ../bin/busybox
│ ├── start-stop-daemon -> ../bin/busybox
│ ├── sulogin -> ../bin/busybox
│ ├── swapoff -> ../bin/busybox
│ ├── swapon -> ../bin/busybox
│ ├── switch_root -> ../bin/busybox
│ ├── sysctl -> ../bin/busybox
│ ├── syslogd -> ../bin/busybox
│ ├── tunctl -> ../bin/busybox
│ ├── udhcpc -> ../bin/busybox
│ ├── vconfig -> ../bin/busybox
│ ├── watchdog -> ../bin/busybox
│ └── zcip -> ../bin/busybox
├── sys
├── tmp
├── usr
│ ├── bin
│ │ ├── [ -> http://www.cnblogs.com/bin/busybox
│ │ ├── [[ -> http://www.cnblogs.com/bin/busybox
│ │ ├── add-shell -> http://www.cnblogs.com/bin/busybox
│ │ ├── arping -> http://www.cnblogs.com/bin/busybox
│ │ ├── awk -> http://www.cnblogs.com/bin/busybox
│ │ ├── basename -> http://www.cnblogs.com/bin/busybox
│ │ ├── beep -> http://www.cnblogs.com/bin/busybox
│ │ ├── bunzip2 -> http://www.cnblogs.com/bin/busybox
│ │ ├── bzcat -> http://www.cnblogs.com/bin/busybox
│ │ ├── bzip2 -> http://www.cnblogs.com/bin/busybox
│ │ ├── cal -> http://www.cnblogs.com/bin/busybox
│ │ ├── chat -> http://www.cnblogs.com/bin/busybox
│ │ ├── chpst -> http://www.cnblogs.com/bin/busybox
│ │ ├── chrt -> http://www.cnblogs.com/bin/busybox
│ │ ├── chvt -> http://www.cnblogs.com/bin/busybox
│ │ ├── cksum -> http://www.cnblogs.com/bin/busybox
│ │ ├── clear -> http://www.cnblogs.com/bin/busybox
│ │ ├── cmp -> http://www.cnblogs.com/bin/busybox
│ │ ├── comm -> http://www.cnblogs.com/bin/busybox
│ │ ├── crontab -> http://www.cnblogs.com/bin/busybox
│ │ ├── cryptpw -> http://www.cnblogs.com/bin/busybox
│ │ ├── cut -> http://www.cnblogs.com/bin/busybox
│ │ ├── dc -> http://www.cnblogs.com/bin/busybox
│ │ ├── deallocvt -> http://www.cnblogs.com/bin/busybox
│ │ ├── diff -> http://www.cnblogs.com/bin/busybox
│ │ ├── dirname -> http://www.cnblogs.com/bin/busybox
│ │ ├── dos2unix -> http://www.cnblogs.com/bin/busybox
│ │ ├── du -> http://www.cnblogs.com/bin/busybox
│ │ ├── dumpleases -> http://www.cnblogs.com/bin/busybox
│ │ ├── eject -> http://www.cnblogs.com/bin/busybox
│ │ ├── env -> http://www.cnblogs.com/bin/busybox
│ │ ├── envdir -> http://www.cnblogs.com/bin/busybox
│ │ ├── envuidgid -> http://www.cnblogs.com/bin/busybox
│ │ ├── ether-wake -> http://www.cnblogs.com/bin/busybox
│ │ ├── expand -> http://www.cnblogs.com/bin/busybox
│ │ ├── expr -> http://www.cnblogs.com/bin/busybox
│ │ ├── fdformat -> http://www.cnblogs.com/bin/busybox
│ │ ├── fgconsole -> http://www.cnblogs.com/bin/busybox
│ │ ├── find -> http://www.cnblogs.com/bin/busybox
│ │ ├── flock -> http://www.cnblogs.com/bin/busybox
│ │ ├── fold -> http://www.cnblogs.com/bin/busybox
│ │ ├── free -> http://www.cnblogs.com/bin/busybox
│ │ ├── ftpget -> http://www.cnblogs.com/bin/busybox
│ │ ├── ftpput -> http://www.cnblogs.com/bin/busybox
│ │ ├── fuser -> http://www.cnblogs.com/bin/busybox
│ │ ├── groups -> http://www.cnblogs.com/bin/busybox
│ │ ├── hd -> http://www.cnblogs.com/bin/busybox
│ │ ├── head -> http://www.cnblogs.com/bin/busybox
│ │ ├── hexdump -> http://www.cnblogs.com/bin/busybox
│ │ ├── hostid -> http://www.cnblogs.com/bin/busybox
│ │ ├── id -> http://www.cnblogs.com/bin/busybox
│ │ ├── ifplugd -> http://www.cnblogs.com/bin/busybox
│ │ ├── install -> http://www.cnblogs.com/bin/busybox
│ │ ├── ipcrm -> http://www.cnblogs.com/bin/busybox
│ │ ├── ipcs -> http://www.cnblogs.com/bin/busybox
│ │ ├── kbd_mode -> http://www.cnblogs.com/bin/busybox
│ │ ├── killall -> http://www.cnblogs.com/bin/busybox
│ │ ├── killall5 -> http://www.cnblogs.com/bin/busybox
│ │ ├── last -> http://www.cnblogs.com/bin/busybox
│ │ ├── less -> http://www.cnblogs.com/bin/busybox
│ │ ├── logger -> http://www.cnblogs.com/bin/busybox
│ │ ├── logname -> http://www.cnblogs.com/bin/busybox
│ │ ├── lpq -> http://www.cnblogs.com/bin/busybox
│ │ ├── lpr -> http://www.cnblogs.com/bin/busybox
│ │ ├── lsof -> http://www.cnblogs.com/bin/busybox
│ │ ├── lspci -> http://www.cnblogs.com/bin/busybox
│ │ ├── lsusb -> http://www.cnblogs.com/bin/busybox
│ │ ├── lzcat -> http://www.cnblogs.com/bin/busybox
│ │ ├── lzma -> http://www.cnblogs.com/bin/busybox
│ │ ├── lzopcat -> http://www.cnblogs.com/bin/busybox
│ │ ├── md5sum -> http://www.cnblogs.com/bin/busybox
│ │ ├── mesg -> http://www.cnblogs.com/bin/busybox
│ │ ├── microcom -> http://www.cnblogs.com/bin/busybox
│ │ ├── mkfifo -> http://www.cnblogs.com/bin/busybox
│ │ ├── mkpasswd -> http://www.cnblogs.com/bin/busybox
│ │ ├── nc -> http://www.cnblogs.com/bin/busybox
│ │ ├── nmeter -> http://www.cnblogs.com/bin/busybox
│ │ ├── nohup -> http://www.cnblogs.com/bin/busybox
│ │ ├── nslookup -> http://www.cnblogs.com/bin/busybox
│ │ ├── od -> http://www.cnblogs.com/bin/busybox
│ │ ├── openvt -> http://www.cnblogs.com/bin/busybox
│ │ ├── passwd -> http://www.cnblogs.com/bin/busybox
│ │ ├── patch -> http://www.cnblogs.com/bin/busybox
│ │ ├── pgrep -> http://www.cnblogs.com/bin/busybox
│ │ ├── pkill -> http://www.cnblogs.com/bin/busybox
│ │ ├── pmap -> http://www.cnblogs.com/bin/busybox
│ │ ├── printf -> http://www.cnblogs.com/bin/busybox
│ │ ├── pscan -> http://www.cnblogs.com/bin/busybox
│ │ ├── pstree -> http://www.cnblogs.com/bin/busybox
│ │ ├── pwdx -> http://www.cnblogs.com/bin/busybox
│ │ ├── readahead -> http://www.cnblogs.com/bin/busybox
│ │ ├── readlink -> http://www.cnblogs.com/bin/busybox
│ │ ├── realpath -> http://www.cnblogs.com/bin/busybox
│ │ ├── remove-shell -> http://www.cnblogs.com/bin/busybox
│ │ ├── renice -> http://www.cnblogs.com/bin/busybox
│ │ ├── reset -> http://www.cnblogs.com/bin/busybox
│ │ ├── resize -> http://www.cnblogs.com/bin/busybox
│ │ ├── rpm2cpio -> http://www.cnblogs.com/bin/busybox
│ │ ├── rtcwake -> http://www.cnblogs.com/bin/busybox
│ │ ├── runsv -> http://www.cnblogs.com/bin/busybox
│ │ ├── runsvdir -> http://www.cnblogs.com/bin/busybox
│ │ ├── rx -> http://www.cnblogs.com/bin/busybox
│ │ ├── script -> http://www.cnblogs.com/bin/busybox
│ │ ├── seq -> http://www.cnblogs.com/bin/busybox
│ │ ├── setkeycodes -> http://www.cnblogs.com/bin/busybox
│ │ ├── setsid -> http://www.cnblogs.com/bin/busybox
│ │ ├── setuidgid -> http://www.cnblogs.com/bin/busybox
│ │ ├── sha1sum -> http://www.cnblogs.com/bin/busybox
│ │ ├── sha256sum -> http://www.cnblogs.com/bin/busybox
│ │ ├── sha512sum -> http://www.cnblogs.com/bin/busybox
│ │ ├── showkey -> http://www.cnblogs.com/bin/busybox
│ │ ├── smemcap -> http://www.cnblogs.com/bin/busybox
│ │ ├── softlimit -> http://www.cnblogs.com/bin/busybox
│ │ ├── sort -> http://www.cnblogs.com/bin/busybox
│ │ ├── split -> http://www.cnblogs.com/bin/busybox
│ │ ├── strings -> http://www.cnblogs.com/bin/busybox
│ │ ├── sum -> http://www.cnblogs.com/bin/busybox
│ │ ├── sv -> http://www.cnblogs.com/bin/busybox
│ │ ├── tac -> http://www.cnblogs.com/bin/busybox
│ │ ├── tail -> http://www.cnblogs.com/bin/busybox
│ │ ├── tcpsvd -> http://www.cnblogs.com/bin/busybox
│ │ ├── tee -> http://www.cnblogs.com/bin/busybox
│ │ ├── telnet -> http://www.cnblogs.com/bin/busybox
│ │ ├── test -> http://www.cnblogs.com/bin/busybox
│ │ ├── tftp -> http://www.cnblogs.com/bin/busybox
│ │ ├── tftpd -> http://www.cnblogs.com/bin/busybox
│ │ ├── time -> http://www.cnblogs.com/bin/busybox
│ │ ├── timeout -> http://www.cnblogs.com/bin/busybox
│ │ ├── top -> http://www.cnblogs.com/bin/busybox
│ │ ├── tr -> http://www.cnblogs.com/bin/busybox
│ │ ├── traceroute -> http://www.cnblogs.com/bin/busybox
│ │ ├── traceroute6 -> http://www.cnblogs.com/bin/busybox
│ │ ├── tty -> http://www.cnblogs.com/bin/busybox
│ │ ├── ttysize -> http://www.cnblogs.com/bin/busybox
│ │ ├── udpsvd -> http://www.cnblogs.com/bin/busybox
│ │ ├── unexpand -> http://www.cnblogs.com/bin/busybox
│ │ ├── uniq -> http://www.cnblogs.com/bin/busybox
│ │ ├── unix2dos -> http://www.cnblogs.com/bin/busybox
│ │ ├── unlzma -> http://www.cnblogs.com/bin/busybox
│ │ ├── unlzop -> http://www.cnblogs.com/bin/busybox
│ │ ├── unxz -> http://www.cnblogs.com/bin/busybox
│ │ ├── unzip -> http://www.cnblogs.com/bin/busybox
│ │ ├── uptime -> http://www.cnblogs.com/bin/busybox
│ │ ├── users -> http://www.cnblogs.com/bin/busybox
│ │ ├── uudecode -> http://www.cnblogs.com/bin/busybox
│ │ ├── uuencode -> http://www.cnblogs.com/bin/busybox
│ │ ├── vlock -> http://www.cnblogs.com/bin/busybox
│ │ ├── volname -> http://www.cnblogs.com/bin/busybox
│ │ ├── wall -> http://www.cnblogs.com/bin/busybox
│ │ ├── wc -> http://www.cnblogs.com/bin/busybox
│ │ ├── wget -> http://www.cnblogs.com/bin/busybox
│ │ ├── which -> http://www.cnblogs.com/bin/busybox
│ │ ├── who -> http://www.cnblogs.com/bin/busybox
│ │ ├── whoami -> http://www.cnblogs.com/bin/busybox
│ │ ├── whois -> http://www.cnblogs.com/bin/busybox
│ │ ├── xargs -> http://www.cnblogs.com/bin/busybox
│ │ ├── xz -> http://www.cnblogs.com/bin/busybox
│ │ ├── xzcat -> http://www.cnblogs.com/bin/busybox
│ │ └── yes -> http://www.cnblogs.com/bin/busybox
│ ├── lib
│ ├── modules
│ └── sbin
│ ├── brctl -> http://www.cnblogs.com/bin/busybox
│ ├── chpasswd -> http://www.cnblogs.com/bin/busybox
│ ├── chroot -> http://www.cnblogs.com/bin/busybox
│ ├── crond -> http://www.cnblogs.com/bin/busybox
│ ├── dhcprelay -> http://www.cnblogs.com/bin/busybox
│ ├── dnsd -> http://www.cnblogs.com/bin/busybox
│ ├── fakeidentd -> http://www.cnblogs.com/bin/busybox
│ ├── fbset -> http://www.cnblogs.com/bin/busybox
│ ├── ftpd -> http://www.cnblogs.com/bin/busybox
│ ├── httpd -> http://www.cnblogs.com/bin/busybox
│ ├── inetd -> http://www.cnblogs.com/bin/busybox
│ ├── loadfont -> http://www.cnblogs.com/bin/busybox
│ ├── lpd -> http://www.cnblogs.com/bin/busybox
│ ├── nanddump -> http://www.cnblogs.com/bin/busybox
│ ├── nandwrite -> http://www.cnblogs.com/bin/busybox
│ ├── nbd-client -> http://www.cnblogs.com/bin/busybox
│ ├── ntpd -> http://www.cnblogs.com/bin/busybox
│ ├── popmaildir -> http://www.cnblogs.com/bin/busybox
│ ├── rdate -> http://www.cnblogs.com/bin/busybox
│ ├── rdev -> http://www.cnblogs.com/bin/busybox
│ ├── readprofile -> http://www.cnblogs.com/bin/busybox
│ ├── sendmail -> http://www.cnblogs.com/bin/busybox
│ ├── setfont -> http://www.cnblogs.com/bin/busybox
│ ├── setlogcons -> http://www.cnblogs.com/bin/busybox
│ ├── svlogd -> http://www.cnblogs.com/bin/busybox
│ ├── telnetd -> http://www.cnblogs.com/bin/busybox
│ ├── ubiattach -> http://www.cnblogs.com/bin/busybox
│ ├── ubidetach -> http://www.cnblogs.com/bin/busybox
│ ├── ubimkvol -> http://www.cnblogs.com/bin/busybox
│ ├── ubirmvol -> http://www.cnblogs.com/bin/busybox
│ ├── ubirsvol -> http://www.cnblogs.com/bin/busybox
│ ├── ubiupdatevol -> http://www.cnblogs.com/bin/busybox
│ └── udhcpd -> http://www.cnblogs.com/bin/busybox
└── var
├── lib
├── lock
├── run
│ └── utmp
└── tmp
30 directories, 365 files
-
修改uboot的bootargs为下面内容:
setenv bootargs noinitrd root=/dev/nfs ip=192.168.1.104:192.168.1.103:192.168.1.1:255.255.255.0::eth0:off nfsroot=192.168.1.103:/home/superzuo/rootfs,nolock,proto=tcp consloe=ttySAC0,115200
其中192.168.1.104为开发板的IP地址(用print命令可以查看)
192.168.1.103为虚拟机的IP地址
192.168.1.1为路由器的网关,在电脑上可以用ipconfig /all命令查看
255.255.255.0为子网掩码,在电脑上可以用ipconfig /all命令查看
先备份一下之前用yaffs2的启动
noinitrd root=/dev/mtdblock3 rootfstype=yaffs2 console=ttySAC0 init=/linuxrc video=fb:AT070TN83
- 使开发板支持域名解析:
-
配置内核:
[*] Networking support --->
File systems --->
[*] Network File Systems --->
-
启动开发板就可以看见一下信息:
Registering the dns_resolver key type
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
input: gpio-keys as /devices/platform/gpio-keys/input/input0
s3c-rtc s3c64xx-rtc: setting system clock to 2000-07-27 09:18:46 UTC (964689526)
dm9000 dm9000.0: eth0: link down
IP-Config: Complete:
device=eth0, addr=192.168.1.104, mask=255.255.255.0, gw=192.168.1.1,
host=192.168.1.104, domain=, nis-domain=(none),
bootserver=192.168.103.0, rootserver=192.168.1.103, rootpath=
dm9000 dm9000.0: eth0: link up, 100Mbps, full-duplex, lpa 0x4DE1
VFS: Mounted root (nfs filesystem) on device 0:10.
Freeing init memory: 156K
Please press Enter to activate this console.
Pillar
[root@Pillar /]#ls
bin dev home linuxrc proc sbin tmp var
boot etc lib mnt root sys usr
这说明NFS已经完全挂载上了,这比飞凌官网提供的系统好多了,我这里文件系统支持文件路径显示和主机信息显示。
在启动的过程中可能 会碰到一个问题:
Starting pid 768, console /dev/console: '/etc/init.d/rcS' (这个错误就在启动信息的最后一行一定要注意)
解决的方法是在主机给rcS修改权限:
chmod -R 777 init.d/*
最后来一个启动信息最后的截图: