配置安装busybox

https://www.360docs.net/doc/1317770601.html,/thread-1972-1-1.html
飞凌OK-2440-III文件系统移植--busybox+mdev
Busybox版本:busybox1.1.3
编译工具:arm-linux-3.3.2
目标板:飞凌OK-2440-III
编译平台:redhat9
一、配置安装busybox
1.配置busybox:
# make menuconfig
Busybox Settings >
General Configuration >
[*] Support for devfs
Build Options >
[*]Build with Large File Support(for accessing files > 2GB)
[*]Do you want to build Busybox with a Cross Compiler?
(/usr/local/arm/3.3.2/bin/arm-linux-)Cross Compiler prefix
//上面的选项用来指定编译工具,我刚开始没有选择这个选项,结果编译出文件系统下到开发板上运行,串口打印信息为:

大家可以试试。
Init Utilities >
[*] init
[*] Support reading an inittab file
[*] Be _extra_ quiet on boot
[*] Support running init from within an initrd (not initramfs)
[*] poweroff, halt, and reboot
[*] mesg
Shells >
Choose your default shell (ash) >
(X) ash
( )hush
( )lash
( )nsh
( )none
--- ash
--- Ash Shell Options
--- Bourne Shell Options
[ ] Hide message on interactive shell startup
[ ] Standalone shell
[*] command line editing
[*] vi-style line editing commands
(15) history size
[*] history saving
[*] tab completion
[*] username completion
[ ] Fancy shell prompts

Coreutils >
[*] cp
[*] cat
[*] ls
[*] mkdir
[*] echo (basic SuSv3 version taking no options)
[*] env
[*] mv
[*] pwd
[*] rm
[*] touch
Editors >
[*] vi
Linux System Utilities >
[*] mdev //不选这个启动不起来系统,大家可以去掉试试看有什么现象
[*] Support /etc/mdev.conf
[*] mount
[*] umount
[*] Support loopback mounts
[*] Support for the old /etc/mtab file
Linux Module Utilities --->
[*] insmod
[*] rmmod
[*] lsmod
[*] lsmod pretty output for 2.6.x Linux kernels
[*] modprobe
[*] Multiple options parsing
--- Options common to multiple modutils
[*] Support tainted module checking with new kernels
[ ] Support version 2.2.x to 2.4.x Linux kernels //此项一定不要选!!!
[*] Support vers

ion 2.6.x Linux kernels
Networking Utilities >
[*] ifconfig
[*] ping
Archival Utilities --->
[*] tar
[*] Enable archive creation (NEW)
[*] Enable -j option to handle .tar.bz2 files
现在配置完成,保存退出之后,执行:make 编译
# make ARCH=arm CROSS_COMPILE=/usr/local/arm/3.3.2/bin/arm-linux-
成功编译完成后执行make install安装
# make install
这样就在busybox1.1.3目录下产生_install文件夹,里面就是编译好的文件系统。
2、创建根文件系统目录
要创建的目录有:bin sbin dev etc lib home root usr var proc mnt tmp sys
可以先创建一个目录比如/usr/src/rootfs,然后进入该目录,创建以上目录。
# cd /usr/src/
# mkdir rootfs
# cd rootfs
# mkdir bin sbin dev etc lib home root usr var proc mnt tmp sys
目录创建好之后把busybox生成的_install目录里那些都复制过来。
接下来我们要在etc目录下创建两个文件和一个文件夹,两个文件分别为fstab和inittab,文件夹为init.d。
(1)
# cd etc
# vi fstab
fstab的内容是:
#device mount-point type options dump fsck order
proc /proc proc defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev tmpfs defaults 0 0
文 件/etc/fstab用来定义文件系统的“静态信息”,这些信息被用来控制mount命令的行为。
(2)
# vi inittab
inittab的内容是:
#/etc/inittab
::sysinit:/etc/init.d/rcS
s3c2410_serial0::askfirst:-/bin/sh 如果不使用mdev则s3c2410_serial0改ttySAC0
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
(3)
# mkdir init.d
# cd init.d
# vi rcS
init.d\rcS文件的内容:
#!/bin/sh
ifconfig eth0 192.168.1.17
mount -t tmpfs mdev /dev
mkdir /dev/pts
mount -t devpts devpts /dev/pts
mount -t sysfs sysfs /sys
mount -a
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev –s
echo My first rootfs
将rcS文件的属性改成可执行的,这一步很重要,必须改。
# chmod 775 etc/init.d/rcS
(4)我在配置busybox的时候用的是动态库,,所以要把/usr/local/arm/3.4.1/arm-linux/lib下面的3个库文件和一个加载器拷贝到/filesystem_install/lib下:ld-2.3.2.so ld-linux.so.2 libc.so.6 libcrypt.so.1 libm.so.6
(5)在/usr、src/rootfs/dev下建立设备节点:
Console null
# sudo mknod console c

5 1
# sudo mknod null c 1 3
到此为止,必要的文件已经建立好了,现在要生成yaffs文件系统。
我们用光盘里带的mkyaffs2image工具来生成。将其解压拷贝到主机的/bin目录下即可。转到建立的那个/rootfs目录的上一级,也就是/usr/src目录,然后执行:mkyaffs2image rootfs rootfs.yaffs 就可以生成文件系统镜像了,将rootfs.yaffs烧进板子,当看到My first rootfs Please press Enter to activate this console.就表明你成功了!!!

相关主题
相关文档
最新文档