From 599e6b692da7f275c23e6d66a5c56f9dd43cbd20 Mon Sep 17 00:00:00 2001 From: finga Date: Sun, 24 Apr 2022 18:14:26 +0200 Subject: [PATCH] Extend `Cargo.toml` and `Readme.md` --- Cargo.toml | 4 +++- README.md | 45 ++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ad3d347..4e20e6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,10 @@ [package] name = "mightyohm-gc-exporter" version = "0.1.0-dev" +authors = ["finga "] edition = "2021" -description = "Prometheus exporter for the MightyOhm Geiger Counter" +description = "Prometheus exporter for the MightyOhm Geiger Counter." +readme = "README.md" license = "GPL-3.0-or-later" repository = "https://git.onders.org/finga/mightyohm-gc-exporter" keywords = ["prometheus", "metrics"] diff --git a/README.md b/README.md index 35264c1..90857ec 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,53 @@ A Prometheus exporter for the [MightyOhm Geiger Counter](https://mightyohm.com/blog/products/geiger-counter/). ## Build +Cargo, the Rust package manager, is used to build this project. + ### Same architecture as system -To compile it for the same architecture as the build system: +Compile it for the same architecture as the build system: ```sh cargo build --release ``` -### Cross-compile for aarch64 (recent RaspberryPi) -To cross-compile it for RaspberryPi: +### Cross-compile for amd64 (recent RaspberryPi) +Cross-compile it for the amd64 architecture: ```sh PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo build --target aarch64-unknown-linux-gnu --release ``` + +## Debian +To build a package for Debian, Raspbian, and so on, +[`cargo-deb`](https://crates.io/crates/cargo-deb) can be used. + +The package comes with an automatically started and enabled systemd +service unit which can be configured via +`/etc/default/mightyohm-gc-exporter`. + +### Same architecture as system +Build a `deb` package for the same architecture as the build system: +```sh +cargo deb +``` + +### Cross-compile for amd64 (recent RaspberryPi) +Build a `deb` package for the amd64 architecture: +```sh +PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo deb --target aarch64-unknown-linux-gnu +``` + +## Usage +``` +USAGE: + mightyohm-gc-exporter [OPTIONS] + +OPTIONS: + -a, --address
The IPv4 or IPv6 address where the metrics are served + [default: 127.0.0.1] + -b, --baud-rate The baudrate of the serial connection [default: 9600] + -h, --help Print help information + -p, --port The port where the metrics are served [default: 9111] + -s, --serial-port The port of the serial device, usually in '/dev/...' + [default: /dev/serial0] + -t, --timeout Timeout of the serial connection in ms [default: 1000] + -V, --version Print version information +```