diff --git a/repos/dde_linux/run/lxip_http_srv.run b/repos/dde_linux/run/lxip_http_srv.run index 771acaa239..dfcc707d50 100644 --- a/repos/dde_linux/run/lxip_http_srv.run +++ b/repos/dde_linux/run/lxip_http_srv.run @@ -97,7 +97,7 @@ install_config $config # generic modules set boot_modules { core ld.lib.so init timer - libc.lib.so lxip.lib.so test-lxip_http_srv libc_resolv.lib.so + libc.lib.so libm.lib.so lxip.lib.so test-lxip_http_srv libc_resolv.lib.so } # platform-specific modules diff --git a/repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc b/repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc index 7f8de3ccd9..4af5f50b22 100644 --- a/repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc +++ b/repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc @@ -172,7 +172,8 @@ class Vfs::Rump_file_system : public File_system ** File_system interface ** ***************************/ - static char const *name() { return "rump"; } + static char const *name() { return "rump"; } + char const *type() override { return "rump"; } /********************************* diff --git a/repos/libports/src/lib/vfs/jitterentropy/vfs_jitterentropy.h b/repos/libports/src/lib/vfs/jitterentropy/vfs_jitterentropy.h index dc4d42f2ef..56e6916d8b 100644 --- a/repos/libports/src/lib/vfs/jitterentropy/vfs_jitterentropy.h +++ b/repos/libports/src/lib/vfs/jitterentropy/vfs_jitterentropy.h @@ -65,7 +65,8 @@ class Jitterentropy_file_system : public Vfs::Single_file_system jent_entropy_collector_free(_ec_stir); } - static char const *name() { return "jitterentropy"; } + static char const *name() { return "jitterentropy"; } + char const *type() override { return "jitterentropy"; } /******************************** diff --git a/repos/os/include/vfs/dir_file_system.h b/repos/os/include/vfs/dir_file_system.h index 2c96ce6655..cd7377653e 100644 --- a/repos/os/include/vfs/dir_file_system.h +++ b/repos/os/include/vfs/dir_file_system.h @@ -562,7 +562,8 @@ class Vfs::Dir_file_system : public File_system ** File_system interface ** ***************************/ - char const *name() const { return "dir"; } + char const *name() const { return "dir"; } + char const *type() override { return "dir"; } /** * Synchronize all file systems @@ -583,6 +584,25 @@ class Vfs::Dir_file_system : public File_system fs->sync(path); } + void apply_config(Genode::Xml_node const &node) override + { + using namespace Genode; + + File_system *curr = _first_file_system; + for (unsigned i = 0; i < node.num_sub_nodes(); i++, curr = curr->next) { + Xml_node const &sub_node = node.sub_node(i); + + /* check if type of XML node matches current file-system type */ + if (sub_node.has_type(curr->type()) == false) { + Genode::error("VFS config update failed (node type '", + sub_node.type(), "' != fs type '", curr->type(),"')"); + return; + } + + curr->apply_config(node.sub_node(i)); + } + } + /******************************** ** File I/O service interface ** diff --git a/repos/os/include/vfs/file_system.h b/repos/os/include/vfs/file_system.h index c9e881bdac..eb8fe9b715 100644 --- a/repos/os/include/vfs/file_system.h +++ b/repos/os/include/vfs/file_system.h @@ -35,6 +35,16 @@ struct Vfs::File_system : Directory_service, File_io_service * This method flushes any delayed operations from the file system. */ virtual void sync(char const *path) { } + + /** + * Adjust to configuration changes + */ + virtual void apply_config(Genode::Xml_node const &node) { } + + /** + * Return the file-system type + */ + virtual char const *type() = 0; }; #endif /* _INCLUDE__VFS__FILE_SYSTEM_H_ */ diff --git a/repos/os/src/lib/vfs/block_file_system.h b/repos/os/src/lib/vfs/block_file_system.h index 7b6c2b483c..c51301aed4 100644 --- a/repos/os/src/lib/vfs/block_file_system.h +++ b/repos/os/src/lib/vfs/block_file_system.h @@ -148,8 +148,8 @@ class Vfs::Block_file_system : public Single_file_system destroy(_alloc, _block_buffer); } - static char const *name() { return "block"; } - + static char const *name() { return "block"; } + char const *type() override { return "block"; } /********************************* ** Directory service interface ** diff --git a/repos/os/src/lib/vfs/fs_file_system.h b/repos/os/src/lib/vfs/fs_file_system.h index 9f2b32df1d..fb015bc230 100644 --- a/repos/os/src/lib/vfs/fs_file_system.h +++ b/repos/os/src/lib/vfs/fs_file_system.h @@ -581,7 +581,8 @@ class Vfs::Fs_file_system : public File_system ** File_system interface ** ***************************/ - static char const *name() { return "fs"; } + static char const *name() { return "fs"; } + char const *type() override { return "fs"; } void sync(char const *path) override { diff --git a/repos/os/src/lib/vfs/inline_file_system.h b/repos/os/src/lib/vfs/inline_file_system.h index a6b9b83e87..37c7a887e2 100644 --- a/repos/os/src/lib/vfs/inline_file_system.h +++ b/repos/os/src/lib/vfs/inline_file_system.h @@ -41,8 +41,8 @@ class Vfs::Inline_file_system : public Single_file_system _size(config.content_size()) { } - static char const *name() { return "inline"; } - + static char const *name() { return "inline"; } + char const *type() override { return "inline"; } /******************************** ** Directory service interface ** diff --git a/repos/os/src/lib/vfs/log_file_system.h b/repos/os/src/lib/vfs/log_file_system.h index d68d3d9a32..86311c3079 100644 --- a/repos/os/src/lib/vfs/log_file_system.h +++ b/repos/os/src/lib/vfs/log_file_system.h @@ -58,8 +58,8 @@ class Vfs::Log_file_system : public Single_file_system _log(_log_session(env)) { } - static const char *name() { return "log"; } - + static const char *name() { return "log"; } + char const *type() override { return "log"; } /******************************** ** File I/O service interface ** diff --git a/repos/os/src/lib/vfs/null_file_system.h b/repos/os/src/lib/vfs/null_file_system.h index 3aaf024bf0..de1de47428 100644 --- a/repos/os/src/lib/vfs/null_file_system.h +++ b/repos/os/src/lib/vfs/null_file_system.h @@ -30,8 +30,8 @@ struct Vfs::Null_file_system : Single_file_system Single_file_system(NODE_TYPE_CHAR_DEVICE, name(), config) { } - static char const *name() { return "null"; } - + static char const *name() { return "null"; } + char const *type() override { return "null"; } /******************************** ** File I/O service interface ** diff --git a/repos/os/src/lib/vfs/ram_file_system.h b/repos/os/src/lib/vfs/ram_file_system.h index e219651763..0036dc89e4 100644 --- a/repos/os/src/lib/vfs/ram_file_system.h +++ b/repos/os/src/lib/vfs/ram_file_system.h @@ -786,7 +786,8 @@ class Vfs::Ram_file_system : public Vfs::File_system ** File_system interface ** ***************************/ - static char const *name() { return "ram"; } + static char const *name() { return "ram"; } + char const *type() override { return "ram"; } }; #endif /* _INCLUDE__VFS__RAM_FILE_SYSTEM_H_ */ diff --git a/repos/os/src/lib/vfs/rom_file_system.h b/repos/os/src/lib/vfs/rom_file_system.h index d39d2f198d..671c4d2884 100644 --- a/repos/os/src/lib/vfs/rom_file_system.h +++ b/repos/os/src/lib/vfs/rom_file_system.h @@ -58,8 +58,8 @@ class Vfs::Rom_file_system : public Single_file_system _rom(env, _label.string) { } - static char const *name() { return "rom"; } - + static char const *name() { return "rom"; } + char const *type() override { return "rom"; } /********************************* ** Directory-service interface ** diff --git a/repos/os/src/lib/vfs/rtc_file_system.h b/repos/os/src/lib/vfs/rtc_file_system.h index 21f2fd6aaa..7d740d30ea 100644 --- a/repos/os/src/lib/vfs/rtc_file_system.h +++ b/repos/os/src/lib/vfs/rtc_file_system.h @@ -39,8 +39,8 @@ class Vfs::Rtc_file_system : public Single_file_system _rtc(env) { } - static char const *name() { return "rtc"; } - + static char const *name() { return "rtc"; } + char const *type() override { return "rtc"; } /********************************* ** Directory-service interface ** diff --git a/repos/os/src/lib/vfs/symlink_file_system.h b/repos/os/src/lib/vfs/symlink_file_system.h index 5cf5ed3f8c..d0dd853152 100644 --- a/repos/os/src/lib/vfs/symlink_file_system.h +++ b/repos/os/src/lib/vfs/symlink_file_system.h @@ -40,8 +40,8 @@ class Vfs::Symlink_file_system : public Single_file_system _target(config.attribute_value("target", Target())) { } - static char const *name() { return "symlink"; } - + static char const *name() { return "symlink"; } + char const *type() override { return "symlink"; } /********************************* ** Directory-service interface ** diff --git a/repos/os/src/lib/vfs/tar_file_system.h b/repos/os/src/lib/vfs/tar_file_system.h index 337546d384..0a6da6bd27 100644 --- a/repos/os/src/lib/vfs/tar_file_system.h +++ b/repos/os/src/lib/vfs/tar_file_system.h @@ -358,7 +358,6 @@ class Vfs::Tar_file_system : public File_system _for_each_tar_record_do(Add_node_action(_alloc, _root_node)); } - /********************************* ** Directory-service interface ** *********************************/ @@ -574,7 +573,8 @@ class Vfs::Tar_file_system : public File_system ** File_system interface ** ***************************/ - static char const *name() { return "tar"; } + static char const *name() { return "tar"; } + char const *type() override { return "tar"; } /******************************** diff --git a/repos/os/src/lib/vfs/terminal_file_system.h b/repos/os/src/lib/vfs/terminal_file_system.h index 2eee440708..5af22d44f8 100644 --- a/repos/os/src/lib/vfs/terminal_file_system.h +++ b/repos/os/src/lib/vfs/terminal_file_system.h @@ -67,8 +67,8 @@ class Vfs::Terminal_file_system : public Single_file_system _terminal.read_avail_sigh(_read_avail_handler); } - static const char *name() { return "terminal"; } - + static const char *name() { return "terminal"; } + char const *type() override { return "terminal"; } /******************************** ** File I/O service interface ** diff --git a/repos/os/src/lib/vfs/zero_file_system.h b/repos/os/src/lib/vfs/zero_file_system.h index 0d5495acdd..7aef6a2410 100644 --- a/repos/os/src/lib/vfs/zero_file_system.h +++ b/repos/os/src/lib/vfs/zero_file_system.h @@ -30,8 +30,8 @@ struct Vfs::Zero_file_system : Single_file_system Single_file_system(NODE_TYPE_CHAR_DEVICE, name(), config) { } - static char const *name() { return "zero"; } - + static char const *name() { return "zero"; } + char const *type() override { return "zero"; } /******************************** ** File I/O service interface ** diff --git a/repos/os/src/server/vfs/main.cc b/repos/os/src/server/vfs/main.cc index 2d4c9196bf..754572069d 100644 --- a/repos/os/src/server/vfs/main.cc +++ b/repos/os/src/server/vfs/main.cc @@ -500,6 +500,15 @@ class Vfs_server::Root : _env, _heap, vfs_config(), _io_response_handler, Vfs::global_file_system_factory() }; + Genode::Signal_handler _config_dispatcher { + _env.ep(), *this, &Root::_config_update }; + + void _config_update() + { + _config_rom.update(); + _vfs.apply_config(vfs_config()); + } + protected: Session_component *_create_session(const char *args) override @@ -603,6 +612,7 @@ class Vfs_server::Root : Root_component(&env.ep().rpc_ep(), &md_alloc), _env(env) { + _config_rom.sigh(_config_dispatcher); env.parent().announce(env.ep().manage(*this)); } };