From patchwork Fri Apr 13 16:25:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 898014 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=datacom.ind.br Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40N36k3PKqz9s0x for ; Sat, 14 Apr 2018 02:25:50 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BC84122E1C; Fri, 13 Apr 2018 16:25:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RVpsi2ENRVEn; Fri, 13 Apr 2018 16:25:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id D1002228DA; Fri, 13 Apr 2018 16:25:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 265421C3F00 for ; Fri, 13 Apr 2018 16:25:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 22F9F886AA for ; Fri, 13 Apr 2018 16:25:41 +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 XZUTitJOr-95 for ; Fri, 13 Apr 2018 16:25:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.ind.br (mx.datacom.ind.br [177.66.5.10]) by whitealder.osuosl.org (Postfix) with ESMTPS id BDEFB8869C for ; Fri, 13 Apr 2018 16:25:39 +0000 (UTC) Received: from mail.datacom.ind.br (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTPS id 404C51BA1A8B; Fri, 13 Apr 2018 13:25:49 -0300 (-03) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTP id 149431BA1AF2; Fri, 13 Apr 2018 13:25:49 -0300 (-03) Received: from mail.datacom.ind.br ([127.0.0.1]) by localhost (mail.datacom.ind.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id GZ8FeBqGbsus; Fri, 13 Apr 2018 13:25:48 -0300 (-03) Received: from pedeld202344.datacom.net (pedeld202344.datacom.net [10.0.120.87]) by mail.datacom.ind.br (Postfix) with ESMTPSA id C986B1BA1A8B; Fri, 13 Apr 2018 13:25:48 -0300 (-03) From: Carlos Santos To: buildroot@buildroot.org Date: Fri, 13 Apr 2018 13:25:20 -0300 Message-Id: <20180413162521.7078-2-casantos@datacom.ind.br> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180413162521.7078-1-casantos@datacom.ind.br> References: <20180413162521.7078-1-casantos@datacom.ind.br> Subject: [Buildroot] [PATCH 1/2] modem-manager: fix test of unset variable in init script X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksander Morgado MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" MODEMMANAGER_BIN was never set. Fortunately it did not break the script execution due to the permissive behavior of "test": $ test -x non-existing || echo error error $ test -x || echo error test -x && echo success success Signed-off-by: Carlos Santos --- package/modem-manager/S44modem-manager | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/modem-manager/S44modem-manager b/package/modem-manager/S44modem-manager index cf6d89601d..05803fe198 100755 --- a/package/modem-manager/S44modem-manager +++ b/package/modem-manager/S44modem-manager @@ -3,6 +3,7 @@ # Starts ModemManager # +MODEMMANAGER_BIN=/usr/sbin/ModemManager PIDFILE=/var/run/ModemManager.pid [ -x $MODEMMANAGER_BIN ] || exit 0 @@ -11,7 +12,7 @@ start() { printf "Starting ModemManager: " umask 077 start-stop-daemon -S -q -b -m -p $PIDFILE \ - --exec /usr/sbin/ModemManager + --exec $MODEMMANAGER_BIN [ $? = 0 ] && echo "OK" || echo "FAIL" } stop() { From patchwork Fri Apr 13 16:25:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 898012 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=datacom.ind.br Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40N36h1173z9s0x for ; Sat, 14 Apr 2018 02:25:48 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8266989D4C; Fri, 13 Apr 2018 16:25:43 +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 eYtlc1Rgj4eR; Fri, 13 Apr 2018 16:25:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 3162C89D4B; Fri, 13 Apr 2018 16:25:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 73E621C3F00 for ; Fri, 13 Apr 2018 16:25:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7177D89D4B for ; Fri, 13 Apr 2018 16:25:40 +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 lS7+Vc-xvuuD for ; Fri, 13 Apr 2018 16:25:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.ind.br (mx.datacom.ind.br [177.66.5.10]) by hemlock.osuosl.org (Postfix) with ESMTPS id C05D789D43 for ; Fri, 13 Apr 2018 16:25:39 +0000 (UTC) Received: from mail.datacom.ind.br (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTPS id 7B1351BA1A96; Fri, 13 Apr 2018 13:25:49 -0300 (-03) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTP id 421B51BA1AC4; Fri, 13 Apr 2018 13:25:49 -0300 (-03) Received: from mail.datacom.ind.br ([127.0.0.1]) by localhost (mail.datacom.ind.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ESSW4b_lDwmq; Fri, 13 Apr 2018 13:25:49 -0300 (-03) Received: from pedeld202344.datacom.net (pedeld202344.datacom.net [10.0.120.87]) by mail.datacom.ind.br (Postfix) with ESMTPSA id EEA461BA1AD1; Fri, 13 Apr 2018 13:25:48 -0300 (-03) From: Carlos Santos To: buildroot@buildroot.org Date: Fri, 13 Apr 2018 13:25:21 -0300 Message-Id: <20180413162521.7078-3-casantos@datacom.ind.br> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180413162521.7078-1-casantos@datacom.ind.br> References: <20180413162521.7078-1-casantos@datacom.ind.br> Subject: [Buildroot] [PATCH 2/2] modem-manager: support a defaults file in the init script X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksander Morgado MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Sometimes it is useful to pass some parameters to ModemManager when it starts (e.g. --log-level). Allow the user add a file with such flags in a MODEMMANAGER_ARGS variable. This is simpler than overriding the whole startup script (e.g. by means of a rootfs overlay). Signed-off-by: Carlos Santos --- package/modem-manager/S44modem-manager | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/modem-manager/S44modem-manager b/package/modem-manager/S44modem-manager index 05803fe198..8fa5d0a429 100755 --- a/package/modem-manager/S44modem-manager +++ b/package/modem-manager/S44modem-manager @@ -3,6 +3,9 @@ # Starts ModemManager # +# Allow a few customizations from a config file +test -r /etc/default/ModemManager && . /etc/default/ModemManager + MODEMMANAGER_BIN=/usr/sbin/ModemManager PIDFILE=/var/run/ModemManager.pid @@ -12,7 +15,7 @@ start() { printf "Starting ModemManager: " umask 077 start-stop-daemon -S -q -b -m -p $PIDFILE \ - --exec $MODEMMANAGER_BIN + --exec $MODEMMANAGER_BIN -- $MODEMMANAGER_ARGS [ $? = 0 ] && echo "OK" || echo "FAIL" } stop() {