[{"id":1774125,"web_url":"http://patchwork.ozlabs.org/comment/1774125/","msgid":"<8c1d85a4-4390-047f-1d21-af37842a0040@mind.be>","list_archive_url":null,"date":"2017-09-24T10:15:09","subject":"Re: [Buildroot] [PATCH 2/3] raspberrypi: post-image.sh add new\n\tgpu_mem option","submitter":{"id":11809,"url":"http://patchwork.ozlabs.org/api/people/11809/","name":"Arnout Vandecappelle","email":"arnout@mind.be"},"content":"On 24-09-17 01:30, Gaël PORTAY wrote:\n> The amount of GPU memory can be set using the new option --gpu_mem_XXX\n> (where XXX is the total amount of memory available on the board).\n> \n> Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>\n> ---\n>  board/raspberrypi/post-image.sh | 7 ++++++-\n>  1 file changed, 6 insertions(+), 1 deletion(-)\n> \n> diff --git a/board/raspberrypi/post-image.sh b/board/raspberrypi/post-image.sh\n> index 1b49f0ea30..9091476ced 100755\n> --- a/board/raspberrypi/post-image.sh\n> +++ b/board/raspberrypi/post-image.sh\n> @@ -1,4 +1,4 @@\n> -#!/bin/sh\n> +#!/bin/bash\n>  \n>  BOARD_DIR=\"$(dirname $0)\"\n>  BOARD_NAME=\"$(basename ${BOARD_DIR})\"\n> @@ -38,6 +38,11 @@ enable_uart=1\n>  __EOF__\n>  \t\tfi\n>  \t\t;;\n> +\t\t--gpu_mem_256=*|--gpu_mem_512=*|--gpu_mem_1024=*)\n> +\t\t# Set GPU memory\n> +\t\tgpu_mem=\"${1:2}\"\n> +\t\tsed -e \"/^${gpu_mem%=*}=/s,=.*,=${gpu_mem##*=},\" -i \"${BINARIES_DIR}/rpi-firmware/config.txt\"\n\n In the end, the config.txt is just for one board, right? So can't we just have\na single --gpu_mem=XXX option and do\n\n\t\tsed -i -e \"/^gpu_mem_[0-9]*=/s/=.*/${1##*=}/\" \\\n\t\t\t\"${BINARIES_DIR}/rpi-firmware/config.txt\"\n\n Note that you no longer need to strip off the -- and that you no longer need bash.\n\n As you can see in the example, I also prefer if the options (-i) come in the\nbeginning, and to use / as the delimiter unless there actually are /-es in any\nof the strings. But that's just personal preference.\n\n\n Regards,\n Arnout\n\n> +\t\t;;\n>  \tesac\n>  \tshift\n>  done\n>","headers":{"Return-Path":"<buildroot-bounces@busybox.net>","X-Original-To":["incoming@patchwork.ozlabs.org","buildroot@lists.busybox.net"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","buildroot@osuosl.org"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=busybox.net\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=buildroot-bounces@busybox.net;\n\treceiver=<UNKNOWN>)","Received":["from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y0NQF0n0Pz9s7p\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 24 Sep 2017 20:15:32 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id BBA798883C;\n\tSun, 24 Sep 2017 10:15:29 +0000 (UTC)","from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id hGwpEDkWIev1; Sun, 24 Sep 2017 10:15:28 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id A146D8881E;\n\tSun, 24 Sep 2017 10:15:28 +0000 (UTC)","from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 3557E1C3F88\n\tfor <buildroot@lists.busybox.net>;\n\tSun, 24 Sep 2017 10:15:27 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 7B3EC26C01\n\tfor <buildroot@lists.busybox.net>;\n\tSun, 24 Sep 2017 10:15:22 +0000 (UTC)","from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id kvzjidI1tTDU for <buildroot@lists.busybox.net>;\n\tSun, 24 Sep 2017 10:15:20 +0000 (UTC)","from exchange.essensium.com (220.77.144.195.ipv4.evonet.be\n\t[195.144.77.220])\n\tby silver.osuosl.org (Postfix) with ESMTP id 1797426B02\n\tfor <buildroot@buildroot.org>; Sun, 24 Sep 2017 10:15:19 +0000 (UTC)","from [10.8.0.14] (10.3.7.11) by beleexch01.local.ess-mail.com\n\t(10.3.7.8) with Microsoft SMTP Server (TLS) id 15.0.847.32;\n\tSun, 24 Sep 2017 12:15:11 +0200"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","To":"=?utf-8?q?Ga=C3=ABl_PORTAY?= <gael.portay@savoirfairelinux.com>,\n\t<buildroot@buildroot.org>, Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>","References":"<20170923233007.13772-1-gael.portay@savoirfairelinux.com>\n\t<20170923233007.13772-3-gael.portay@savoirfairelinux.com>","From":"Arnout Vandecappelle <arnout@mind.be>","Organization":"Essensium/Mind","Message-ID":"<8c1d85a4-4390-047f-1d21-af37842a0040@mind.be>","Date":"Sun, 24 Sep 2017 12:15:09 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170923233007.13772-3-gael.portay@savoirfairelinux.com>","Content-Language":"en-GB","X-Originating-IP":"[10.3.7.11]","X-ClientProxiedBy":"beleexch01.local.ess-mail.com (10.3.7.8) To\n\tbeleexch01.local.ess-mail.com (10.3.7.8)","Subject":"Re: [Buildroot] [PATCH 2/3] raspberrypi: post-image.sh add new\n\tgpu_mem option","X-BeenThere":"buildroot@busybox.net","X-Mailman-Version":"2.1.18-1","Precedence":"list","List-Id":"Discussion and development of buildroot <buildroot.busybox.net>","List-Unsubscribe":"<http://lists.busybox.net/mailman/options/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=unsubscribe>","List-Archive":"<http://lists.busybox.net/pipermail/buildroot/>","List-Post":"<mailto:buildroot@busybox.net>","List-Help":"<mailto:buildroot-request@busybox.net?subject=help>","List-Subscribe":"<http://lists.busybox.net/mailman/listinfo/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"buildroot-bounces@busybox.net","Sender":"\"buildroot\" <buildroot-bounces@busybox.net>"}},{"id":1774203,"web_url":"http://patchwork.ozlabs.org/comment/1774203/","msgid":"<20170924141207.muyixrdd2u27n7uw@gportay>","list_archive_url":null,"date":"2017-09-24T14:12:07","subject":"Re: [Buildroot] [PATCH 2/3] raspberrypi: post-image.sh add new\n\tgpu_mem option","submitter":{"id":70334,"url":"http://patchwork.ozlabs.org/api/people/70334/","name":"Gaël PORTAY","email":"gael.portay@savoirfairelinux.com"},"content":"Arnout,\n\nOn Sun, Sep 24, 2017 at 12:15:09PM +0200, Arnout Vandecappelle wrote:\n> \n> On 24-09-17 01:30, Gaël PORTAY wrote:\n> > The amount of GPU memory can be set using the new option --gpu_mem_XXX\n> > (where XXX is the total amount of memory available on the board).\n> > \n> > Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>\n> > ---\n> >  board/raspberrypi/post-image.sh | 7 ++++++-\n> >  1 file changed, 6 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/board/raspberrypi/post-image.sh b/board/raspberrypi/post-image.sh\n> > index 1b49f0ea30..9091476ced 100755\n> > --- a/board/raspberrypi/post-image.sh\n> > +++ b/board/raspberrypi/post-image.sh\n> > @@ -1,4 +1,4 @@\n> > -#!/bin/sh\n> > +#!/bin/bash\n> >  \n> >  BOARD_DIR=\"$(dirname $0)\"\n> >  BOARD_NAME=\"$(basename ${BOARD_DIR})\"\n> > @@ -38,6 +38,11 @@ enable_uart=1\n> >  __EOF__\n> >  \t\tfi\n> >  \t\t;;\n> > +\t\t--gpu_mem_256=*|--gpu_mem_512=*|--gpu_mem_1024=*)\n> > +\t\t# Set GPU memory\n> > +\t\tgpu_mem=\"${1:2}\"\n> > +\t\tsed -e \"/^${gpu_mem%=*}=/s,=.*,=${gpu_mem##*=},\" -i \"${BINARIES_DIR}/rpi-firmware/config.txt\"\n> \n>  In the end, the config.txt is just for one board, right? So can't we just have\n> a single --gpu_mem=XXX option and do\n> \n> \t\tsed -i -e \"/^gpu_mem_[0-9]*=/s/=.*/${1##*=}/\" \\\n> \t\t\t\"${BINARIES_DIR}/rpi-firmware/config.txt\"\n> \n\nIf we consider the output is only for one target (rpi, rpi2, rpi3 or\nrpi3-64), so yes we can have only a single gpu_mem option; but we have\nto remove all gpu_mem_xxx= in the config.txt (rpi-firmware). If set,\nthese options overrides gpu_mem= (if unset, it default value is 64).\n\nAccording the config.txt memory documentation [*]:\n\n\tgpu_mem\n\t\n\tGPU memory in megabytes. This sets the memory split between the CPU and GPU; the CPU gets the remaining memory. Minimum value is 16; maximum value is 192, 448, or 944, depending on whether you are using a 256M, 512MB, or 1024MB Pi. The default value is 64.\n\t\n\tSetting gpu_mem to low values may automatically disable certain firmware features, as there are some things the GPU cannot do if it has access to too little memory. So if a feature you are trying to use isn't working, try setting a larger GPU memory split.\n\t\n\tUsing gpu_mem_256, gpu_mem_512, and gpu_mem_1024 allows you to swap the same SD card between 256MB, 512MB, and 1024MB Pis without having to edit config.txt each time:\n\n>  Note that you no longer need to strip off the -- and that you no longer need bash.\n>\n\nIndeed.\n\nIn the end, what I would like to have is to give config.txt options as\narguments to post-image.sh; that are echo'ed to the file. Because some\noptions are already presents in the config.txt file, we have either to\nsed or to echo/cat.\n\nSomething arround...\n\n\t$ post-image.sh skip-first-arg enable_uart=1 dtoverlay=pi3-miniuart-bt gpu_mem=200\n\nand...\n\n\tshift\n\twhile [ $# -eq 0 ]; do\n\t\techo \"$1\" >>$BINARIES_DIR/rpi-firmware/config.txt\n\t\tshift\n\tdone\n\n\tgenimage ...\n\nSo we no longer needs to update the script each time we need to add a\nnew argument that plays with the config.txt.\n\nWhat do you think?\n\n>  As you can see in the example, I also prefer if the options (-i) come in the\n> beginning, and to use / as the delimiter unless there actually are /-es in any\n> of the strings. But that's just personal preference.\n> \n\nOkay. It is fine for me, I will update it.\n\n>  Regards,\n>  Arnout\n> \n> > +\t\t;;\n> >  \tesac\n> >  \tshift\n> >  done\n> > \n\nRegards,\nGael\n\n[*]: https://www.raspberrypi.org/documentation/configuration/config-txt/memory.md","headers":{"Return-Path":"<buildroot-bounces@busybox.net>","X-Original-To":["incoming@patchwork.ozlabs.org","buildroot@lists.busybox.net"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","buildroot@osuosl.org"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=busybox.net\n\t(client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=buildroot-bounces@busybox.net;\n\treceiver=<UNKNOWN>)","Received":["from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y0TgZ61rGz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 00:12:26 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 127B1872CA;\n\tSun, 24 Sep 2017 14:12:25 +0000 (UTC)","from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 1p6DlSEveO8v; Sun, 24 Sep 2017 14:12:24 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 51A3387375;\n\tSun, 24 Sep 2017 14:12:24 +0000 (UTC)","from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 6600B1C3F89\n\tfor <buildroot@lists.busybox.net>;\n\tSun, 24 Sep 2017 14:12:12 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 5F86087A76\n\tfor <buildroot@lists.busybox.net>;\n\tSun, 24 Sep 2017 14:12:12 +0000 (UTC)","from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id zTlZlWjhTijg for <buildroot@lists.busybox.net>;\n\tSun, 24 Sep 2017 14:12:11 +0000 (UTC)","from mail.savoirfairelinux.com (mail.savoirfairelinux.com\n\t[208.88.110.44])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 0C9E487979\n\tfor <buildroot@buildroot.org>; Sun, 24 Sep 2017 14:12:11 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby mail.savoirfairelinux.com (Postfix) with ESMTP id 4B20C9C19E9;\n\tSun, 24 Sep 2017 10:12:10 -0400 (EDT)","from mail.savoirfairelinux.com ([127.0.0.1])\n\tby localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new,\n\tport 10032)\n\twith ESMTP id rsuRIalhmCg2; Sun, 24 Sep 2017 10:12:08 -0400 (EDT)","from localhost (localhost [127.0.0.1])\n\tby mail.savoirfairelinux.com (Postfix) with ESMTP id 585609C1BB7;\n\tSun, 24 Sep 2017 10:12:08 -0400 (EDT)","from mail.savoirfairelinux.com ([127.0.0.1])\n\tby localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new,\n\tport 10026)\n\twith ESMTP id Cg1nYiVuLmLD; Sun, 24 Sep 2017 10:12:08 -0400 (EDT)","from gportay (modemcable013.17-177-173.mc.videotron.ca\n\t[173.177.17.13])\n\tby mail.savoirfairelinux.com (Postfix) with ESMTPSA id 251769C19E9;\n\tSun, 24 Sep 2017 10:12:08 -0400 (EDT)"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org","amavisd-new at mail.savoirfairelinux.com"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","Date":"Sun, 24 Sep 2017 10:12:07 -0400","From":"=?iso-8859-1?q?Ga=EBl?= PORTAY <gael.portay@savoirfairelinux.com>","To":"Arnout Vandecappelle <arnout@mind.be>","Message-ID":"<20170924141207.muyixrdd2u27n7uw@gportay>","References":"<20170923233007.13772-1-gael.portay@savoirfairelinux.com>\n\t<20170923233007.13772-3-gael.portay@savoirfairelinux.com>\n\t<8c1d85a4-4390-047f-1d21-af37842a0040@mind.be>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<8c1d85a4-4390-047f-1d21-af37842a0040@mind.be>","User-Agent":"NeoMutt/20161104 (1.7.1)","Cc":"buildroot@buildroot.org","Subject":"Re: [Buildroot] [PATCH 2/3] raspberrypi: post-image.sh add new\n\tgpu_mem option","X-BeenThere":"buildroot@busybox.net","X-Mailman-Version":"2.1.18-1","Precedence":"list","List-Id":"Discussion and development of buildroot <buildroot.busybox.net>","List-Unsubscribe":"<http://lists.busybox.net/mailman/options/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=unsubscribe>","List-Archive":"<http://lists.busybox.net/pipermail/buildroot/>","List-Post":"<mailto:buildroot@busybox.net>","List-Help":"<mailto:buildroot-request@busybox.net?subject=help>","List-Subscribe":"<http://lists.busybox.net/mailman/listinfo/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=subscribe>","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"buildroot-bounces@busybox.net","Sender":"\"buildroot\" <buildroot-bounces@busybox.net>"}},{"id":1774212,"web_url":"http://patchwork.ozlabs.org/comment/1774212/","msgid":"<71439ed0-48d7-ac9f-3cf5-33748f566fea@mind.be>","list_archive_url":null,"date":"2017-09-24T14:20:41","subject":"Re: [Buildroot] [PATCH 2/3] raspberrypi: post-image.sh add new\n\tgpu_mem option","submitter":{"id":11809,"url":"http://patchwork.ozlabs.org/api/people/11809/","name":"Arnout Vandecappelle","email":"arnout@mind.be"},"content":"On 24-09-17 16:12, Gaël PORTAY wrote:\n> In the end, what I would like to have is to give config.txt options as\n> arguments to post-image.sh; that are echo'ed to the file. Because some\n> options are already presents in the config.txt file, we have either to\n> sed or to echo/cat.\n> \n> Something arround...\n> \n> \t$ post-image.sh skip-first-arg enable_uart=1 dtoverlay=pi3-miniuart-bt gpu_mem=200\n> \n> and...\n> \n> \tshift\n> \twhile [ $# -eq 0 ]; do\n> \t\techo \"$1\" >>$BINARIES_DIR/rpi-firmware/config.txt\n> \t\tshift\n> \tdone\n> \n> \tgenimage ...\n> \n> So we no longer needs to update the script each time we need to add a\n> new argument that plays with the config.txt.\n> \n> What do you think?\n\n Well, then it's probably easier to just copy a config.txt, no? Perhaps adding\noptions for custom config.txt to rpi-firmware?\n\n Regards,\n Arnout","headers":{"Return-Path":"<buildroot-bounces@busybox.net>","X-Original-To":["incoming@patchwork.ozlabs.org","buildroot@lists.busybox.net"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","buildroot@osuosl.org"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=busybox.net\n\t(client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n\tenvelope-from=buildroot-bounces@busybox.net;\n\treceiver=<UNKNOWN>)","Received":["from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y0Tss1XLSz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 00:21:21 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 9023887FA1;\n\tSun, 24 Sep 2017 14:21:17 +0000 (UTC)","from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id Psiopp3PwZcj; Sun, 24 Sep 2017 14:21:16 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 3AC2A87D2F;\n\tSun, 24 Sep 2017 14:21:16 +0000 (UTC)","from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 272721C3F89\n\tfor <buildroot@lists.busybox.net>;\n\tSun, 24 Sep 2017 14:21:15 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 1E80787170\n\tfor <buildroot@lists.busybox.net>;\n\tSun, 24 Sep 2017 14:21:15 +0000 (UTC)","from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id Hrtjxes91rZp for <buildroot@lists.busybox.net>;\n\tSun, 24 Sep 2017 14:21:14 +0000 (UTC)","from exchange.essensium.com (220.77.144.195.ipv4.evonet.be\n\t[195.144.77.220])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 3A8E2870E1\n\tfor <buildroot@buildroot.org>; Sun, 24 Sep 2017 14:21:14 +0000 (UTC)","from [10.8.0.14] (10.3.7.11) by beleexch01.local.ess-mail.com\n\t(10.3.7.8) with Microsoft SMTP Server (TLS) id 15.0.847.32;\n\tSun, 24 Sep 2017 16:20:55 +0200"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","To":"=?utf-8?q?Ga=C3=ABl_PORTAY?= <gael.portay@savoirfairelinux.com>","References":"<20170923233007.13772-1-gael.portay@savoirfairelinux.com>\n\t<20170923233007.13772-3-gael.portay@savoirfairelinux.com>\n\t<8c1d85a4-4390-047f-1d21-af37842a0040@mind.be>\n\t<20170924141207.muyixrdd2u27n7uw@gportay>","From":"Arnout Vandecappelle <arnout@mind.be>","Organization":"Essensium/Mind","Message-ID":"<71439ed0-48d7-ac9f-3cf5-33748f566fea@mind.be>","Date":"Sun, 24 Sep 2017 16:20:41 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170924141207.muyixrdd2u27n7uw@gportay>","Content-Language":"en-GB","X-Originating-IP":"[10.3.7.11]","X-ClientProxiedBy":"beleexch01.local.ess-mail.com (10.3.7.8) To\n\tbeleexch01.local.ess-mail.com (10.3.7.8)","Cc":"buildroot@buildroot.org","Subject":"Re: [Buildroot] [PATCH 2/3] raspberrypi: post-image.sh add new\n\tgpu_mem option","X-BeenThere":"buildroot@busybox.net","X-Mailman-Version":"2.1.18-1","Precedence":"list","List-Id":"Discussion and development of buildroot <buildroot.busybox.net>","List-Unsubscribe":"<http://lists.busybox.net/mailman/options/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=unsubscribe>","List-Archive":"<http://lists.busybox.net/pipermail/buildroot/>","List-Post":"<mailto:buildroot@busybox.net>","List-Help":"<mailto:buildroot-request@busybox.net?subject=help>","List-Subscribe":"<http://lists.busybox.net/mailman/listinfo/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"buildroot-bounces@busybox.net","Sender":"\"buildroot\" <buildroot-bounces@busybox.net>"}},{"id":1774256,"web_url":"http://patchwork.ozlabs.org/comment/1774256/","msgid":"<20170924164905.qapjtso5vh37mbyj@gportay>","list_archive_url":null,"date":"2017-09-24T16:49:05","subject":"Re: [Buildroot] [PATCH 2/3] raspberrypi: post-image.sh add new\n\tgpu_mem option","submitter":{"id":70334,"url":"http://patchwork.ozlabs.org/api/people/70334/","name":"Gaël PORTAY","email":"gael.portay@savoirfairelinux.com"},"content":"On Sun, Sep 24, 2017 at 04:20:41PM +0200, Arnout Vandecappelle wrote:\n> On 24-09-17 16:12, Gaël PORTAY wrote:\n> > In the end, what I would like to have is to give config.txt options as\n> > arguments to post-image.sh; that are echo'ed to the file. Because some\n> > options are already presents in the config.txt file, we have either to\n> > sed or to echo/cat.\n> > \n> > Something arround...\n> > \n> > \t$ post-image.sh skip-first-arg enable_uart=1 dtoverlay=pi3-miniuart-bt gpu_mem=200\n> > \n> > and...\n> > \n> > \tshift\n> > \twhile [ $# -eq 0 ]; do\n> > \t\techo \"$1\" >>$BINARIES_DIR/rpi-firmware/config.txt\n> > \t\tshift\n> > \tdone\n> > \n> > \tgenimage ...\n> > \n> > So we no longer needs to update the script each time we need to add a\n> > new argument that plays with the config.txt.\n> > \n> > What do you think?\n> \n>  Well, then it's probably easier to just copy a config.txt, no? Perhaps adding\n> options for custom config.txt to rpi-firmware?\n>\n\nYes. For now, it is simple to have one config.txt per rpi-board as there\nis a limited number of raspberrypi config. But, the config.txt will\nprobably be duplicated many times.\n\nFor a user point of view, my suggestion makes the customization more\nversatile.\n\nIf the user have a rpi3 with a lirc-rpi module (do not know what it is),\nhe will have to edit manually the config.txt.\n\n\t# cat <<EOF >output/images/rpi-firmare/config.txt\n\tdtoverlay=lirc-rpi\n\tEOF\n\nThis is fair.\n\nIf the user want it to be mainlined, he will have to add an extra option\nin the post-image script. And we probably have to maintain many (all? or\nat least dtoverlays) config.txt options.\n\nWith my suggestion, the user is able to add dtoverlay=lirc-rpi to the\nlist of post-scripts arguments.\n\n\tBR2_ROOTFS_POST_SCRIPT_ARGS=\"... dtoverlay=lirc-rpi\"\n\nThus we do not need to maintain all config.txt options in the script\npost-image.sh. The config.txt can be tunned using make menuconfig. \n\n\tshift\n\twhile [ $# -eq ]; do\n\t\tcase \"$1\" in\n\t\t# keep legacy cases (--add-pi3-miniuart-bt-overlay, --aarch64...)\n\t\t*) # or *=*)\n\t\t\techo \"$1\" >>${BINARIES_DIR}/rpi-firmware/config.txt\n\t\t\t# or sed -i -e \"/^${1#=}/d;\\$a$1\" ${BINARIES_DIR}/rpi-firmware/config.txt\n\t\t\t;;\n\t\tesac\n\t\tshift\n\tdone\n\nNote: Maybe, we should reduce the config.txt to the bare minimum set of\noption and rely on default values.","headers":{"Return-Path":"<buildroot-bounces@busybox.net>","X-Original-To":["incoming@patchwork.ozlabs.org","buildroot@lists.busybox.net"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","buildroot@osuosl.org"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=busybox.net\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=buildroot-bounces@busybox.net;\n\treceiver=<UNKNOWN>)","Received":["from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y0Y8V115xz9sRW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 02:49:13 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 17CEC87D42;\n\tSun, 24 Sep 2017 16:49:12 +0000 (UTC)","from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 9PpHYbk2xLRJ; Sun, 24 Sep 2017 16:49:10 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id BEE3A87439;\n\tSun, 24 Sep 2017 16:49:10 +0000 (UTC)","from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 456211C1E7D\n\tfor <buildroot@lists.busybox.net>;\n\tSun, 24 Sep 2017 16:49:09 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 3A70387FEB\n\tfor <buildroot@lists.busybox.net>;\n\tSun, 24 Sep 2017 16:49:09 +0000 (UTC)","from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id PdgbygzCQWUt for <buildroot@lists.busybox.net>;\n\tSun, 24 Sep 2017 16:49:08 +0000 (UTC)","from mail.savoirfairelinux.com (mail.savoirfairelinux.com\n\t[208.88.110.44])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id E597587FE0\n\tfor <buildroot@buildroot.org>; Sun, 24 Sep 2017 16:49:07 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby mail.savoirfairelinux.com (Postfix) with ESMTP id 60BAC9C19B8;\n\tSun, 24 Sep 2017 12:49:06 -0400 (EDT)","from mail.savoirfairelinux.com ([127.0.0.1])\n\tby localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new,\n\tport 10032)\n\twith ESMTP id OL5jDhMiOK3O; Sun, 24 Sep 2017 12:49:05 -0400 (EDT)","from localhost (localhost [127.0.0.1])\n\tby mail.savoirfairelinux.com (Postfix) with ESMTP id E5E309C1CB2;\n\tSun, 24 Sep 2017 12:49:05 -0400 (EDT)","from mail.savoirfairelinux.com ([127.0.0.1])\n\tby localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new,\n\tport 10026)\n\twith ESMTP id H-RrF-YLb8i0; Sun, 24 Sep 2017 12:49:05 -0400 (EDT)","from gportay (modemcable013.17-177-173.mc.videotron.ca\n\t[173.177.17.13])\n\tby mail.savoirfairelinux.com (Postfix) with ESMTPSA id BB54F9C19B8;\n\tSun, 24 Sep 2017 12:49:05 -0400 (EDT)"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org","amavisd-new at mail.savoirfairelinux.com"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","Date":"Sun, 24 Sep 2017 12:49:05 -0400","From":"=?iso-8859-1?q?Ga=EBl?= PORTAY <gael.portay@savoirfairelinux.com>","To":"Arnout Vandecappelle <arnout@mind.be>","Message-ID":"<20170924164905.qapjtso5vh37mbyj@gportay>","References":"<20170923233007.13772-1-gael.portay@savoirfairelinux.com>\n\t<20170923233007.13772-3-gael.portay@savoirfairelinux.com>\n\t<8c1d85a4-4390-047f-1d21-af37842a0040@mind.be>\n\t<20170924141207.muyixrdd2u27n7uw@gportay>\n\t<71439ed0-48d7-ac9f-3cf5-33748f566fea@mind.be>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<71439ed0-48d7-ac9f-3cf5-33748f566fea@mind.be>","User-Agent":"NeoMutt/20161104 (1.7.1)","Cc":"buildroot@buildroot.org","Subject":"Re: [Buildroot] [PATCH 2/3] raspberrypi: post-image.sh add new\n\tgpu_mem option","X-BeenThere":"buildroot@busybox.net","X-Mailman-Version":"2.1.18-1","Precedence":"list","List-Id":"Discussion and development of buildroot <buildroot.busybox.net>","List-Unsubscribe":"<http://lists.busybox.net/mailman/options/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=unsubscribe>","List-Archive":"<http://lists.busybox.net/pipermail/buildroot/>","List-Post":"<mailto:buildroot@busybox.net>","List-Help":"<mailto:buildroot-request@busybox.net?subject=help>","List-Subscribe":"<http://lists.busybox.net/mailman/listinfo/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=subscribe>","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"buildroot-bounces@busybox.net","Sender":"\"buildroot\" <buildroot-bounces@busybox.net>"}}]