ubifs
2012-09-13 09:14:54
分类: 嵌入式
1,安装相关的软件包
apt-get install liblzo2-dev
2,获取相关的工具 mkfs.ubifs 和 ubinize
这两个工具是制作 ubifs 文件系统的时候用到,它们是 mtd-utils 工具包中的内容,mtd-utils 工具
包你可以从下面的网站下载和编译出来:
官方网站:http://www.linux-mtd.infradead.org/index.html
资源下载网站:http://git.infradead.org/
3,创建一个 create-ubifs.sh 脚本,主要是调用 mkfs.ubifs 和 ubinize 工具和相关参数来制作
ubifs 文件系统,内容如下:
#!/bin/bash
###############################################
###########
# Script to generate ubifs filesystem image. #
###############################################
###########
##### ubinize configuration file
config_file=rootfs_ubinize.cfg
##### Function to check result of the command
check_result() {
if [ $? -ne 0 ]
then
echo "FAILED"
else
echo "SUCCESSFUL"
fi
}
###### Function to check whether an application exists
check_program() {
for cmd in "$@"
do
which ${cmd} > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo
echo "Cannot find command /"${cmd}/""
echo
exit 1
fi
done
}
if [ $# -ne 5 ]