linux文件系统的建立,linux 文件系统的建立

1.     文件系统的制作

Linux Core NANDUser’s Guide

http://processors.wiki.ti.com/index.php/Linux_Core_NAND_User%27s_Guide#.23Building_UBI_File_system

1.1.通过sudo apt-get install mtd-utils安装。

When building a UBI file systemyou need to have a directory that contains the exact files and directorieslayout that you plan to use for your file system. This is similar to the filesand directories layout you will use to copy a file system onto a SD card

forbooting purposes. It is important that your file system size is smaller than thefile system partition in the NAND.

Next you need a file namedubinize.cfg. Below contains the exact contents of ubinize.cfg you should use.However, replace with a name of your choosing.

1.2建立目录

解压TI提供的文件系统arago-base-tisdk-image-am335x-evm.tar.gz,进入filesystem 目录

$   mkdir rootfs

$   tar -xf  arago-base-tisdk-image-am335x-evm.tar.xz -C rootfs

ubinize.cfg是ubinize命令的一个配置文件:每句后面注意不要有空格。

[ubifs]

mode=ubi

image=ubifs.img //用mkfs.ubifs工具制作出来的ubifs镜像vol_id=0

vol_size=260MiB/* 大小视mkfs.ubifs制作出来的文件大小而定*/

vol_type=dynamic

vol_name=rootfs

vol_flags=autoresize

1.3编译命令

$ sudo mkfs.ubifs -r/home/tb/ti_sdk/filesystem/rootfs -F -m 2048 -e 126976 -c 5600 -o ubifs.img

-r ./rootfs :指定制作UBIFS文件系统的源文件目录

-m 2048:指定最小I/O操作的大小为2048字节

-e 126976:指定逻辑擦除块的大小

-c 992:指定最大逻辑除块的数目

-o ubifs.img 生成的文件,同ubinize.cfg配置中的image名字一样。

-F不加可能会出错。

上面两条命令的具体参数要看板子NAND参数

1.4编译脚本

#! /bin/sh

echo "make director rootfs to ubifs.img..."

sudo mkfs.ubifs -r /home/tb/ti_sdk/filesystem/rootfs -F -m 2048 -e126976 -c 5600 -o ubifs.img

echo "ubifs.img done."

#使用ubinize可以将mkfs.ubifs命令制作出来的UBIFS 文件系统镜像直接在FLASH上烧写的>格式

#(带有UBI文件系统镜像卷标)

#能过此命令生成的ubi.img可直接烧写到NAND FLASH上。

echo "make ubifs.img to ubi.img..."

sudo ubinize -o ubi.img -m 2048 -p 128KiB -s 512 -O 2048 ubinize.cfg

echo "ubi.img done."

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值