summaryrefslogtreecommitdiff
path: root/functions/init.sh
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-02-25 11:41:25 +0000
committerLyndon Brown <jnqnfe@gmail.com>2020-03-10 14:12:45 +0000
commit48df750411d9017804c3cde397a66db4726acf41 (patch)
tree16f43b6163b04e8301c35e586d691284f68da3dc /functions/init.sh
parent9faf9bcbed78c075287a74f3ccd58dbbfc973e63 (diff)
downloadvyos-live-build-48df750411d9017804c3cde397a66db4726acf41.tar.gz
vyos-live-build-48df750411d9017804c3cde397a66db4726acf41.zip
config: improve documentation
Diffstat (limited to 'functions/init.sh')
-rwxr-xr-xfunctions/init.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/functions/init.sh b/functions/init.sh
index 1fc653224..4eb6e7299 100755
--- a/functions/init.sh
+++ b/functions/init.sh
@@ -30,6 +30,26 @@ Init_config_data ()
Set_config_defaults
}
+# "Auto" script redirection.
+#
+# As a matter of convenience users can have a set of saved commandline options
+# which will be automatically included in every execution of live-build. How
+# this works is that the save file is itself a shell script saved in the config
+# directory (one per top-level live-build command in fact). When `lb config`,
+# `lb build` or `lb clean` is run, these scripts, if they see that an "auto"
+# file exists in the config, they run that file, passing along any user
+# arguments, and terminate once that ends. The "auto" script simply re-executes
+# the same command (e.g. `lb config`), only with a first param of "noauto",
+# used to stop an infinite loop of further redirection, then a fixed saved set
+# of command line options, as saved in the file by the user, then any
+# additional command line arguments passed into the script. This is simply a
+# means of injecting a saved set of command line options into the execution of
+# live-build.
+#
+# As for this function, it is a simple helper, used by the top-level commands
+# to perform the redirection if the relevant "auto" file exists. It should only
+# be called if the calling command script was not run with "noauto" as the
+# first argument (the purpose of which was just described).
Maybe_auto_redirect ()
{
local TYPE="${1}"; shift