* [Buildroot] Buildroot creates broken jffs2 image
@ 2010-11-09 15:25 Bjørn Forsman
2010-11-09 17:43 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Bjørn Forsman @ 2010-11-09 15:25 UTC (permalink / raw)
To: buildroot
Hi all,
It seems to me that Buildroot creates broken jffs2 image. And I really
do not understand why because using mkfs.jffs2 from the package
manager (both report version 1.60) with the *same* arguments as
Buildroot did produces a working image. So here's what I do:
1) build Buildroot with jffs2 image
2) flash jffs2 image and try to mount. Watch errors on console:
# mount -t jffs2 /dev/mtdblock7 /mnt
[ snip ]
[ 3628.114395] jffs2_scan_eraseblock(): Node at 0x02800000 {0x1985,
0xe002, 0x00000415) has invalid CR)
[ 3628.127268] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found
at 0x02800004: 0x0415 instead
[ 3628.138850] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found
at 0x02800008: 0xe46f instead
[ 3628.148470] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found
at 0x0280000c: 0x134b instead
[ 3628.160049] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found
at 0x02800010: 0x0001 instead
[ 3628.169675] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found
at 0x02800014: 0x81a4 instead
[ 3628.181252] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found
at 0x0280001c: 0x165d instead
[ 3628.190865] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found
at 0x02800020: 0xa68f instead
[ 3628.202587] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found
at 0x02800024: 0xa68f instead
[ 3628.211430] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found
at 0x02800028: 0xa68f instead
[ 3628.220395] Further such events for this erase block will not be printed
[ 3628.272389] Old JFFS2 bitmask found at 0x0280b86c
[ 3628.277079] You cannot use older JFFS2 filesystems with newer kernels
[ 3628.788134] Cowardly refusing to erase blocks on filesystem with no
valid JFFS2 nodes
[ 3628.796023] empty_blocks 191, bad_blocks 0, c->nr_blocks 512
mount: mounting /dev/mtdblock7 on /mnt failed: Input/output error
3) look at the build log and retrieve the mkfs.jffs2 command that
buildroot used:
echo " /home/bjornfor/forks/buildroot-skipper/output/host/usr/sbin/mkfs.jffs2
-e 0x20000 -p -l -s 0x800 -n -d
/home/bjornfor/forks/buildroot-skipper/output/target -o
/home/bjornfor/forks/buildroot-skipper/output/images/rootfs.jffs2" >>
/home/bjornfor/forks/buildroot-skipper/output/build/_fakeroot.fs
4) issue the command with *host* mkfs.jffs2 instead (using the exact
same arguments):
mkfs.jffs2 -e 0x20000 -p -l -s 0x800 -n -d
/home/bjornfor/forks/buildroot-skipper/output/target -o
/home/bjornfor/forks/buildroot-skipper/output/images/rootfs.jffs2.v2
5) flash new jffs2 image and mount. This time with *no errors*.
Any ideas on why this is happening?
I'm running from git master but on a commit some time after the
2010.08 tag (I haven't updated in a while).
Best regards,
Bj?rn Forsman
^ permalink raw reply [flat|nested] 4+ messages in thread* [Buildroot] Buildroot creates broken jffs2 image
2010-11-09 15:25 [Buildroot] Buildroot creates broken jffs2 image Bjørn Forsman
@ 2010-11-09 17:43 ` Thomas Petazzoni
2010-11-10 17:29 ` Bjørn Forsman
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2010-11-09 17:43 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, 9 Nov 2010 16:25:23 +0100
Bj?rn Forsman <bjorn.forsman@gmail.com> wrote:
> 3) look at the build log and retrieve the mkfs.jffs2 command that
> buildroot used:
> echo
> " /home/bjornfor/forks/buildroot-skipper/output/host/usr/sbin/mkfs.jffs2
> -e 0x20000 -p -l -s 0x800 -n
> -d /home/bjornfor/forks/buildroot-skipper/output/target
> -o /home/bjornfor/forks/buildroot-skipper/output/images/rootfs.jffs2"
> >> /home/bjornfor/forks/buildroot-skipper/output/build/_fakeroot.fs
>
> 4) issue the command with *host* mkfs.jffs2 instead (using the exact
> same arguments):
> mkfs.jffs2 -e 0x20000 -p -l -s 0x800 -n -d
> /home/bjornfor/forks/buildroot-skipper/output/target -o
> /home/bjornfor/forks/buildroot-skipper/output/images/rootfs.jffs2.v2
>
> 5) flash new jffs2 image and mount. This time with *no errors*.
>
> Any ideas on why this is happening?
Not sure, but steps 3) and steps 4) are not identical. In step 3),
mkfs.jffs2 is called by fakeroot, which first creates the device files.
In step 4), you don't have anything creating the device files.
Could you try doing step 4 (i.e calling mkfs.jffs2 directly), but by
calling the mkfs.jffs2 built by Buildroot (in $(HOST_DIR)) ?
Thanks,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] Buildroot creates broken jffs2 image
2010-11-09 17:43 ` Thomas Petazzoni
@ 2010-11-10 17:29 ` Bjørn Forsman
2010-11-11 9:09 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Bjørn Forsman @ 2010-11-10 17:29 UTC (permalink / raw)
To: buildroot
On 9 November 2010 18:43, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Tue, 9 Nov 2010 16:25:23 +0100
> Bj?rn Forsman <bjorn.forsman@gmail.com> wrote:
>
>> 3) look at the build log and retrieve the mkfs.jffs2 command that
>> buildroot used:
>> echo
>> " ? ? /home/bjornfor/forks/buildroot-skipper/output/host/usr/sbin/mkfs.jffs2
>> -e 0x20000 -p -l -s 0x800 -n
>> -d /home/bjornfor/forks/buildroot-skipper/output/target
>> -o /home/bjornfor/forks/buildroot-skipper/output/images/rootfs.jffs2"
>> >> /home/bjornfor/forks/buildroot-skipper/output/build/_fakeroot.fs
>>
>> 4) issue the command with *host* mkfs.jffs2 instead (using the exact
>> same arguments):
>> mkfs.jffs2 -e 0x20000 -p -l -s 0x800 -n -d
>> /home/bjornfor/forks/buildroot-skipper/output/target -o
>> /home/bjornfor/forks/buildroot-skipper/output/images/rootfs.jffs2.v2
>>
>> 5) flash new jffs2 image and mount. This time with *no errors*.
>>
>> Any ideas on why this is happening?
>
> Not sure, but steps 3) and steps 4) are not identical. In step 3),
> mkfs.jffs2 is called by fakeroot, which first creates the device files.
> In step 4), you don't have anything creating the device files.
True.
> Could you try doing step 4 (i.e calling mkfs.jffs2 directly), but by
> calling the mkfs.jffs2 built by Buildroot (in $(HOST_DIR)) ?
Yes. What I found is that calling HOST_DIR mkfs.jffs2 directly (and
not in fakeroot) also created a bad image.
However, I just looked at the BR changelog and found this:
$ git log HEAD..origin/master -- package/mtd/
commit 90660c282298fdb6b09baefe44845b923d9e077f
Author: Peter Korsgaard <jacmet@sunsite.dk>
Date: Sat Oct 16 22:20:21 2010 +0200
mtd: bump version
For mkfs.jffs2 bugfix.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
commit 823aaef1ce9d68e14ff9ac26f38b74139a77f47b
Author: Peter Korsgaard <jacmet@sunsite.dk>
Date: Fri Oct 15 10:39:23 2010 +0200
mtd: fix big endian crc calculation
Taken from upstream git.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
So I cherry-picked these commits and rebuilt. Now the issue is gone!
Sweet! But AFAICS, jffs2 is broken for 2010.08 users...
Thanks for your help, Thomas.
Best regards,
Bj?rn Forsman
^ permalink raw reply [flat|nested] 4+ messages in thread* [Buildroot] Buildroot creates broken jffs2 image
2010-11-10 17:29 ` Bjørn Forsman
@ 2010-11-11 9:09 ` Thomas Petazzoni
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2010-11-11 9:09 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 10 Nov 2010 18:29:25 +0100
Bj?rn Forsman <bjorn.forsman@gmail.com> wrote:
> So I cherry-picked these commits and rebuilt. Now the issue is gone!
> Sweet! But AFAICS, jffs2 is broken for 2010.08 users...
Ok, good to know. Thanks for digging into this.
Concerning 2010.08 users, we don't yet have a process for releasing
stabilized version of past Buildroot releases. Maybe this will come in
the future, if someone steps up to do the maintainance.
Regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-11 9:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-09 15:25 [Buildroot] Buildroot creates broken jffs2 image Bjørn Forsman
2010-11-09 17:43 ` Thomas Petazzoni
2010-11-10 17:29 ` Bjørn Forsman
2010-11-11 9:09 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox