Hi group,
I am looking for a tiny jffs2 reader that can read a file from a 
jffs2 partition..
the code in jffs2reader.c in the MTD utils tar
mtd-20000704.tar.gz (hope this is the latest)
does not have the logic to read beyond the first node of the 
file.
basically the following func is called and it doesnt read beyond 
the first inode !
--snip--
putblock(char *b, size_t bsize, size_t * rsize,
 			  struct jffs2_raw_inode *n)
{
 	uLongf dlen = n->dsize;

if (*rsize < n->isize)
 		bzero(b + *rsize, n->isize - *rsize);

 	switch (n->compr) {
 	case JFFS2_COMPR_ZLIB:
 		uncompress((Bytef *) b + n->offset, &dlen,
 				   (Bytef *) ((char *) n) + sizeof(struct jffs2_raw_inode),
 				   (uLongf) n->csize);
 		break;

 	case JFFS2_COMPR_NONE:
 		memcpy(b + n->offset,
 			   ((char *) n) + sizeof(struct jffs2_raw_inode), dlen);
 		break;

 	case JFFS2_COMPR_ZERO:
 		bzero(b + n->offset, dlen);
 		break;

 		/* [DYN]RUBIN support required! */

 	default:
 		fprintf(stderr, "Unsupported compression method!\n");
 		exit(EXIT_FAILURE);
 	}

 	*rsize = n->isize;
}



How to get the compelete file from the partition? any ideas or is 
there any other code.

i looked at the actual JFFS2 kernel code , it uses pretty huge 
inode caches which is initted  during sys_mount...but i cant 
afford to put the MTD & FS code in my tiny bootloader!

TIA
sriram
__________________________________________________________
Give your Company an email address like
ravi @ ravi-exports.com.  Sign up for Rediffmail Pro today!
Know more. http://www.rediffmailpro.com/signup/



