live-build/functions/init.sh
Lyndon Brown 7a4a9f94b8 amend copyright & licensing blocks
Current versions of the project files are built upon versions published
and licensed by Daniel Baumann, but are modified copies of those files and
thus need to be marked as such per licensing requirements (afaik he did
not pass along ownership / licensing rights to anyone when he left the
project). We should also be careful to not be misrepresenting such
modified copies as being attributed to Daniel.

Adding a new copyright line referring to "The Debian Live team" should
suffice for this.

The authorship block in man pages has also similarly been updated.

Notes:
 - tweaked a copy of daniel copyright lines stating 2014 instead of 2015.
   both of these cases were in files that i had personally introduced in
   some of my past merged commits that moved some code around. i don't know
   why they stated 2014.
 - binary_onie was introduced in 2018, so that has a 2018 date instead of
   2016 unlike the rest.
 - 'efi-image' is a 3rd-party (Canonical Ltd) work that we bundle, but it
   has been modified by 674794a8f4 and
   36a3ba7634 so I similarly added a
   debian live copyright line.
 - 'grub-cpmodules' is similar. it was only changed by the indentation fix
   of 36a3ba7634 but modification is
   modification, and this does help cover any possible future changes that
   might be made.
2020-03-11 13:51:19 +00:00

74 lines
2.3 KiB
Bash
Executable File

#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2016-2020 The Debian Live team
## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Common_config_files ()
{
echo "config/all config/common config/bootstrap config/chroot config/binary config/source"
}
Auto_build_config ()
{
# Automatically build config
if [ -x auto/config ] && [ ! -e .build/config ]; then
Echo_message "Automatically populating config tree."
lb config
fi
}
Init_config_data ()
{
Arguments "${@}"
Read_conffiles $(Common_config_files)
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
case "${TYPE}" in
clean|config|build)
;;
*)
Echo_error "Unknown auto redirect type"
exit 1
;;
esac
local AUTO_SCRIPT="auto/${TYPE}"
if [ -x "${AUTO_SCRIPT}" ]; then
Echo_message "Executing ${AUTO_SCRIPT} script."
./"${AUTO_SCRIPT}" "${@}"
exit ${?}
fi
}