Ramdisk的制作,以及genext2fs和mkiamge的工具使用
来源:互联网 发布:mysql官网无法访问 编辑:程序博客网 时间:2024/05/16 13:42
在嵌入式系统中,有时出于主板硬件成本的考虑,可能会没有NANDFLASH设备,并且SPI-FLASH也只有512K可以放下一个bootloader,这个时候可以采取让bootloader从网络或者硬盘读取kernel和ramdisk并在bootm之后挂载ramdisk来解决FLASH存储空间不能放下文件系统的问题。
而ramdisk是通过genext2fs工具和uboot中mkimage工具制作而成的,下面我们就来看看这两个工具的使用说明和制作ramdisk的方法。
一、genext2fs的使用
genext2fs下载地址是:http://sourceforge.net/projects/genext2fs/files/
genext2fs工具的作用在于将一个文件夹制作成一个ext2文件系统镜像
使用: ./genext2fs [options] image
参数说明:
-x, --starting-image <image>
-d, --root <directory>
-D, --devtable <file>
-b, --size-in-blocks <blocks>
-i, --bytes-per-inode <bytes per inode>
-N, --number-of-inodes <number of inodes>
-m, --reserved-percentage <percentage of blocks to reserve>
-g, --block-map <path> Generate a block map file for this path.
-e, --fill-value <value> Fill unallocated blocks with value.
-z, --allow-holes Allow files with holes.
-f, --faketime Set filesystem timestamps to 0 (for testing).
-q, --squash Same as "-U -P".
-U, --squash-uids Squash owners making all files be owned by root.
-P, --squash-perms Squash permissions on all files.
-h, --help
-V, --version
-v, --verbose
二、mkimage的使用
这个工具来自于uboot的tools中,作用是将genext2fs生成的ext2文件系统镜像压缩并生成为ramdisk镜像
使用1: ./mkimage -l image
-l ==> list image header information
使用2:./mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image
-A ==> set architecture to 'arch'
-O ==> set operating system to 'os'
-T ==> set image type to 'type'
-C ==> set compression type 'comp'
-a ==> set load address to 'addr' (hex)
-e ==> set entry point to 'ep' (hex)
-n ==> set image name to 'name'
-d ==> use image data from 'datafile'
-x ==> set XIP (execute in place)
使用3:./mkimage [-D dtc_options] -f fit-image.its fit-image
三、ramdisk的制作
现假设约定如下:
./rootbox为busybox生成的文件系统文件夹
1,生成ext2文件系统镜像
计算文件夹的大小:
size=`du -s --apparent-size ./rootfs | cut --fields=1`
size=`expr '(' '(' $size / 1024 ')' + 2 ')' '*' 1024 `
计算节点数:
inode_counti=`expr '(' $size / 4 ')'`
将rootbox文件夹生成名为roottbox.ext2的ext2文件系统镜像
genext2fs -b $size -N $inode_counti -d ./rootbox rootbox.ext2
2.生成ramdisk镜像
内存中load地址为0x2500000
ramdisk名称为 ARM Linux RAMDisk
生成的镜像名为ramdisk.img
./mkimage -A arm -O linux -T ramdisk -C gzip -a 0x2500000 -e 0x2500000 -n "ARM Linux RAMDisk" -d rootbox.ext2.gz ramdisk.img
- Ramdisk的制作,以及genext2fs和mkiamge的工具使用
- 使用genext2fs制作ramdisk
- 使用genext2fs制作ramdisk
- 使用genext2fs制作ramdisk
- rootfs和ramdisk的制作
- ramdisk文件系统的制作以及移植
- 制作ramdisk的全过程
- RAMDISK的制作
- Ramdisk文件系统的制作
- Ramdisk文件系统的制作
- RAMDISK文件系统的制作
- ramdisk文件系统的制作
- RAMDISK文件系统的制作 .
- ramdisk的制作过程
- 制作ramdisk根文件系统的步骤和经验
- 文件系统的制作遇到的问题(genext2fs: couldn't allocate a block (no free space))
- 制作 ramdisk.img,使用cpio 和 gzip
- 嵌入式 ramdisk制作和使用参数
- ASP.NET页面间数据传递的方法
- 三种文件系统的简介
- QT串口接收十六进制
- 表现生猛的Like语句
- linux 查看文件夹大小
- Ramdisk的制作,以及genext2fs和mkiamge的工具使用
- poj 3335 Rotating Scoreboard
- 递归无限极查找上级分类
- iphone ios timer NStimer 使用教程
- 程序员有趣的面试智力题
- android键盘钩子 android按键劫持
- 有关SQL server connection KeepAlive 的FAQ
- 鼠标样式
- js的with语句使用方法