From 6e4c3b2fd65f2a2de5f35eccc2626b496c98ca71 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Thu, 2 Jun 2022 15:39:11 +0200 Subject: [PATCH] sculpt: support to skip depot archive integration To not integrate referenced depot packages when building a sculpt image, just set the environment variable DEPOT= to be empty. This allows to produce slim images to the price that you have to publish the packages yourself. In that case the sculpt run-script reminds you, and prints the package versions. Fix genodelabs/genode#4530 --- repos/gems/run/sculpt.run | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/repos/gems/run/sculpt.run b/repos/gems/run/sculpt.run index 8c70b93d89..f73c3bd108 100644 --- a/repos/gems/run/sculpt.run +++ b/repos/gems/run/sculpt.run @@ -853,8 +853,36 @@ exec sed -i "/config/s/arch=\"\"/arch=\"[depot_spec]\"/" [initial_config_file de ## Depot content integrated in the Sculpt image ## -create_tar_from_depot_binaries [run_dir]/genode/depot.tar \ +## +# Return which kind of depot archive is wanted 'tar' or 'omit' +# +proc depot_archive { } { + + global ::env + + set archive "tar" + if {[info exists ::env(DEPOT)]} { + set archive "$::env(DEPOT)" } + + if {$archive != "omit" && $archive != "tar"} { + puts stderr "Error: invalid value of DEPOT=$archive variable!" } + + return $archive +} + +proc create_depot_archive { } { + global ::env + + if {[depot_archive] == "tar"} { + create_tar_from_depot_binaries [run_dir]/genode/depot.tar \ {*}[pkg_archive_paths [referenced_pkg_values]] + } else { + puts "Do not forget to publish:" + puts [pkg_archive_paths [referenced_pkg_values]] + } +} + +create_depot_archive #