From fd105e16aae69fff885ae6cbc29ac00fd747154a Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 5 Jan 2022 16:44:36 +0100 Subject: [PATCH] tool/run: add install_boot_module function This function largely alleviates the need to manually open/close files in run scripts such as sculpt.run. --- tool/run/run | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tool/run/run b/tool/run/run index a9ed77b29a..4e08e8e708 100755 --- a/tool/run/run +++ b/tool/run/run @@ -209,13 +209,23 @@ proc check_config {bin xml_file xsd_file label avail_xsd_files xsd_inc nesting_l } +## +# Install boot module with the given 'name' and content +# +proc install_boot_module { name args } { + + set fh [open [file join [run_dir] genode $name] "WRONLY CREAT TRUNC"] + puts $fh [join $args {}] + close $fh +} + + ## # Install content of specified variable as init config file # proc install_config { args } { - set fh [open "[run_dir]/genode/config" "WRONLY CREAT TRUNC"] - puts $fh [join $args {}] - close $fh + + install_boot_module "config" [join $args {}] }