diff --git a/recipes-bsp/storage-info/storage-info.bb b/recipes-bsp/storage-info/storage-info.bb new file mode 100644 index 0000000..5484225 --- /dev/null +++ b/recipes-bsp/storage-info/storage-info.bb @@ -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} +} + diff --git a/recipes-bsp/storage-info/storage-info/storage-info.conf b/recipes-bsp/storage-info/storage-info/storage-info.conf new file mode 100644 index 0000000..3318b05 --- /dev/null +++ b/recipes-bsp/storage-info/storage-info/storage-info.conf @@ -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" diff --git a/recipes-bsp/storage-info/storage-info/storage-info.service b/recipes-bsp/storage-info/storage-info/storage-info.service new file mode 100644 index 0000000..803eaab --- /dev/null +++ b/recipes-bsp/storage-info/storage-info/storage-info.service @@ -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