Add option to limit architectures for offline installs. (#17604)
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
Austin S. Hemmelgarn committed
May 7, 2024 at 08:42 UTC
8719db26411886eb9d0dd8da2fa002b6eb1b9dbb
1 file changed
+11
-2
packaging/installer/kickstart.sh
+11
-2
@@ -2,7 +2,7 @@
2
#
3
# SPDX-License-Identifier: GPL-3.0-or-later
4
#
5
-# Next unused error code: F0518
5
+# Next unused error code: F0519
6
7
# ======================================================================
8
# Constants
@@ -196,6 +196,7 @@ USAGE: kickstart.sh [options]
196
--no-cleanup Don't do any cleanup steps. This is intended to help with debugging the installer.
197
--local-build-options Specify additional options to pass to the installer code when building locally. Only valid if --build-only is also specified.
198
--static-install-options Specify additional options to pass to the static installer code. Only valid if --static-only is also specified.
199
+ --offline-architecture Limit an offline install source being prepared with --prepare-offline-install-source to only include the specified static build architecture.
200
201
The following options are mutually exclusive and specifiy special operations other than trying to install Netdata normally or update an existing install:
202
@@ -2021,7 +2022,7 @@ prepare_offline_install_source() {
2022
fi
2023
2024
if check_for_remote_file "${NETDATA_STATIC_ARCHIVE_URL}"; then
2024
- for arch in ${STATIC_INSTALL_ARCHES}; do
2025
+ for arch in $(echo "${NETDATA_OFFLINE_ARCHES:-${STATIC_INSTALL_ARCHES}}" | awk '{for (i=1;i<=NF;i++) if (!a[$i]++) printf("%s%s",$i,FS)}{printf("\n")}'); do
2026
set_static_archive_urls "${SELECTED_RELEASE_CHANNEL}" "${arch}"
2027
2028
if check_for_remote_file "${NETDATA_STATIC_ARCHIVE_URL}"; then
@@ -2449,6 +2450,14 @@ parse_args() {
2450
fatal "A target directory must be specified with the --prepare-offline-install-source option." F0500
2451
fi
2452
;;
2453
+ "--offline-architecture")
2454
+ if echo "${STATIC_INSTALL_ARCHES}" | grep -qw "${2}"; then
2455
+ NETDATA_OFFLINE_ARCHES="${NETDATA_OFFLINE_ARCHES} ${2}"
2456
+ else
2457
+ fatal "${2} is not a recognized static build architecture (supported architectures are ${STATIC_INSTALL_ARCHES})" F0518
2458
+ fi
2459
+ shift 1
2460
+ ;;
2461
"--offline-install-source")
2462
if [ -d "${2}" ]; then
2463
NETDATA_OFFLINE_INSTALL_SOURCE="${2}"