mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 15:02:25 +00:00
Allow defining ram_fs file content from config
This commit is contained in:
parent
95766bd4a1
commit
cdbd1630bb
@ -18,8 +18,9 @@ The following configuration illustates the way of how to express policy.
|
|||||||
! </dir>
|
! </dir>
|
||||||
! <dir name="home">
|
! <dir name="home">
|
||||||
! <dir name="user">
|
! <dir name="user">
|
||||||
! <!-- just a place holder -->
|
! <inline name=".vimrc">
|
||||||
! <rom name="timer" />
|
! set hidden
|
||||||
|
! </inline>
|
||||||
! </dir>
|
! </dir>
|
||||||
! </dir>
|
! </dir>
|
||||||
! </content>
|
! </content>
|
||||||
@ -33,7 +34,10 @@ The '<content>' sub node of the '<config>' node provides a way to pre-populate
|
|||||||
the file system with directories and files. Note that '<dir>' nodes can be
|
the file system with directories and files. Note that '<dir>' nodes can be
|
||||||
arbitrarily nested. Files can be loaded from the ROM service. By adding the
|
arbitrarily nested. Files can be loaded from the ROM service. By adding the
|
||||||
optional 'at' attribute to a rom node, the file name can be defined
|
optional 'at' attribute to a rom node, the file name can be defined
|
||||||
independently from the ROM module name.
|
independently from the ROM module name. In addition to creating files from
|
||||||
|
ROM modules, files can be created from data specified directly as part of the
|
||||||
|
configuration using '<inline>' nodes. The content of such nodes is used as
|
||||||
|
file content as is.
|
||||||
|
|
||||||
Session-specific access-control policy is expressed via one or more '<policy>'
|
Session-specific access-control policy is expressed via one or more '<policy>'
|
||||||
nodes. At session-creation time, each policy node is matched against the label
|
nodes. At session-creation time, each policy node is matched against the label
|
||||||
|
@ -598,6 +598,16 @@ static void preload_content(Genode::Allocator &alloc,
|
|||||||
catch (Rm_session::Attach_failed) {
|
catch (Rm_session::Attach_failed) {
|
||||||
PWRN("Could not locally attach ROM file \"%s\"", (char *)name); }
|
PWRN("Could not locally attach ROM file \"%s\"", (char *)name); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create file from inline data provided as content of the XML node
|
||||||
|
*/
|
||||||
|
if (sub_node.has_type("inline")) {
|
||||||
|
|
||||||
|
File *file = new (&alloc) File(alloc, name);
|
||||||
|
file->write(sub_node.content_addr(), sub_node.content_size(), 0);
|
||||||
|
dir.adopt_unsynchronized(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user