Re: [Yaffs] yaffs2 on 2.4 vs yaffs2 on 2.6

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] yaffs2 on 2.4 vs yaffs2 on 2.6
On Tuesday 13 April 2010 02:45:43 wrote:
> On 04/12/10 03:45, Charles Manning wrote:
> > On Sunday 11 April 2010 06:51:43 wrote:
> >> Re:
> >>
> >>
> >>
> >> Author:
> >> Date: 2010-04-05 21:41 +200
> >> To: YAFFS ML
> >> Subject: [Yaffs] yaffs2 on 2.4 vs yaffs2 on 2.6
> >> Hi,
>
> Hi Charles , thanks for the reply.
>
> >> I am in the porcess of updating an older yaffs2 partition on a 2.4
> >> kernel to a recent 2.6 kernel build with the following yaffs code.
> >>
> >> # cat /proc/mtd
> >> dev: size erasesize name
> >> mtd0: 00020000 00020000 "TS-BOOTROM"
> >> mtd1: 07d00000 00020000 "Linux"
> >> mtd2: 002e0000 00020000 "RedBoot"
> >> # cat /proc/yaffs
> >> YAFFS built:Aug 16 2009 21:32:17
> >> $Id: yaffs_fs.c,v 1.79 2009/03/17 01:12:00 wookey Exp $
> >> $Id: yaffs_guts.c,v 1.82 2009/03/09 04:24:17 charles Exp $
> >>
> >>
> >> If I mount /dev/mtdblock1 under a nfs boot of the 2.6 kernel and fsystem
> >> I get rubbish. Some files seem to be interpreted as directories and the
> >> result is chaos.
> >
> > First off, I'd suggest you try to remove variables. Try doing this
> > without nfs first.
> >
> > I expect the difference is in changes in the mtd layer. The yaffs<-->VFS
> > connection should be fine.
>
> I don't have vfs but this would seem to merely to replace one variable
> with a new, unknown variable. Indeed I don't quite see the point.


You most certainly do have vfs. It is the part of the kernel that habdles all
the file systems.

>
> I think maybe I didn't explain it clearly enough.
>
> I boot a 2.6.29 kernel loaded via http. I give the kernel an nfsroot.
> Once the system is up I login via serial connection and/or ssh over
> ethernet.
>
> From this console I mounted /dev/mtdblock1 as stated.
>
> lt showed that it was trying to interpret some data files as directory
> files. I did a hasty reboot.
>
> >> Fortunately it did not hose the fs.
> >>
> >> I was able to make a tarball of the fs by nfs boot to 2.4 and an fs
> >> image close to that in flash. Here mount /dev/mtdblock/1 is OK.
> >>
> >> The earlier version is signed:
> >>
> >> $ cat /proc/yaffs
> >> YAFFS built:Jun 6 2006 14:14:22
> >> $Id: yaffs_fs.c,v 1.2 2006/02/14 18:20:41 michael Exp $
> >> $Id: yaffs_guts.c,v 1.1 2006/02/09 21:08:29 michael Exp $
> >>
> >> $ cat /proc/mtd
> >> dev: size erasesize name
> >> mtd0: 00020000 00020000 "TS-BOOTROM"
> >> mtd1: 07d00000 00020000 "Linux"
> >> mtd2: 002e0000 00020000 "RedBoot"
> >>
> >> $ cat /proc/partitions
> >> major minor #blocks name
> >>
> >>
> >> 31 0 128 mtdblocka
> >> 31 1 128000 mtdblockb
> >> 31 2 2944 mtdblockc
> >>
> >> It seems the two versions have different nomenclatures for the block
> >> devices.
> >>
> >>
> >> Should it be possible to mount this partition with the 2.6 yaffs2 code?
> >
> > Yes, so long as the mtd is good.
>
> What do you mean by "the mtd" here?
>    The hardware? Yes it is still functional under 2.4


The mtd layer is the layer that handles flash in the kernel. Google 'Linux.
mtd'
>
> The mtd driver in the newer kernel? Well that's this issue I need to
> resolve before reformatting the device.
>
> The renaming should be just an internal device convention in the kernel
> . It makes me very jittery when I see it makes total pig's ear of
> mounting the device.


It the two mtds are reading the spare area differntly then yaffs will not be
getting the tags. Wrong tags == wrong files.
>
> >> What version of flash_erase should I use to clear the partition prior to
> >> installing the new fs image?
> >
> > Use the one that matches the kernel you're using.
> >
> >> Any comment on this issue please . I need to install the new fs image
> >> but do not want to run this risk of bricking the device with
> >> incompatible tools screwing up the flash structure.
> >>
> >> If hose the reboot partition through something going wrong I'll have a
> >> bill of $200 for a new board or an RMA and postage nearly as dear.
> >>
> >> Is there a known incompatibility between these two vintages of yaffs2
> >> code ? Is the name change a problem?
> >
> > I would expect it to still boot, so long as the mtd in the new kernel
> > matches the old kernel.
> >
> >> What tools should I use to clear the old partition? Before installing
> >> the new fs?
> >
> > flash_eraseall.
>
> Thanks, I realise that, what I meant was which version. Since the 2.6
> mtd tools can't even mount the image correctly I was concerned that it
> may misread something else and stomp another part of the device.
>
> Does it make any sense to boot the 2.4 image first and use it compatible
> flash_eraseall then reboot 2.6 and run its version of flash_eraseall ?


You could do that but flash_eraseall should do a pretty good job of erasing
regardless of version.

>
> #on 2.4 kernel nfsroot using manufacturer's fs image:
> mount -t yaffs2 /dev/mtdblock/1 /mnt/mtd1
>
> ### this is very slow , over a minute to mount!
>
> $ ls /mnt/mtd1
> bin         fastboot    lib         proc        tmp         www
> dev         home        lost+found  root        usr
> etc         initrd      mnt         sbin        var

