Skip to contentSkip to conversation

trouble compiling mkfs.jffs2

DISCUSSION James Schettine 5 participants 11 messages Sep 14, 2001 – Sep 17, 2001 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

JFFS2 is working great on my embedded arm processor. (Great work everybody!)

I have started out with a pre-built root image I grabbed from others working on handhelds, and they have set the erase block size to 0x40000 and mine needs to be 0x20000. Question #1... does this only affect the overhead/optimal use or will I actually run into problems if I run this over a long period.

In order to re-flash my embedded root filesystem with the correct erase block size, I have transferred all files to my desktop system (an older Debian 2.2) and read up on using mkfs.jffs2. I couldn't find a pre-compiled binary in a quick and lazy search so I grabbed the cvs tree, cd util, and make mkfs.jffs2. (did the configure thing too, but that didn't fix this problem.)

I'm getting problems with size_t undefined in linux/string.h (I can't believe it doesn't include what it needs !), and patching around that I get conflicts between linux/string.h and asm/string.h

Then it struck me that as a user-land utility application, we shouldn't need to get TOO intimate with the kernel. After all, I am cross-building my filesystem. The more you ask about the host kernel, the more wrong you'll be when you get to the target kernel.

Has anyone else had these troubles/got a work-around. It's not a good time to be upgrading this particular system right now.

#1 lore raw

Hi!

Quoted 9 lines

In order to re-flash my embedded root filesystem with the correct erase block size, I have transferred all files to my desktop system (an older Debian 2.2) and read up on using mkfs.jffs2. I couldn't find a pre-compiled binary in a quick and lazy search so I grabbed the cvs tree, cd util, and make mkfs.jffs2. (did the configure thing too, but that didn't fix this problem.)

[more error descriptions]

Just a wild guess, but Debian 2.2 (aka Potato) is based on the 2.2 Kernel series. This also effects a bunch of files in the /usr/include tree and might be the cause of your problems.
You could update your Debian system to testing/Woody or simply temporarily symlink /usr/include/linux to /usr/src/linux/include - if that one belongs to a current kernel version.

Jörn

Signature · 2 lines
Every good work of software starts by 
scratching a developer's personal itch.
#2 lore raw
Quoted 6 lines · [email protected] writes:

Just a wild guess, but Debian 2.2 (aka Potato) is based on the 2.2 Kernel series. This also effects a bunch of files in the /usr/include tree and might be the cause of your problems.
You could update your Debian system to testing/Woody or simply temporarily symlink /usr/include/linux to /usr/src/linux/include - if that one belongs to a current kernel version.

Thanks... I got it to compile (v1.15), but when I run it it creates a file size == one erase block.

A quick web search led me to :
ftp://ftp.uk.linux.org/pub/people/dwmw2/iPAQ/mkfs.jffs2.1.8 running it --version sez 1.7 and it creates the whole 5 meg but my kernel complains bitterly that the fs is too old.

If I could grab a binary somewhere I could move on. If no-one can point me to a binary, I guess I'll be debugging this app on a 2.2 kernel.
(my boss threatens to "just go back to WinCE"!)

Thanks J

#3 lore raw
Quoted 2 lines · [email protected] said:

Thanks... I got it to compile (v1.15), but when I run it it creates
a file size == one erase block.

1.15 was doing naughty things when given a relative rootdir, and just segfaulting when the rootdir wasn't specified. 1.16 should fix it.

ftp.uk.linux.org:/pub/people/dwmw2/jffs2/mkfs.jffs2-1.16

--
dwmw2

#4 lore raw

Hi

When mounting a mkfs.jffs2 made jffs2 image, I get:

