1. 编译 busybox的 ARM版本。
2. 拷贝必要的动态库文件到 _install/lib下面。
-rwxr-xr-x 1 charles charles 93476 Oct 7 2011 ld-2.13.so lrwxrwxrwx 1 charles charles 10 Apr 25 2012 ld-linux.so.3 -> ld-2.13.so -rwxr-xr-x 1 charles charles 876656 Oct 7 2011 libc-2.13.so lrwxrwxrwx 1 charles charles 12 Apr 25 2012 libc.so.6 -> libc-2.13.so -rw-r--r-- 1 charles charles 9812 Oct 7 2011 libdl-2.13.so lrwxrwxrwx 1 charles charles 13 Apr 25 2012 libdl.so.2 -> libdl-2.13.so -rw-r--r-- 1 charles charles 407148 Oct 7 2011 libm-2.13.so lrwxrwxrwx 1 charles charles 12 Apr 25 2012 libm.so.6 -> libm-2.13.so -rwxr-xr-x 1 charles charles 105112 Oct 7 2011 libpthread-2.13.so lrwxrwxrwx 1 charles charles 18 Apr 25 2012 libpthread.so.0 -> libpthread-2.13.so -rw-r--r-- 1 charles charles 55144 Oct 7 2011 libresolv-2.13.so lrwxrwxrwx 1 charles charles 17 Apr 25 2012 libresolv.so.2 -> libresolv-2.13.so -rw-r--r-- 1 charles charles 22540 Oct 7 2011 librt-2.13.so lrwxrwxrwx 1 charles charles 13 Apr 25 2012 librt.so.1 -> librt-2.13.so -rw-r--r-- 1 charles charles 2871558 Apr 25 2012 libstdc++.a lrwxrwxrwx 1 charles charles 19 Apr 25 2012 libstdc++.so -> libstdc++.so.6.0.17 lrwxrwxrwx 1 charles charles 19 Apr 25 2012 libstdc++.so.6 -> libstdc++.so.6.0.17 -rwxr-xr-x 1 charles charles 4924070 Apr 25 2012 libstdc++.so.6.0.17 -rw-r--r-- 1 charles charles 2588 Apr 25 2012 libstdc++.so.6.0.17-gdb.py -rw-r--r-- 1 charles charles 9848 Oct 7 2011 libutil-2.13.so lrwxrwxrwx 1 charles charles 15 Apr 25 2012 libutil.so.1 -> libutil-2.13.so
4. 在 etc/下,建立文件 inittab,内容如下:
::sysinit:/etc/init.d/rcS ::respawn:-/bin/login ::restart:/sbin/init ttyAMA0::askfirst:-/bin/sh ::ctrlaltdel:/sbin/reboot ::shutdown:/bin/umount -a –r
#!/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin umask 022 export PATH /bin/mount -a /sbin/mdev -s #/bin/sh echo /sbin/mdev > /proc/sys/kernel/hotplug hostname taotao
USER="id -un" LOGNAME=$USER #/bin/hostname taotao HOSTNAME=`/bin/hostname` PS1='\u@\h:\w#' export USER LOGNAME HOSTNAME PS1 PATH7. 建立文件 etc/fstab:
/dev/mmcblk0 / ext3 errors=remount-ro,noatime 0 1 proc /proc proc defaults 0 0 sysfs /sys sysfs defaults 0 0 tmpfs /tmp tmpfs defaults 0 0 tmpfs /var tmpfs defaults 0 0 mdev /dev ramfs defaults 0 0
root::0:0:root:/root:/bin/sh daemon::1:1:daemon:/usr/sbin:/bin/sh bin::2:2:bin:/bin:/bin/sh sys::3:3:sys:/dev:/bin/sh和 group文件:
root::0: daemon::1: bin::2: sys::3: tty::5:
etc ├── fstab ├── group ├── init.d │ └── rcS ├── inittab ├── passwd └── profile 1 directory, 6 files
sudo mknod mmcblk0 b 8 0
sudo mknod mmcblk0p1 b 8 1
10. 启动内核:
qemu-system-arm -M vexpress-a9 -kernel ./linux-3.2/arch/arm/boot/zImage -sd rootfs.img --append "root=/dev/mmcblk0 rw rootfs=ext3 rootdelay=3 physmap.enabled=0 console=tty0"
11. 存在的问题:
i: mount 的时候提示有错:
mounting /dev/mmcblk0 on / failed: no such device or addressii)执行mount 命令,会发现,有两个在 / 的 mount项:
rootfs on / type rootfs (rw)
/dev/root on / type ext3