From patchwork Wed Aug 6 18:17:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Beno=C3=AEt_Th=C3=A9baudeau?= X-Patchwork-Id: 377305 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 29F2C1400D6 for ; Thu, 7 Aug 2014 04:18:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6F5A18A3F4; Wed, 6 Aug 2014 18:18:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M-2q6xQfgFLm; Wed, 6 Aug 2014 18:18:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 7B8608A3B6; Wed, 6 Aug 2014 18:18:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 30B271C2237 for ; Wed, 6 Aug 2014 18:18:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2C1018C819 for ; Wed, 6 Aug 2014 18:18:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yAn3iG3qOhH3 for ; Wed, 6 Aug 2014 18:18:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from zose-mta02.web4all.fr (zose-mta02.web4all.fr [185.49.20.43]) by whitealder.osuosl.org (Postfix) with ESMTP id B111E8C7F7 for ; Wed, 6 Aug 2014 18:18:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zose-mta02.web4all.fr (Postfix) with ESMTP id DA66F43F52 for ; Wed, 6 Aug 2014 20:18:02 +0200 (CEST) Received: from zose-mta02.web4all.fr ([127.0.0.1]) by localhost (zose-mta02.web4all.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 7mzTL7qg5Ej7; Wed, 6 Aug 2014 20:17:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zose-mta02.web4all.fr (Postfix) with ESMTP id D803143F51; Wed, 6 Aug 2014 20:17:58 +0200 (CEST) X-Virus-Scanned: amavisd-new at zose-mta-02.w4a.fr Received: from zose-mta02.web4all.fr ([127.0.0.1]) by localhost (zose-mta02.web4all.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IXGx0BQwQgKK; Wed, 6 Aug 2014 20:17:58 +0200 (CEST) Received: from localhost.localdomain (cie44-1-88-188-188-147.fbx.proxad.net [88.188.188.147]) by zose-mta02.web4all.fr (Postfix) with ESMTPSA id 9C19243F50; Wed, 6 Aug 2014 20:17:58 +0200 (CEST) From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= To: Date: Wed, 6 Aug 2014 20:17:46 +0200 Message-Id: <1407349066-50612-1-git-send-email-benoit.thebaudeau@advansee.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Cc: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Subject: [Buildroot] [PATCH v3 1/1] rpi-userland: Fix vcfiled startup X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net 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. Signed-off-by: Benoît Thébaudeau --- Changes in v3: - Add a config option to start this daemon. Changes in v2: - Indent .mk rules with tabs. - Simplify the new vcfiled startup script. - Rename S97vcfiled to S94vcfiled for a better integration with existing init scripts. --- package/rpi-userland/Config.in | 7 ++++++ package/rpi-userland/S94vcfiled | 47 ++++++++++++++++++++++++++++++++++++ package/rpi-userland/rpi-userland.mk | 10 ++++++++ 3 files changed, 64 insertions(+) create mode 100755 package/rpi-userland/S94vcfiled diff --git a/package/rpi-userland/Config.in b/package/rpi-userland/Config.in index aeee5e1..89e99e0 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 filing + 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 0000000..25a0fcd --- /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/$NAME" + +# 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 81ed95c..a5e0715 100644 --- a/package/rpi-userland/rpi-userland.mk +++ b/package/rpi-userland/rpi-userland.mk @@ -13,7 +13,17 @@ RPI_USERLAND_CONF_OPT = -DVMCS_INSTALL_PREFIX=/usr 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