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 2/3] raspberrypi: post-image.sh add new gpu_mem option
Date: Sun, 24 Sep 2017 12:49:05 -0400	[thread overview]
Message-ID: <20170924164905.qapjtso5vh37mbyj@gportay> (raw)
In-Reply-To: <71439ed0-48d7-ac9f-3cf5-33748f566fea@mind.be>

On Sun, Sep 24, 2017 at 04:20:41PM +0200, Arnout Vandecappelle wrote:
> On 24-09-17 16:12, Ga?l PORTAY wrote:
> > In the end, what I would like to have is to give config.txt options as
> > arguments to post-image.sh; that are echo'ed to the file. Because some
> > options are already presents in the config.txt file, we have either to
> > sed or to echo/cat.
> > 
> > Something arround...
> > 
> > 	$ post-image.sh skip-first-arg enable_uart=1 dtoverlay=pi3-miniuart-bt gpu_mem=200
> > 
> > and...
> > 
> > 	shift
> > 	while [ $# -eq 0 ]; do
> > 		echo "$1" >>$BINARIES_DIR/rpi-firmware/config.txt
> > 		shift
> > 	done
> > 
> > 	genimage ...
> > 
> > So we no longer needs to update the script each time we need to add a
> > new argument that plays with the config.txt.
> > 
> > What do you think?
> 
>  Well, then it's probably easier to just copy a config.txt, no? Perhaps adding
> options for custom config.txt to rpi-firmware?
>

Yes. For now, it is simple to have one config.txt per rpi-board as there
is a limited number of raspberrypi config. But, the config.txt will
probably be duplicated many times.

For a user point of view, my suggestion makes the customization more
versatile.

If the user have a rpi3 with a lirc-rpi module (do not know what it is),
he will have to edit manually the config.txt.

	# cat <<EOF >output/images/rpi-firmare/config.txt
	dtoverlay=lirc-rpi
	EOF

This is fair.

If the user want it to be mainlined, he will have to add an extra option
in the post-image script. And we probably have to maintain many (all? or
at least dtoverlays) config.txt options.

With my suggestion, the user is able to add dtoverlay=lirc-rpi to the
list of post-scripts arguments.

	BR2_ROOTFS_POST_SCRIPT_ARGS="... dtoverlay=lirc-rpi"

Thus we do not need to maintain all config.txt options in the script
post-image.sh. The config.txt can be tunned using make menuconfig. 

	shift
	while [ $# -eq ]; do
		case "$1" in
		# keep legacy cases (--add-pi3-miniuart-bt-overlay, --aarch64...)
		*) # or *=*)
			echo "$1" >>${BINARIES_DIR}/rpi-firmware/config.txt
			# or sed -i -e "/^${1#=}/d;\$a$1" ${BINARIES_DIR}/rpi-firmware/config.txt
			;;
		esac
		shift
	done

Note: Maybe, we should reduce the config.txt to the bare minimum set of
option and rely on default values.

  reply	other threads:[~2017-09-24 16:49 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
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 [this message]
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=20170924164905.qapjtso5vh37mbyj@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.