From f0ac01395f874283da39946f5240ebc109ae389d Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Mon, 16 Apr 2018 15:08:18 +0200 Subject: [PATCH] sculpt: read config from /rw/config// By incorporating the sculpt version into the path where customizations are stored, we can update and roll back sculpt versions without risking configuration incompatibilities. By default, the sculpt version corresponds to /VERSION. --- repos/gems/run/sculpt.run | 14 ++++++++ repos/gems/run/sculpt/leitzentrale.config | 1 + repos/gems/run/sculpt/load_runtime.config | 39 +++++++---------------- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/repos/gems/run/sculpt.run b/repos/gems/run/sculpt.run index 942ddbc386..8b38900b49 100644 --- a/repos/gems/run/sculpt.run +++ b/repos/gems/run/sculpt.run @@ -484,9 +484,23 @@ file copy -force [genode_dir]/repos/gems/recipes/raw/depot_download/depot_downlo file copy -force [genode_dir]/depot/[depot_user]/pubkey [run_dir]/genode/[depot_user]_pubkey file copy -force [genode_dir]/depot/[depot_user]/download [run_dir]/genode/[depot_user]_download +file copy -force [genode_dir]/VERSION [run_dir]/genode/ + exec gzip -dc [genode_dir]/repos/gems/run/sculpt/machine.vdi.gz > [run_dir]/genode/machine.vdi +# +# Define 'VERSION' ROM module +# +proc sculpt_version { } { + return "[string trim [exec cat [genode_dir]/VERSION]]" } + +# write file with newline (for producing nice output when using 'cat /VERSION') +set fd [open [run_dir]/genode/VERSION w] +puts $fd "[sculpt_version]" +close $fd + + # # Package-management support # diff --git a/repos/gems/run/sculpt/leitzentrale.config b/repos/gems/run/sculpt/leitzentrale.config index 9adc4b2a89..c16b3621dc 100644 --- a/repos/gems/run/sculpt/leitzentrale.config +++ b/repos/gems/run/sculpt/leitzentrale.config @@ -157,6 +157,7 @@ + diff --git a/repos/gems/run/sculpt/load_runtime.config b/repos/gems/run/sculpt/load_runtime.config index f830047056..9a4cf8a084 100644 --- a/repos/gems/run/sculpt/load_runtime.config +++ b/repos/gems/run/sculpt/load_runtime.config @@ -1,4 +1,4 @@ - + @@ -30,42 +30,26 @@ - - - - - - - - - - - - - - - - - - - + - cp /rw/config/* /config/ - cp /rw/config/subinit/*.config /config/subinit/ - cp /rw/config/deploy/* /config/deploy/ - cp /rw/config/leitzentrale/config /config/leitzentrale/ - cp /rw/config/runtime/*.config /config/runtime/ - cp /rw/config/runtime/config /config/runtime/ + export VERSION=`cat /VERSION` + cp /rw/config/$VERSION/* /config/ + cp /rw/config/$VERSION/subinit/*.config /config/subinit/ + cp /rw/config/$VERSION/deploy/* /config/deploy/ + cp /rw/config/$VERSION/leitzentrale/config /config/leitzentrale/ + cp /rw/config/$VERSION/runtime/*.config /config/runtime/ + cp /rw/config/$VERSION/runtime/config /config/runtime/ - + + @@ -77,7 +61,6 @@ -