Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 4/4] iucode-tool: rewrite init script
Date: Mon, 12 Nov 2018 22:47:55 +0100	[thread overview]
Message-ID: <87a7me55o4.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20181104210241.20237-5-casantos@datacom.com.br> (Carlos Santos's message of "Sun, 4 Nov 2018 19:02:41 -0200")

>>>>> "Carlos" == Carlos Santos <casantos@datacom.com.br> writes:

 > - 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

s/inhipt/inhibit/
s/taht/that/

>   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/'

This is IMHO not very readable, and busybox sed doesn't like it:

# echo 'stop' | sed 's/^./\U&\E/;s/p/pp/;s/$/ing iucode-tool: OK/'
UsEtopping iucode-tool: OK

So I've dropped this and committed to next, thanks.

> +}
 > +
 >  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}"

You forgot to document "reload".

-- 
Bye, Peter Korsgaard

      reply	other threads:[~2018-11-12 21:47 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 ` [Buildroot] [PATCH 4/4] iucode-tool: rewrite init script Carlos Santos
2018-11-12 21:47   ` Peter Korsgaard [this message]

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=87a7me55o4.fsf@dell.be.48ers.dk \
    --to=peter@korsgaard.com \
    --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