0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-28 14:42:31 +00:00
netdata_netdata/packaging/makeself
2025-04-17 13:43:12 +03:00
..
jobs Work to find leaks easily (#20106) 2025-04-15 11:09:21 +03:00
build-static.sh Large-scale cleanup of static build infrastructure. (#19852) 2025-03-25 07:00:54 -04:00
build-x86_64-static.sh fix static build, curl will be staict binary; extra args can be transfer (#11852) 2021-12-07 09:59:22 -05:00
build.sh Large-scale cleanup of static build infrastructure. (#19852) 2025-03-25 07:00:54 -04:00
bundled-packages.version Include libucontext in static builds to vendor libunwind even on POWER. (#19817) 2025-03-11 06:58:11 -04:00
functions.sh Large-scale cleanup of static build infrastructure. (#19852) 2025-03-25 07:00:54 -04:00
install-alpine-packages.sh enable libunwind in static builds (#19764) 2025-03-06 12:39:10 +02:00
install-or-update.sh detect the system ca bundle at runtime (#19622) 2025-02-12 16:28:01 +02:00
makeself-header.sh Prevent pager from preventing non-interactive install (#14950) 2023-04-25 07:50:19 -04:00
makeself-help-header.txt change the moto and the description of netdata (#19696) 2025-02-23 13:02:22 +02:00
makeself-license.txt change the moto and the description of netdata (#19696) 2025-02-23 13:02:22 +02:00
makeself.lsm Fix SIGSEGV on static installs due to dengine log (#19774) 2025-03-05 14:24:43 +02:00
makeself.sh Update the bundled version of makeself used to create static builds. (#14822) 2023-04-12 06:58:36 -04:00
post-installer.sh move makeself (#4688) 2019-01-02 10:12:24 +01:00
README.md Install fix admonition docs (#20136) 2025-04-17 13:43:12 +03:00
run-all-jobs.sh Large-scale cleanup of static build infrastructure. (#19852) 2025-03-25 07:00:54 -04:00
uname2platform.sh Add ARMv6 static builds. (#16853) 2024-01-29 11:59:13 +02:00

Netdata Static Binary Build

Netdata provides pre-built static binaries for Linux systems where native packages aren't available. The installer automatically uses these static builds when needed.

Key Features:

  • Self-contained installation (no system dependencies required, no interference with system libraries)
  • Installed under /opt/netdata

Supported Architectures

Architecture Identifier Notes
x86_64 x86_64 64-bit Intel/AMD processors
ARMv7 armv7l Raspberry Pi 2/3, many SBCs
AArch64 aarch64 ARM 64-bit (Pi 4, newer devices)
POWER8+ ppc64le IBM POWER architecture

Build Process

Requirements

Requirement Purpose
Docker or Podman Container environment for isolated builds
~10GB disk space For build artifacts and containers

Preparation

Before building, ensure your repository is clean from previous builds.

Perform a cleanup

Building the Static Binary

Run the build script with your target architecture identifier:

# For x86_64 (default)
./packaging/makeself/build-static.sh x86_64

# For ARM 64-bit (AArch64)
./packaging/makeself/build-static.sh aarch64

# For ARMv7
./packaging/makeself/build-static.sh armv7l

# For POWER8+
./packaging/makeself/build-static.sh ppc64le

The script will automatically:

  • Launch an Alpine Linux container
  • Install necessary build dependencies
  • Compile required third-party tools (bash, curl, etc.)
  • Build Netdata with optimized settings
  • Package everything into a self-extracting installer

When building for an architecture different from your host:

  • The build process uses QEMU for emulation
  • Build times will be significantly longer
  • More disk space may be required
  • Some features may have architecture-specific limitations

Build Output

The process generates several installer files in the artifacts/ directory:

artifacts/
├── netdata-latest.gz.run                    # Latest version
├── netdata-v[VERSION]-[BUILD].gz.run        # Specific version
├── netdata-[ARCH]-latest.gz.run             # Architecture-specific latest
└── netdata-[ARCH]-v[VERSION]-[BUILD].gz.run # Architecture-specific version

Example output:

$ ls -l artifacts/
drwxrwxr-x   - user group     cache
.rwxrwxr-x 94M user group     netdata-latest.gz.run
.rwxrwxr-x 94M user group     netdata-v2.3.0-193-nightly.gz.run
.rwxrwxr-x 94M user group     netdata-x86_64-latest.gz.run
.rwxrwxr-x 94M user group     netdata-x86_64-v2.3.0-193-nightly.gz.run

Advanced Build Options

Debug Builds

For troubleshooting, you can create a debug-enabled build:

./packaging/makeself/build-static.sh x86_64 debug

Debug build characteristics:

  • Larger file size
  • Runtime performance impact
  • Additional diagnostic information
  • Disabled optimizations
  • Enhanced tracing capabilities

Troubleshooting

Running with Valgrind

To diagnose memory issues or crashes:

PATH="/opt/netdata/bin:${PATH}" valgrind --undef-value-errors=no /opt/netdata/bin/srv/netdata -D

Important notes:

  • Performance will be significantly reduced (~10x slower)
  • Stop Valgrind with Ctrl+C
  • The --undef-value-errors=no flag suppresses hundreds of false positives from the bundled libraries

Crash Reporting

If Netdata crashes during development or testing:

  1. Capture the complete Valgrind output
  2. Open a GitHub Issue
  3. Include:
    • Build details (architecture, version)
    • Complete stack trace
    • Steps to reproduce the issue