From patchwork Mon Aug 4 18:20:56 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: 376416 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 2055A1400F0 for ; Tue, 5 Aug 2014 04:26:36 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3BEDB8AB97; Mon, 4 Aug 2014 18:26:35 +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 tWbYkuuePQts; Mon, 4 Aug 2014 18:26:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id A77CF87AC6; Mon, 4 Aug 2014 18:26:33 +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 43D4F1C2207 for ; Mon, 4 Aug 2014 18:26:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3ED9B8B8DD for ; Mon, 4 Aug 2014 18:26:33 +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 EGZrnZWjLudl for ; Mon, 4 Aug 2014 18:26:31 +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 EC1D08681E for ; Mon, 4 Aug 2014 18:26:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zose-mta02.web4all.fr (Postfix) with ESMTP id C113943BB7 for ; Mon, 4 Aug 2014 20:21:03 +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 BXSh7VHQP_kv; Mon, 4 Aug 2014 20:20:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zose-mta02.web4all.fr (Postfix) with ESMTP id 82B8843BB6; Mon, 4 Aug 2014 20:20:59 +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 1S3szpIFqGE5; Mon, 4 Aug 2014 20:20:59 +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 4F33D43BB4; Mon, 4 Aug 2014 20:20:59 +0200 (CEST) From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= To: Date: Mon, 4 Aug 2014 20:20:56 +0200 Message-Id: <1407176456-13473-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 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 SysV 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 install a vcfiled SysV startup script suitable for BuildRoot. Signed-off-by: Benoît Thébaudeau --- package/rpi-userland/S97vcfiled | 100 +++++++++++++++++++++++++++++++++++ package/rpi-userland/rpi-userland.mk | 8 +++ 2 files changed, 108 insertions(+) create mode 100755 package/rpi-userland/S97vcfiled diff --git a/package/rpi-userland/S97vcfiled b/package/rpi-userland/S97vcfiled new file mode 100755 index 0000000..87c4e76 --- /dev/null +++ b/package/rpi-userland/S97vcfiled @@ -0,0 +1,100 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: vcfiled +# Required-Start: udev +# Required-Stop: udev +# Short-Description: VideoCore file server daemon +### END INIT INFO + +DESC="VideoCore file server daemon" +NAME=vcfiled +VCROOT=/usr +DAEMON=$VCROOT/sbin/$NAME +DAEMON_ARGS="" +PIDFILE=/var/run/$NAME/$NAME +SCRIPTNAME="$0" + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +# +# Function that starts the daemon/service +# +do_start() +{ + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ + && return 1 + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ + $DAEMON_ARGS \ + || return 2 +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. + rm -f $PIDFILE + return "$RETVAL" +} + +case "$1" in + start) + echo -n "Starting $DESC $NAME: " + do_start + case "$?" in + 0|1) echo done ;; + 2) echo failed ;; + esac + ;; + stop) + echo -n "Stopping $DESC $NAME: " + do_stop + case "$?" in + 0|1) echo done ;; + 2) echo failed ;; + esac + ;; + restart|force-reload) + echo -n "Restarting $DESC $NAME: " + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) echo done ;; + 1) echo stop ignored ;; # Old process is still running + *) echo start failed ;; # Failed to start + esac + ;; + *) + # Failed to stop + echo stop failed + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/package/rpi-userland/rpi-userland.mk b/package/rpi-userland/rpi-userland.mk index 717eab1..bdf4e91 100644 --- a/package/rpi-userland/rpi-userland.mk +++ b/package/rpi-userland/rpi-userland.mk @@ -13,7 +13,15 @@ RPI_USERLAND_CONF_OPT = -DVMCS_INSTALL_PREFIX=/usr RPI_USERLAND_PROVIDES = libegl libgles libopenmax libopenvg +define RPI_USERLAND_INSTALL_INIT_SYSV + $(INSTALL) -m 0755 -D package/rpi-userland/S97vcfiled \ + $(TARGET_DIR)/etc/init.d/S97vcfiled +endef + 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