Skip to content

Commit

Permalink
Fix handling of eBPF plugin for DEB packages. (netdata#15117)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferroin authored May 30, 2023
1 parent d3dc461 commit 8a6f699
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions contrib/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Description: The charts.d metrics collection plugin for the Netdata Agent
LibreSWAN, OpenSIPS, and Wireless access point statistics.

Package: netdata-plugin-ebpf
Architecture: any
Architecture: amd64
Depends: ${shlibs:Depends},
netdata (>= ${source:Version})
Recommends: netdata-ebpf-code-legacy (>= ${source:Version}),
Expand All @@ -110,7 +110,7 @@ Description: The eBPF metrics collection plugin for the Netdata Agent
detailed kernel-level metrics for the system.

Package: netdata-ebpf-code-legacy
Architecture: i386 amd64
Architecture: amd64
Depends: netdata-plugin-ebpf (= ${source:Version})
Conflicts: netdata (< ${source:Version})
Description: Compiled eBPF legacy code for the Netdata eBPF plugin
Expand Down
27 changes: 14 additions & 13 deletions contrib/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ else
SYSTEMD_UNIT = system/systemd/netdata.service
endif

ifeq ($(shell test `uname -m` != "x86_64" && echo "1"), 1)
ifeq ($(shell test ${DEB_TARGET_ARCH} != "amd64" && echo "1"), 1)
HAVE_EBPF = 0
EBPF_CONFIG = --disable-ebpf
else
Expand Down Expand Up @@ -82,14 +82,13 @@ override_dh_install:
$(TOP)-plugin-chartsd/usr/lib/netdata/conf.d/charts.d

# Add ebpf plugin install rules
[ $(HAVE_EBPF) -eq 1 ] && mkdir -p $(TOP)-plugin-ebpf/usr/libexec/netdata/plugins.d/
[ $(HAVE_EBPF) -eq 1 ] && mkdir -p $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/
[ $(HAVE_EBPF) -eq 1 ] && mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/ebpf.plugin \
$(TOP)-plugin-ebpf/usr/libexec/netdata/plugins.d/ebpf.plugin
[ $(HAVE_EBPF) -eq 1 ] && mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/ebpf.d.conf \
$(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/ebpf.d.conf
[ $(HAVE_EBPF) -eq 1 ] && mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/ebpf.d \
$(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/ebpf.d
if [ $(HAVE_EBPF) -eq 1 ]; then \
mkdir -p $(TOP)-plugin-ebpf/usr/libexec/netdata/plugins.d/; \
mkdir -p $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/; \
mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/ebpf.plugin $(TOP)-plugin-ebpf/usr/libexec/netdata/plugins.d/ebpf.plugin; \
mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/ebpf.d.conf $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/ebpf.d.conf; \
mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/ebpf.d $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/ebpf.d; \
fi

# Add python plugin install rules
mkdir -p $(TOP)-plugin-pythond/usr/libexec/netdata/plugins.d/
Expand Down Expand Up @@ -145,8 +144,10 @@ override_dh_install:

# Handle eBPF code
#
[ $(HAVE_EBPF) -eq 1 ] && mkdir -p $(TOP)-plugin-ebpf-code/usr/libexec/netdata/plugins.d/
[ $(HAVE_EBPF) -eq 1 ] && packaging/bundle-ebpf.sh . ${TOP}-plugin-ebpf-code/usr/libexec/netdata/plugins.d/
if [ $(HAVE_EBPF) -eq 1 ]; then \
mkdir -p $(TOP)-ebpf-code-legacy/usr/libexec/netdata/plugins.d/; \
packaging/bundle-ebpf.sh . ${TOP}-ebpf-code-legacy/usr/libexec/netdata/plugins.d/; \
fi

# Install go to it's own package directory
#
Expand Down Expand Up @@ -215,5 +216,5 @@ override_dh_clean:

# Tidy up copied/generated files
#
-[ -r $(CURDIR)/debian/netdata.logrotate ] && rm $(CURDIR)/debian/netdata.logrotate
-[ -r $(CURDIR)/debian/netdata.conffiles ] && rm $(CURDIR)/debian/netdata.conffiles
[ -r $(CURDIR)/debian/netdata.logrotate ] && rm $(CURDIR)/debian/netdata.logrotate ; true
[ -r $(CURDIR)/debian/netdata.conffiles ] && rm $(CURDIR)/debian/netdata.conffiles ; true

0 comments on commit 8a6f699

Please sign in to comment.