UBIFS and Gumstix

I wanted try something other than JFFS2 as the rootfs and decided to go with UBIFS. Thanks to GIT’s brilliance I had no trouble pulling the UBIFS kernel patches from their tree to mine.

It seems that the UBIFS hasn’t had many NOR flash users before me and it needed some fixes. Artem Bityutskiy was extremely helpful in fixing the deficiencies and helping me out. After a few debug rounds I now have UBIFS root on my Gumstix.

I created the UBIFS image with the following commands:


sudo mkfs.ubifs --compr=zlib -r /tmp/rootfs -m 1 -e 130944 -c 120 -o ubifs.img
ubinize -o ubi.img -m 1 -p 128KiB -v ubinize.cfg

With this ubinize.cfg:


[ubifs]
mode=ubi
image=ubifs.img
vol_id=0
vol_size=13MiB
vol_type=dynamic
vol_name=rootfs
vol_alignment=1
vol_flags=autoresize

Note that I have reserved 2MiB for the kernel partition.

I had to add one extra parameter to the kernel args to specify what MTD partition I wanted to use:

console=ttyS0,115200n8 root=ubi0:rootfs rootfstype=ubifs reboot=cold,hard ubi.mtd=1

Now my Gumstix boots with simplified kernel to busybox shell in roughly 4.2 seconds (counted from the bootm command in U-Boot).

9 thoughts on “UBIFS and Gumstix

  • March 25, 2009 at 10:51 pm
    Permalink

    What was the boot time before you switched to UBIFS?

  • March 26, 2009 at 7:53 am
    Permalink

    Sorry, I never booted my gumstix with anything else than UBIFS.

  • November 10, 2009 at 5:38 pm
    Permalink

    Hi
    I am a newbie… please can you let me know how to install ubifs? I mean do I need a linux distro like ubuntu and build it up or it is a separate specific distro?

    I would setup a notebook with ubifs to conenct and read the onenand on my ipaq: I just need read it possibly with all bad blocks, so a read only version is all I need.

    Maybe I a messing up with my spare knowledge …:) anyway thanks

    sax

  • November 10, 2009 at 6:27 pm
    Permalink

    UBIFS is a file system format, like e.g. EXT2, JFFS2 and VFAT. So you have your linux distro and you put that to the file system. You can find more details from the UBIFS page:

    http://www.linux-mtd.infradead.org/doc/ubifs.html

    I’m not quite sure what you are trying to do but if you need to retrieve your IPAQ’s file system then UBIFS isn’t anything you need. And you can’t put UBIFS on e.g. a harddrive, you need a flash device.

  • December 7, 2010 at 3:36 pm
    Permalink

    Looks like you already got good answers in gumstix mailing list.

    I used a small (~8MB) rootfs images with the Verdex board. Iirc, I treated those in the same way I treated JFFS2 images: I transferred those over a serial connection to the board using the U-Boot and then erased the flash with “erase” command and flashed the rootfs with “cp.b” command.

    Nowadays I have an Overo board and I use the Micro SD card for convenience.

  • December 7, 2010 at 4:32 pm
    Permalink

    I am playing with it right now, but it doesn’t look good so far. u-boot and uImage is still generated as before, I think they quite the same. For rootfs there are two files generated, ubi and ubifs. So I tried putting ubi file onto mtd4, but it pretty much fails.

  • December 7, 2010 at 5:15 pm
    Permalink

    After few times of trying it is booting! I just had to learn more about ubi utilities and read problems.

    What is the difference with ubi and ubifs files Bitbake gerantes? ubifs is 1MB smaller and actually it didn’t want to work nice, but ubi worked fine.

Comments are closed.