This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: How to incorporate a file system image when building eCos app
Ok, made some progress.
>> My problem is that I don't know how to get my files into an
>> appropriate file system image and how to get it built into the eCos
>> image. If someone has a howto they can point me to or to some other
>> documentation, it would be greatly appreciated.
>
> You can mkfs.jffs2 the file system on the host computer:
> http://linux.die.net/man/1/mkfs.jffs2
> Then you can either copy separately the binary file of the file system
> to the target, or you can transform it into a .h file and compile and
> link it with your application (assuming the application is a ROM or a
> ROMRAM application).
I made the file system image with:
$ mkfs.jffs2 -r myfs -o myfs.jffs2
where the myfs directory contains the contents of my file system.
$ find myfs -iname "*"
myfs
myfs/test
myfs/test/file1.txt
myfs/test/file2.txt
So, the 'test' directory is at the root of the jffs2 fs image.
Confirmed this by mounting the image on my host.
Then, I converted the jffs2 image to a '.h' to be included in my test
app. I have file2c.tcl script for such purposes.
I build the Linux Synthetic target with the required supporting
packages. In my working directory, where the root of the ecos tree is,
I do the following:
$ mkdir synthbuild
$ cd synthbuild
$ ecosconfig new linux
$ ecosconfig add posix fileio net freebsd_net eth_drivers linux_compat
flash crc jffs2
$ ecosconfig tree
$ make
Everything builds without issue.
The last part is to get the file system image hooked into the test
app. In my test app, I try to make the linkage to the file system
with:
# include "myfs_jffs2.h"
MTAB_ENTRY( myfs_mte1,
"/",
"jffs2",
"",
(CYG_ADDRWORD) &myfs_jffs2[0] );
The test builds without any problems. However, when I run it, I get a
'No such entity' error when trying to open the file.
error:02001002:system library:fopen:No such entity:fopen('/test/file1.txt','r')
Any idea what I seem to be missing?
Thanks,
--
Mike
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss