mkfs.jffs2: device table entries not the same type as in FS

Mitch Davis mjd-linux-mtd at afork.com
Thu Sep 18 11:00:38 EDT 2008


Hello,

I'm using buildroot, which can use mkfs.jffs2 to generate JFFS2
images.  I'm having the problem that mkfs.jffs2 fails with this
message:

  % mkfs.jffs2 -e 0x20000 -l -s 0x800 -n -D device_table.txt -d root
-o rootfs.arm-20080918.jffs2
  mkfs.jffs2: root/dev/mem: file type does not match specified type!

The problem is that there is an entry for /dev/mem (plus lots of
others) in device_table.txt, but there is also an empty file called
root/dev/mem in the tree I've pointed mkfs.jfffs2 at.  Now of course,
the problem would go away if there was no empty file there, but those
files are a consequence of generating other output types in buildroot
using fakeroot to imitate root-owned device files.  It's not really
possible to make them go away.

Here's the code in mkfs.jffs2:

  http://git.infradead.org/mtd-utils.git?a=blob;f=mkfs.jffs2.c;hb=d769da93a56590c23ce9430a1d970e31e835ae88#l320

The comment says "It is ok for some types of files to not exit on disk
(such as device nodes), but if they _do_ exist the specified mode had
better match the actual file or strange things will happen....".

What strange things?  If I change the code so it just replaces the
existing filesystem_entry, what will break?

Hoping you can help me understand that code.

Thanks,

Mitch.



More information about the linux-mtd mailing list