Skip to content
Snippets Groups Projects
Commit f81daf3a authored by Jan David Mol's avatar Jan David Mol
Browse files

fix

parent 3f9267b2
No related branches found
No related tags found
No related merge requests found
Pipeline #122013 skipped
...@@ -86,7 +86,7 @@ local_conf_header: ...@@ -86,7 +86,7 @@ local_conf_header:
DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit" DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
VIRTUAL-RUNTIME_init_manager = "systemd" VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = "systemd-compat-units" VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
IMAGE_INSTALL:append = "node-exporter ntp python3-pypcc python3-halibut-ipconfig vcgencmd dtc i2c-tools swupdate swupdate-www libgpiod libgpiod-tools libgpiod-dev kernel-module-i2c-gpio" IMAGE_INSTALL:append = "node-exporter chrony-exporter ntp python3-pypcc python3-halibut-ipconfig vcgencmd dtc i2c-tools swupdate swupdate-www libgpiod libgpiod-tools libgpiod-dev kernel-module-i2c-gpio"
IMAGE_FSTYPES = "tar.bz2 ext4 ext4.gz wic.bz2 wic.bmap" IMAGE_FSTYPES = "tar.bz2 ext4 ext4.gz wic.bz2 wic.bmap"
SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ubifs" SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ubifs"
IMAGE_BOOT_FILES:append = "halibut.dtbo;overlays/halibut.dtbo" IMAGE_BOOT_FILES:append = "halibut.dtbo;overlays/halibut.dtbo"
......
SUMMARY = "Prometheus Exporter for Chrony NTP"
HOMEPAGE = "https://github.com/SuperQ/chrony_exporter"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${S}/${GO_INSTALL}/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
FILESEXTRAPATHS:prepend := "${THISDIR}:"
SRC_URI = " \
git://github.com/SuperQ/chrony_exporter.git;branch=main;protocol=https \
file://files/chrony_exporter.service \
file://files/chrony_exporter.socket \
file://files/chrony_exporter.sysconfig \
"
SRCREV = "f95d00763f6291742e51326402102ffd68d6d5cf"
GO_IMPORT = "github.com/SuperQ/chrony_exporter"
GO_INSTALL = "src/${GO_IMPORT}/"
inherit go go-mod
export GO111MODULE = "on"
export GOPROXY = "https://proxy.golang.org"
FILES:${PN} += "\
${systemd_unitdir}/system/chrony_exporter.service \
${systemd_unitdir}/system/chrony_exporter.socket \
${systemd_unitdir}/system/multi-user.target.wants/chrony_exporter.service \
${systemd_unitdir}/system/sockets.target.wants/chrony_exporter.socket \
${sysconfdir}/sysconfig/chrony_exporter \
"
do_install() {
install -Dm755 bin/linux_arm64/chrony_exporter ${D}${bindir}/chrony_exporter
install -Dm644 ${WORKDIR}/files/chrony_exporter.service ${D}${systemd_unitdir}/system/chrony_exporter.service
install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
ln -sf ../chrony_exporter.service ${D}${systemd_unitdir}/system/multi-user.target.wants/chrony_exporter.service
install -Dm644 ${WORKDIR}/files/chrony_exporter.socket ${D}${systemd_unitdir}/system/chrony_exporter.socket
install -d ${D}${systemd_unitdir}/system/sockets.target.wants
ln -sf ../chrony_exporter.socket ${D}${systemd_unitdir}/system/sockets.target.wants/chrony_exporter.socket
install -Dm644 ${WORKDIR}/files/chrony_exporter.sysconfig ${D}${sysconfdir}/sysconfig/chrony_exporter
}
OPTIONS="--collector.sources"
[Unit]
Description=Chrony Exporter
Requires=chrony_exporter.socket
[Service]
User=node_exporter
EnvironmentFile=/etc/sysconfig/chrony_exporter
ExecStart=/usr/sbin/chrony_exporter --web.systemd-socket $OPTIONS
[Install]
WantedBy=multi-user.target
[Unit]
Description=Chrony Exporter
[Socket]
ListenStream=9123
[Install]
WantedBy=sockets.target
OPTIONS="--collector.sources"
[Unit]
Description=Node Exporter
Requires=node_exporter.socket
[Service]
User=node_exporter
EnvironmentFile=/etc/sysconfig/node_exporter
ExecStart=/usr/sbin/node_exporter --web.systemd-socket $OPTIONS
[Install]
WantedBy=multi-user.target
[Unit]
Description=Node Exporter
[Socket]
ListenStream=9100
[Install]
WantedBy=sockets.target
...@@ -4,9 +4,14 @@ HOMEPAGE = "https://github.com/prometheus/node_exporter" ...@@ -4,9 +4,14 @@ HOMEPAGE = "https://github.com/prometheus/node_exporter"
LICENSE = "Apache-2.0" LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${S}/${GO_INSTALL}/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" LIC_FILES_CHKSUM = "file://${S}/${GO_INSTALL}/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
SRC_URI = "git://github.com/prometheus/node_exporter.git;branch=release-1.8;protocol=https" FILESEXTRAPATHS:prepend := "${THISDIR}:"
SRC_URI = " \
git://github.com/prometheus/node_exporter.git;branch=release-1.8;protocol=https \
file://files/node_exporter.service \
file://files/node_exporter.socket \
file://files/node_exporter.sysconfig \
"
SRCREV = "f1e0e8360aa60b6cb5e5cc1560bed348fc2c1895" SRCREV = "f1e0e8360aa60b6cb5e5cc1560bed348fc2c1895"
PV = "1.8.2"
GO_IMPORT = "github.com/prometheus/node_exporter" GO_IMPORT = "github.com/prometheus/node_exporter"
GO_INSTALL = "src/${GO_IMPORT}/" GO_INSTALL = "src/${GO_IMPORT}/"
...@@ -17,13 +22,23 @@ export GO111MODULE = "on" ...@@ -17,13 +22,23 @@ export GO111MODULE = "on"
export GOPROXY = "https://proxy.golang.org" export GOPROXY = "https://proxy.golang.org"
FILES:${PN} += "\ FILES:${PN} += "\
${systemd_unitdir}/system/*.service \ ${systemd_unitdir}/system/node_exporter.service \
${systemd_unitdir}/system/node_exporter.socket \
${systemd_unitdir}/system/multi-user.target.wants/node_exporter.service \
${systemd_unitdir}/system/sockets.target.wants/node_exporter.socket \
${sysconfdir}/sysconfig/node_exporter \
" "
do_install() { do_install() {
install -Dm755 bin/linux_arm64/node_exporter ${D}${bindir}/node_exporter install -Dm755 bin/linux_arm64/node_exporter ${D}${bindir}/node_exporter
install -Dm644 ${S}/${GO_INSTALL}/examples/systemd/node_exporter.service ${D}${systemd_unitdir}/system/node_exporter.service
install -Dm644 ${WORKDIR}/files/node_exporter.service ${D}${systemd_unitdir}/system/node_exporter.service
install -d ${D}${systemd_unitdir}/system/multi-user.target.wants install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
ln -sf ../node_exporter.service ${D}${systemd_unitdir}/system/multi-user.target.wants/node_exporter.service ln -sf ../node_exporter.service ${D}${systemd_unitdir}/system/multi-user.target.wants/node_exporter.service
install -Dm644 ${WORKDIR}/files/node_exporter.socket ${D}${systemd_unitdir}/system/node_exporter.socket
install -d ${D}${systemd_unitdir}/system/sockets.target.wants
ln -sf ../node_exporter.socket ${D}${systemd_unitdir}/system/sockets.target.wants/node_exporter.socket
install -Dm644 ${WORKDIR}/files/node_exporter.sysconfig ${D}${sysconfdir}/sysconfig/node_exporter
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment