diff --git a/repos/gems/src/app/depot_deploy/main.cc b/repos/gems/src/app/depot_deploy/main.cc index 9b60fa9f2b..9492003046 100644 --- a/repos/gems/src/app/depot_deploy/main.cc +++ b/repos/gems/src/app/depot_deploy/main.cc @@ -36,6 +36,7 @@ struct Depot_deploy::Main typedef String<128> Name; typedef String<80> Binary; + typedef String<80> Config; /** * Generate start node of init configuration @@ -73,8 +74,8 @@ struct Depot_deploy::Main Xml_node const runtime = pkg.sub_node("runtime"); - if (!runtime.has_sub_node("binary")) { - warning(" node for '", name, "' lacks node"); + if (!runtime.has_attribute("binary")) { + warning(" node for '", name, "' lacks 'binary' attribute"); return; } @@ -105,7 +106,8 @@ void Depot_deploy::Main::_gen_start_node(Xml_generator &xml, Xml_node pkg, Xml_n Xml_node const runtime = pkg.sub_node("runtime"); size_t const caps = runtime.attribute_value("caps", 0UL); Number_of_bytes const ram = runtime.attribute_value("ram", Number_of_bytes()); - Binary const binary = runtime.sub_node("binary").attribute_value("name", Binary()); + Binary const binary = runtime.attribute_value("binary", Binary()); + Config const config = runtime.attribute_value("config", Config()); xml.attribute("name", name); xml.attribute("caps", caps); @@ -123,12 +125,24 @@ void Depot_deploy::Main::_gen_start_node(Xml_generator &xml, Xml_node pkg, Xml_n if (runtime.has_sub_node("config")) { Xml_node config = runtime.sub_node("config"); xml.node("config", [&] () { - xml.append(config.content_base(), config.content_size()); - }); + xml.append(config.content_base(), config.content_size()); }); }; xml.node("route", [&] () { + /* + * Redirect config ROM request to label given in the 'config' + * attribute. + */ + if (config.valid()) { + xml.node("service", [&] () { + xml.attribute("name", "ROM"); + xml.attribute("label", "config"); + xml.node("parent", [&] () { + xml.attribute("label", config); }); + }); + } + /* * Add ROM routing rule with the label rewritten to * the path within the depot. @@ -147,8 +161,7 @@ void Depot_deploy::Main::_gen_start_node(Xml_generator &xml, Xml_node pkg, Xml_n xml.attribute("name", "ROM"); xml.attribute("label", label); xml.node("parent", [&] () { - xml.attribute("label", path); - }); + xml.attribute("label", path); }); }); }); diff --git a/repos/gems/src/app/depot_query/main.cc b/repos/gems/src/app/depot_query/main.cc index 815276f2d6..732a0ff17b 100644 --- a/repos/gems/src/app/depot_query/main.cc +++ b/repos/gems/src/app/depot_query/main.cc @@ -344,13 +344,17 @@ void Depot_query::Main::_query_blueprint(Directory::Path const &pkg_path, Xml_ge xml.attribute("name", Archive::name(pkg_path)); xml.attribute("path", pkg_path); + Rom_label const config = node.attribute_value("config", Rom_label()); + if (config.valid()) + xml.attribute("config", config); + Xml_node env_xml = _config.xml().has_sub_node("env") ? _config.xml().sub_node("env") : ""; node.for_each_sub_node([&] (Xml_node node) { /* skip non-rom nodes */ - if (!node.has_type("rom") && !node.has_type("binary")) + if (!node.has_type("rom")) return; Rom_label const label = node.attribute_value("label", Rom_label()); diff --git a/repos/os/recipes/pkg/test-fs_report/runtime b/repos/os/recipes/pkg/test-fs_report/runtime index 9da707c1c7..38c72c8c89 100644 --- a/repos/os/recipes/pkg/test-fs_report/runtime +++ b/repos/os/recipes/pkg/test-fs_report/runtime @@ -1,9 +1,7 @@ - + - -