1.)制作简易根文件系统/tftpboot/nfs
>mkdir -p bin dev etc lib mnt proc sbin sys tmp usr/bin var usr/lib
>mknod -m 600 /dev/console c 5 1
>mknod -m 666 /dev/null c 1 3
2.)编译busybox-1.24.0
目录:/home/jimmy/news5pv210/busybox-1.24.0
>make menuconfig ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
Busybox Settings--->
Build Options--->
[*]Build BusyBox as a static binary(no shared libs)
Busybox Library Tuning--->
[*]vi-style line editing commands
[*]Fancy shell prompts
Linux Module Utilities--->
[ ]Simplified modutils
[*]insmod
[*]rmmod
[*]lsmod
[*]modprobe
[*]depmod
Linux System Utilities--->[*]mdev
[*]Support /etc/mdev.conf
[*]Support subdirs/symlinks
[*]Support regular expressions substitutions when renaming dev
[*]Support command execution at device addition/removal
[*]Support loading of firmwares
>make
>make install (我的安装在nfs根目录下 /tftpboot/nfs)
3.)编写/etc/inittab文件:
::sysinit:/etc/init.d/rcS
::askfirst:-/bin/sh
::ctrlaltdel:-/bin/reboot
::shutdown:/bin/umount -a -r
::restart:sbin/init
4)编写/etc/init.d/rcS文件,这里我改写为调用/etc/init.d/S*所有S开头的文件,最后调用mount -a 挂载fstab里的文件系统
#!/bin/sh
# Start all init scripts in /etc/init.d
# executing them in numerical order.
#
for i in /etc/init.d/S??* ;do
# Ignore dangling symlinks (if any).
[ ! -f "$i" ] && continue
case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set start
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i start
;;
esac
done
mount -a
5.)/etc/fstab, 其中/proc和/sys最重要,因为里面有驱动要用的结构
# /etc/fstab: static file system information.
#
/dev/root / ext2 rw,noauto 0 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts defaults,gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs mode=0777 0 0
tmpfs /tmp tmpfs defaults 0 0
sysfs /sys sysfs defaults 0 0
6)/etc/init.d/S10mdev 启动mdev
#!/bin/sh
#
# Start mdev....
#
case "$1" in
start)
echo "Starting mdev..."
/sbin/mdev -s
;;
stop)
;;
restart|reload)
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?