diff --git a/os/src/server/ram_fs/README b/os/src/server/ram_fs/README index 4a5989044..d2f441eb8 100644 --- a/os/src/server/ram_fs/README +++ b/os/src/server/ram_fs/README @@ -18,8 +18,9 @@ The following configuration illustates the way of how to express policy. ! ! ! -! -! +! +! set hidden +! ! ! ! @@ -33,7 +34,10 @@ The '' sub node of the '' node provides a way to pre-populate the file system with directories and files. Note that '' nodes can be 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 -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 '' nodes. The content of such nodes is used as +file content as is. Session-specific access-control policy is expressed via one or more '' nodes. At session-creation time, each policy node is matched against the label diff --git a/os/src/server/ram_fs/main.cc b/os/src/server/ram_fs/main.cc index ba05f9692..f68fb9a66 100644 --- a/os/src/server/ram_fs/main.cc +++ b/os/src/server/ram_fs/main.cc @@ -598,6 +598,16 @@ static void preload_content(Genode::Allocator &alloc, catch (Rm_session::Attach_failed) { 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); + } } }