From: chessmylitis@hotmail.com To: manningc2@actrix.gen.nz Subject: RE: [Yaffs] (no subject) Date: Wed, 8 Jun 2011 06:47:08 +0000 > From: manningc2@actrix.gen.nz > To: yaffs@lists.aleph1.co.uk > Subject: Re: [Yaffs] (no subject) > Date: Wed, 8 Jun 2011 17:01:01 +1200 > CC: chessmylitis@hotmail.com > > On Wednesday 08 June 2011 02:10:42 Rhykie Rhykie wrote: > > Hi, > > I have two questions: > > > > 1) In the cramfs file system i have a source code in which i want to use > > fread()/fwrite() functions to read/write to a text file in the yaffs file > > system, all this in a nand flash memory in two different partitions. > > Unfortunately when compiling i get the "trying to access read-only file > > system" error. Any idea of how i can achieve what i want to do. > > That is very little info to work on/ Can you explain more? Ok, the nand flash is divided into four MTD block partitions; in mtdblock2 there is a cramfs file system which comprises my source code. Now since cramfs is read-only, I want to permanently store some text files in mtdblock3 which is a yaffs file system, allowing read and write. Then from the cramfs[mtdblock2] I want to access those files in [yaffs]mtdblock3 to perform read/write. For example I have the following instruction, in my source code [mtdblock2], to open the file in mtdblock3: FILE*ft = fopen("/dev/mtdblock3/myfile.txt", "r+"); So I get I get the error! If the file myfile.txt is in mtdblock3 yaffs partition, is its directory written as: /dev/mtdblock3/myfile.txt? > > > > > 2)When the cramfs file system is configured to be the root after kernel > > boot-up, i have read that i can mount the yaffs to mtdblock3 partition by > > using the command mount -t yaffs /dev/mtdblock3 /mnt/. > > > > In the /mnt directory, i get the empty yaffs folder. As i was researching > > about how to get going with yaffs i got a couple yaffs source code which i > > dont know how to use them. Please help, how do i get a yaffs file system in > > the nand partition. > > First, start off with an empty flash (before you mouint yaffs). You can use > flash_eraseall to do this. Mount yaffs, then copy the files in from another > source. > -- Charles