From aff17cb1779c97cf0754994532b5fe5afe6c5048 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 28 Sep 2023 16:46:48 +0200 Subject: [PATCH] sculpt: propagate managing_system role This change allows for the hosting of system-management components in Sculpt's runtime. The special role must be declared either as attribute or in the deploy configuration's attribute. Issue #5009 --- repos/gems/run/sculpt.run | 2 +- repos/gems/src/app/depot_deploy/child.h | 14 ++++++++++++++ repos/gems/src/app/sculpt_manager/deploy.h | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/repos/gems/run/sculpt.run b/repos/gems/run/sculpt.run index 2be567f76d..3acf1267d4 100644 --- a/repos/gems/run/sculpt.run +++ b/repos/gems/run/sculpt.run @@ -598,7 +598,7 @@ install_config { - + diff --git a/repos/gems/src/app/depot_deploy/child.h b/repos/gems/src/app/depot_deploy/child.h index 8fae221506..5cc46f2e29 100644 --- a/repos/gems/src/app/depot_deploy/child.h +++ b/repos/gems/src/app/depot_deploy/child.h @@ -426,6 +426,20 @@ void Depot_deploy::Child::gen_start_node(Xml_generator &xml, xml.attribute("priority", priority); } + auto permit_managing_system = [&] + { + if (start_xml.attribute_value("managing_system", false)) + return true; + + if (_defined_by_launcher()) + if (launcher_xml.attribute_value("managing_system", false)) + return true; + + return false; + }; + if (permit_managing_system()) + xml.attribute("managing_system", "yes"); + bool shim_reroute = false; /* lookup if PD/CPU service is configured and use shim in such cases */ diff --git a/repos/gems/src/app/sculpt_manager/deploy.h b/repos/gems/src/app/sculpt_manager/deploy.h index d1e5edec68..93f591b040 100644 --- a/repos/gems/src/app/sculpt_manager/deploy.h +++ b/repos/gems/src/app/sculpt_manager/deploy.h @@ -167,6 +167,7 @@ struct Sculpt::Deploy copy_attribute("cpu"); copy_attribute("priority"); copy_attribute("pkg"); + copy_attribute("managing_system"); /* copy start-node content */ node.with_raw_content([&] (char const *start, size_t length) {