小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

嵌入式系統(tǒng)中常用文件系統(tǒng)的制作總結(jié)

 darkhero 2006-11-15
Creating a Compressed RAM Disk
a) Decide on the RAM disk size that you want. Say 8 MB for this example.


    dd if=/dev/zero of=ramdisk bs=1k count=8192

 

b) Make a filesystem on it. Say ext2fs for this example.

 

$mke2fs -F -vm0 ramdisk

 

mke2fs 1.38 (22-April-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
2048 inodes, 8192 blocks
409 blocks (4.99%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
2048 inodes per group

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 16 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

 

c) Mount it, copy the files you want to it (eg: /etc/* /dev/* ...)
   and unmount it again.

 

$mount -o loop ramdisk /mnt

$ls /mnt

lost+found

$df -h /mnt

Filesystem            容量  已用 可用 已用% 掛載點(diǎn)
/mnt                  7.8M  1.0K  7.4M   1% /mnt

 

$umount /mnt

 

d)compress

 

$gzip -9 ramdisk 

-9使用最高級(jí)的壓縮算法,大約60%的壓縮比.得到ramdisk.gz

$mv ramdisk.gz ramdisk.image.gz

$gunzip ramdisk.image.gz





JFFS2

 

mkdir  /jffs2_dir
這樣做就是你新做的jffs2.img里面除了你剛剛添加的hello外沒有任何目錄和文件,而這完全可以工作,啟動(dòng)后自己添加即可。
mkfs.jffs2 -d  /jffs2_dir  -o  jffs2.img
這個(gè)mkfs.jffs2工具是要額外提供的,如果您沒有,可發(fā)信索取。

 

mkfs.jffs2 -r rootfs/ -o jffs2.img

-r指定內(nèi)含有根文件系統(tǒng)的目錄,并使用-o來指定文件系統(tǒng)映像的輸出文件名稱.

-l or -b建立字節(jié)順序?yàn)閘ittle endian或big endian.

 

jffs2的壓縮比僅為10%高一點(diǎn)..

 

eraseall /dev/mtd5

    Erased 8192 Kibyte @ 0 -- 100% complete.

cat jffs2.img >/dev/mtd5

 

mount -t jffs2 /dev/mtdblock/5 /jffs2

與磁盤文件系統(tǒng)不同,無法在loopback設(shè)備上使用mount -o loop ...命令jffs2。你必須從真正的MTD設(shè)備來安裝jffs2。




CRAMFS
 

對(duì)于CRAMFS:
和JFFS2完全相同的做法,你也完全可以自己
mkdir /cramfs_dir
mkcramfs /cramfs_dir cramfs.img
當(dāng)然了,和JFFS2不同的是,它是只讀的,你在PC機(jī)上添加了什么,到板子上就只能有什么,不能再動(dòng)態(tài)創(chuàng)建目錄和復(fù)制進(jìn)去文件了,要添加必須重做cramfs.img燒寫到FLASH上才行。
這個(gè)mkcramfs的工具是REDHAT LINUX自帶的。

mount -t cramfs /dev/mtdblock/5 /cramfs

 


  1. 每個(gè)文件最大不超過16M;
  2. 不提供.和..目錄;
  3. 文件的uid具有16bits的width,gid有8bits的寬度.一般的文件系統(tǒng)通常會(huì)支持寬度16/32的uid和gid,CRAMFS, GIDs are truncated to the lower 8 bits.In other words, the maximum GID usable in a root filesystem built on CRAMFS is 255.
  4. 所有文件的時(shí)間戳?xí)辉O(shè)成Unix epoch(00:00:00 GMT, January 1, 1970).The timestamps may be
    updated at runtime, but the updated values will last only as long as the inode is cached in memory;Once the file is reloaded, its timestamp will revert to epoch.
  5. CRAMFS images can be read only by kernels using 4096-byte page sizes (The value of
    PAGE_CACHE_SIZE must be 4096).
  6. All files, whether they are linked or not, have a link count of 1. Even when multiple filesystem entries point to the same file, that file has a link count of only 1. This is fine for most operations,however, since no files can actually be deleted from CRAMFS.

 





NFTL

 

mke2fs /dev/nftla1

 

mount -t ext2 /dev/nftla1 /mnt

NFTL上的ext2并不提供"斷電可靠性"。如有這方面需要,可使用日志型文件系統(tǒng),如ext3,XFS,jfs或reiserfs.




Filesystem characteristics
Filesystem       Write     Persistent    Power down reliability   Compression     Lives in RAM
CRAMFS           No         N/A          N/A                         Yes             No
JFFS2            Yes         Yes         Yes                         Yes             No
JFFS             Yes         Yes         Yes                         No              No
Ext2overNFTL     Yes         Yes         No                          No              No
Ext3overNFTL     Yes         Yes         Yes                         No              No
Ext2overRAMdisk  Yes         No          No                          No              Yes

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多