-
Notifications
You must be signed in to change notification settings - Fork 17
Add support for armv7l #404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,19 +47,31 @@ endif | |
| ifeq ($(GOARCH),aarch64) | ||
| export GOARCH := arm64 | ||
| endif | ||
| ifeq ($(GOARCH),armv7l) | ||
| export GOARCH := arm | ||
| export GOARM := 7 | ||
| endif | ||
|
|
||
| DEB_ARCH:=$(GOARCH) | ||
| ifeq ($(DEB_ARCH),386) | ||
| DEB_ARCH := i386 | ||
| endif | ||
| ifeq ($(DEB_ARCH),arm) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. simply check for armv7l here, then you don't have to copy multiple variables back and forth. |
||
| DEB_ARCH := armhf | ||
| endif | ||
| DEBFILE ?= snclient-$(VERSION)-$(RPM_ARCH).deb | ||
|
|
||
| GITBASE=github.com/consol-monitoring/snclient | ||
| BUILD_FLAGS=-ldflags "-s -w -X $(GITBASE)/pkg/snclient.Build=$(BUILD) -X $(GITBASE)/pkg/snclient.Revision=$(REVISION)" | ||
| TEST_FLAGS=-timeout=5m $(BUILD_FLAGS) | ||
|
|
||
| NODE_EXPORTER_ARCH:=$(GOARCH) | ||
| ifeq ($(NODE_EXPORTER_ARCH),arm) | ||
| NODE_EXPORTER_ARCH := armv7 | ||
| endif | ||
|
|
||
| NODE_EXPORTER_VERSION=1.11.1 | ||
| NODE_EXPORTER_FILE=node_exporter-$(NODE_EXPORTER_VERSION).$(GOOS)-$(GOARCH).tar.gz | ||
| NODE_EXPORTER_FILE=node_exporter-$(NODE_EXPORTER_VERSION).$(GOOS)-$(NODE_EXPORTER_ARCH).tar.gz | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all this changes are not required. |
||
| NODE_EXPORTER_URL=https://github.com/prometheus/node_exporter/releases/download/v$(NODE_EXPORTER_VERSION) | ||
|
|
||
| # last i386 exe is the 0.24.0 | ||
|
|
@@ -472,8 +484,8 @@ deb: | dist | |
| test -f $(NODE_EXPORTER_FILE) || curl -s -L -O $(NODE_EXPORTER_URL)/$(NODE_EXPORTER_FILE) | ||
| shasum --ignore-missing -c packaging/sha256sums.txt | ||
| tar zxvf $(NODE_EXPORTER_FILE) | ||
| mv node_exporter-$(NODE_EXPORTER_VERSION).linux-$(GOARCH)/node_exporter build-deb/usr/lib/snclient/node_exporter | ||
| rm -rf node_exporter-$(NODE_EXPORTER_VERSION).linux-$(GOARCH) | ||
| mv node_exporter-$(NODE_EXPORTER_VERSION).linux-$(NODE_EXPORTER_ARCH)/node_exporter build-deb/usr/lib/snclient/node_exporter | ||
| rm -rf node_exporter-$(NODE_EXPORTER_VERSION).linux-$(NODE_EXPORTER_ARCH) | ||
|
|
||
| rm -rf ./build-deb/DEBIAN | ||
| cp -r ./packaging/debian ./build-deb/DEBIAN | ||
|
|
@@ -523,8 +535,8 @@ rpm: | dist | |
| test -f $(NODE_EXPORTER_FILE) || curl -s -L -O $(NODE_EXPORTER_URL)/$(NODE_EXPORTER_FILE) | ||
| shasum --ignore-missing -c packaging/sha256sums.txt | ||
| tar zxvf $(NODE_EXPORTER_FILE) | ||
| mv node_exporter-$(NODE_EXPORTER_VERSION).linux-$(GOARCH)/node_exporter snclient-$(VERSION)/node_exporter | ||
| rm -rf node_exporter-$(NODE_EXPORTER_VERSION).linux-$(GOARCH) | ||
| mv node_exporter-$(NODE_EXPORTER_VERSION).linux-$(NODE_EXPORTER_ARCH)/node_exporter snclient-$(VERSION)/node_exporter | ||
| rm -rf node_exporter-$(NODE_EXPORTER_VERSION).linux-$(NODE_EXPORTER_ARCH) | ||
|
|
||
| chmod 755 \ | ||
| snclient-$(VERSION)/snclient \ | ||
|
|
@@ -560,8 +572,8 @@ apk: | dist | |
|
|
||
| test -f $(NODE_EXPORTER_FILE) || curl -s -L -O $(NODE_EXPORTER_URL)/$(NODE_EXPORTER_FILE) | ||
| tar zxvf $(NODE_EXPORTER_FILE) | ||
| mv node_exporter-$(NODE_EXPORTER_VERSION).linux-$(GOARCH)/node_exporter snclient-$(VERSION)/node_exporter | ||
| rm -rf node_exporter-$(NODE_EXPORTER_VERSION).linux-$(GOARCH) | ||
| mv node_exporter-$(NODE_EXPORTER_VERSION).linux-$(NODE_EXPORTER_ARCH)/node_exporter snclient-$(VERSION)/node_exporter | ||
| rm -rf node_exporter-$(NODE_EXPORTER_VERSION).linux-$(NODE_EXPORTER_ARCH) | ||
|
|
||
| chmod 755 \ | ||
| snclient-$(VERSION)/snclient \ | ||
|
|
@@ -589,9 +601,9 @@ osx: | dist | |
| test -f $(NODE_EXPORTER_FILE) || curl -s -L -O $(NODE_EXPORTER_URL)/$(NODE_EXPORTER_FILE) | ||
| shasum --ignore-missing -c packaging/sha256sums.txt | ||
| tar zxvf $(NODE_EXPORTER_FILE) | ||
| mv node_exporter-$(NODE_EXPORTER_VERSION).darwin-$(GOARCH)/node_exporter build-pkg/usr/local/bin/node_exporter | ||
| mv node_exporter-$(NODE_EXPORTER_VERSION).darwin-$(NODE_EXPORTER_ARCH)/node_exporter build-pkg/usr/local/bin/node_exporter | ||
| chmod 755 build-pkg/usr/local/bin/node_exporter | ||
| rm -rf node_exporter-$(NODE_EXPORTER_VERSION).darwin-$(GOARCH) | ||
| rm -rf node_exporter-$(NODE_EXPORTER_VERSION).darwin-$(NODE_EXPORTER_ARCH) | ||
|
|
||
| cp packaging/osx/com.snclient.snclient.plist build-pkg/Library/LaunchDaemons/ | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ e987428618362c2d2540a68b722bd982ef1486c9961631298f20ea8fd57d3be4 node_exporter- | |
| 4df4ec0dca5bc061c59181cfedcd8887cb5df9c710db3c4038bc51923414bc5d node_exporter-1.11.1.linux-386.tar.gz | ||
| 9f5ea48e5bc7b656f8a91a32e7d7deb89f70f73dabd0d974418aca15f37d6810 node_exporter-1.11.1.linux-amd64.tar.gz | ||
| ba1886efbd76cb96b0087c695ea8d1b9cb6e8aa946c996d744e9ee16c8e3591a node_exporter-1.11.1.linux-arm64.tar.gz | ||
| 661c662e566d5c68950d63f7dfd1ec46ba28858f91aeba220c32baa1d3ad7b33 node_exporter-1.11.1.linux-armv7.tar.gz | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. have you changed this file manually? Because it is auto-generated by |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first you set GOARCH to arm and because of that, you need to set it back later by NODE_EXPORTER_ARCH. This doesn't make sense to me. Why not keep GOARCH as it is.
The only variable different from GOARCH is DEB_ARCH.