[ELDK] How to make root file system

Wolfgang Denk wd at denx.de
Tue Sep 29 23:54:57 CEST 2009


Dear "J.Hwan.Kim",

In message <4AC19A61.2080108 at gmail.com> you wrote:
> 
> I hope to make JFFS2 root file system with ELDK4.2.
> I followed DULG manual to make root file system like this :
> 
> bash$ gzip -d -c -v /opt/eldk/arm/images/ramdisk_image.gz > /tmp/ramdisk_image
> bash$ mount -o loop /tmp/ramdisk_image /mnt/tmp
> bash# cd /mnt/tmp
> bash# tar -zc --exclude='dev/*' -f /tmp/rootfs.tar.gz *
> bash# umount /mnt/tmp
> 
> $ mkdir rootfs
> $ cd rootfs
> $ tar zxf /tmp/rootfs.tar.gz
> $ mkfs.jffs2 -U -d . -o root.jffs2 -e 0x20000 -n

This looks OK to me.

> But created root.jffs2 was too large - it was over 2GB.

I guess this is a type, and you mean "over 2 MB". And this is a size
I consider pretty normal for your situation.

> The rootfs.tar.gz was about 1.6MB
> What is wrong?
> How can I solve this problem?

I do not see a problem, everything seems to have worked fine.

You may have to correct your expectations, though. The compressed data
you want to store in the file system is about 1.6 MB, as you say;
let's assume that the representation of this data in a JFFS2 file
system will take about the same amount of memory (actually it will be
some more than the tarball size). In addition to that, a JFFS2 file
system always needs a number of (typically 5) spare blocks. You
specifiy an erase block size of 0x20000 = 138 kB, so we have to add
5 x 128 = 640 kB.

1.6 MB + 640 kB = 2.2 MB.  I would expect your JFFS2 image to be in
the range of 2.2 ... 2.5 MB.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Those who do not  understand  Unix  are  condemned  to  reinvent  it,
poorly.              - Henry Spencer, University of Toronto Unix hack


More information about the eldk mailing list