From: Carlos Santos <casantos@datacom.com.br>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 4/4] iucode-tool: rewrite init script
Date: Sun, 4 Nov 2018 19:02:41 -0200 [thread overview]
Message-ID: <20181104210241.20237-5-casantos@datacom.com.br> (raw)
In-Reply-To: <20181104210241.20237-1-casantos@datacom.com.br>
- 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 <casantos@datacom.com.br>
---
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 $?
--
2.17.1
next prev parent reply other threads:[~2018-11-04 21:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-04 21:02 [Buildroot] [PATCH 0/4] update/improve intel-microcode and iucode-tool Carlos Santos
2018-11-04 21:02 ` [Buildroot] [PATCH 1/4] linux: enable MICROCODE_INTEL if intel-microcode is selected Carlos Santos
2018-11-12 21:37 ` Peter Korsgaard
2018-11-04 21:02 ` [Buildroot] [PATCH 2/4] intel-microcode: bump to version 20180807a Carlos Santos
2018-11-12 21:39 ` Peter Korsgaard
2018-11-04 21:02 ` [Buildroot] [PATCH 3/4] iucode-tool: bump to version 2.3.1 Carlos Santos
2018-11-12 21:39 ` Peter Korsgaard
2018-11-04 21:02 ` Carlos Santos [this message]
2018-11-12 21:47 ` [Buildroot] [PATCH 4/4] iucode-tool: rewrite init script Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181104210241.20237-5-casantos@datacom.com.br \
--to=casantos@datacom.com.br \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox