Skip to content

Commit

Permalink
Rename to jetson-exporter as package and jetson_exporter in go
Browse files Browse the repository at this point in the history
  • Loading branch information
GDWR committed Feb 3, 2024
1 parent 8b0e4ce commit 565047a
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.PHONY: clean
dist/jetsonexporter_0.0.1_arm64.deb:
mkdir -p dist/jetsonexporter/DEBIAN
mkdir -p dist/jetsonexporter/usr/bin
mkdir -p dist/jetsonexporter/lib/systemd/system
dist/jetson-exporter_0.0.1_arm64.deb:
mkdir -p dist/jetson-exporter/DEBIAN
mkdir -p dist/jetson-exporter/usr/bin
mkdir -p dist/jetson-exporter/lib/systemd/system

cp deploy/debian/* dist/jetsonexporter/DEBIAN/
cp deploy/jetsonexporter.service dist/jetsonexporter/lib/systemd/system
GOARCH=arm64 go build -o dist/jetsonexporter/usr/bin/jetsonexporter cmd/jetsonexporter.go
cp deploy/debian/* dist/jetson-exporter/DEBIAN/
cp deploy/jetson-exporter.service dist/jetson-exporter/lib/systemd/system
GOARCH=arm64 go build -o dist/jetson-exporter/usr/bin/jetson-exporter cmd/jetson_exporter.go

dpkg-deb --build dist/jetsonexporter dist/jetsonexporter_0.0.1_arm64.deb
dpkg-deb --build dist/jetson-exporter dist/jetson-exporter.0.1_arm64.deb

clean:
rm -rf dist
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ Supported devices:

```shell
# Download the latest release
wget https://github.com/GDWR/jetson-exporter/releases/download/v0.0.1/jetsonexporter_0.0.1_arm64.deb
wget https://github.com/GDWR/jetson-exporter/releases/download/v0.0.1/jetson-exporter_0.0.1_arm64.deb
# Install the package
sudo dpkg -i jetsonexporter_0.0.1_arm64.deb
sudo dpkg -i jetson-exporter_0.0.1_arm64.deb
# Clean up
rm jetsonexporter_0.0.1_arm64.deb
rm jetson-exporter_0.0.1_arm64.deb
```


Expand Down
2 changes: 1 addition & 1 deletion cmd/jetsonexporter.go → cmd/jetson_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/promlog"
"jetsonexporter/pkg/tegrastats"
"jetson_exporter/pkg/tegrastats"
"net/http"
"os"
"os/exec"
Expand Down
2 changes: 1 addition & 1 deletion deploy/debian/control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: jetsonexporter
Package: jetson-exporter
Priority: optional
Maintainer: GDWR <[email protected]>
Version: 0.1.0
Expand Down
10 changes: 5 additions & 5 deletions deploy/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ set -e
# Automatically added by dh_installsystemd/13.2
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask 'jetsonexporter.service' >/dev/null || true
deb-systemd-helper unmask 'jetson-exporter.service' >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled 'jetsonexporter.service'; then
if deb-systemd-helper --quiet was-enabled 'jetson-exporter.service'; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable 'jetsonexporter.service' >/dev/null || true
deb-systemd-helper enable 'jetson-exporter.service' >/dev/null || true
else
# Update the statefile to add new symlinks (if any), which need to be
# cleaned up on purge. Also remove old symlinks.
deb-systemd-helper update-state 'jetsonexporter.service' >/dev/null || true
deb-systemd-helper update-state 'jetson-exporter.service' >/dev/null || true
fi
fi
# End automatically added section
Expand All @@ -26,7 +26,7 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-decon
else
_dh_action=start
fi
deb-systemd-invoke $_dh_action 'jetsonexporter.service' >/dev/null || true
deb-systemd-invoke $_dh_action 'jetson-exporter.service' >/dev/null || true
fi
fi
# End automatically added section
6 changes: 3 additions & 3 deletions deploy/debian/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ fi
# Automatically added by dh_installsystemd/13.2
if [ "$1" = "remove" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper mask 'jetsonexporter.service' >/dev/null || true
deb-systemd-helper mask 'jetson-exporter.service' >/dev/null || true
fi
fi

if [ "$1" = "purge" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper purge 'jetsonexporter.service' >/dev/null || true
deb-systemd-helper unmask 'jetsonexporter.service' >/dev/null || true
deb-systemd-helper purge 'jetson-exporter.service' >/dev/null || true
deb-systemd-helper unmask 'jetson-exporter.service' >/dev/null || true
fi
fi
# End automatically added section
2 changes: 1 addition & 1 deletion deploy/debian/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
set -e
# Automatically added by dh_installsystemd/13.2
if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
deb-systemd-invoke stop 'jetsonexporter.service' >/dev/null || true
deb-systemd-invoke stop 'jetson-exporter.service' >/dev/null || true
fi
# End automatically added section
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Description=A prometheus exporter for the Nvidia Jetson family

[Service]
ExecStart=/usr/bin/env jetsonexporter
ExecStart=/usr/bin/env jetson-exporter
Restart=always

[Install]
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module jetsonexporter
module jetson_exporter

go 1.21

Expand Down

0 comments on commit 565047a

Please sign in to comment.