From f81f075670f053675c5765400cb3a526f0391722 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 28 Sep 2022 14:08:50 +0200 Subject: [PATCH] sculpt: allow for dynamic managed/system state Until now, the /config/system ROM was not handled by the sculpt manager but solely managed by the user. Its main purpose was the ability to reset or power-down the machine by manually modifying the 'state' attribute. However, down the road, we'd like to enable the sculpt manager to drive this state, e.g., to implement the multi-staged loading of drivers, or to drive suspend-resume states. The support such scenarios, the 'system' state has been moved from /config/system to /config/managed/system. --- repos/gems/run/sculpt.run | 4 ++-- repos/gems/sculpt/leitzentrale/default | 2 ++ repos/gems/src/app/sculpt_manager/main.cc | 8 ++++++++ repos/gems/src/app/sculpt_manager/model/runtime_config.h | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/repos/gems/run/sculpt.run b/repos/gems/run/sculpt.run index 7fb47d4d0e..932b267c93 100644 --- a/repos/gems/run/sculpt.run +++ b/repos/gems/run/sculpt.run @@ -388,7 +388,7 @@ install_config { - + @@ -720,7 +720,7 @@ set fd [open [managed_config_path depot_query] w] puts $fd "" close $fd -foreach config { fonts wifi runtime event_filter } { +foreach config { fonts wifi runtime event_filter system } { set ingredient [single_ingredient $config "default"] if {$ingredient != ""} { set from [ingredient_path $config $ingredient] diff --git a/repos/gems/sculpt/leitzentrale/default b/repos/gems/sculpt/leitzentrale/default index 05d82c1409..d9aca015e7 100644 --- a/repos/gems/sculpt/leitzentrale/default +++ b/repos/gems/sculpt/leitzentrale/default @@ -239,6 +239,8 @@ + + diff --git a/repos/gems/src/app/sculpt_manager/main.cc b/repos/gems/src/app/sculpt_manager/main.cc index e6dc6bed44..aab277c75d 100644 --- a/repos/gems/src/app/sculpt_manager/main.cc +++ b/repos/gems/src/app/sculpt_manager/main.cc @@ -91,6 +91,14 @@ struct Sculpt::Main : Input_event_handler, handle_input_event(ev); }); } + Managed_config
_system_config { + _env, "system", "system", *this, &Main::_handle_system_config }; + + void _handle_system_config(Xml_node) + { + _system_config.try_generate_manually_managed(); + } + Signal_handler
_gui_mode_handler { _env.ep(), *this, &Main::_handle_gui_mode }; diff --git a/repos/gems/src/app/sculpt_manager/model/runtime_config.h b/repos/gems/src/app/sculpt_manager/model/runtime_config.h index 419758de23..c9eac86b36 100644 --- a/repos/gems/src/app/sculpt_manager/model/runtime_config.h +++ b/repos/gems/src/app/sculpt_manager/model/runtime_config.h @@ -340,7 +340,7 @@ class Sculpt::Runtime_config _vimrc { _r, Type::ROM, "default vim configuration", "config -> vimrc" }, _fonts { _r, Type::ROM, "system font configuration", "config -> managed/fonts" }, _pf_info { _r, Type::ROM, "platform information", "platform_info" }, - _system { _r, Type::ROM, "system status", "config -> system" }, + _system { _r, Type::ROM, "system status", "config -> managed/system" }, _report { _r, Type::REPORT, "system reports" }, _shape { _r, Type::REPORT, "pointer shape", "shape", Service::Match_label::LAST }, _copy { _r, Type::REPORT, "global clipboard", "clipboard", Service::Match_label::LAST },