基于busybox-1.10.1的简易根文件系统制作
2012-11-22 11:31
441 查看
1) 解压busybox,当前目录为/new_disk/weiyan/
tar jxf /new_disk/weiyan/busybox-1.10.1.tar.bz2
cd busybox-1.10.1
2) 修改体系架构并指定交叉编译器
vi Makefile,将175行和176行的
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?=
修改为
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-
3) 简单配置busybox
make defconfig #载入默认配置
make menuconfig
Busybox Settings --->
Busybox Library Tuning --->
[*] Additional editing keys
[*] vi-style line editing commands
[*] History saving
[*] Fancy shellprompts
#添加对转义命令提示符和快捷键的支持
Linux Module Utilities --->
[ ] Support version 2.2.x to 2.4.x Linux kernels
#取消对旧内核模块加载功能的支持
Miscellaneous Utilities --->
[ ] taskset #取消导致编译错误的CPU绑定支持,
Shells --->
[*] alias support #加入对命令别名的支持
4) 编译,并安装到_install目录
make && make install
5) 建立文件系统目录
mkdir /new_disk/weiyan/rootfs
cd /new_disk/weiyan/rootfs
mkdir lib dev etc etc/init.d
6) 复制busybox和库文件
cp /new_disk/weiyan/busybox-1.10.1/_install/* ./ -a
cp /usr/local/arm/3.4.1/arm-linux/lib/*so* lib -a
rm lib/libstdc++.so*
7) 建立必要的启动节点
mknod -m 660 dev/console c 5 1
mknod -m 660 dev/null c 1 3
mknod -m 660 dev/tty0 c 4 0
mknod -m 660 dev/tty1 c 4 1
mknod -m 660 dev/tty2 c 4 2
mknod -m 660 dev/tty3 c 4 3
mknod -m 660 dev/tty4 c 4 4
8) 建立初始化脚本
touch etc/init.d/rcS
chmod 777 etc/init.d/rcS
9) 建立并格式化ext2格式的ram盘镜像
cd ..
dd if=/dev/zero of=ramfs.img bs=1k count=4k
mkfs.ext2 -F -m0 ramfs.img
10) 挂载ram盘并导入文件
mkdir ramfs
mount -o loop ramfs.img ramfs
cp -a rootfs/* ramfs
umount ramfs
11) 生成压缩的ram盘镜像
gzip -9 ramfs.img
cp ramfs.img.gz /new_disk/tftp
12) 启动开发板,修改U-boot的启动参数
设置ram盘的加载地址为0x33000000,大小为0x200000
WEIYAN # setramopt root=/dev/ram0 initrd=0x33000000,0x200000
WEIYAN # set bootargs $(ramopt) console=ttySAC0
保存修改
save
13) 下载ram盘镜像和内核,并从sdram启动内核
WEIYAN # tftp 0x33000000 ramfs.img.gz
WEIYAN # tftp 0x31000000 uImage
WEIYAN # bootm 0x31000000
14) 启动运行结果
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 136K
init started: BusyBox v1.10.1 (2008-03-02 02:33:43 CST)
starting pid 791, tty '': '/etc/init.d/rcS'
usb 1-1: new full speed USB device using s3c2410-ohci and address 2
Please press Enter to activate this console.
tar jxf /new_disk/weiyan/busybox-1.10.1.tar.bz2
cd busybox-1.10.1
2) 修改体系架构并指定交叉编译器
vi Makefile,将175行和176行的
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?=
修改为
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-
3) 简单配置busybox
make defconfig #载入默认配置
make menuconfig
Busybox Settings --->
Busybox Library Tuning --->
[*] Additional editing keys
[*] vi-style line editing commands
[*] History saving
[*] Fancy shellprompts
#添加对转义命令提示符和快捷键的支持
Linux Module Utilities --->
[ ] Support version 2.2.x to 2.4.x Linux kernels
#取消对旧内核模块加载功能的支持
Miscellaneous Utilities --->
[ ] taskset #取消导致编译错误的CPU绑定支持,
Shells --->
[*] alias support #加入对命令别名的支持
4) 编译,并安装到_install目录
make && make install
5) 建立文件系统目录
mkdir /new_disk/weiyan/rootfs
cd /new_disk/weiyan/rootfs
mkdir lib dev etc etc/init.d
6) 复制busybox和库文件
cp /new_disk/weiyan/busybox-1.10.1/_install/* ./ -a
cp /usr/local/arm/3.4.1/arm-linux/lib/*so* lib -a
rm lib/libstdc++.so*
7) 建立必要的启动节点
mknod -m 660 dev/console c 5 1
mknod -m 660 dev/null c 1 3
mknod -m 660 dev/tty0 c 4 0
mknod -m 660 dev/tty1 c 4 1
mknod -m 660 dev/tty2 c 4 2
mknod -m 660 dev/tty3 c 4 3
mknod -m 660 dev/tty4 c 4 4
8) 建立初始化脚本
touch etc/init.d/rcS
chmod 777 etc/init.d/rcS
9) 建立并格式化ext2格式的ram盘镜像
cd ..
dd if=/dev/zero of=ramfs.img bs=1k count=4k
mkfs.ext2 -F -m0 ramfs.img
10) 挂载ram盘并导入文件
mkdir ramfs
mount -o loop ramfs.img ramfs
cp -a rootfs/* ramfs
umount ramfs
11) 生成压缩的ram盘镜像
gzip -9 ramfs.img
cp ramfs.img.gz /new_disk/tftp
12) 启动开发板,修改U-boot的启动参数
设置ram盘的加载地址为0x33000000,大小为0x200000
WEIYAN # setramopt root=/dev/ram0 initrd=0x33000000,0x200000
WEIYAN # set bootargs $(ramopt) console=ttySAC0
保存修改
save
13) 下载ram盘镜像和内核,并从sdram启动内核
WEIYAN # tftp 0x33000000 ramfs.img.gz
WEIYAN # tftp 0x31000000 uImage
WEIYAN # bootm 0x31000000
14) 启动运行结果
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 136K
init started: BusyBox v1.10.1 (2008-03-02 02:33:43 CST)
starting pid 791, tty '': '/etc/init.d/rcS'
usb 1-1: new full speed USB device using s3c2410-ohci and address 2
Please press Enter to activate this console.
相关文章推荐
- 基于busybox-1.10.1的简易根文件系统制作
- arm-linux移植手记(四)基于busybox1.16.0的根文件系统制作
- arm-linux移植手记(四)基于busybox1.16.0的根文件系统制作
- 制作文件系统之五:基于BusyBox的默认配置来构建文件系统
- 基于S3C2440的busybox的移植 yaffs根文件系统制作
- 基于busybox制作mini2440根文件系统及使用nfs挂载
- 基于S3C2440的busybox的移植 yaffs根文件系统制作 .
- 基于S3C2440的busybox的移植 yaffs根文件系统制作
- 基于S3C2440的busybox的移植 yaffs根文件系统制作
- 基于busybox制作mini2440根文件系统及使用nfs挂载
- 制作基于OK6410的文件系统(2.修改busybox文件系统,使之能启动)
- 基于busybox的根文件系统制作
- 使用busybox-1.9.2制作根文件系统 (转,可以用来参考配置busybox)
- 嵌入式 使用busybox制作完全属于自己的文件系统
- 用Busybox制作嵌入式Linux的文件系统
- 基于busybox的Linux小系统制作 (initrd)
- Busybox构建根文件系统和制作Ramdisk
- 用busybox制作嵌入式Linux的文件系统
- mini6410基于linux2.6.36内核通过NFS启动根文件系统总结(四制作根文件系统及通过NFS挂载文件系统)
- 如何使用CubeMx制作一个基于SD卡的文件系统工程(2)