All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/pkg-golang.mk: set GOPROXY to proxy.golang.org
@ 2022-01-09 15:00 Romain Naour
  2022-01-09 15:00 ` [Buildroot] [PATCH 2/2] package/telegraf: new package Romain Naour
  0 siblings, 1 reply; 2+ messages in thread
From: Romain Naour @ 2022-01-09 15:00 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Thomas Petazzoni

While packaging telegraf [1] the download step failed due to a checksum
mismatch:

    go: downloading collectd.org v0.5.0
    get "collectd.org": found meta tag vcs.metaImport{Prefix:"collectd.org", VCS:"git", RepoRoot:"https://github.com/collectd/go-collectd"} at //collectd.org/?go-get=1
    verifying collectd.org@v0.5.0: checksum mismatch
        downloaded: h1:mRTLdljvxJNXPMMO9RSxf0PANDAqu/Tz+I6Dt6OjB28=
        go.sum:     h1:y4uFSAuOmeVhG3GCRa3/oH+ysePfO/+eGJNfd0Qa3d8=

    SECURITY ERROR
    This download does NOT match an earlier download recorded in go.sum.
    The bits may have been replaced on the origin server, or an attacker may
    have intercepted the download attempt.

    For more information, see 'go help module-auth'.

go-collectd was bumped in telegraf since several releases (since v1.19.0) without
any changes regarding the go-collectd hash.

Some users reported an issue [3] when using "GOPROXY=direct" and used
"GOPROXY=proxy.golang.org" as a workaround.

[1] https://github.com/influxdata/telegraf/
[2] https://github.com/influxdata/telegraf/commit/d4b051edc247a13d7fbdaa49d95fe6e93505d14e
[3] https://github.com/google/flatbuffers/issues/6466#issuecomment-781954742

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/pkg-golang.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk
index 35bcb1673b..e23778d96a 100644
--- a/package/pkg-golang.mk
+++ b/package/pkg-golang.mk
@@ -85,7 +85,7 @@ $(2)_POST_PATCH_HOOKS += $(2)_GEN_GOMOD
 $(2)_DOWNLOAD_POST_PROCESS = go
 $(2)_DL_ENV = \
 	$(HOST_GO_COMMON_ENV) \
-	GOPROXY=direct \
+	GOPROXY=proxy.golang.org \
 	BR_GOMOD=$$($(2)_GOMOD)
 
 # Due to vendoring, it is pretty likely that not all licenses are
-- 
2.31.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH 2/2] package/telegraf: new package
  2022-01-09 15:00 [Buildroot] [PATCH 1/2] package/pkg-golang.mk: set GOPROXY to proxy.golang.org Romain Naour
@ 2022-01-09 15:00 ` Romain Naour
  0 siblings, 0 replies; 2+ messages in thread
From: Romain Naour @ 2022-01-09 15:00 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour

Install the telegraf default configuration and the systemd service files
provided by the project [1].

[1] https://github.com/influxdata/telegraf/blob/v1.21.2/scripts/deb/post-install.sh

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
Telegraf also provide an SysVinit script but I didn't tested it.
---
 DEVELOPERS                     |  1 +
 package/Config.in              |  1 +
 package/telegraf/Config.in     | 19 +++++++++++++++++++
 package/telegraf/telegraf.hash |  3 +++
 package/telegraf/telegraf.mk   | 32 ++++++++++++++++++++++++++++++++
 5 files changed, 56 insertions(+)
 create mode 100644 package/telegraf/Config.in
 create mode 100644 package/telegraf/telegraf.hash
 create mode 100644 package/telegraf/telegraf.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index ed65c74319..ab4d5ba446 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2462,6 +2462,7 @@ F:	package/solarus/
 F:	package/stress-ng/
 F:	package/supertux/
 F:	package/supertuxkart/
+F:	package/telegraf/
 F:	package/terminology/
 F:	package/tk/
 F:	package/upower/
diff --git a/package/Config.in b/package/Config.in
index 2d3ca6a3b6..d77c843465 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2595,6 +2595,7 @@ menu "System tools"
 	source "package/systemd-bootchart/Config.in"
 	source "package/sysvinit/Config.in"
 	source "package/tar/Config.in"
+	source "package/telegraf/Config.in"
 	source "package/thermald/Config.in"
 	source "package/tpm-tools/Config.in"
 	source "package/tpm2-abrmd/Config.in"
diff --git a/package/telegraf/Config.in b/package/telegraf/Config.in
new file mode 100644
index 0000000000..c95145f386
--- /dev/null
+++ b/package/telegraf/Config.in
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_TELEGRAF
+	bool "telegraf"
+	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU # logrotate
+	depends on BR2_USE_WCHAR # logrotate
+	select BR2_PACKAGE_LOGROTATE # runtime
+	help
+	  Telegraf is the open source server agent to help you
+	  collect metrics from your stacks, sensors and systems.
+
+	  https://www.influxdata.com/time-series-platform/telegraf
+
+comment "telegraf needs a toolchain w/ wchar, threads"
+	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
+	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU
diff --git a/package/telegraf/telegraf.hash b/package/telegraf/telegraf.hash
new file mode 100644
index 0000000000..0547621ea4
--- /dev/null
+++ b/package/telegraf/telegraf.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256  bdd33f9248872dca282f8649713dedf7fc0eafd8876664031fb37a0350059ab6  v1.21.2.tar.gz
+sha256  29d6b3c9c5671e8375a42bf4c5d4e85e05efd314ef363a56bb1728621e9cad5a  LICENSE
diff --git a/package/telegraf/telegraf.mk b/package/telegraf/telegraf.mk
new file mode 100644
index 0000000000..42b19a11e9
--- /dev/null
+++ b/package/telegraf/telegraf.mk
@@ -0,0 +1,32 @@
+################################################################################
+#
+# telegraf
+#
+################################################################################
+
+TELEGRAF_VERSION = 1.21.2
+TELEGRAF_SITE = https://github.com/influxdata/telegraf/archive
+TELEGRAF_SOURCE = v$(TELEGRAF_VERSION).tar.gz
+TELEGRAF_LICENSE = MIT
+TELEGRAF_LICENSE_FILES = LICENSE
+
+TELEGRAF_LDFLAGS = -X main.version=$(TELEGRAF_VERSION)
+TELEGRAF_BUILD_TARGETS = cmd/telegraf
+
+define TELEGRAF_INSTALL_TARGET_FIXUP
+	mkdir -p $(TARGET_DIR)/etc/telegraf/telegraf.d
+	$(INSTALL) -D -m 644 $(@D)/etc/telegraf.conf $(TARGET_DIR)/etc/telegraf.conf
+	mkdir -p $(TARGET_DIR)/etc/logrotate.d
+	$(INSTALL) -D -m 644 $(@D)/etc/logrotate.d/telegraf $(TARGET_DIR)/etc/logrotate.d/telegraf
+	mkdir -p $(TARGET_DIR)/etc/default
+	touch $(TARGET_DIR)/etc/default/telegraf
+endef
+
+TELEGRAF_POST_INSTALL_TARGET_HOOKS += TELEGRAF_INSTALL_TARGET_FIXUP
+
+define TELEGRAF_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 644 $(@D)/scripts/telegraf.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/telegraf.service
+endef
+
+$(eval $(golang-package))
-- 
2.31.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-09 15:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-09 15:00 [Buildroot] [PATCH 1/2] package/pkg-golang.mk: set GOPROXY to proxy.golang.org Romain Naour
2022-01-09 15:00 ` [Buildroot] [PATCH 2/2] package/telegraf: new package Romain Naour

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.