Discussion:
Loading component configuration from file with lx_fs.
Mikael Sahlström
2016-01-25 14:37:37 UTC
Permalink
Hi!

I would like to load a component configuration from a file on linux. So
I've added a lx_fs and a fs_rom component that replaces my dynamic_rom
component without changing any code in my component. So far is everything
good (I hope!).

To my questions:
1. How do I state which file to read?
2. My understanding is that the root attribute in lx_fs defines which
directory genode will see as root. But anything except "/" here results in
the error message "Session root directory "..." does not exist".
3. Do I write the same thing in the config file as I did when having the
dynamic_rom (<config attribute="value" .... />)?

My configuration:
<start name="component">
<resource name="RAM" quantum="5M"/>
<route>
<service name="ROM">
<child name="fs_rom"/>
</service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>

<start name="fs_rom">
<resource name="RAM" quantum="4M" />
<provides> <service name="ROM" /> </provides>
<route>
<service name="File_system"> <child name="lx_fs" /> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>

<start name="lx_fs">
<resource name="RAM" quantum="4M" />
<provides> <service name="File_system" /> </provides>
<config> <policy label="fs_rom" root="/" writable="no" /> </config>
</start>

Thanks!
Christian Helmuth
2016-01-25 18:40:27 UTC
Permalink
Hello Mikael,
Post by Mikael Sahlström
1. How do I state which file to read?
lx_fs provides access to the path configured in the "root" attribute
of the policy node. The path is interpreted *relative* to the
directory lx_fs is executed from, e.g., <build dir>/var/run/lx_fs for
"make run/lxf_fs". Please have a look at base-linux/run/lx_fs.run (as
suggested in the lx_fs/README for further details.
Post by Mikael Sahlström
2. My understanding is that the root attribute in lx_fs defines which
directory genode will see as root. But anything except "/" here results in
the error message "Session root directory "..." does not exist".
See above.
Post by Mikael Sahlström
3. Do I write the same thing in the config file as I did when having the
dynamic_rom (<config attribute="value" .... />)?
Sorry, I fear I don't understand this question.

Regards
--
Christian Helmuth
Genode Labs

http://www.genode-labs.com/ · http://genode.org/
https://twitter.com/GenodeLabs · /ˈdʒiː.nəʊd/

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
e***@vfemail.net
2016-01-25 22:24:33 UTC
Permalink
I'd just like to point out that while lx_fs is handy, it doesn't always
work as well as the other file system servers, so if you start running
into problems, try the ram_fs or the vfs. If you are dynamically
generating and writing the roms to a file system I would use one of
those two because, for example, lx_fs does not support update
notifications.

I myself use the vfs and fs_rom servers as a persistent shared state
between components, but I'm not sure if this is the same as what you
are doing.

Emery

Loading...