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
<launcher managing_system="yes"> attribute or in the deploy
configuration's <start managing_system="yes"> attribute.

Issue #5009
This commit is contained in:
Norman Feske 2023-09-28 16:46:48 +02:00 committed by Christian Helmuth
parent 558a00138c
commit aff17cb177
3 changed files with 16 additions and 1 deletions

View File

@ -598,7 +598,7 @@ install_config {
</route>
</start>
<start name="runtime" caps="50000" priority="-1">
<start name="runtime" caps="50000" priority="-1" managing_system="yes">
<binary name="init"/>
<resource name="RAM" quantum="32G"/>
<resource name="CPU" quantum="40"/>

View File

@ -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 */

View File

@ -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) {