From patchwork Sat Apr 21 13:00:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 902424 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 40StB7131Jz9s1l for ; Sat, 21 Apr 2018 23:00:30 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 30D9822624; Sat, 21 Apr 2018 13:00:28 +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 BhBHcU3wVPDi; Sat, 21 Apr 2018 13:00:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 949CB24306; Sat, 21 Apr 2018 13:00:26 +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 D93A31C2092 for ; Sat, 21 Apr 2018 13:00:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D60BC889AE for ; Sat, 21 Apr 2018 13:00:24 +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 5gaEcbEvIvnI for ; Sat, 21 Apr 2018 13:00:23 +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 45CDA8891D for ; Sat, 21 Apr 2018 13:00:23 +0000 (UTC) Received: from mail.datacom.ind.br (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTPS id E37B61BA06B2; Sat, 21 Apr 2018 10:00:24 -0300 (-03) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTP id CFE231BA05F0; Sat, 21 Apr 2018 10:00:24 -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 CoNsAalrvdBq; Sat, 21 Apr 2018 10:00:24 -0300 (-03) Received: from p7-1130br.casantos.org (189.27.227.50.dynamic.adsl.gvt.net.br [189.27.227.50]) by mail.datacom.ind.br (Postfix) with ESMTPSA id 6212F1BA048D; Sat, 21 Apr 2018 10:00:24 -0300 (-03) From: Carlos Santos To: buildroot@buildroot.org Date: Sat, 21 Apr 2018 10:00:10 -0300 Message-Id: <20180421130010.7702-1-casantos@datacom.ind.br> X-Mailer: git-send-email 2.14.3 Subject: [Buildroot] [PATCH v2] 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 Acked-by: Petr Vorel --- Changes v1->v2 - Rebase after commit ef0b7e7521 (modem-manager: don't test if the binary exists in the init script). --- 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 a3f5003aa1..416c1e2ee6 100755 --- a/package/modem-manager/S44modem-manager +++ b/package/modem-manager/S44modem-manager @@ -3,13 +3,16 @@ # Starts ModemManager # +# Allow a few customizations from a config file +test -r /etc/default/ModemManager && . /etc/default/ModemManager + PIDFILE=/var/run/ModemManager.pid start() { printf "Starting ModemManager: " umask 077 start-stop-daemon -S -q -b -m -p $PIDFILE \ - --exec /usr/sbin/ModemManager + --exec /usr/sbin/ModemManager -- $MODEMMANAGER_ARGS [ $? = 0 ] && echo "OK" || echo "FAIL" } stop() {