summaryrefslogtreecommitdiffstats
path: root/packaging/makeself/jobs
diff options
context:
space:
mode:
authorJames Mills <prologic@shortcircuit.net.au>2020-05-29 12:27:22 +1000
committerGitHub <noreply@github.com>2020-05-29 12:27:22 +1000
commit5087294d8174c16b0b46fc591f3fcc716cd20023 (patch)
treeb515bd7746b18673924394f5b85d9fe839c2e8d0 /packaging/makeself/jobs
parentaff16a2dfa79e3b8ed360878837fb72446f4c591 (diff)
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
Diffstat (limited to 'packaging/makeself/jobs')
-rwxr-xr-xpackaging/makeself/jobs/10-prepare-destination.install.sh3
-rwxr-xr-xpackaging/makeself/jobs/50-bash-4.4.18.install.sh49
-rwxr-xr-xpackaging/makeself/jobs/50-curl-7.60.0.install.sh27
-rwxr-xr-xpackaging/makeself/jobs/50-fping-4.2.install.sh19
-rwxr-xr-xpackaging/makeself/jobs/50-ioping-1.1.install.sh14
-rwxr-xr-xpackaging/makeself/jobs/70-netdata-git.install.sh10
-rwxr-xr-xpackaging/makeself/jobs/99-makeself.install.sh73
7 files changed, 85 insertions, 110 deletions
diff --git a/packaging/makeself/jobs/10-prepare-destination.install.sh b/packaging/makeself/jobs/10-prepare-destination.install.sh
index 06dc82f294..8cce2d4427 100755
--- a/packaging/makeself/jobs/10-prepare-destination.install.sh
+++ b/packaging/makeself/jobs/10-prepare-destination.install.sh
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
-. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+# shellcheck source=packaging/makeself/functions.sh
+. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
[ -d "${NETDATA_INSTALL_PATH}.old" ] && run rm -rf "${NETDATA_INSTALL_PATH}.old"
[ -d "${NETDATA_INSTALL_PATH}" ] && run mv -f "${NETDATA_INSTALL_PATH}" "${NETDATA_INSTALL_PATH}.old"
diff --git a/packaging/makeself/jobs/50-bash-4.4.18.install.sh b/packaging/makeself/jobs/50-bash-4.4.18.install.sh
index a762d37aef..72420d6f6b 100755
--- a/packaging/makeself/jobs/50-bash-4.4.18.install.sh
+++ b/packaging/makeself/jobs/50-bash-4.4.18.install.sh
@@ -1,46 +1,24 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
-. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+# shellcheck source=packaging/makeself/functions.sh
+. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
fetch "bash-4.4.18" "http://ftp.gnu.org/gnu/bash/bash-4.4.18.tar.gz"
run ./configure \
- --prefix=${NETDATA_INSTALL_PATH} \
- --without-bash-malloc \
- --enable-static-link \
- --enable-net-redirections \
- --enable-array-variables \
- --disable-profiling \
- --disable-nls \
-# --disable-rpath \
-# --enable-alias \
-# --enable-arith-for-command \
-# --enable-array-variables \
-# --enable-brace-expansion \
-# --enable-casemod-attributes \
-# --enable-casemod-expansions \
-# --enable-command-timing \
-# --enable-cond-command \
-# --enable-cond-regexp \
-# --enable-directory-stack \
-# --enable-dparen-arithmetic \
-# --enable-function-import \
-# --enable-glob-asciiranges-default \
-# --enable-help-builtin \
-# --enable-job-control \
-# --enable-net-redirections \
-# --enable-process-substitution \
-# --enable-progcomp \
-# --enable-prompt-string-decoding \
-# --enable-readline \
-# --enable-select \
-
+ --prefix="${NETDATA_INSTALL_PATH}" \
+ --without-bash-malloc \
+ --enable-static-link \
+ --enable-net-redirections \
+ --enable-array-variables \
+ --disable-profiling \
+ --disable-nls
run make clean
-run make -j$(find_processors)
+run make -j "$(nproc)"
-cat >examples/loadables/Makefile <<EOF
+cat > examples/loadables/Makefile << EOF
all:
clean:
install:
@@ -48,7 +26,6 @@ EOF
run make install
-if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
-then
- run strip ${NETDATA_INSTALL_PATH}/bin/bash
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]; then
+ run strip "${NETDATA_INSTALL_PATH}"/bin/bash
fi
diff --git a/packaging/makeself/jobs/50-curl-7.60.0.install.sh b/packaging/makeself/jobs/50-curl-7.60.0.install.sh
index c91598251f..8171129db2 100755
--- a/packaging/makeself/jobs/50-curl-7.60.0.install.sh
+++ b/packaging/makeself/jobs/50-curl-7.60.0.install.sh
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
-. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+# shellcheck source=packaging/makeself/functions.sh
+. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
fetch "curl-curl-7_60_0" "https://github.com/curl/curl/archive/curl-7_60_0.tar.gz"
@@ -11,24 +12,22 @@ export PKG_CONFIG="pkg-config --static"
run ./buildconf
run ./configure \
- --prefix=${NETDATA_INSTALL_PATH} \
- --enable-optimize \
- --disable-shared \
- --enable-static \
- --enable-http \
- --enable-proxy \
- --enable-ipv6 \
- --enable-cookies \
- ${NULL}
+ --prefix="${NETDATA_INSTALL_PATH}" \
+ --enable-optimize \
+ --disable-shared \
+ --enable-static \
+ --enable-http \
+ --enable-proxy \
+ --enable-ipv6 \
+ --enable-cookies
# Curl autoconf does not honour the curl_LDFLAGS environment variable
run sed -i -e "s/curl_LDFLAGS =/curl_LDFLAGS = -all-static/" src/Makefile
run make clean
-run make -j$(find_processors)
+run make -j "$(nproc)"
run make install
-if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
-then
- run strip ${NETDATA_INSTALL_PATH}/bin/curl
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]; then
+ run strip "${NETDATA_INSTALL_PATH}"/bin/curl
fi
diff --git a/packaging/makeself/jobs/50-fping-4.2.install.sh b/packaging/makeself/jobs/50-fping-4.2.install.sh
index a137753d8e..635d4d582d 100755
--- a/packaging/makeself/jobs/50-fping-4.2.install.sh
+++ b/packaging/makeself/jobs/50-fping-4.2.install.sh
@@ -1,29 +1,28 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
-. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+# shellcheck source=packaging/makeself/functions.sh
+. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
fetch "fping-4.2" "https://github.com/schweikert/fping/releases/download/v4.2/fping-4.2.tar.gz"
export CFLAGS="-static"
run ./configure \
- --prefix=${NETDATA_INSTALL_PATH} \
- --enable-ipv4 \
- --enable-ipv6 \
- ${NULL}
+ --prefix="${NETDATA_INSTALL_PATH}" \
+ --enable-ipv4 \
+ --enable-ipv6
-cat >doc/Makefile <<EOF
+cat > doc/Makefile << EOF
all:
clean:
install:
EOF
run make clean
-run make -j$(find_processors)
+run make -j "$(nproc)"
run make install
-if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
-then
- run strip ${NETDATA_INSTALL_PATH}/bin/fping
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]; then
+ run strip "${NETDATA_INSTALL_PATH}"/bin/fping
fi
diff --git a/packaging/makeself/jobs/50-ioping-1.1.install.sh b/packaging/makeself/jobs/50-ioping-1.1.install.sh
index 83c778c158..a3f57f5f8c 100755
--- a/packaging/makeself/jobs/50-ioping-1.1.install.sh
+++ b/packaging/makeself/jobs/50-ioping-1.1.install.sh
@@ -1,18 +1,18 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
-. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+# shellcheck source=packaging/makeself/functions.sh
+. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
fetch "netdata-ioping-43d15a5" "https://github.com/netdata/ioping/tarball/master"
export CFLAGS="-static"
run make clean
-run make -j$(find_processors)
-run mkdir -p ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/
-run install -o root -g root -m 4750 ioping ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/
+run make -j "$(nproc)"
+run mkdir -p "${NETDATA_INSTALL_PATH}"/usr/libexec/netdata/plugins.d/
+run install -o root -g root -m 4750 ioping "${NETDATA_INSTALL_PATH}"/usr/libexec/netdata/plugins.d/
-if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]
-then
- run strip ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/ioping
+if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]; then
+ run strip "${NETDATA_INSTALL_PATH}"/usr/libexec/netdata/plugins.d/ioping
fi
diff --git a/packaging/makeself/jobs/70-netdata-git.install.sh b/packaging/makeself/jobs/70-netdata-git.install.sh
index 923c29667f..ebd2d30b67 100755
--- a/packaging/makeself/jobs/70-netdata-git.install.sh
+++ b/packaging/makeself/jobs/70-netdata-git.install.sh
@@ -10,17 +10,19 @@ if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ]; then
export CFLAGS="-static -O3"
else
export CFLAGS="-static -O1 -ggdb -Wall -Wextra -Wformat-signedness -fstack-protector-all -D_FORTIFY_SOURCE=2 -DNETDATA_INTERNAL_CHECKS=1"
-# export CFLAGS="-static -O1 -ggdb -Wall -Wextra -Wformat-signedness"
fi
# We export this to 'yes', installer sets this to .environment.
# The updater consumes this one, so that it can tell whether it should update a static install or a non-static one
export IS_NETDATA_STATIC_BINARY="yes"
-run ./netdata-installer.sh --install "${NETDATA_INSTALL_PARENT}" \
+# Set eBPF LIBC to "static" to bundle the `-static` variant of the kernel-collector
+export EBPF_LIBC="static"
+
+run ./netdata-installer.sh \
+ --install "${NETDATA_INSTALL_PARENT}" \
--dont-wait \
- --dont-start-it \
- "${NULL}"
+ --dont-start-it
# Remove the netdata.conf file from the tree. It has hard-coded sensible defaults builtin.
rm -f "${NETDATA_INSTALL_PARENT}/etc/netdata/netdata.conf"
diff --git a/packaging/makeself/jobs/99-makeself.install.sh b/packaging/makeself/jobs/99-makeself.install.sh
index f3056e6aca..8d806099d4 100755
--- a/packaging/makeself/jobs/99-makeself.install.sh
+++ b/packaging/makeself/jobs/99-makeself.install.sh
@@ -1,21 +1,22 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
-. $(dirname "${0}")/../functions.sh "${@}" || exit 1
+# shellcheck source=packaging/makeself/functions.sh
+. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
run cd "${NETDATA_SOURCE_PATH}" || exit 1
# -----------------------------------------------------------------------------
# find the netdata version
-VERSION="$(git describe 2>/dev/null)"
+VERSION="$(git describe 2> /dev/null)"
if [ -z "${VERSION}" ]; then
- VERSION=$(cat packaging/version)
+ VERSION=$(cat packaging/version)
fi
if [ "${VERSION}" == "" ]; then
- echo >&2 "Cannot find version number. Create makeself executable from source code with git tree structure."
- exit 1
+ echo >&2 "Cannot find version number. Create makeself executable from source code with git tree structure."
+ exit 1
fi
# -----------------------------------------------------------------------------
@@ -24,17 +25,16 @@ fi
run mkdir -p "${NETDATA_INSTALL_PATH}/system"
run cp \
- packaging/makeself/post-installer.sh \
- packaging/makeself/install-or-update.sh \
- packaging/installer/functions.sh \
- configs.signatures \
- system/netdata-init-d \
- system/netdata-lsb \
- system/netdata-openrc \
- system/netdata.logrotate \
- system/netdata.service \
- "${NETDATA_INSTALL_PATH}/system/"
-
+ packaging/makeself/post-installer.sh \
+ packaging/makeself/install-or-update.sh \
+ packaging/installer/functions.sh \
+ configs.signatures \
+ system/netdata-init-d \
+ system/netdata-lsb \
+ system/netdata-openrc \
+ system/netdata.logrotate \
+ system/netdata.service \
+ "${NETDATA_INSTALL_PATH}/system/"
# -----------------------------------------------------------------------------
# create a wrapper to start our netdata with a modified path
@@ -42,9 +42,9 @@ run cp \
run mkdir -p "${NETDATA_INSTALL_PATH}/bin/srv"
run mv "${NETDATA_INSTALL_PATH}/bin/netdata" \
- "${NETDATA_INSTALL_PATH}/bin/srv/netdata" || exit 1
+ "${NETDATA_INSTALL_PATH}/bin/srv/netdata" || exit 1
-cat >"${NETDATA_INSTALL_PATH}/bin/netdata" <<EOF
+cat > "${NETDATA_INSTALL_PATH}/bin/netdata" << EOF
#!${NETDATA_INSTALL_PATH}/bin/bash
export NETDATA_BASH_LOADABLES="DISABLE"
export PATH="${NETDATA_INSTALL_PATH}/bin:\${PATH}"
@@ -52,36 +52,33 @@ exec "${NETDATA_INSTALL_PATH}/bin/srv/netdata" "\${@}"
EOF
run chmod 755 "${NETDATA_INSTALL_PATH}/bin/netdata"
-
# -----------------------------------------------------------------------------
# remove the links to allow untaring the archive
run rm "${NETDATA_INSTALL_PATH}/sbin" \
- "${NETDATA_INSTALL_PATH}/usr/bin" \
- "${NETDATA_INSTALL_PATH}/usr/sbin" \
- "${NETDATA_INSTALL_PATH}/usr/local"
-
+ "${NETDATA_INSTALL_PATH}/usr/bin" \
+ "${NETDATA_INSTALL_PATH}/usr/sbin" \
+ "${NETDATA_INSTALL_PATH}/usr/local"
# -----------------------------------------------------------------------------
# create the makeself archive
-run sed "s|NETDATA_VERSION|${VERSION}|g" <"${NETDATA_MAKESELF_PATH}/makeself.lsm" >"${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp"
+run sed "s|NETDATA_VERSION|${VERSION}|g" < "${NETDATA_MAKESELF_PATH}/makeself.lsm" > "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp"
run "${NETDATA_MAKESELF_PATH}/makeself.sh" \
- --gzip \
- --complevel 9 \
- --notemp \
- --needroot \
- --target "${NETDATA_INSTALL_PATH}" \
- --header "${NETDATA_MAKESELF_PATH}/makeself-header.sh" \
- --lsm "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp" \
- --license "${NETDATA_MAKESELF_PATH}/makeself-license.txt" \
- --help-header "${NETDATA_MAKESELF_PATH}/makeself-help-header.txt" \
- "${NETDATA_INSTALL_PATH}" \
- "${NETDATA_INSTALL_PATH}.gz.run" \
- "netdata, the real-time performance and health monitoring system" \
- ./system/post-installer.sh \
- ${NULL}
+ --gzip \
+ --complevel 9 \
+ --notemp \
+ --needroot \
+ --target "${NETDATA_INSTALL_PATH}" \
+ --header "${NETDATA_MAKESELF_PATH}/makeself-header.sh" \
+ --lsm "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp" \
+ --license "${NETDATA_MAKESELF_PATH}/makeself-license.txt" \
+ --help-header "${NETDATA_MAKESELF_PATH}/makeself-help-header.txt" \
+ "${NETDATA_INSTALL_PATH}" \
+ "${NETDATA_INSTALL_PATH}.gz.run" \
+ "netdata, the real-time performance and health monitoring system" \
+ ./system/post-installer.sh
run rm "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp"