MTD工具的安裝

2021-04-12 23:00:22 字數 1919 閱讀 1504

, 為宿主機安裝

mtd工具程式

mtd工具程式

: ftp://ftp.uk.linux.org/pub/people/dwmw2/mtd/cvs/

$/build-tools

並將它解開

.$ cd $/build-tools/mtd/util

$ make clean

修改makefile檔案:

sbindir=sbin

mandir=man

includedir=include

$ make

install

時需要root許可權,

否則提示安裝失敗

:($ su -m

password:

# make destdir=$ install

工具程式安裝到

$/sbin目錄.

搜尋路徑已經在開發工具裡新增

.然後用

# chown -r

命令改變

tools

目錄的屬主

在主機/dev

目錄中建立

mtd裝置條目,以

root

的身份執行

makedev

# ./makedev二,

為目標板安裝

mtd工具程式

zlib.

從http://www.gzip.org/zlib/

zlib

並將它解開放到

$/build-tools目錄.

然後移往該鏈結庫的原始碼目錄

,進行編譯工作

:$ cd $/build-tools/zlib-1.2.3

$ cc=arm-linux-gcc ldshared="arm-linux-ld -shared" ./configure --shared

預設情況下

,zlib

建立靜態的鏈結庫.設定

ldshared

變數以及提供

--shared選項,

建立成共享鏈結庫

.$ make

$ make prefix=$ install

zlib

安裝到$/lib,

接著將它安裝到目標板的根檔案系統

:$ cd $/lib

$ cp -d libz.so* $/rootfs/lib然後,

將mtd snapshot

修改makefile檔案:

sbindir=usr/sbin

mandir=usr/man

includedir=usr/include

cross=arm-linux-

$ make

install

時需要root

許可權$ su -m

password:

# make destdir=$/rootfs install

工具程式安裝到

$/rootfs/usr/sbin目錄.

然後用# chown -r

命令改變

rootfs

目錄的屬主

.flash

晶元以塊

(而非位元組

)為單位

,所以建立分割槽的時候必須考慮到

"抹除塊

"的大小,以

"抹除塊

"的大小為界,如

:(可以# cat /proc/mtd

來察看分割槽資訊

)dev: size erasesize name

mtd0: 00030000 00004000 "boot"

mtd1: 001d0000 00004000 "kernel"

mtd2: 00a00000 00004000 "rootfs"

mtd3: 03400000 00004000 "ext-fs3"

MTD工具使用

mtd 工具使用 mtd debug usage mtd debug info mtd debug read mtd debug write mtd debug erase mtd debug info 可以檢視 flash 型別 塊大小及 mtd 分割槽總大小,大小以10進製顯示,分割槽大小就是 ...

MTD 工具使用

mtd debug usage mtd debug info mtd debug read mtd debug write mtd debug erase mtd debug info 可以檢視 flash 型別 塊大小及 mtd 分割槽總大小,大小以10進製顯示,分割槽大小就是 len mtd d...

MTD的壞塊管理 一 快速了解MTD的壞塊管理

由於nand flash的現有工藝不能保證nand的memory array在其生命週期中保持效能的可靠,因此在nand晶元出廠的時候,廠家只能保證block 0不是壞塊,對於其它block,則均有可能存在壞塊,而且nand晶元在使用的過程中也很容易產生壞塊。因此,我們在讀寫nand flash 的...