recipes-bsp: added storage-info as systemd service

BugzID: 75350
Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmueller 2021-11-23 16:57:05 +01:00
parent 96c52172f7
commit 842e337481
3 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,42 @@
SUMMARY = "Storage Information Tool"
SECTION = "base"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://LICENSE;md5=81438338854bd7a09cb97215f36db46b"
SRC_URI = "git://gitlab.com/netmodule/tools/storage-info.git;protocol=ssh;user=git;branch=develop"
SRCREV = "${AUTOREV}"
SRC_URI_append = " \
file://storage-info.conf \
file://storage-info.service \
"
PV = "0.0.1+git${SRCPV}"
DEPENDS_append = " libnmapp"
inherit systemd
S = "${WORKDIR}/git"
B = "${S}/build"
SYSTEMD_SERVICE_${PN} = "storage-info.service"
FILES_${PN} += " \
${bindir}/storage-info \
${systemd_system_unitdir}/storage-info.service \
${sysconfdir}/storage/storage-info.conf \
"
# build variables for the target (rest is default)
EXTRA_OEMAKE_append = " 'BUILD_TARGET=target' 'BUILD_CONFIG=rls' 'SYSROOT=${STAGING_DIR_TARGET}'"
do_install() {
install -d ${D}${bindir}
install -m 755 ${B}/rls/target/${BPN} ${D}${bindir}
install -d ${D}${sysconfdir}/storage
install -m 644 ${WORKDIR}/${BPN}.conf ${D}${sysconfdir}/storage/
install -d ${D}${systemd_system_unitdir}
install -m 644 ${WORKDIR}/${BPN}.service ${D}${systemd_system_unitdir}
}

View File

@ -0,0 +1,6 @@
# Default settings for storage-info
# for details run storage-info --help
INTERVAL="-i 3600000"
TARGET_FILE="-f /run/storage/storage0.config"
LOGGER_CONFIG="--loglevel=6,evtloop.5,info-collector.6,info-writer.6"

View File

@ -0,0 +1,11 @@
[Unit]
Description=Storage Information daemon
[Service]
Type=forking
EnvironmentFile=-/etc/default/storage-info.conf
ExecStart=/usr/bin/storage-info $INTERVAL $TARGET_FILE -d -p /run/storage-info.pid $LOGGER_CONFIG
PIDFile=/run/storage-info.pid
[Install]
WantedBy=multi-user.target