@cryptotaxi247 / netdata-1 / commits / 8a6f6999f

Fix handling of eBPF plugin for DEB packages. (#15117)

Austin S. Hemmelgarn committed May 30, 2023 at 14:47 UTC 8a6f6999fe991196357f66a9edde10c6d746e084
2 files changed +16 -15
contrib/debian/control
+2 -2
@@ -99,7 +99,7 @@ Description: The charts.d metrics collection plugin for the Netdata Agent
99 LibreSWAN, OpenSIPS, and Wireless access point statistics.
100
101 Package: netdata-plugin-ebpf
102 -Architecture: any
102 +Architecture: amd64
103 Depends: ${shlibs:Depends},
104 netdata (>= ${source:Version})
105 Recommends: netdata-ebpf-code-legacy (>= ${source:Version}),
@@ -110,7 +110,7 @@ Description: The eBPF metrics collection plugin for the Netdata Agent
110 detailed kernel-level metrics for the system.
111
112 Package: netdata-ebpf-code-legacy
113 -Architecture: i386 amd64
113 +Architecture: amd64
114 Depends: netdata-plugin-ebpf (= ${source:Version})
115 Conflicts: netdata (< ${source:Version})
116 Description: Compiled eBPF legacy code for the Netdata eBPF plugin
contrib/debian/rules
+14 -13
@@ -15,7 +15,7 @@ else
15 SYSTEMD_UNIT = system/systemd/netdata.service
16 endif
17
18 -ifeq ($(shell test `uname -m` != "x86_64" && echo "1"), 1)
18 +ifeq ($(shell test ${DEB_TARGET_ARCH} != "amd64" && echo "1"), 1)
19 HAVE_EBPF = 0
20 EBPF_CONFIG = --disable-ebpf
21 else
@@ -82,14 +82,13 @@ override_dh_install:
82 $(TOP)-plugin-chartsd/usr/lib/netdata/conf.d/charts.d
83
84 # Add ebpf plugin install rules
85 - [ $(HAVE_EBPF) -eq 1 ] && mkdir -p $(TOP)-plugin-ebpf/usr/libexec/netdata/plugins.d/
86 - [ $(HAVE_EBPF) -eq 1 ] && mkdir -p $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/
87 - [ $(HAVE_EBPF) -eq 1 ] && mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/ebpf.plugin \
88 - $(TOP)-plugin-ebpf/usr/libexec/netdata/plugins.d/ebpf.plugin
89 - [ $(HAVE_EBPF) -eq 1 ] && mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/ebpf.d.conf \
90 - $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/ebpf.d.conf
91 - [ $(HAVE_EBPF) -eq 1 ] && mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/ebpf.d \
92 - $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/ebpf.d
85 + if [ $(HAVE_EBPF) -eq 1 ]; then \
86 + mkdir -p $(TOP)-plugin-ebpf/usr/libexec/netdata/plugins.d/; \
87 + mkdir -p $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/; \
88 + mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/ebpf.plugin $(TOP)-plugin-ebpf/usr/libexec/netdata/plugins.d/ebpf.plugin; \
89 + mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/ebpf.d.conf $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/ebpf.d.conf; \
90 + mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/ebpf.d $(TOP)-plugin-ebpf/usr/lib/netdata/conf.d/ebpf.d; \
91 + fi
92
93 # Add python plugin install rules
94 mkdir -p $(TOP)-plugin-pythond/usr/libexec/netdata/plugins.d/
@@ -145,8 +144,10 @@ override_dh_install:
144
145 # Handle eBPF code
146 #
148 - [ $(HAVE_EBPF) -eq 1 ] && mkdir -p $(TOP)-plugin-ebpf-code/usr/libexec/netdata/plugins.d/
149 - [ $(HAVE_EBPF) -eq 1 ] && packaging/bundle-ebpf.sh . ${TOP}-plugin-ebpf-code/usr/libexec/netdata/plugins.d/
147 + if [ $(HAVE_EBPF) -eq 1 ]; then \
148 + mkdir -p $(TOP)-ebpf-code-legacy/usr/libexec/netdata/plugins.d/; \
149 + packaging/bundle-ebpf.sh . ${TOP}-ebpf-code-legacy/usr/libexec/netdata/plugins.d/; \
150 + fi
151
152 # Install go to it's own package directory
153 #
@@ -215,5 +216,5 @@ override_dh_clean:
216
217 # Tidy up copied/generated files
218 #
218 - -[ -r $(CURDIR)/debian/netdata.logrotate ] && rm $(CURDIR)/debian/netdata.logrotate
219 - -[ -r $(CURDIR)/debian/netdata.conffiles ] && rm $(CURDIR)/debian/netdata.conffiles
219 + [ -r $(CURDIR)/debian/netdata.logrotate ] && rm $(CURDIR)/debian/netdata.logrotate ; true
220 + [ -r $(CURDIR)/debian/netdata.conffiles ] && rm $(CURDIR)/debian/netdata.conffiles ; true