summaryrefslogtreecommitdiffstats
path: root/packaging/makeself
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:19:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:20:02 +0000
commit58daab21cd043e1dc37024a7f99b396788372918 (patch)
tree96771e43bb69f7c1c2b0b4f7374cb74d7866d0cb /packaging/makeself
parentReleasing debian version 1.43.2-1. (diff)
downloadnetdata-58daab21cd043e1dc37024a7f99b396788372918.tar.xz
netdata-58daab21cd043e1dc37024a7f99b396788372918.zip
Merging upstream version 1.44.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/makeself')
-rw-r--r--packaging/makeself/README.md17
-rw-r--r--packaging/makeself/bundled-packages16
-rw-r--r--packaging/makeself/curl.version1
-rwxr-xr-xpackaging/makeself/jobs/20-openssl.install.sh7
-rwxr-xr-xpackaging/makeself/jobs/50-bash-5.1.16.install.sh10
-rwxr-xr-xpackaging/makeself/jobs/50-curl.install.sh9
-rwxr-xr-xpackaging/makeself/jobs/50-ioping-1.3.install.sh10
-rwxr-xr-xpackaging/makeself/jobs/50-libnetfilter_acct-1.0.3.install.sh12
-rwxr-xr-xpackaging/makeself/jobs/70-netdata-git.install.sh8
-rw-r--r--packaging/makeself/openssl.version1
10 files changed, 57 insertions, 34 deletions
diff --git a/packaging/makeself/README.md b/packaging/makeself/README.md
index 9219aefc..1f2c746b 100644
--- a/packaging/makeself/README.md
+++ b/packaging/makeself/README.md
@@ -19,13 +19,20 @@ will be used by default for installation.
If you want to enforce the usage of a static build and have the installer return a failure if one is not available,
you can do so by adding `--static-only` to the options you pass to the installer.
+## Requirements
+
+- Container runtime tool (Docker or Podman)
+
## Building a static binary package
-To build the static binary 64-bit distribution package, run:
+Before you begin, make sure that your repo and the repo's submodules are clean from any previous builds and up to date.
+Otherwise, [perform a cleanup](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/manual.md#perform-a-cleanup-in-your-netdata-repo)
+
+
+To build the static binary 64-bit distribution package, into the root folder on the netdata repo, run:
```bash
-cd /path/to/netdata.git
-./packaging/makeself/build-x86_64-static.sh
+./packaging/makeself/build-static.sh x86_64
```
The program will:
@@ -37,13 +44,15 @@ The program will:
Once finished, a file named `netdata-vX.X.X-gGITHASH-x86_64-DATE-TIME.run` will be created in the current directory. This is the Netdata binary package that can be run to install Netdata on any other computer.
+You can build static binaries for other architectures such as `armv7l`, `aarch64`, and `ppc64le`.
+
## Building binaries with debug info
To build Netdata binaries with debugging / tracing information in them, use:
```bash
cd /path/to/netdata.git
-./packaging/makeself/build-x86_64-static.sh debug
+./packaging/makeself/build-static.sh x86_64 debug
```
These binaries are not optimized (they are a bit slower), they have certain features disables (like log flood protection), other features enables (like `debug flags`) and are not stripped (the binary files are bigger, since they now include source code tracing information).
diff --git a/packaging/makeself/bundled-packages b/packaging/makeself/bundled-packages
new file mode 100644
index 00000000..02ee4469
--- /dev/null
+++ b/packaging/makeself/bundled-packages
@@ -0,0 +1,16 @@
+# Source of truth for all the packages we bundle in static builds
+PACKAGES=("OPENSSL" "CURL" "BASH" "IOPING" "LIBNETFILTER_ACT")
+SOURCE_TYPES=("GH_REPO_CLONE" "GH_REPO_CLONE" "DW_TARBALL" "GH_REPO_SOURCE" "DW_TARBALL")
+OPENSSL_VERSION="openssl-3.1.4"
+OPENSSL_SOURCE="https://github.com/openssl/openssl"
+CURL_VERSION="curl-8_4_0"
+CURL_SOURCE="https://github.com/curl/curl"
+BASH_VERSION="5.1.16"
+BASH_ARTIFACT_SOURCE="http://ftp.gnu.org/gnu/bash"
+BASH_ARTIFACT_SHA256="5bac17218d3911834520dad13cd1f85ab944e1c09ae1aba55906be1f8192f558"
+IOPING_VERSION="1.3"
+IOPING_SOURCE="https://github.com/koct9i/ioping"
+IOPING_ARTIFACT_SHA256="7aa48e70aaa766bc112dea57ebbe56700626871052380709df3a26f46766e8c8"
+LIBNETFILTER_ACT_VERSION="1.0.3"
+LIBNETFILTER_ACT_SOURCE="https://www.netfilter.org/projects/libnetfilter_acct/files"
+LIBNETFILTER_ACT_ARTIFACT_SHA256="4250ceef3efe2034f4ac05906c3ee427db31b9b0a2df41b2744f4bf79a959a1a"
diff --git a/packaging/makeself/curl.version b/packaging/makeself/curl.version
deleted file mode 100644
index 12ab47e6..00000000
--- a/packaging/makeself/curl.version
+++ /dev/null
@@ -1 +0,0 @@
-curl-8_4_0
diff --git a/packaging/makeself/jobs/20-openssl.install.sh b/packaging/makeself/jobs/20-openssl.install.sh
index 04ec2626..1158a633 100755
--- a/packaging/makeself/jobs/20-openssl.install.sh
+++ b/packaging/makeself/jobs/20-openssl.install.sh
@@ -3,12 +3,11 @@
# shellcheck source=packaging/makeself/functions.sh
. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
-
+# Source of truth for all the packages we bundle in static builds
+. "$(dirname "${0}")/../bundled-packages"
# shellcheck disable=SC2015
[ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::Building OpenSSL" || true
-version="$(cat "$(dirname "${0}")/../openssl.version")"
-
export CFLAGS='-fno-lto -pipe'
export LDFLAGS='-static'
export PKG_CONFIG="pkg-config --static"
@@ -29,7 +28,7 @@ if [ -d "${cache}" ]; then
CACHE_HIT=1
else
echo "No cached copy of build directory for openssl found, fetching sources instead."
- run git clone --branch "${version}" --single-branch --depth 1 https://github.com/openssl/openssl.git "${NETDATA_MAKESELF_PATH}/tmp/openssl"
+ run git clone --branch "${OPENSSL_VERSION}" --single-branch --depth 1 "${OPENSSL_SOURCE}" "${NETDATA_MAKESELF_PATH}/tmp/openssl"
CACHE_HIT=0
fi
diff --git a/packaging/makeself/jobs/50-bash-5.1.16.install.sh b/packaging/makeself/jobs/50-bash-5.1.16.install.sh
index f75bb9d2..7a302f2e 100755
--- a/packaging/makeself/jobs/50-bash-5.1.16.install.sh
+++ b/packaging/makeself/jobs/50-bash-5.1.16.install.sh
@@ -3,14 +3,14 @@
# shellcheck source=packaging/makeself/functions.sh
. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
-
-version="5.1.16"
+# Source of truth for all the packages we bundle in static builds
+. "$(dirname "${0}")/../bundled-packages"
# shellcheck disable=SC2015
[ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::building bash" || true
-fetch "bash-${version}" "http://ftp.gnu.org/gnu/bash/bash-${version}.tar.gz" \
- 5bac17218d3911834520dad13cd1f85ab944e1c09ae1aba55906be1f8192f558 bash
+fetch "bash-${BASH_VERSION}" "${BASH_ARTIFACT_SOURCE}/bash-${BASH_VERSION}.tar.gz" \
+ "${BASH_ARTIFACT_SHA256}" bash
export CFLAGS="-pipe"
export PKG_CONFIG_PATH="/openssl-static/lib64/pkgconfig"
@@ -39,7 +39,7 @@ fi
run make install
-store_cache bash "${NETDATA_MAKESELF_PATH}/tmp/bash-${version}"
+store_cache bash "${NETDATA_MAKESELF_PATH}/tmp/bash-${BASH_VERSION}"
if [ "${NETDATA_BUILD_WITH_DEBUG}" -eq 0 ]; then
run strip "${NETDATA_INSTALL_PATH}"/bin/bash
diff --git a/packaging/makeself/jobs/50-curl.install.sh b/packaging/makeself/jobs/50-curl.install.sh
index b3ed3318..824b3056 100755
--- a/packaging/makeself/jobs/50-curl.install.sh
+++ b/packaging/makeself/jobs/50-curl.install.sh
@@ -3,8 +3,8 @@
# shellcheck source=packaging/makeself/functions.sh
. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
-
-version="$(cat "$(dirname "${0}")/../curl.version")"
+# Source of truth for all the packages we bundle in static builds
+. "$(dirname "${0}")/../bundled-packages"
# shellcheck disable=SC2015
[ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::Building cURL" || true
@@ -21,7 +21,7 @@ if [ -d "${cache}" ]; then
CACHE_HIT=1
else
echo "No cached copy of build directory for curl found, fetching sources instead."
- run git clone --branch "${version}" --single-branch --depth 1 'https://github.com/curl/curl.git' "${NETDATA_MAKESELF_PATH}/tmp/curl"
+ run git clone --branch "${CURL_VERSION}" --single-branch --depth 1 "${CURL_SOURCE}" "${NETDATA_MAKESELF_PATH}/tmp/curl"
CACHE_HIT=0
fi
@@ -36,7 +36,7 @@ if [ "${CACHE_HIT:-0}" -eq 0 ]; then
run autoreconf -fi
run ./configure \
- --prefix="${NETDATA_INSTALL_PATH}" \
+ --prefix="/curl-local" \
--enable-optimize \
--disable-shared \
--enable-static \
@@ -69,6 +69,7 @@ run make install
store_cache curl "${NETDATA_MAKESELF_PATH}/tmp/curl"
+cp /curl-local/bin/curl "${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-ioping-1.3.install.sh b/packaging/makeself/jobs/50-ioping-1.3.install.sh
index 88309c3e..6bd538e3 100755
--- a/packaging/makeself/jobs/50-ioping-1.3.install.sh
+++ b/packaging/makeself/jobs/50-ioping-1.3.install.sh
@@ -3,14 +3,14 @@
# shellcheck source=packaging/makeself/functions.sh
. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
-
-version='1.3'
+# Source of truth for all the packages we bundle in static builds
+. "$(dirname "${0}")/../bundled-packages" || exit 1
# shellcheck disable=SC2015
[ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::Building ioping" || true
-fetch "ioping-${version}" "https://github.com/koct9i/ioping/archive/v${version}.tar.gz" \
- 7aa48e70aaa766bc112dea57ebbe56700626871052380709df3a26f46766e8c8 ioping
+fetch "ioping-${IOPING_VERSION}" "${IOPING_SOURCE}/archive/refs/tags/v${IOPING_VERSION}.tar.gz" \
+ "${IOPING_ARTIFACT_SHA256}" ioping
export CFLAGS="-static -pipe"
@@ -22,7 +22,7 @@ fi
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/
-store_cache ioping "${NETDATA_MAKESELF_PATH}/tmp/ioping-${version}"
+store_cache ioping "${NETDATA_MAKESELF_PATH}/tmp/ioping-${IOPING_VERSION}"
if [ "${NETDATA_BUILD_WITH_DEBUG}" -eq 0 ]; then
run strip "${NETDATA_INSTALL_PATH}"/usr/libexec/netdata/plugins.d/ioping
diff --git a/packaging/makeself/jobs/50-libnetfilter_acct-1.0.3.install.sh b/packaging/makeself/jobs/50-libnetfilter_acct-1.0.3.install.sh
index 2b7a761c..82975217 100755
--- a/packaging/makeself/jobs/50-libnetfilter_acct-1.0.3.install.sh
+++ b/packaging/makeself/jobs/50-libnetfilter_acct-1.0.3.install.sh
@@ -2,12 +2,12 @@
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Install the libnetfilter_acct and it's dependency libmnl
-#
+
# shellcheck source=packaging/makeself/functions.sh
. "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
-
-version="1.0.3"
+# Source of truth for all the packages we bundle in static builds
+. "$(dirname "${0}")/../bundled-packages" || exit 1
# shellcheck disable=SC2015
[ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::building libnetfilter_acct" || true
@@ -17,8 +17,8 @@ export LDFLAGS="-static -L/usr/lib -lmnl"
export PKG_CONFIG="pkg-config --static"
export PKG_CONFIG_PATH="/usr/lib/pkgconfig"
-fetch "libnetfilter_acct-${version}" "https://www.netfilter.org/projects/libnetfilter_acct/files/libnetfilter_acct-${version}.tar.bz2" \
- 4250ceef3efe2034f4ac05906c3ee427db31b9b0a2df41b2744f4bf79a959a1a libnetfilter_acct
+fetch "libnetfilter_acct-${LIBNETFILTER_ACT_VERSION}" "${LIBNETFILTER_ACT_SOURCE}/libnetfilter_acct-${LIBNETFILTER_ACT_VERSION}.tar.bz2" \
+ "${LIBNETFILTER_ACT_ARTIFACT_SHA256}" libnetfilter_acct
if [ "${CACHE_HIT:-0}" -eq 0 ]; then
@@ -32,7 +32,7 @@ fi
run make install
-store_cache libnetfilter_acct "${NETDATA_MAKESELF_PATH}/tmp/libnetfilter_acct-${version}"
+store_cache libnetfilter_acct "${NETDATA_MAKESELF_PATH}/tmp/libnetfilter_acct-${LIBNETFILTER_ACT_VERSION}"
# shellcheck disable=SC2015
diff --git a/packaging/makeself/jobs/70-netdata-git.install.sh b/packaging/makeself/jobs/70-netdata-git.install.sh
index 62f0c822..83d28bf8 100755
--- a/packaging/makeself/jobs/70-netdata-git.install.sh
+++ b/packaging/makeself/jobs/70-netdata-git.install.sh
@@ -7,12 +7,12 @@
cd "${NETDATA_SOURCE_PATH}" || exit 1
if [ "${NETDATA_BUILD_WITH_DEBUG}" -eq 0 ]; then
- export CFLAGS="-ffunction-sections -fdata-sections -static -O2 -funroll-loops -I/openssl-static/include -I/libnetfilter-acct-static/include/libnetfilter_acct -I/usr/include/libmnl -pipe"
+ export CFLAGS="-ffunction-sections -fdata-sections -static -O2 -funroll-loops -I/openssl-static/include -I/libnetfilter-acct-static/include/libnetfilter_acct -I/curl-local/include/curl -I/usr/include/libmnl -pipe"
else
- export CFLAGS="-static -O1 -pipe -ggdb -Wall -Wextra -Wformat-signedness -DNETDATA_INTERNAL_CHECKS=1 -I/openssl-static/include -I/libnetfilter-acct-static/include/libnetfilter_acct -I/usr/include/libmnl"
+ export CFLAGS="-static -O1 -pipe -ggdb -Wall -Wextra -Wformat-signedness -DNETDATA_INTERNAL_CHECKS=1 -I/openssl-static/include -I/libnetfilter-acct-static/include/libnetfilter_acct -I/curl-local/include/curl -I/usr/include/libmnl"
fi
-export LDFLAGS="-Wl,--gc-sections -static -L/openssl-static/lib64 -L/libnetfilter-acct-static/lib -lnetfilter_acct -L/usr/lib -lmnl"
+export LDFLAGS="-Wl,--gc-sections -static -L/openssl-static/lib64 -L/libnetfilter-acct-static/lib -lnetfilter_acct -L/usr/lib -lmnl -L/usr/lib -lzstd -L/curl-local/lib"
# 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
@@ -21,7 +21,7 @@ export IS_NETDATA_STATIC_BINARY="yes"
# Set eBPF LIBC to "static" to bundle the `-static` variant of the kernel-collector
export EBPF_LIBC="static"
export PKG_CONFIG="pkg-config --static"
-export PKG_CONFIG_PATH="/openssl-static/lib64/pkgconfig:/libnetfilter-acct-static/lib/pkgconfig:/usr/lib/pkgconfig"
+export PKG_CONFIG_PATH="/openssl-static/lib64/pkgconfig:/libnetfilter-acct-static/lib/pkgconfig:/usr/lib/pkgconfig:/curl-local/lib/pkgconfig"
# Set correct CMake flags for building against non-System OpenSSL
# See: https://github.com/warmcat/libwebsockets/blob/master/READMEs/README.build.md
diff --git a/packaging/makeself/openssl.version b/packaging/makeself/openssl.version
deleted file mode 100644
index c4d4ea13..00000000
--- a/packaging/makeself/openssl.version
+++ /dev/null
@@ -1 +0,0 @@
-openssl-3.1.3