>
> $ mount
> /dev/root on / type nfs
> (rw,v2,rsize=8192,wsize=8192,hard,udp,nolock,addr=192.168.1.3)
> none on /dev type devfs (rw)
> proc on /proc type proc (rw)
> /dev/mtdblock/1 on /mnt/mtd1 type yaffs2 (rw)
>
>
> All seems well .
>
> Reboot to 2.6 kernel and suitable nfsroot fs.
>
> # time  mount -t yaffs2 /dev/mtdblock1 /mnt/mtd1
> real    0m 0.17s
> user    0m 0.00s
> sys     0m 0.17s

>
>
> during mount the serial console outputs this:
>
> yaffs: dev is 32505857 name is "mtdblock1"
> yaffs: passed flags ""
> yaffs: Attempting MTD mount on 31.1, "mtdblock1"
> yaffs: restored from checkpoint
> yaffs_read_super: isCheckpointed 1
>
> # ls /mnt/mtd1
> ls: /mnt/mtd1/5
> 06:44:16 0.000 0.000 1.267 1.271 1.161 1.117 2.159 0.000 15
> 06:45:16 0.001 0.000 1.266 1.271 1.162 1.118 2.162 0.001 15
> 06:46:16 0.002 0.000 1.268 1.271 1.162 1.115 2.156 0.000 15
> 06:47:16 0.000 0.001 1.266 1.265 1.156 1.112 2.161 0.002 15
> 06:48:16 : No such file or directory
> ls: /mnt/mtd1/71 1.277 1.141 1.101 2.142 0.000 15
> 06:11:16 0.002 0.000 1.271 1.276 1.139 1.104 2.141 0.000 15
> 06:12:16 0.001 0.001 1.271 1.272 1.138 1.100 2.148 0.002 15
> 06:13:16 0.000 0.002 1.272 1.276 1.138 1.099 2.145 0.002 15
> 06:14:16 0.000 0.001 1.265 1.270 1.: No such file or directory
> ls: /mnt/mtd1/ 0.001 15
> 05:37:16 0.000 0.002 1.272 1.278 1.138 1.102 2.155 0.002 15
> 05:38:16 0.002 0.000 1.279 1.284 1.145 1.110 2.150 0.000 1505:40:16
> 0.000 0.001 1.273 1.279 1.141 1.108 2.155 0.002 15
>
> : No such file or directory
>
> ls: /mnt/mtd1/113 2.170 0.001 15
> 04:30:16 0.000 0.002 1.289 1.296 1.157 1.119 2.175 0.001 15
> 04:31:16 0.000 0.002 1.294 1.301 1.160 1.113 2.170 0.000 15
> 04:32:16 0.001 0.000 1.294 1.300 1.161 1.117 2.169 0.000 15
> 04:33:16 0.000 0.001 1.288 1.294 1.155 1.115 2.174 0: No such file or
> directory
> ls: /mnt/mtd1/14:34:46 0.000 0.000 1.135 1.283 1.289 1.255 2.191 0.000 15
> 14:35:46 0.001 0.002 1.130 1.277 1.284 1.250 2.194 0.002 15
> 14:36:46 0.002 0.001 1.130 1.282 1.289 1.255 2.196 0.000 15
> 14:37:46 0.002 0.002 1.130 1.277 1.285 1.255 2.196 0.002 15
> 14:38:46 0.: No such file or directory
> ls: /mnt/mtd1/ 1.274 1.290 1.250 2.195 0.001 15
> 14:01:46 0.002 0.000 1.133 1.278 1.284 1.246 2.190 0.002 15
> 14:02:46 0.000 0.000 1.130 1.279 1.292 1.251 2.195 0.000 15
> 14:03:46 0.000 0.000 1.134 1.279 1.290 1.246 2.189 0.000 15
> 14:04:46 0.002 0.000 1.134 1.279 1.29: No such file or directory
> ls: /mnt/mtd1/63 1.694 0.001 15
> 08:25:45 0.002 0.000 0.936 0.933 0.883 0.861 1.694 0.001 15
> 08:26:45 0.001 0.000 0.935 0.929 0.885 0.863 1.696 0.000 15
> 05:39:16 0.000 0.002 1.278 1.279 1.139 1.104 2.153 0.002 15
> 08:27:45 0.000 0.000 0.936 0.936 0.891 0.861 1.692 0.001 15
> 08:28:45 0.000 0.001 0.939 0.930 0.890 0.867 1.698 0.: No such file or
> directory
>
>
> Y¾Ï鬤-òõ¤iü:ºåû9|xß`$±5Ï
> óAs@c1§»ük0×­AºkÌ(³ö(åMÐN_ó[®XóþQê¡L½ÑàY[óõácÁ«Âáhô4¤ïGý?zçÌ<ã@S×ö»Ö,£íê0mc
>8+Ö
>
> : usb_submit_urb(read int) failed
>
> depmod
> lost+found
> mage
> se
>           %s does not exist.  The use of %s is
>           deprecated, please rename %s to %s
>           as soon as possible.  Command
>           mv %s %s

>
> var
> www
> # 1;2c
>
>
>
> I reported about 6 months ago that this partition was taking about 90s
> to mount on the original 2.4 system. The problem went unresolved.
>
> Although the partition has continued to work correctly in all other
> respects under the original kernel it is still amazingly slow to mount
> and is apparently badly formed as far as a more recent kernel and
> mtd-utils is concerned.


If you fix the mtd issue I expect this to be resolved too.


>
>
> Can you suggest what may be happening here and the best way to clear the
> problem?
>


Charles