Re: [Yaffs] mkyaffs2image generate wrong image Failed to exe…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: BI Mingliang
Date:  
To: Charles Manning, yaffs@lists.aleph1.co.uk
Subject: Re: [Yaffs] mkyaffs2image generate wrong image Failed to execute /linuxrc. Attempting defaults...
Hello Charles,
You said "Thus, you will need to take the mkyaffs2image code and fiddle with it to get 
the layout you need."
We can find the default 64bytes layout in kernel code: drivers/mtd/nand/nand_base.c
static struct nand_ecclayout nand_oob_64 = {
        .eccbytes = 24,
        .eccpos = {
                   40, 41, 42, 43, 44, 45, 46, 47,
                   48, 49, 50, 51, 52, 53, 54, 55,
                   56, 57, 58, 59, 60, 61, 62, 63},
        .oobfree = {
                {.offset = 2,
                 .length = 38} }
};
It means there are 38 bytes yaffs tags and 24 bytes ecc information need to be filled.
So function "write_chunk" needs some modification in mkyaffs2image.c, then I got a new mkyaffs2image tool to generate a new yaffs2 image. But the problem still exist. 
Could you help me ? Thank you very much ...
//after shuffle_oob
        /* calculate the 24 bytes ecc */
        yaffs_calc_ecc(data, &yaffs_spare);
        spareData[40] = yaffs_spare.ecc1[0];
        spareData[41] = yaffs_spare.ecc1[1];
        spareData[42] = yaffs_spare.ecc1[2];
        spareData[43] = yaffs_spare.ecc2[0];
        spareData[44] = yaffs_spare.ecc2[1];
        spareData[45] = yaffs_spare.ecc2[2];

        yaffs_calc_ecc(data+512, &yaffs_spare);
        spareData[46] = yaffs_spare.ecc1[0];
        spareData[47] = yaffs_spare.ecc1[1];
        spareData[48] = yaffs_spare.ecc1[2];
        spareData[49] = yaffs_spare.ecc2[0];
        spareData[50] = yaffs_spare.ecc2[1];
        spareData[51] = yaffs_spare.ecc2[2];

        yaffs_calc_ecc(data+1024, &yaffs_spare);
        spareData[52] = yaffs_spare.ecc1[0];
        spareData[53] = yaffs_spare.ecc1[1];
        spareData[54] = yaffs_spare.ecc1[2];
        spareData[55] = yaffs_spare.ecc2[0];
        spareData[56] = yaffs_spare.ecc2[1];
        spareData[57] = yaffs_spare.ecc2[2];

        yaffs_calc_ecc(data+1536, &yaffs_spare);
        spareData[58] = yaffs_spare.ecc1[0];
        spareData[59] = yaffs_spare.ecc1[1];
        spareData[60] = yaffs_spare.ecc1[2];
        spareData[61] = yaffs_spare.ecc2[0];
        spareData[62] = yaffs_spare.ecc2[1];
        spareData[63] = yaffs_spare.ecc2[2];
Best Regards,
Bi Mingliang (EXT:2783-7314) 


-----Original Message-----
From: Charles Manning [mailto:manningc2@actrix.gen.nz] 
Sent: 2012年3月26日 11:58
To: 
Cc: BI Mingliang
Subject: Re: [Yaffs] mkyaffs2image generate wrong image Failed to execute /linuxrc. Attempting defaults...

On Saturday 24 March 2012 21:37:23 BI Mingliang wrote:

> Hello All,
>
> It's really disappointing that we can't get a quick response in yaffs mail
> group. This issue blocked me several weeks and we can't find any update in
> yaffs repository. What's more, many developers think there is something
> wrong in the mkyaffs2image. Usually, during linux booting, we get the
> following warning which is related with this tool.


The mkyaffs2image tool does not generate useful images for all flash drivers
mainly because of different OOB layouts.

Thus, you will need to take the mkyaffs2image code and fiddle with it to get
the layout you need.

I am in the process of redoing the tools to try to make this easier to use,
but unfortunately I have not had much time to work on that recently.


>
> For example:
>
> s3c-rtc s3c2410-rtc: setting system clock to 2000-01-01 02:27:02 UTC
> (946693622) yaffs: dev is 32505858 name is "mtdblock2" rw
> yaffs: passed flags ""
> VFS: Mounted root (yaffs2 filesystem) on device 31:2.
> Freeing init memory: 136K
> Failed to execute /linuxrc.  Attempting defaults...
> Kernel panic - not syncing: No init found.  Try passing init= option to
> kernel. See Linux
>
> Documentation/init.txt for guidance.
> [<c0019960>] (unwind_backtrace+0x0/0xf0) from [<c03344e8>]
> (panic+0x58/0x18c) [<c03344e8>] (panic+0x58/0x18c) from [<c00085c4>]
> (init_post+0x7c/0xcc) [<c00085c4>] (init_post+0x7c/0xcc) from [<c0452838>]
> (kernel_init+0xe4/0x114)
>
>
> Then I trace the error information in fs/exec.c, in function
> do_execve_common, there is wrong file ponter(IS_ERR). In NFS mode, I mount
> the yaffs2 block to mnt directory, and there is only lost+found folders,
> all other folders can't displayed. So, it's quite possible that this tool
> generate a wrong yaffs2 image in the former version. And the latest version
> can' compile.
>
> Could anyone help me? Sometime I want abandon the yaffs FS, because UBIFS
> works very well every time. We need to do too much work to make the latest
> yaffs work well in the latest linux kernel.
> ---------------------------------------------------------------------------
>------- 1448 static int do_execve_common(const char *filename,
> 1449                 struct user_arg_ptr argv,
> 1450                 struct user_arg_ptr envp,
> 1451                 struct pt_regs *regs)
>
>
> 1495     file = open_exec(filename);
> 1496     retval = PTR_ERR(file);
> 1497     if (IS_ERR(file))
> 1498         goto out_unmark;