root@board8:~# mount /dev/mtdblock4 /jffs2/
Child dir "." (ino #1) of dir ino #1 appears to be a hard link
root@board8:~# cd /jffs2/                                     
root@board8:/jffs2# ls -l
total 4
drwxr-xr-x    2 root     root            0 Sep 14 09:05 ./
drwxr-xr-x    2 root     root            0 Sep 14 09:05 ./
drwxrwxrwx   17 root     root         4096 Sep 11 09:53 ../
drwxr-xr-x    1 root     root            0 Sep 11 09:38 bin/
drwxr-xr-x    1 root     root            0 Sep  4 08:55 boot/
drwxr-xr-x    1 root     root            0 Sep 14 09:33 dev/
drwxr-xr-x    1 root     root            0 Sep 11 09:49 etc/
-rw-r--r--    1 root     root            0 Sep  4 13:38 fastboot
drwxr-xr-x    1 root     root            0 Sep  4 08:57 home/
drwxr-xr-x    1 root     root            0 Jul 10 07:04 lib/
drwxr-xr-x    1 root     root            0 May 23 19:49 mnt/
drwxr-xr-x    1 root     root            0 May 23 19:49 opt/
drwxr-xr-x    1 root     root            0 Sep  4 08:52 proc/
drwsr--r--    1 root     root            0 Sep 17 12:36 root/
drwxr-xr-x    1 root     root            0 Sep  4 11:57 sbin/
drwxrwxrwt    1 root     root            0 Aug 29 07:19 tmp/
drwxr-xr-x    1 root     root            0 Sep  4 10:28 usr/
drwxr-xr-x    1 root     root            0 Jun  8 17:29 var/

This is with mkfs.jffs2 v1.16

I am not sure what I was running before I upgraded to v1.16, but it could have been as old as v1.11

This FS is created from MV 2.0 by doing(on Host, Redhat 7.1):
cp -a /opt/hardhat/.../target /root/target
<rm /root/target a lot of unnedded files> mkfs.jffs2 -b -e 0x40000 -o rootfs -d /root/target

On target(custom PPC 860):
eraseall /dev/mtd4
cp rootfs /dev/mtdblock4

Joakim

Quoted 19 lines
Quoted 2 lines · [email protected] said:

Thanks... I got it to compile (v1.15), but when I run it it creates
a file size == one erase block.

1.15 was doing naughty things when given a relative rootdir, and just segfaulting when the rootdir wasn't specified. 1.16 should fix it.

ftp.uk.linux.org:/pub/people/dwmw2/jffs2/mkfs.jffs2-1.16

--
dwmw2

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#5 lore raw
Quoted 9 lines · [email protected] said:

When mounting a mkfs.jffs2 made jffs2 image, I get:

root@board8:~# mount /dev/mtdblock4 /jffs2/
Child dir "." (ino #1) of dir ino #1 appears to be a hard link
root@board8:~# cd /jffs2/                                     
root@board8:/jffs2# ls -l
total 4
drwxr-xr-x    2 root     root            0 Sep 14 09:05 ./
drwxr-xr-x    2 root     root            0 Sep 14 09:05 ./
drwxrwxrwx   17 root     root         4096 Sep 11 09:53 ../

Interesting. I recommend you poke Erik with a sharp stick :)

What args did you use to create the filesystem, and does it still do it with v1.15 (before I changed some stuff)?

--
dwmw2

#6 lore raw
Quoted 2 lines

Interesting. I recommend you poke Erik with a sharp stick :)

:-)

Quoted 3 lines

What args did you use to create the filesystem, and does it still do it with v1.15 (before I changed some stuff)?

args? What more do you want, than what I included last in my previous mail?

v1.15 has the same problem.

Jocke

Quoted 5 lines

--
dwmw2

#7 lore raw
Quoted 2 lines · [email protected] said:

args? What more do you want, than what I included last in my previous mail?

Er, I want you to put them near the top of the mail, of course, so that I don't have to be intelligent enough to scroll down and look at them :)

--
dwmw2

#8 lore raw
Quoted 3 lines

Er, I want you to put them near the top of the mail, of course, so that I don't have to be intelligent enough to scroll down and look at them :)

OK, I try to remember that next time :-)

Jocke

#10 lore raw

jffs vs. jffs2 & new code

In reply to Jörn Engel

Hi!

I am relatively new to mtd, but already have two questions. Please give me a hint if they are covered in some faq.

1. jffs is not jffs2, obvious. But what is the difference from a user-perspective besides the mkfs used?
I created some test partitions and tried both but could not really see a difference. The platform is a 2.4.2 Kernel with the montavista patches, additional patches for the hardware - still secret stuff, sorry - and the current MTD code from cvs.

2. After examining the availlable partition table parsers, I was not very happy with the choices and wrote my own, along with a userspace tool for partition table creation. This still needs a couple of days for testing and code cleanup, before it is ready for the wild, but at least my employer allows me to send the code to you.
How, when, where, [...] can I do it?

Regards, Joern

#9 lore raw
In reply to David Woodhouse
Quoted 12 lines · David Woodhouse
Quoted 9 lines · [email protected] said:

When mounting a mkfs.jffs2 made jffs2 image, I get:

root@board8:~# mount /dev/mtdblock4 /jffs2/
Child dir "." (ino #1) of dir ino #1 appears to be a hard link
root@board8:~# cd /jffs2/                                     
root@board8:/jffs2# ls -l
total 4
drwxr-xr-x    2 root     root            0 Sep 14 09:05 ./
drwxr-xr-x    2 root     root            0 Sep 14 09:05 ./
drwxrwxrwx   17 root     root         4096 Sep 11 09:53 ../
Quoted 1 line

Interesting. I recommend you poke Erik with a sharp stick :)

Hmm. Sorry about that. I thought I had everything perfect but I guess not...

-Erik

--
Erik B. Andersen email: [email protected], formerly of Lineo
--This message was written using 73% post-consumer electrons--