Add support for eBPF for Netdata static64 (kickstart-static64.sh) (#9104)
* Add tool to build the dist and static x864_64 artifacts * Add tool to bump the Netdata packaging version * Cleanup all the makeself scripts and update to Alpine 3.11 * Add zgrep and xz to Alpine 3.7 container used to build x86_64 static Netdata so check-kernel-config.sh does not fail * Explicitly bundle the -static varient of the eBPF kernel-collector library/programs
James Mills committed
May 29, 2020 at 12:27 UTC
5087294d8174c16b0b46fc591f3fcc716cd20023
15 files changed
+222
-164
.github/scripts/build-artifacts.sh
new
+78
@@ -0,0 +1,78 @@
1
+#!/bin/sh
2
+#
3
+# Builds the netdata-vX.y.Z-xxxx.tar.gz source tarball (dist)
4
+# and netdata-vX.Y.Z-xxxx.gz.run (static x86_64) artifacts.
5
+
6
+set -e
7
+
8
+# shellcheck source=.github/scripts/functions.sh
9
+. "$(dirname "$0")/functions.sh"
10
+
11
+NAME="${NAME:-netdata}"
12
+VERSION="${VERSION:-"$(git describe)"}"
13
+BASENAME="$NAME-$VERSION"
14
+
15
+prepare_build() {
16
+ progress "Preparing build"
17
+ (
18
+ test -d artifacts || mkdir -p artifacts
19
+ ) >&2
20
+}
21
+
22
+build_dist() {
23
+ progress "Building dist"
24
+ (
25
+ autoreconf -ivf
26
+ ./configure \
27
+ --prefix=/usr \
28
+ --sysconfdir=/etc \
29
+ --localstatedir=/var \
30
+ --libexecdir=/usr/libexec \
31
+ --with-zlib \
32
+ --with-math \
33
+ --with-user=netdata \
34
+ CFLAGS=-O2
35
+ make dist
36
+ mv "${BASENAME}.tar.gz" artifacts/
37
+ ) >&2
38
+}
39
+
40
+build_static_x86_64() {
41
+ progress "Building static x86_64"
42
+ (
43
+ USER="" ./packaging/makeself/build-x86_64-static.sh
44
+ ) >&2
45
+}
46
+
47
+prepare_assets() {
48
+ progress "Preparing assets"
49
+ (
50
+ cp packaging/version artifacts/latest-version.txt
51
+
52
+ cd artifacts || exit 1
53
+ ln -s "${BASENAME}.tar.gz" netdata-latest.tar.gz
54
+ ln -s "${BASENAME}.gz.run" netdata-latest.gz.run
55
+ sha256sum -b ./* > "sha256sums.txt"
56
+ ) >&2
57
+}
58
+
59
+steps="prepare_build build_dist build_static_x86_64"
60
+steps="$steps prepare_assets"
61
+
62
+_main() {
63
+ for step in $steps; do
64
+ if ! run "$step"; then
65
+ if [ -t 1 ]; then
66
+ debug
67
+ else
68
+ fail "Build failed"
69
+ fi
70
+ fi
71
+ done
72
+
73
+ echo "🎉 All Done!"
74
+}
75
+
76
+if [ -n "$0" ] && [ x"$0" != x"-bash" ]; then
77
+ _main "$@"
78
+fi
.github/scripts/bump-packaging-version.sh
new
+6
@@ -0,0 +1,6 @@
1
+#!/bin/sh
2
+
3
+VERSION="$(git describe)"
4
+echo "$VERSION" > packaging/version
5
+git add -A
6
+git ci -m "[netdata nightly] $VERSION"
netdata-installer.sh
+1
-1
@@ -1355,7 +1355,7 @@ install_ebpf() {
1355
progress "Installing eBPF plugin"
1356
1357
# Detect libc
1358
- libc="$(detect_libc)"
1358
+ libc="${EBPF_LIBC:-"$(detect_libc)"}"
1359
1360
EBPF_VERSION="$(cat packaging/ebpf.version)"
1361
EBPF_TARBALL="netdata-kernel-collector-${libc}-${EBPF_VERSION}.tar.xz"
packaging/installer/functions.sh
+5
@@ -202,6 +202,11 @@ safe_pidof() {
202
203
# -----------------------------------------------------------------------------
204
find_processors() {
205
+ # Most UNIX systems have `nproc` as part of their userland (including macOS, Linux and BSD)
206
+ if command -v nproc > /dev/null; then
207
+ nproc && return
208
+ fi
209
+
210
local cpus
211
if [ -f "/proc/cpuinfo" ]; then
212
# linux
packaging/makeself/build.sh
+2
-4
@@ -4,6 +4,8 @@
4
# -----------------------------------------------------------------------------
5
# parse command line arguments
6
7
+set -e
8
+
9
export NETDATA_BUILD_WITH_DEBUG=0
10
11
while [ -n "${1}" ]; do
@@ -37,18 +39,14 @@ if [ ! -f ../../netdata-installer.sh ]; then
39
fi
40
41
cat >&2 << EOF
40
-
42
This program will create a self-extracting shell package containing
43
a statically linked netdata, able to run on any 64bit Linux system,
44
without any dependencies from the target system.
45
46
It can be used to have netdata running in no-time, or in cases the
47
target Linux system cannot compile netdata.
47
-
48
EOF
49
50
-# read -p "Press ENTER to continue > "
51
-
50
if [ ! -d tmp ]; then
51
mkdir tmp || exit 1
52
fi
packaging/makeself/functions.sh
+23
-23
@@ -6,19 +6,20 @@
6
# allow running the jobs by hand
7
[ -z "${NETDATA_BUILD_WITH_DEBUG}" ] && export NETDATA_BUILD_WITH_DEBUG=0
8
[ -z "${NETDATA_INSTALL_PATH}" ] && export NETDATA_INSTALL_PATH="${1-/opt/netdata}"
9
-[ -z "${NETDATA_MAKESELF_PATH}" ] && export NETDATA_MAKESELF_PATH="$(dirname "${0}")/../.."
10
-[ "${NETDATA_MAKESELF_PATH:0:1}" != "/" ] && export NETDATA_MAKESELF_PATH="$(pwd)/${NETDATA_MAKESELF_PATH}"
9
+[ -z "${NETDATA_MAKESELF_PATH}" ] && NETDATA_MAKESELF_PATH="$(dirname "${0}")/../.."
10
+[ "${NETDATA_MAKESELF_PATH:0:1}" != "/" ] && NETDATA_MAKESELF_PATH="$(pwd)/${NETDATA_MAKESELF_PATH}"
11
[ -z "${NETDATA_SOURCE_PATH}" ] && export NETDATA_SOURCE_PATH="${NETDATA_MAKESELF_PATH}/../.."
12
+export NETDATA_MAKESELF_PATH NETDATA_MAKESELF_PATH
13
export NULL=
14
15
# make sure the path does not end with /
15
-if [ "${NETDATA_INSTALL_PATH:$(( ${#NETDATA_INSTALL_PATH} - 1)):1}" = "/" ]
16
- then
17
- export NETDATA_INSTALL_PATH="${NETDATA_INSTALL_PATH:0:$(( ${#NETDATA_INSTALL_PATH} - 1))}"
16
+if [ "${NETDATA_INSTALL_PATH:$((${#NETDATA_INSTALL_PATH} - 1)):1}" = "/" ]; then
17
+ export NETDATA_INSTALL_PATH="${NETDATA_INSTALL_PATH:0:$((${#NETDATA_INSTALL_PATH} - 1))}"
18
fi
19
20
# find the parent directory
21
-export NETDATA_INSTALL_PARENT="$(dirname "${NETDATA_INSTALL_PATH}")"
21
+NETDATA_INSTALL_PARENT="$(dirname "${NETDATA_INSTALL_PATH}")"
22
+export NETDATA_INSTALL_PARENT
23
24
# -----------------------------------------------------------------------------
25
@@ -28,27 +29,26 @@ set -euo pipefail
29
# -----------------------------------------------------------------------------
30
31
fetch() {
31
- local dir="${1}" url="${2}"
32
- local tar="${dir}.tar.gz"
33
-
34
- if [ ! -f "${NETDATA_MAKESELF_PATH}/tmp/${tar}" ]
35
- then
36
- run wget -O "${NETDATA_MAKESELF_PATH}/tmp/${tar}" "${url}"
37
- fi
38
-
39
- if [ ! -d "${NETDATA_MAKESELF_PATH}/tmp/${dir}" ]
40
- then
41
- cd "${NETDATA_MAKESELF_PATH}/tmp"
42
- run tar -zxpf "${tar}"
43
- cd -
44
- fi
45
-
46
- run cd "${NETDATA_MAKESELF_PATH}/tmp/${dir}"
32
+ local dir="${1}" url="${2}"
33
+ local tar="${dir}.tar.gz"
34
+
35
+ if [ ! -f "${NETDATA_MAKESELF_PATH}/tmp/${tar}" ]; then
36
+ run wget -O "${NETDATA_MAKESELF_PATH}/tmp/${tar}" "${url}"
37
+ fi
38
+
39
+ if [ ! -d "${NETDATA_MAKESELF_PATH}/tmp/${dir}" ]; then
40
+ cd "${NETDATA_MAKESELF_PATH}/tmp"
41
+ run tar -zxpf "${tar}"
42
+ cd -
43
+ fi
44
+
45
+ run cd "${NETDATA_MAKESELF_PATH}/tmp/${dir}"
46
}
47
48
# -----------------------------------------------------------------------------
49
50
# load the functions of the netdata-installer.sh
51
+# shellcheck source=packaging/installer/functions.sh
52
. "${NETDATA_SOURCE_PATH}/packaging/installer/functions.sh"
53
54
# -----------------------------------------------------------------------------
@@ -59,4 +59,4 @@ echo "NETDATA_INSTALL_PARENT=${NETDATA_INSTALL_PARENT}"
59
echo "NETDATA_INSTALL_PATH=${NETDATA_INSTALL_PATH}"
60
echo "NETDATA_MAKESELF_PATH=${NETDATA_MAKESELF_PATH}"
61
echo "NETDATA_SOURCE_PATH=${NETDATA_SOURCE_PATH}"
62
-echo "PROCESSORS=$(find_processors)"
62
+echo "PROCESSORS=$(nproc)"
packaging/makeself/install-alpine-packages.sh
+11
-15
@@ -7,11 +7,8 @@
7
#
8
# Author: Paul Emm. Katsoulakis <paul@netdata.cloud>
9
10
-# Packaging update
11
-apk update
12
-
10
# Add required APK packages
14
-apk add --no-cache \
11
+apk add --no-cache -U \
12
bash \
13
wget \
14
curl \
@@ -37,28 +34,27 @@ apk add --no-cache \
34
openssl-dev \
35
snappy-dev \
36
protobuf-dev \
40
- binutils ||
41
- exit 1
37
+ binutils \
38
+ gzip \
39
+ xz || exit 1
40
41
# snappy doesnt have static version in alpine, let's compile it
42
export SNAPPY_VER="1.1.7"
43
wget -O /snappy.tar.gz https://github.com/google/snappy/archive/${SNAPPY_VER}.tar.gz
46
-cd /
47
-tar -xf snappy.tar.gz
48
-rm snappy.tar.gz
49
-cd /snappy-${SNAPPY_VER}
44
+tar -C / -xf /snappy.tar.gz
45
+rm /snappy.tar.gz
46
+cd /snappy-${SNAPPY_VER} || exit 1
47
mkdir build
51
-cd build
48
+cd build || exit 1
49
cmake -DCMAKE_BUILD_SHARED_LIBS=true -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR=lib ../
50
make && make install
51
52
# Judy doesnt seem to be available on the repositories, download manually and install it
53
export JUDY_VER="1.0.5"
54
wget -O /judy.tar.gz http://downloads.sourceforge.net/project/judy/judy/Judy-${JUDY_VER}/Judy-${JUDY_VER}.tar.gz
58
-cd /
59
-tar -xf judy.tar.gz
60
-rm judy.tar.gz
61
-cd /judy-${JUDY_VER}
55
+tar -C / -xf /judy.tar.gz
56
+rm /judy.tar.gz
57
+cd /judy-${JUDY_VER} || exit 1
58
CFLAGS="-O2 -s" CXXFLAGS="-O2 -s" ./configure
59
make
60
make install
packaging/makeself/jobs/10-prepare-destination.install.sh
+2
-1
@@ -1,7 +1,8 @@
1
#!/usr/bin/env bash
2
# SPDX-License-Identifier: GPL-3.0-or-later
3
4
-. $(dirname "${0}")/../functions.sh "${@}" || exit 1
4
+# shellcheck source=packaging/makeself/functions.sh
5
+. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
6
7
[ -d "${NETDATA_INSTALL_PATH}.old" ] && run rm -rf "${NETDATA_INSTALL_PATH}.old"
8
[ -d "${NETDATA_INSTALL_PATH}" ] && run mv -f "${NETDATA_INSTALL_PATH}" "${NETDATA_INSTALL_PATH}.old"
packaging/makeself/jobs/50-bash-4.4.18.install.sh
+13
-36
@@ -1,46 +1,24 @@
1
#!/usr/bin/env bash
2
# SPDX-License-Identifier: GPL-3.0-or-later
3
4
-. $(dirname "${0}")/../functions.sh "${@}" || exit 1
4
+# shellcheck source=packaging/makeself/functions.sh
5
+. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
6
7
fetch "bash-4.4.18" "http://ftp.gnu.org/gnu/bash/bash-4.4.18.tar.gz"
8
9
run ./configure \
9
- --prefix=${NETDATA_INSTALL_PATH} \
10
- --without-bash-malloc \
11
- --enable-static-link \
12
- --enable-net-redirections \
13
- --enable-array-variables \
14
- --disable-profiling \
15
- --disable-nls \
16
-# --disable-rpath \
17
-# --enable-alias \
18
-# --enable-arith-for-command \
19
-# --enable-array-variables \
20
-# --enable-brace-expansion \
21
-# --enable-casemod-attributes \
22
-# --enable-casemod-expansions \
23
-# --enable-command-timing \
24
-# --enable-cond-command \
25
-# --enable-cond-regexp \
26
-# --enable-directory-stack \
27
-# --enable-dparen-arithmetic \
28
-# --enable-function-import \
29
-# --enable-glob-asciiranges-default \
30
-# --enable-help-builtin \
31
-# --enable-job-control \
32
-# --enable-net-redirections \
33
-# --enable-process-substitution \
34
-# --enable-progcomp \
35
-# --enable-prompt-string-decoding \
36
-# --enable-readline \
37
-# --enable-select \
38
-
10
+ --prefix="${NETDATA_INSTALL_PATH}" \
11
+ --without-bash-malloc \
12
+ --enable-static-link \
13
+ --enable-net-redirections \
14
+ --enable-array-variables \
15
+ --disable-profiling \
16
+ --disable-nls
17
18
run make clean
41
-run make -j$(find_processors)
19
+run make -j "$(nproc)"
20
43
-cat >examples/loadables/Makefile <<EOF
21
+cat > examples/loadables/Makefile << EOF
22
all:
23
clean:
24
install:
@@ -48,7 +26,6 @@ EOF
26
27
run make install
28
51
-if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
52
-then
53
- run strip ${NETDATA_INSTALL_PATH}/bin/bash
29
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]; then
30
+ run strip "${NETDATA_INSTALL_PATH}"/bin/bash
31
fi
packaging/makeself/jobs/50-curl-7.60.0.install.sh
+13
-14
@@ -1,7 +1,8 @@
1
#!/usr/bin/env bash
2
# SPDX-License-Identifier: GPL-3.0-or-later
3
4
-. $(dirname "${0}")/../functions.sh "${@}" || exit 1
4
+# shellcheck source=packaging/makeself/functions.sh
5
+. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
6
7
fetch "curl-curl-7_60_0" "https://github.com/curl/curl/archive/curl-7_60_0.tar.gz"
8
@@ -11,24 +12,22 @@ export PKG_CONFIG="pkg-config --static"
12
run ./buildconf
13
14
run ./configure \
14
- --prefix=${NETDATA_INSTALL_PATH} \
15
- --enable-optimize \
16
- --disable-shared \
17
- --enable-static \
18
- --enable-http \
19
- --enable-proxy \
20
- --enable-ipv6 \
21
- --enable-cookies \
22
- ${NULL}
15
+ --prefix="${NETDATA_INSTALL_PATH}" \
16
+ --enable-optimize \
17
+ --disable-shared \
18
+ --enable-static \
19
+ --enable-http \
20
+ --enable-proxy \
21
+ --enable-ipv6 \
22
+ --enable-cookies
23
24
# Curl autoconf does not honour the curl_LDFLAGS environment variable
25
run sed -i -e "s/curl_LDFLAGS =/curl_LDFLAGS = -all-static/" src/Makefile
26
27
run make clean
28
-run make -j$(find_processors)
28
+run make -j "$(nproc)"
29
run make install
30
31
-if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
32
-then
33
- run strip ${NETDATA_INSTALL_PATH}/bin/curl
31
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]; then
32
+ run strip "${NETDATA_INSTALL_PATH}"/bin/curl
33
fi
packaging/makeself/jobs/50-fping-4.2.install.sh
+9
-10
@@ -1,29 +1,28 @@
1
#!/usr/bin/env bash
2
# SPDX-License-Identifier: GPL-3.0-or-later
3
4
-. $(dirname "${0}")/../functions.sh "${@}" || exit 1
4
+# shellcheck source=packaging/makeself/functions.sh
5
+. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
6
7
fetch "fping-4.2" "https://github.com/schweikert/fping/releases/download/v4.2/fping-4.2.tar.gz"
8
9
export CFLAGS="-static"
10
11
run ./configure \
11
- --prefix=${NETDATA_INSTALL_PATH} \
12
- --enable-ipv4 \
13
- --enable-ipv6 \
14
- ${NULL}
12
+ --prefix="${NETDATA_INSTALL_PATH}" \
13
+ --enable-ipv4 \
14
+ --enable-ipv6
15
16
-cat >doc/Makefile <<EOF
16
+cat > doc/Makefile << EOF
17
all:
18
clean:
19
install:
20
EOF
21
22
run make clean
23
-run make -j$(find_processors)
23
+run make -j "$(nproc)"
24
run make install
25
26
-if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
27
-then
28
- run strip ${NETDATA_INSTALL_PATH}/bin/fping
26
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]; then
27
+ run strip "${NETDATA_INSTALL_PATH}"/bin/fping
28
fi
packaging/makeself/jobs/50-ioping-1.1.install.sh
+7
-7
@@ -1,18 +1,18 @@
1
#!/usr/bin/env bash
2
# SPDX-License-Identifier: GPL-3.0-or-later
3
4
-. $(dirname "${0}")/../functions.sh "${@}" || exit 1
4
+# shellcheck source=packaging/makeself/functions.sh
5
+. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
6
7
fetch "netdata-ioping-43d15a5" "https://github.com/netdata/ioping/tarball/master"
8
9
export CFLAGS="-static"
10
11
run make clean
11
-run make -j$(find_processors)
12
-run mkdir -p ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/
13
-run install -o root -g root -m 4750 ioping ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/
12
+run make -j "$(nproc)"
13
+run mkdir -p "${NETDATA_INSTALL_PATH}"/usr/libexec/netdata/plugins.d/
14
+run install -o root -g root -m 4750 ioping "${NETDATA_INSTALL_PATH}"/usr/libexec/netdata/plugins.d/
15
15
-if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
16
-then
17
- run strip ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/ioping
16
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]; then
17
+ run strip "${NETDATA_INSTALL_PATH}"/usr/libexec/netdata/plugins.d/ioping
18
fi
packaging/makeself/jobs/70-netdata-git.install.sh
+6
-4
@@ -10,17 +10,19 @@ if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]; then
10
export CFLAGS="-static -O3"
11
else
12
export CFLAGS="-static -O1 -ggdb -Wall -Wextra -Wformat-signedness -fstack-protector-all -D_FORTIFY_SOURCE=2 -DNETDATA_INTERNAL_CHECKS=1"
13
-# export CFLAGS="-static -O1 -ggdb -Wall -Wextra -Wformat-signedness"
13
fi
14
15
# We export this to 'yes', installer sets this to .environment.
16
# The updater consumes this one, so that it can tell whether it should update a static install or a non-static one
17
export IS_NETDATA_STATIC_BINARY="yes"
18
20
-run ./netdata-installer.sh --install "${NETDATA_INSTALL_PARENT}" \
19
+# Set eBPF LIBC to "static" to bundle the `-static` variant of the kernel-collector
20
+export EBPF_LIBC="static"
21
+
22
+run ./netdata-installer.sh \
23
+ --install "${NETDATA_INSTALL_PARENT}" \
24
--dont-wait \
22
- --dont-start-it \
23
- "${NULL}"
25
+ --dont-start-it
26
27
# Remove the netdata.conf file from the tree. It has hard-coded sensible defaults builtin.
28
rm -f "${NETDATA_INSTALL_PARENT}/etc/netdata/netdata.conf"
packaging/makeself/jobs/99-makeself.install.sh
+35
-38
@@ -1,21 +1,22 @@
1
#!/usr/bin/env bash
2
# SPDX-License-Identifier: GPL-3.0-or-later
3
4
-. $(dirname "${0}")/../functions.sh "${@}" || exit 1
4
+# shellcheck source=packaging/makeself/functions.sh
5
+. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
6
7
run cd "${NETDATA_SOURCE_PATH}" || exit 1
8
9
# -----------------------------------------------------------------------------
10
# find the netdata version
11
11
-VERSION="$(git describe 2>/dev/null)"
12
+VERSION="$(git describe 2> /dev/null)"
13
if [ -z "${VERSION}" ]; then
13
- VERSION=$(cat packaging/version)
14
+ VERSION=$(cat packaging/version)
15
fi
16
17
if [ "${VERSION}" == "" ]; then
17
- echo >&2 "Cannot find version number. Create makeself executable from source code with git tree structure."
18
- exit 1
18
+ echo >&2 "Cannot find version number. Create makeself executable from source code with git tree structure."
19
+ exit 1
20
fi
21
22
# -----------------------------------------------------------------------------
@@ -24,17 +25,16 @@ fi
25
run mkdir -p "${NETDATA_INSTALL_PATH}/system"
26
27
run cp \
27
- packaging/makeself/post-installer.sh \
28
- packaging/makeself/install-or-update.sh \
29
- packaging/installer/functions.sh \
30
- configs.signatures \
31
- system/netdata-init-d \
32
- system/netdata-lsb \
33
- system/netdata-openrc \
34
- system/netdata.logrotate \
35
- system/netdata.service \
36
- "${NETDATA_INSTALL_PATH}/system/"
37
-
28
+ packaging/makeself/post-installer.sh \
29
+ packaging/makeself/install-or-update.sh \
30
+ packaging/installer/functions.sh \
31
+ configs.signatures \
32
+ system/netdata-init-d \
33
+ system/netdata-lsb \
34
+ system/netdata-openrc \
35
+ system/netdata.logrotate \
36
+ system/netdata.service \
37
+ "${NETDATA_INSTALL_PATH}/system/"
38
39
# -----------------------------------------------------------------------------
40
# create a wrapper to start our netdata with a modified path
@@ -42,9 +42,9 @@ run cp \
42
run mkdir -p "${NETDATA_INSTALL_PATH}/bin/srv"
43
44
run mv "${NETDATA_INSTALL_PATH}/bin/netdata" \
45
- "${NETDATA_INSTALL_PATH}/bin/srv/netdata" || exit 1
45
+ "${NETDATA_INSTALL_PATH}/bin/srv/netdata" || exit 1
46
47
-cat >"${NETDATA_INSTALL_PATH}/bin/netdata" <<EOF
47
+cat > "${NETDATA_INSTALL_PATH}/bin/netdata" << EOF
48
#!${NETDATA_INSTALL_PATH}/bin/bash
49
export NETDATA_BASH_LOADABLES="DISABLE"
50
export PATH="${NETDATA_INSTALL_PATH}/bin:\${PATH}"
@@ -52,36 +52,33 @@ exec "${NETDATA_INSTALL_PATH}/bin/srv/netdata" "\${@}"
52
EOF
53
run chmod 755 "${NETDATA_INSTALL_PATH}/bin/netdata"
54
55
-
55
# -----------------------------------------------------------------------------
56
# remove the links to allow untaring the archive
57
58
run rm "${NETDATA_INSTALL_PATH}/sbin" \
60
- "${NETDATA_INSTALL_PATH}/usr/bin" \
61
- "${NETDATA_INSTALL_PATH}/usr/sbin" \
62
- "${NETDATA_INSTALL_PATH}/usr/local"
63
-
59
+ "${NETDATA_INSTALL_PATH}/usr/bin" \
60
+ "${NETDATA_INSTALL_PATH}/usr/sbin" \
61
+ "${NETDATA_INSTALL_PATH}/usr/local"
62
63
# -----------------------------------------------------------------------------
64
# create the makeself archive
65
68
-run sed "s|NETDATA_VERSION|${VERSION}|g" <"${NETDATA_MAKESELF_PATH}/makeself.lsm" >"${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp"
66
+run sed "s|NETDATA_VERSION|${VERSION}|g" < "${NETDATA_MAKESELF_PATH}/makeself.lsm" > "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp"
67
68
run "${NETDATA_MAKESELF_PATH}/makeself.sh" \
71
- --gzip \
72
- --complevel 9 \
73
- --notemp \
74
- --needroot \
75
- --target "${NETDATA_INSTALL_PATH}" \
76
- --header "${NETDATA_MAKESELF_PATH}/makeself-header.sh" \
77
- --lsm "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp" \
78
- --license "${NETDATA_MAKESELF_PATH}/makeself-license.txt" \
79
- --help-header "${NETDATA_MAKESELF_PATH}/makeself-help-header.txt" \
80
- "${NETDATA_INSTALL_PATH}" \
81
- "${NETDATA_INSTALL_PATH}.gz.run" \
82
- "netdata, the real-time performance and health monitoring system" \
83
- ./system/post-installer.sh \
84
- ${NULL}
69
+ --gzip \
70
+ --complevel 9 \
71
+ --notemp \
72
+ --needroot \
73
+ --target "${NETDATA_INSTALL_PATH}" \
74
+ --header "${NETDATA_MAKESELF_PATH}/makeself-header.sh" \
75
+ --lsm "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp" \
76
+ --license "${NETDATA_MAKESELF_PATH}/makeself-license.txt" \
77
+ --help-header "${NETDATA_MAKESELF_PATH}/makeself-help-header.txt" \
78
+ "${NETDATA_INSTALL_PATH}" \
79
+ "${NETDATA_INSTALL_PATH}.gz.run" \
80
+ "netdata, the real-time performance and health monitoring system" \
81
+ ./system/post-installer.sh
82
83
run rm "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp"
84
packaging/makeself/run-all-jobs.sh
+11
-11
@@ -1,12 +1,11 @@
1
#!/usr/bin/env bash
2
# SPDX-License-Identifier: GPL-3.0-or-later
3
4
+set -e
5
+
6
LC_ALL=C
7
umask 002
8
7
-# be nice
8
-renice 19 $$ >/dev/null 2>/dev/null
9
-
9
# -----------------------------------------------------------------------------
10
# prepare the environment for the jobs
11
@@ -14,10 +13,11 @@ renice 19 $$ >/dev/null 2>/dev/null
13
export NETDATA_INSTALL_PATH="${1-/opt/netdata}"
14
15
# our source directory
17
-export NETDATA_MAKESELF_PATH="$(dirname "${0}")"
18
-if [ "${NETDATA_MAKESELF_PATH:0:1}" != "/" ]
19
- then
20
- export NETDATA_MAKESELF_PATH="$(pwd)/${NETDATA_MAKESELF_PATH}"
16
+NETDATA_MAKESELF_PATH="$(dirname "${0}")"
17
+export NETDATA_MAKESELF_PATH
18
+if [ "${NETDATA_MAKESELF_PATH:0:1}" != "/" ]; then
19
+ NETDATA_MAKESELF_PATH="$(pwd)/${NETDATA_MAKESELF_PATH}"
20
+ export NETDATA_MAKESELF_PATH
21
fi
22
23
# netdata source directory
@@ -30,12 +30,12 @@ export NULL=
30
31
cd "${NETDATA_MAKESELF_PATH}" || exit 1
32
33
+# shellcheck source=packaging/makeself/functions.sh
34
. ./functions.sh "${@}" || exit 1
35
35
-for x in jobs/*.install.sh
36
-do
37
- progress "running ${x}"
38
- "${x}" "${NETDATA_INSTALL_PATH}"
36
+for x in jobs/*.install.sh; do
37
+ progress "running ${x}"
38
+ "${x}" "${NETDATA_INSTALL_PATH}"
39
done
40
41
echo >&2 "All jobs for static packaging done successfully."