From 27b0d3bd11ba6829d686f290596a79bd798ba3ee Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 10 Jun 2021 10:11:25 +0200 Subject: [PATCH 1/2] lcd4linux: Possibility added that the config can also be loaded from /tmp Until now, the configuration must be stored under '/etc/lcd4linux.conf'. So that the configuration can also be changed dynamically, it makes sense to store this under /tmp and load them from this directory. The init script first checks whether there is a configuration under '/etc/lcd4linux.conf' and only then does it try to find it under '/tmp/lcd4linux.conf'. If there is no configuration, an error message is shown. Signed-off-by: Florian Eckert --- utils/lcd4linux/Makefile | 2 +- utils/lcd4linux/files/lcd4linux.init | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/utils/lcd4linux/Makefile b/utils/lcd4linux/Makefile index 20eac0748..4f42576da 100644 --- a/utils/lcd4linux/Makefile +++ b/utils/lcd4linux/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lcd4linux -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/feckert/lcd4linux diff --git a/utils/lcd4linux/files/lcd4linux.init b/utils/lcd4linux/files/lcd4linux.init index a5e6a9db4..3c743b047 100644 --- a/utils/lcd4linux/files/lcd4linux.init +++ b/utils/lcd4linux/files/lcd4linux.init @@ -5,10 +5,19 @@ START=98 USE_PROCD=1 PROG="/usr/bin/lcd4linux" -CONFIGFILE="/etc/lcd4linux.conf" +STATIC_CONFIG="/etc/lcd4linux.conf" +DYNAMIC_CONFIG="/tmp/lcd4linux.conf" start_service() { - [ -f /etc/lcd4linux.conf ] || return 1 + if [ -f "$DYNAMIC_CONFIG" ]; then + CONFIGFILE="$DYNAMIC_CONFIG" + elif [ -f "$STATIC_CONFIG" ]; then + CONFIGFILE="$STATIC_CONFIG" + else + echo "No config found" + return 1 + fi + procd_open_instance procd_set_param command "$PROG" procd_append_param command -F From 66ca1ebd26b476e66fbf9e73a5f11910f61f2f30 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 29 Sep 2022 16:19:53 +0200 Subject: [PATCH 2/2] lcd4linux: add debug option Setting the DEBUG variable in the init script to '1' enables the lcd4linux verbose mode, by setting the arg '-vv'. The option also redirects the error and stdout to the syslog. Signed-off-by: Florian Eckert --- utils/lcd4linux/files/lcd4linux.init | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/lcd4linux/files/lcd4linux.init b/utils/lcd4linux/files/lcd4linux.init index 3c743b047..3884b041a 100644 --- a/utils/lcd4linux/files/lcd4linux.init +++ b/utils/lcd4linux/files/lcd4linux.init @@ -4,6 +4,7 @@ START=98 USE_PROCD=1 +DEBUG=1 PROG="/usr/bin/lcd4linux" STATIC_CONFIG="/etc/lcd4linux.conf" DYNAMIC_CONFIG="/tmp/lcd4linux.conf" @@ -24,6 +25,11 @@ start_service() { procd_append_param command -q procd_append_param command -o /tmp/lcd4linux.png procd_append_param command -f "$CONFIGFILE" + [ "$DEBUG" = 1 ] && { + procd_append_param command -vv + procd_set_param stdout 1 + procd_set_param stderr 1 + } procd_set_param file "$CONFIGFILE" procd_close_instance }