From dd7cb235158a2ae68ed1bd84a10e5ea04dc4c5de Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 8 May 2023 13:45:58 +0200 Subject: [PATCH] Make it posible to override the init actions This makes it easier to run parts of the actions when running tests. --- lib/tiny-cloud/init | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/tiny-cloud/init b/lib/tiny-cloud/init index d8322eb..4c46df3 100644 --- a/lib/tiny-cloud/init +++ b/lib/tiny-cloud/init @@ -10,19 +10,23 @@ ### default phase actions (without leading 'init__') -INIT_ACTIONS_EARLY=" +DEFAULT_ACTIONS_EARLY=" expand_root install_hotplugs set_default_interfaces create_default_user enable_sshd " -INIT_ACTIONS_MAIN=" +DEFAULT_ACTIONS_MAIN=" save_userdata set_hostname set_ssh_keys " -INIT_ACTIONS_FINAL="" +DEFAULT_ACTIONS_FINAL="" + +: "${INIT_ACTIONS_EARLY=$DEFAULT_ACTIONS_EARLY}" +: "${INIT_ACTIONS_MAIN=$DEFAULT_ACTIONS_MAIN}" +: "${INIT_ACTIONS_FINAL=$DEFAULT_ACTIONS_FINAL}" # try to ensure existence of output directories, but otherwise don't panic [ ! -d "$TINY_CLOUD_LOGS" ] && mkdir -p "$TINY_CLOUD_LOGS" || true