Add options to kickstart.sh for explicitly passing options to installer code. (#12658)
Also, deprecate all existing methods of doing so.
Austin S. Hemmelgarn committed
Apr 27, 2022 at 07:36 UTC
10bcf66593f40e730d958b61197a5e3eb12718a0
2 files changed
+33
-3
packaging/installer/kickstart.sh
+31
-2
@@ -144,6 +144,8 @@ USAGE: kickstart.sh [options]
144
--no-cleanup Don't do any cleanup steps. This is intended to help with debugging the installer.
145
--uninstall Uninstall an existing installation of Netdata.
146
--reinstall-clean Clean reinstall Netdata.
147
+ --local-build-options Specify additional options to pass to the installer code when building locally. Only valid if --build-only is also specified.
148
+ --static-install-options Specify additional options to pass to the static installer code. Only valid if --static-only is also specified.
149
150
Additionally, this script may use the following environment variables:
151
@@ -155,7 +157,6 @@ Additionally, this script may use the following environment variables:
157
you need special options for one of those to work, or have a different tool to do
158
the same thing on your system, you can specify it here.
159
DISABLE_TELEMETRY If set to a value other than 0, behave as if \`--disable-telemetry\` was specified.
158
- NETDATA_INSTALLER_OPTIONS: Specifies extra options to pass to the static installer or local build script.
160
161
HEREDOC
162
}
@@ -1664,6 +1665,10 @@ install_on_freebsd() {
1665
1666
setup_terminal || echo > /dev/null
1667
1668
+if [ -n "${NETDATA_INSTALLER_OPTIONS}" ]; then
1669
+ warning "Explicitly specifying additional installer options with NETDATA_INSTALLER_OPTIONS is deprecated. Please instead pass the options to the script using either --local-build-options or --static-install-options as appropriate."
1670
+fi
1671
+
1672
while [ -n "${1}" ]; do
1673
case "${1}" in
1674
"--help")
@@ -1769,14 +1774,38 @@ while [ -n "${1}" ]; do
1774
;;
1775
esac
1776
;;
1777
+ "--local-build-options")
1778
+ LOCAL_BUILD_OPTIONS="${2}"
1779
+ shift 1
1780
+ ;;
1781
+ "--static-install-options")
1782
+ STATIC_INSTALL_OPTIONS="${2}"
1783
+ shift 1
1784
+ ;;
1785
*)
1773
- warning "Passing unrecognized option '${1}' to installer script. If this is intended, please add it to \$NETDATA_INSTALLER_OPTIONS instead."
1786
+ warning "Passing unrecognized option '${1}' to installer script. This behavior is deprecated and will be removed in the near future. If you intended to pass this option to the installer code, please use either --local-build-options or --static-install-options to specify it instead."
1787
NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} ${1}"
1788
;;
1789
esac
1790
shift 1
1791
done
1792
1793
+if [ -n "${LOCAL_BUILD_OPTIONS}" ]; then
1794
+ if [ "${NETDATA_ONLY_BUILD}" -eq 1 ]; then
1795
+ NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} ${LOCAL_BUILD_OPTIONS}"
1796
+ else
1797
+ fatal "Specifying local build options is only supported when the --build-only option is also specified." F0401
1798
+ fi
1799
+fi
1800
+
1801
+if [ -n "${STATIC_INSTALL_OPTIONS}" ]; then
1802
+ if [ "${NETDATA_ONLY_STATIC}" -eq 1 ]; then
1803
+ NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} ${STATIC_INSTALL_OPTIONS}"
1804
+ else
1805
+ fatal "Specifying installer options options is only supported when the --static-only option is also specified." F0402
1806
+ fi
1807
+fi
1808
+
1809
check_claim_opts
1810
confirm_root_support
1811
get_system_info
packaging/installer/methods/kickstart.md
+2
-1
@@ -67,6 +67,8 @@ The `kickstart.sh` script accepts a number of optional parameters to control how
67
- `--old-install-prefix`: Specify the custom local build's installation prefix that should be removed.
68
- `--uninstall`: Uninstall an existing installation of Netdata.
69
- `--reinstall-clean`: Performs an uninstall of Netdata and clean installation.
70
+- `--local-build-options`: Specify additional options to pass to the installer code when building locally. Only valid if `--build-only` is also specified.
71
+- `--static-install-options`: Specify additional options to pass to the static installer code. Only valid if --static-only is also specified.
72
73
Additionally, the following environment variables may be used to further customize how the script runs (most users
74
should not need to use special values for any of these):
@@ -78,7 +80,6 @@ should not need to use special values for any of these):
80
we try to use sudo, doas, or pkexec (in that order of preference), but if you need special options for one of
81
those to work, or have a different tool to do the same thing on your system, you can specify it here.
82
- `DISABLE_TELEMETRY`: If set to a value other than 0, behave as if `--disable-telemetry` was specified.
81
-- `NETDATA_INSTALLER_OPTIONS`: Specifies extra options to pass to the static installer or local build script.
83
84
### Connect node to Netdata Cloud during installation
85