bundle-ebpf.sh 781 B

12345678910111213141516171819
  1. #!/bin/sh
  2. SRCDIR="${1}"
  3. PLUGINDIR="${2}"
  4. EBPF_VERSION="$(cat "${SRCDIR}/packaging/ebpf.version")"
  5. EBPF_TARBALL="netdata-kernel-collector-glibc-${EBPF_VERSION}.tar.xz"
  6. if [ -x "${PLUGINDIR}/ebpf.plugin" ] ; then
  7. mkdir -p "${SRCDIR}/tmp/ebpf"
  8. curl -sSL --connect-timeout 10 --retry 3 "https://github.com/netdata/kernel-collector/releases/download/${EBPF_VERSION}/${EBPF_TARBALL}" > "${EBPF_TARBALL}" || exit 1
  9. grep "${EBPF_TARBALL}" "${SRCDIR}/packaging/ebpf.checksums" | sha256sum -c - || exit 1
  10. tar -xaf "${EBPF_TARBALL}" -C "${SRCDIR}/tmp/ebpf" || exit 1
  11. if [ ! -d "${PLUGINDIR}/ebpf.d" ];then
  12. mkdir "${PLUGINDIR}/ebpf.d"
  13. fi
  14. # shellcheck disable=SC2046
  15. cp -a $(find "${SRCDIR}/tmp/ebpf" -mindepth 1 -maxdepth 1) "${PLUGINDIR}/ebpf.d"
  16. fi