S1: 运行 mkroot
#! /bin/sh
echo "creatint rootfs dir......"
mkdir rootfs
cd rootfs
echo "making dir : bin dev etc lib proc sbin sys usr"
mkdir bin dev etc lib proc sbin sys usr #必备的8个目录
mkdir usr/bin usr/lib usr/sbin lib/modules
# Don't use mknod ,unless you run this Script as root !
# mknod -m 600 dev/console c 5 1
# mknod -m 666 dev/null c 1 3
echo "making dir : mnt tmp var"
mkdir mnt tmp var
chmod 1777 tmp
mkdir mnt/etc mnt/jffs2 mnt/yaffs mnt/data mnt/temp
mkdir var/lib var/lock var/log var/run var/tmp
chmod 1777 var/tmp
echo "making dir : home root boot"
mkdir home root boot
echo "done"
S3: sudo mknod -m 600 console c 5 1;mknod -m 666 null c 1 3;
S4: tar -xjvf busybox-1x.xx.tar.bz2
S5: 修改 Makefile & change arch=? CROSS=?
S6: make menuconfig
S7: 修改安装路径 BusyBox installation prefix 修改编译工具 arm-linux-
S8: 不要选择 "Login/Password Management Utilities" , 独立安装使用 TinyLogin
S9: make & make install
s10: arm-linux-readelf -d busybox ## 检查需要的动态库 动态库需要支持当前内核版本,否则会出现kernel too old 等错误。
s11: cp -a examples/bootfloppy/etc/* ../nfs/rootfs/etc/ ##拷贝etc下必要文件
s12: 修改etc/profile 增加如下信息# Set search library path
echo "Set search library path in /etc/profile"
export LD_LIBRARY_PATH=/lib:/usr/lib
# Set user path
echo "Set user path in /etc/profile"
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH
#设置用户名 根目录
export HOSTNAME= youname
export USER=root
export HOME=root
# Set PS1
#注意:ash 除了SHELL变量外,支持\u、\h、\W、\$、\!、\n、\w 、\nnn(ASCII字符对应的八进制数)
#以及\e[xx;xxm (彩色特效)等等!
#而且前面还要多加一个 '\'!
echo "Set PS1 in /etc/profile"
#显示提示符
export PS1="\\e[05;32m[$USER@$HOSTNAME\w\\a]\\$\\e[00;34m"
#export PS1="[$USER@$HOSTNAME \W]\# "
s13: 修改inittab
#this is run first except when booting in single-user mode.
::sysinit:/etc/init.d/rcS
#::respawn:-/bin/login #后续安装Tinylogin时增加此行
# Start an "askfirst"shell on the console (whatever that may be)
::askfirst:-/bin/sh # 直接进入shell
# Stuff to do when restarting the init process
::restart:/sbin/init
# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a
s14: 修改fstab
#device mount-point type options dump fsck order
proc /proc proc defaults 0 0
none /tmp ramfs defaults 0 0
mdev /dev ramfs defaults 0 0
sysfs /sys sysfs defaults 0 0
s15: 修改脚本init.d/rcS
#! /bin/sh
echo "----------mount all"
/bin/mount -a
echo "----------Starting mdev......"
/bin/echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s
echo "*********************************************************"
echo " YOURNAME 2440 Rootfs(nfs) 20xx.2 "
echo " 你的声明"
echo "********************************************************"
s16: 删除 ~ 备份文件
s17: 创建mdev.conf