This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

制作ubifs文件系统

am5728

在板子上添加了nand芯片,sdk中内核不支持yaffs2格式,所以想使用ubifs格式的文件系统

在网上找了好多制作ubifs文件系统的帖子,可是工具都编译不过去啊

下载的最新的ubifs源码,想通过附件的流程编译,可是最新源码的目录结构变了

一直制作不出来工具,

请问有制作好的直接使用的工具吗

  • 不能够发附件

    附件内容:

    zlib
    host$ tar xvf zlib-1.2.5.tar.gz
    host$ cd zlib-1.2.5/
    host$ ./configure --prefix=~/mtd/install
    host$ make
    host$ make install
    host$ cd ..
    lzo
    host$ tar xvf lzo-2.06.tar.gz
    host$ cd lzo-2.06/
    host$ ./configure --build=i686-pc-linux --prefix=~/mtd/install
    host$ make
    host$ make install
    host$ cd ..

    e2fsprogs
    host$ tar xvf e2fsprogs-1.42.tar.gz
    host$ cd e2fsprogs-1.42/
    host$ ./configure --build=i686-pc-linux --prefix=~/mtd/install
    host$ make
    host$ make install
    host$ cd lib/uuid/
    host$ make install
    host$ cd ../../../

    2.1 编译MTD Utilites:
    在编译mtd-utils之前,先修改makfile文件:
    host$ vi Makefile
    PREFIX = ~/mtd/install
    ZLIBCPPFLAGS = -I$(PREFIX)/include
    LZOCPPFLAGS = -I$(PREFIX)/include
    ZLIBLDFLAGS = -L$(PREFIX)/lib
    LZOLDFLAGS = -L$(PREFIX)/lib
    LDFLAGS += $(ZLIBLDFLAGS) $(LZOLDFLAGS)
    CFLAGS ?= -O2 -g $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)
    host$ vi common.mk
    #PREFIX=/usr

    然后依照如下指令编译:
    host$ WITHOUT_XATTR=1 make
    host$ make install DESTDIR=~/mtd/install
    host$ cd ..
    制作ubi文件系统所用的工具在如下目录下:
    ~/mtd/install/home/<username>/mtd/install/sbin/mkfs.ubifs ~/mtd/install/home/<username>/mtd/install/sbin/ubinize

    可是新版的源码中没有Makefile啊

  • http://processors.wiki.ti.com/index.php/UBIFS_Support?keyMatch=ubifs&tisearch=Search-EN

  • 你好,感谢回复

    可是这里没有制作mtd-utils工具的流程啊,

    看了很多网上的例子,可是对这个流程还是比较模糊,,所以工具移植制作不出来,

    请问能够提供相关制作的具体流程吗

    或者是提供mtd-utils和ubinize这两个工具

    我使用的SDK:ti-processor-sdk-linux-am57xx-evm-03.03.00.04

    环境:

    machine:~$ uname -a
    Linux machine 4.4.0-93-generic #116-Ubuntu SMP Fri Aug 11 21:17:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux


  • 你好:

    我使用的NAND:

    MT29F4G08ABA

    page size:4096B

    block size:64*4096=262144B

    block count:2048

    [ 68.475004] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xdc
    [ 68.481384] nand: Micron MT29F4G08ABAEAWP
    [ 68.485431] nand: 512 MiB, SLC, erase size: 256 KiB, page size: 4096, OOB size: 224
    [ 68.493183] using OMAP_ECC_BCH16_CODE_HW ECC scheme

    mkfs.ubifs参数:

    mkfs.ubifs -F -q -r rootfs/ -m 4096 -e 253952 -c 2000 -o ubifs.img

    ubinize -o ubi.img -m 4096 -p 256KiB ubinize.cfg

    1 [ubifs]
    2 mode=ubi
    3 image=ubifs.img
    4 vol_id=0
    5 vol_size=500MiB
    6 vol_type=dynamic
    7 #vol_alignment=1
    8 vol_name=NAND.file-system
    9 vol_flags=autoresize

    错误提示:

    [ 68.504304] Creating 10 MTD partitions on "8000000.nand":
    [ 68.509729] 0x000000000000-0x000000040000 : "NAND.SPL"
    [ 68.525960] 0x000000040000-0x000000080000 : "NAND.SPL.backup1"
    [ 68.542832] 0x000000080000-0x0000000c0000 : "NAND.SPL.backup2"
    [ 68.559666] 0x0000000c0000-0x000000100000 : "NAND.SPL.backup3"
    [ 68.576514] 0x000000100000-0x000000180000 : "NAND.u-boot-spl-os"
    [ 68.583569] 0x000000180000-0x000000380000 : "NAND.u-boot"
    [ 68.600352] 0x000000380000-0x0000003c0000 : "NAND.u-boot-env"
    [ 68.617132] 0x0000003c0000-0x000000400000 : "NAND.u-boot-env.backup1"
    [ 68.624641] 0x000000400000-0x000000c00000 : "NAND.kernel"
    [ 68.632697] 0x000000c00000-0x000020000000 : "NAND.file-system"

    [ 68.861546] ubi0: attaching mtd9
    [ 70.131591] ubi0: scanning is finished
    [ 70.140598] ubi0 error: vtbl_check: too large reserved_pebs 2065, good PEBs 2000
    [ 70.148051] ubi0 error: vtbl_check: volume table check failed: record 0, error 9
    [ 70.155493] Volume table record 0 dump:
    [ 70.159343] reserved_pebs 2065
    [ 70.162683] alignment 1
    [ 70.165749] data_pad 0
    [ 70.168814] vol_type 1
    [ 70.171877] upd_marker 0
    [ 70.174955] name_len 16
    [ 70.178108] name NAND.file-system
    [ 70.182497] crc 0x3a24d27f
    [ 70.187186] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd9, error -22
    [ 70.194305] UBI error: cannot attach mtd9

  • 你好,bootargs:

    setenv bootargs mem=2048M noinitrd ip=off rootwait=1 rw ubi.mtd=9,4096 rootfstype=ubifs root=ubi0:rootfs init=/init console=${console}

    请问ubi.mtd=9,4096是什么意思呢

  • 下面的帖子有详细步骤和讨论,可以参考下面的帖子:

    http://www.deyisupport.com/question_answer/dsp_arm/sitara_arm/f/25/t/59921.aspx?pi239031348=1