aboutsummaryrefslogtreecommitdiff
path: root/package/rpi-userland
diff options
context:
space:
mode:
authorGravatar Benoît Thébaudeau <benoit.thebaudeau@advansee.com>2014-08-07 17:24:28 +0200
committerGravatar Peter Korsgaard <peter@korsgaard.com>2014-09-28 21:22:41 +0200
commit997c17a84c04cc4a63b15ff062d1ce8e5106cab4 (patch)
treebdfac434eb1c5fd8ba2da31f06768afbd9e05b33 /package/rpi-userland
parent47544e43a5e36f6c4ee1acb06315ab974cde78b4 (diff)
downloadbuildroot-997c17a84c04cc4a63b15ff062d1ce8e5106cab4.tar.gz
buildroot-997c17a84c04cc4a63b15ff062d1ce8e5106cab4.tar.bz2
rpi-userland: Fix vcfiled startup
The VideoCore file server daemon startup script installed from this package is not compatible with BuildRoot (because of its naming and other Debian dependencies), which prevented vcfiled from starting. Hence, prevent this package from installing its vcfiled startup script, and add a configuration option to install a vcfiled SysV init script suitable for BuildRoot. [Peter: tweak help text as suggested by Yann] Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/rpi-userland')
-rw-r--r--package/rpi-userland/Config.in7
-rwxr-xr-xpackage/rpi-userland/S94vcfiled47
-rw-r--r--package/rpi-userland/rpi-userland.mk13
3 files changed, 66 insertions, 1 deletions
diff --git a/package/rpi-userland/Config.in b/package/rpi-userland/Config.in
index aeee5e11bf..e629bb6ecb 100644
--- a/package/rpi-userland/Config.in
+++ b/package/rpi-userland/Config.in
@@ -31,6 +31,13 @@ config BR2_PACKAGE_PROVIDES_LIBOPENVG
config BR2_PACKAGE_PROVIDES_LIBOPENMAX
default "rpi-userland"
+config BR2_PACKAGE_RPI_USERLAND_START_VCFILED
+ bool "Start vcfiled"
+ depends on BR2_INIT_SYSV || BR2_INIT_BUSYBOX
+ help
+ vcfiled is a daemon serving files to VideoCore from the host file
+ system.
+
endif
comment "rpi-userland needs a toolchain w/ C++, largefile, threads"
diff --git a/package/rpi-userland/S94vcfiled b/package/rpi-userland/S94vcfiled
new file mode 100755
index 0000000000..9a3e523d3b
--- /dev/null
+++ b/package/rpi-userland/S94vcfiled
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+NAME=vcfiled
+DESC="VideoCore file server daemon $NAME"
+DAEMON="/usr/sbin/$NAME"
+DAEMON_ARGS=""
+CFGFILE="/etc/default/$NAME"
+PIDFILE="/var/run/$NAME.pid"
+
+# Read configuration variable file if it is present
+[ -r "$CFGFILE" ] && . "$CFGFILE"
+
+do_start()
+{
+ echo -n "Starting $DESC: "
+ start-stop-daemon -S -q -p "$PIDFILE" -x "$DAEMON" -- $DAEMON_ARGS &&
+ echo "done" || echo "failed"
+}
+
+do_stop()
+{
+ echo -n "Stopping $DESC: "
+ if start-stop-daemon -K -q -R TERM/30/KILL/5 -p "$PIDFILE" -n "$NAME"; then
+ # This daemon does not remove its PID file when it exits.
+ rm -f "$PIDFILE"
+ echo "done"
+ else
+ echo "failed"
+ fi
+}
+
+case "$1" in
+ start)
+ do_start
+ ;;
+ stop)
+ do_stop
+ ;;
+ restart|reload)
+ do_stop
+ do_start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload}" >&2
+ exit 1
+ ;;
+esac
diff --git a/package/rpi-userland/rpi-userland.mk b/package/rpi-userland/rpi-userland.mk
index 81ed95c6b9..74a0056f9f 100644
--- a/package/rpi-userland/rpi-userland.mk
+++ b/package/rpi-userland/rpi-userland.mk
@@ -9,11 +9,22 @@ RPI_USERLAND_SITE = $(call github,raspberrypi,userland,$(RPI_USERLAND_VERSION))
RPI_USERLAND_LICENSE = BSD-3c
RPI_USERLAND_LICENSE_FILES = LICENCE
RPI_USERLAND_INSTALL_STAGING = YES
-RPI_USERLAND_CONF_OPT = -DVMCS_INSTALL_PREFIX=/usr
+RPI_USERLAND_CONF_OPT = -DVMCS_INSTALL_PREFIX=/usr \
+ -DCMAKE_C_FLAGS="-DVCFILED_LOCKFILE=\\\"/var/run/vcfiled.pid\\\""
RPI_USERLAND_PROVIDES = libegl libgles libopenmax libopenvg
+ifeq ($(BR2_PACKAGE_RPI_USERLAND_START_VCFILED),y)
+define RPI_USERLAND_INSTALL_INIT_SYSV
+ $(INSTALL) -m 0755 -D package/rpi-userland/S94vcfiled \
+ $(TARGET_DIR)/etc/init.d/S94vcfiled
+endef
+endif
+
define RPI_USERLAND_POST_TARGET_CLEANUP
+ rm -f $(TARGET_DIR)/etc/init.d/vcfiled
+ rm -f $(TARGET_DIR)/usr/share/install/vcfiled
+ rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/install
rm -Rf $(TARGET_DIR)/usr/src
endef
RPI_USERLAND_POST_INSTALL_TARGET_HOOKS += RPI_USERLAND_POST_TARGET_CLEANUP