All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gaël PORTAY" <gael.portay@savoirfairelinux.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/3] raspberrypi: post-image.sh handles many arguments
Date: Sun, 24 Sep 2017 09:25:51 -0400	[thread overview]
Message-ID: <20170924132551.uvxo7nhtxbvbggo5@gportay> (raw)
In-Reply-To: <f843fcf3-4bc0-53ec-8b75-34694270bab1@mind.be>

Arnout,

On Sun, Sep 24, 2017 at 12:04:19PM +0200, Arnout Vandecappelle wrote:
> 
> On 24-09-17 01:30, Ga?l PORTAY wrote:
> > This post-image script now handles many optional arguments given
> > through the command-line.
> > 
> > Signed-off-by: Ga?l PORTAY <gael.portay@savoirfairelinux.com>
> 
>  Can you evaluate how this patch interacts with [1] ? Note that I haven't looked
> at either of them in detail.
> 
> [1] http://patchwork.ozlabs.org/patch/788904/
>

Both patches does the same thing.

The only difference is that my patch parses arguments using a while loop
(and shifts the first argument), while the patch from Erik parses
argument using a for loop.

Here is a diff of both patches.

	-+: mine
	++: Erik

	@@ -27,9 +11,9 @@
	 -	if ! grep -qE '^dtoverlay=' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
	 -		echo "Adding 'dtoverlay=pi3-miniuart-bt' to config.txt (fixes ttyAMA0 serial console)."
	 -		cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
	-+shift
	-+while [ $# -ne 0 ]; do
	-+	case "${1}" in
My patch is using a while --^ (+ shift)
	++for arg in "$@"
	++do
	++	case "${arg}" in
Erik's solution uses a for -^
	 +		--add-pi3-miniuart-bt-overlay)
	 +		if ! grep -qE '^dtoverlay=' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
	 +			echo "Adding 'dtoverlay=pi3-miniuart-bt' to config.txt (fixes ttyAMA0 serial console)."

Erik's forgot to indent the esac.

Otherwise, only the `-+ shift' would have been present is that chunk [*]. 

	@@ -71,15 +55,12 @@
	  __EOF__
	 -	fi
	 -	;;
	--esac
	 +		fi
	 +		;;
	-+	esac
	-+	shift
[*]: ---^-----------^
	-+done
	+ esac
	
	++done
	++
	  rm -rf "${GENIMAGE_TMP}"

Regards,
Gael

  reply	other threads:[~2017-09-24 13:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-23 23:30 [Buildroot] [PATCH 0/3] Fix Qt WE run-time issue on RPI3 Gaël PORTAY
2017-09-23 23:30 ` [Buildroot] [PATCH 1/3] raspberrypi: post-image.sh handles many arguments Gaël PORTAY
2017-09-24 10:04   ` Arnout Vandecappelle
2017-09-24 13:25     ` Gaël PORTAY [this message]
2017-09-23 23:30 ` [Buildroot] [PATCH 2/3] raspberrypi: post-image.sh add new gpu_mem option Gaël PORTAY
2017-09-24 10:15   ` Arnout Vandecappelle
2017-09-24 14:12     ` Gaël PORTAY
2017-09-24 14:20       ` Arnout Vandecappelle
2017-09-24 16:49         ` Gaël PORTAY
2017-09-23 23:30 ` [Buildroot] [PATCH 3/3] configs/raspberrypi3_qt5we: set gpu-mem to 200 Gaël PORTAY
2017-09-27 20:12 ` [Buildroot] [PATCH 0/3] Fix Qt WE run-time issue on RPI3 Arnout Vandecappelle

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=20170924132551.uvxo7nhtxbvbggo5@gportay \
    --to=gael.portay@savoirfairelinux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.