Re: [Yaffs] android boot issue with latest git source

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
CC: Wills, Jordan
Subject: Re: [Yaffs] android boot issue with latest git source
patch-ker.sh now has a better explanation of what to do.

See
http://yaffs.net/gitweb?p=yaffs2/.git;a=commitdiff;h=69808485ec796bfa2b4806f91828281eccd0827b;hp=1cbf86620c7070821b8790ae38bd5b578e7125c0

On Friday 03 September 2010 09:20:57 Charles Manning wrote:
> On Wednesday 01 September 2010 03:16:52 Wills, Jordan wrote:
> > Charles,
> > I did attempt to use the patch-ker.sh script at first, but received
> > erroneous output when I tried to run it. To be more specific:
> >
> > ./patch-ker.sh c ~/projects/android2.1/kernel
> >
> > Resulted in the following output:
> >
> > ~/projects/android2.1/kernel/fs/Kconfig already mentions YAFFS, so we
> > will not change it ~/projects/android2.1/kernel/fs/yaffs2 exists, not
> > patching
> >
> > When I first received this message, I assumed that it was because my
> > kernel already had YAFFS implemented in it, albeit an out of date version
> > of YAFFS. Should patch-ker.sh be able to update an old version of YAFFS
> > as well as being able to add YAFFS to a kernel that doesn't already
> > include it? If so, did I call patch-ker.sh incorrectly, or is there an
> > issue with patch-ker.sh that caused it to not realize that my
> > kernel/fs/yaffs was out of date?
>
> The patch-ker.sh script is simplistic. It has two steps:
>
> * Modify fs/Kconfig to include fs/yaffs2/Kconfig. If that is already there
> then warn and do nothing.
> * Add the fs/yaffs2 directory. If that is already there then warn and do
> nothing.
>
> What you need to do is get rid of the old code first by either:
>
> rm -rf ~/projects/android2.1/kernel/fs/yaffs2
> -or-
> mv ~/projects/android2.1/kernel/fs/yaffs2 \
> ~/projects/android2.1/kernel/fs/yaffs2.prev
>
> > Thanks,
> > Jordan Wills
> >
> >
> > -----Original Message-----
> > From: Charles Manning [mailto:manningc2@actrix.gen.nz]
> > Sent: Monday, August 30, 2010 7:14 PM
> > To:
> > Cc: Wills, Jordan
> > Subject: Re: [Yaffs] android boot issue with latest git source
> >
> > Glad to see you fixed this.
> >
> >
> > I strongly recommend that you do not use such a manual process to patch
> > in a new version of yaffs2. I suggest that you rather use the
> > patch-ker.sh script.
> >
> > rm -f /kernel-tree/fs/yaffs2
> > (or mv /kernel-tree/fs/yaffs2 /kernel-tree/fs/old-yaffs2)
> >
> > cd new-yaffs2
> > ./patch-ker.sh c /kernel-tree
> > -or-
> > ./patch-ker.sh l /kernel-tree
> >
> > c will copy, l will create symbolic links.
> >
> > -- Charles
> >
> > On Tuesday 31 August 2010 02:38:29 Wills, Jordan wrote:
> > > Sudeep,
> > > Thank you very much for your response. It is good to know that the
> > > issues we were observing were indeed to do a bug that has already been
> > > fixed. I am still seeing the problematic behavior I detailed in the
> > > second paragraph of my last post, though- after updating YAFFS2 to the
> > > latest version, attempting to mount what I know to be a properly
> > > written YAFFS2 partition results in that partition's contents being
> > > erased (save for the lost+found directory). Would you mind stepping me
> > > through your process for replacing the android yaffs2 code with the
> > > updated yaffs2 code? I will post the steps I take as well- if anything
> > > appears to be incorrect, please let me know.
> > >
> > > Get the latest YAFFS2 code:
> > >     git clone git://www.aleph1.co.uk/yaffs2

> > >
> > > Copy the YAFFS2 code into the android kernel
> > >     rm -r android2.1/kernel/fs/yaffs2
> > >     cp -r yaffs2 android2.1/kernel/fs/

> > >
> > > Change the YAFFS2 makefile to be compatible with Android
> > > /* If anything in this process is wrong, my guess is it's this */
> > >     cd android2.1/kernel/fs/yaffs2
> > >     vim Makefile.kernel
> > >         replace yaffs.o with yaffs2.o
> > >         replace all occurrences of yaffs-y with yaffs2-y
> > >     cp Makefile.kernel Makefile

> > >
> > > Compile the updated kernel
> > >     cd android2.1/kernel
> > >     export
> > > PATH=$PWD/../prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:/opt/ldp-2
> > >.1 0/ bin:$PATH make ARCH=arm CROSS_COMPILE=arm-eabi- uImage -j8

> > >
> > > When I load this image into my device, I am able to mount the OneNAND
> > > and copy my file system onto it. If I sync, unmount, and mount the
> > > file system again, though, the OneNAND shows that it contains only the
> > > LOST+FOUND directory.
> > >
> > > Thanks again for the help,
> > > Jordan Wills
> > >
> > >
> > > -----Original Message-----
> > > From: Sudeep K N [mailto:sudeepholla.maillist@gmail.com]
> > > Sent: Saturday, August 28, 2010 8:50 AM
> > > To: Wills, Jordan
> > > Cc: ; Kieran Cox; Lloyd, Jay; Charles Manning
> > > Subject: Re: [Yaffs] android boot issue with latest git source
> > >
> > > Jordon Wills,
> > >
> > > We too faced similar issues with data getting zeroed in the first two
> > > pages of a block following a bad block.
> > > Below is our analysis:
> > >
> > >     The problem was the OOB length YAFFS2 was reading from MTD. On
> > > OneNand there was 20 bytes left free on OOB and YAFFS2 would request a
> > > read of 28 bytes of OOB. The OneNand MTD driver would read 20 bytes
> > > from the page requested and the rest 8 bytes from next page. If the
> > > next page happened to be marked bad we would get an ECC error which
> > > would cause the current page to be ignored as well. Hence the YAFFS2
> > > mounted file would get corrupted (if this happens to be some of the
> > > core android jar files then it would result in android boot being
> > > stuck).

> > >
> > >     The latest YAFFS2 code ignores reading the ecc portion of the
> > > struct (12 bytes) from OOB.(YAFFS2 any way does not calculate the ECC
> > > and is handled by the MTD driver). This way we only read 16 bytes from
> > > OOB which is less than oobavail and hence fixes the issue.

> > >
> > > Hope this helps you.
> > >
> > > Regards,
> > > Sudeep
> > >
> > > _______________________________________________
> > > yaffs mailing list
> > >
> > > http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
>
> _______________________________________________
> yaffs mailing list
>
> http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs