use fkgpiod in Recovery too

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK
2021-04-10 11:11:45 +02:00
parent 0e4fd2b01a
commit b3bde9a4db
9 changed files with 95 additions and 138 deletions

View File

@@ -0,0 +1,5 @@
config BR2_PACKAGE_FKGPIOD
bool "FunKey S GPIO daemon"
default y
help
The FunKey GPIO mapping utility.

View File

@@ -0,0 +1,35 @@
#!/bin/sh
#
# Start/stop FunKey GPIO daemon
#
DAEMON=/usr/local/sbin/fkgpiod
case "$1" in
start)
echo -n "Starting FunKey GPIO daemon: "
${DAEMON} -d /etc/fkgpiod.conf > /dev/null 2>&1
if [ ${?} -eq 0 ]; then
echo "OK"
else
echo "ERROR"
fi
;;
stop)
echo -n "Stopping FunKey GPIO daemon: "
${DAEMON} -k > /dev/null 2>&1
if [ ${?} -eq 0 ]; then
echo "OK"
else
echo "ERROR"
fi
;;
restart)
${0} stop
sleep 1 # Prevent race condition: ensure FunKey GPIO daemon stops before start.
${0} start
;;
*)
echo "Usage: ${0} {start|stop|restart}"
exit 1
esac

View File

@@ -0,0 +1,29 @@
################################################################################
#
# fkgpiod
#
################################################################################
FKGPIOD_VERSION = 16b7a7b
FKGPIOD_SITE_METHOD = git
FKGPIOD_SITE = https://github.com/FunKey-Project/fkgpiod.git
FKGPIOD_SITE_LICENSE = GPL-2.1+
FKGPIOD_SITE_LICENSE_FILES = COPYING
define FKGPIOD_BUILD_CMDS
$(TARGET_MAKE_ENV) CROSS_COMPILE=$(TARGET_CROSS) \
CC="$(TARGET_CC)" \
$(MAKE) -C $(@D) \
CFLAGS="$(TARGET_CFLAGS)" $(FKGPIOD_BUILD_TARGET)
endef
define FKGPIOD_INSTALL_TARGET_CMDS
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/local/sbin
$(INSTALL) -m 0755 $(@D)/fkgpiod $(TARGET_DIR)/usr/local/sbin/fkgpiod
$(INSTALL) -m 0755 $(@D)/termfix $(TARGET_DIR)/usr/local/sbin/termfix
$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc
$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/init.d
$(INSTALL) -m 0755 $(FKGPIOD_PKGDIR)etc/init.d/S11gpio $(TARGET_DIR)/etc/init.d/S11gpio
endef
$(eval $(generic-package))