tiny JFFS2 Reader
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/
Quoted 7 lines · sriram neelakandan
Hi group,
I am looking for a tiny jffs2 reader that can read a file from a jffs2 partition..
the code injffs2reader.cin 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.
There was a project called load_kernel at
http://russ.dhs.org/load_kernel.html, but this web server doesn't exist anymore. It contains all code to look for a file called "linux" on a cramfs oder jffs2 image and read it (including zlib decompression). Maybe you want to contact the author (try [email protected]). I could also send you the archive.
Regards,
Tino
Signature · 4 lines
[email protected] dipl.-inf. Innominate Security Technologies AG software engineer networking people tel: +49.30.6392-3308 http://www.innominate.com/
Quoted 8 lines
Quoted 8 lines · sriram neelakandan
Hi group,
I am looking for a tiny jffs2 reader that can read a file from a jffs2 partition..
the code injffs2reader.cin 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.
...
Hi
Look for ppcboot sources, this is a bootloader that know about jffs2 (it can acces any level of
directory and load a file).
Sylvain
Quoted 9 lines · Tino Keitel
Quoted 7 lines · sriram neelakandan
Hi group,
I am looking for a tiny jffs2 reader that can read a file from a jffs2 partition..
the code injffs2reader.cin 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.
Quoted 6 lines
There was a project called
load_kernelat
http://russ.dhs.org/load_kernel.html, but this web server doesn't exist anymore. It contains all code to look for a file called "linux" on a cramfs oder jffs2 image and read it (including zlib decompression). Maybe you want to contact the author (try [email protected]). I could also send you the archive.
it exists, it just moved to port 8000, also, the code is in blob cvs