From patchwork Sun Nov 4 21:02:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 992792 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.com.br Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42p7Yy6Nx2zB6NF for ; Mon, 5 Nov 2018 08:03:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 11FE48798D; Sun, 4 Nov 2018 21:03:00 +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 kTfCyBK1IPvn; Sun, 4 Nov 2018 21:02:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 827D38792A; Sun, 4 Nov 2018 21:02:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 3BA561BF3D1 for ; Sun, 4 Nov 2018 21:02:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 38E6C85DF2 for ; Sun, 4 Nov 2018 21:02:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hhe-E10ScfQ8 for ; Sun, 4 Nov 2018 21:02:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.com.br (mx.datacom.ind.br [177.66.5.10]) by fraxinus.osuosl.org (Postfix) with ESMTPS id D067685DDC for ; Sun, 4 Nov 2018 21:02:54 +0000 (UTC) Received: from mail.datacom.com.br (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTPS id B0B641BA08D7; Sun, 4 Nov 2018 19:03:20 -0200 (-02) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTP id 9D63F1BA05C7; Sun, 4 Nov 2018 19:03:20 -0200 (-02) Received: from mail.datacom.com.br ([127.0.0.1]) by localhost (mail.datacom.com.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id RUYm2ImT33aE; Sun, 4 Nov 2018 19:03:20 -0200 (-02) Received: from p7-1130br.casantos.org (unknown [179.162.0.126]) by mail.datacom.com.br (Postfix) with ESMTPSA id 433AA1BA0AB9; Sun, 4 Nov 2018 19:03:20 -0200 (-02) From: Carlos Santos To: buildroot@buildroot.org Date: Sun, 4 Nov 2018 19:02:41 -0200 Message-Id: <20181104210241.20237-5-casantos@datacom.com.br> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181104210241.20237-1-casantos@datacom.com.br> References: <20181104210241.20237-1-casantos@datacom.com.br> Subject: [Buildroot] [PATCH 4/4] iucode-tool: rewrite init script X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Hadjinlian MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" - Indent with tabs. - Use a function for start. - Use a dummy function that reports OK for stop, restart and reload. - Pass "-q" to iucode_tool to inhipt usual output taht would otherwise interfere with the operation status report. Signed-off-by: Carlos Santos --- package/iucode-tool/S00iucode-tool | 37 +++++++++++++++++++----------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/package/iucode-tool/S00iucode-tool b/package/iucode-tool/S00iucode-tool index a97b33c045..eb9f93ad6e 100644 --- a/package/iucode-tool/S00iucode-tool +++ b/package/iucode-tool/S00iucode-tool @@ -5,19 +5,28 @@ MICROCODE_DIR="/lib/firmware/intel-ucode" +start() { + printf 'Starting iucode-tool: ' + /usr/sbin/iucode_tool -q -k "$MICROCODE_DIR" + status="$?" + if [ "$status" = 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +dummy() { + echo "$1" | sed 's/^./\U&\E/;s/p/pp/;s/$/ing iucode-tool: OK/' +} + case "$1" in - start) - echo "Starting iucode-tool:" - /usr/sbin/iucode_tool -k "$MICROCODE_DIR" - echo "done" - ;; - stop) - ;; - restart|reload) - ;; - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 + start) + start;; + stop|restart|reload) + dummy "$1";; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 esac - -exit $?