{"id":817851,"url":"http://patchwork.ozlabs.org/api/patches/817851/?format=json","web_url":"http://patchwork.ozlabs.org/project/buildroot/patch/20170923233007.13772-2-gael.portay@savoirfairelinux.com/","project":{"id":27,"url":"http://patchwork.ozlabs.org/api/projects/27/?format=json","name":"Buildroot development","link_name":"buildroot","list_id":"buildroot.buildroot.org","list_email":"buildroot@buildroot.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170923233007.13772-2-gael.portay@savoirfairelinux.com>","list_archive_url":null,"date":"2017-09-23T23:30:05","name":"[1/3] raspberrypi: post-image.sh handles many arguments","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"cabe3c71a327af3483956e25fafa8aae701fb562","submitter":{"id":70334,"url":"http://patchwork.ozlabs.org/api/people/70334/?format=json","name":"Gaël PORTAY","email":"gael.portay@savoirfairelinux.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/buildroot/patch/20170923233007.13772-2-gael.portay@savoirfairelinux.com/mbox/","series":[{"id":4797,"url":"http://patchwork.ozlabs.org/api/series/4797/?format=json","web_url":"http://patchwork.ozlabs.org/project/buildroot/list/?series=4797","date":"2017-09-23T23:30:05","name":"Fix Qt WE run-time issue on RPI3","version":1,"mbox":"http://patchwork.ozlabs.org/series/4797/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/817851/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/817851/checks/","tags":{},"related":[],"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 3y065l6k6yz9t43\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 24 Sep 2017 09:30:18 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 168DB86B5E;\n\tSat, 23 Sep 2017 23:30:16 +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 DCUuZkFEY--a; Sat, 23 Sep 2017 23:30:15 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 61D4E81BD6;\n\tSat, 23 Sep 2017 23:30:15 +0000 (UTC)","from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 5F4411C0D8C\n\tfor <buildroot@lists.busybox.net>;\n\tSat, 23 Sep 2017 23:30:14 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 5A57A88C0D\n\tfor <buildroot@lists.busybox.net>;\n\tSat, 23 Sep 2017 23:30:14 +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 mvHMq1NfxljA for <buildroot@lists.busybox.net>;\n\tSat, 23 Sep 2017 23:30:13 +0000 (UTC)","from mail.savoirfairelinux.com (mail.savoirfairelinux.com\n\t[208.88.110.44])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 120AD88C08\n\tfor <buildroot@buildroot.org>; Sat, 23 Sep 2017 23:30:12 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby mail.savoirfairelinux.com (Postfix) with ESMTP id DEC5B9C1A55;\n\tSat, 23 Sep 2017 19:30:11 -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 j-jkSq4tLB3n; Sat, 23 Sep 2017 19:30:11 -0400 (EDT)","from localhost (localhost [127.0.0.1])\n\tby mail.savoirfairelinux.com (Postfix) with ESMTP id 661EC9C1A76;\n\tSat, 23 Sep 2017 19:30:11 -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 QPxEb9pkQF1l; Sat, 23 Sep 2017 19:30:11 -0400 (EDT)","from localhost.localdomain (unknown [172.16.15.6])\n\tby mail.savoirfairelinux.com (Postfix) with ESMTPSA id 250A69C1A55;\n\tSat, 23 Sep 2017 19:30:11 -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","From":"=?utf-8?q?Ga=C3=ABl_PORTAY?= <gael.portay@savoirfairelinux.com>","To":"buildroot@buildroot.org, Arnout Vandecappelle <arnout@mind.be>,\n\tZoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>","Date":"Sat, 23 Sep 2017 19:30:05 -0400","Message-Id":"<20170923233007.13772-2-gael.portay@savoirfairelinux.com>","X-Mailer":"git-send-email 2.13.2","In-Reply-To":"<20170923233007.13772-1-gael.portay@savoirfairelinux.com>","References":"<20170923233007.13772-1-gael.portay@savoirfairelinux.com>","MIME-Version":"1.0","Cc":"=?utf-8?q?Ga=C3=ABl_PORTAY?= <gael.portay@savoirfairelinux.com>","Subject":"[Buildroot] [PATCH 1/3] raspberrypi: post-image.sh handles many\n\targuments","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>"},"content":"This post-image script now handles many optional arguments given\nthrough the command-line.\n\nSigned-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>\n---\n board/raspberrypi/post-image.sh | 42 ++++++++++++++++++++++-------------------\n 1 file changed, 23 insertions(+), 19 deletions(-)","diff":"diff --git a/board/raspberrypi/post-image.sh b/board/raspberrypi/post-image.sh\nindex de972998b0..1b49f0ea30 100755\n--- a/board/raspberrypi/post-image.sh\n+++ b/board/raspberrypi/post-image.sh\n@@ -5,38 +5,42 @@ BOARD_NAME=\"$(basename ${BOARD_DIR})\"\n GENIMAGE_CFG=\"${BOARD_DIR}/genimage-${BOARD_NAME}.cfg\"\n GENIMAGE_TMP=\"${BUILD_DIR}/genimage.tmp\"\n \n-case \"${2}\" in\n-\t--add-pi3-miniuart-bt-overlay)\n-\tif ! grep -qE '^dtoverlay=' \"${BINARIES_DIR}/rpi-firmware/config.txt\"; then\n-\t\techo \"Adding 'dtoverlay=pi3-miniuart-bt' to config.txt (fixes ttyAMA0 serial console).\"\n-\t\tcat << __EOF__ >> \"${BINARIES_DIR}/rpi-firmware/config.txt\"\n+shift\n+while [ $# -ne 0 ]; do\n+\tcase \"${1}\" in\n+\t\t--add-pi3-miniuart-bt-overlay)\n+\t\tif ! grep -qE '^dtoverlay=' \"${BINARIES_DIR}/rpi-firmware/config.txt\"; then\n+\t\t\techo \"Adding 'dtoverlay=pi3-miniuart-bt' to config.txt (fixes ttyAMA0 serial console).\"\n+\t\t\tcat << __EOF__ >> \"${BINARIES_DIR}/rpi-firmware/config.txt\"\n \n # fixes rpi3 ttyAMA0 serial console\n dtoverlay=pi3-miniuart-bt\n __EOF__\n-\tfi\n-\t;;\n-\t--aarch64)\n-\t# Run a 64bits kernel (armv8)\n-\tsed -e '/^kernel=/s,=.*,=Image,' -i \"${BINARIES_DIR}/rpi-firmware/config.txt\"\n-\tif ! grep -qE '^arm_control=0x200' \"${BINARIES_DIR}/rpi-firmware/config.txt\"; then\n-\t\tcat << __EOF__ >> \"${BINARIES_DIR}/rpi-firmware/config.txt\"\n+\t\tfi\n+\t\t;;\n+\t\t--aarch64)\n+\t\t# Run a 64bits kernel (armv8)\n+\t\tsed -e '/^kernel=/s,=.*,=Image,' -i \"${BINARIES_DIR}/rpi-firmware/config.txt\"\n+\t\tif ! grep -qE '^arm_control=0x200' \"${BINARIES_DIR}/rpi-firmware/config.txt\"; then\n+\t\t\tcat << __EOF__ >> \"${BINARIES_DIR}/rpi-firmware/config.txt\"\n \n # enable 64bits support\n arm_control=0x200\n __EOF__\n-\tfi\n+\t\tfi\n \n-\t# Enable uart console\n-\tif ! grep -qE '^enable_uart=1' \"${BINARIES_DIR}/rpi-firmware/config.txt\"; then\n-\t\tcat << __EOF__ >> \"${BINARIES_DIR}/rpi-firmware/config.txt\"\n+\t\t# Enable uart console\n+\t\tif ! grep -qE '^enable_uart=1' \"${BINARIES_DIR}/rpi-firmware/config.txt\"; then\n+\t\t\tcat << __EOF__ >> \"${BINARIES_DIR}/rpi-firmware/config.txt\"\n \n # enable rpi3 ttyS0 serial console\n enable_uart=1\n __EOF__\n-\tfi\n-\t;;\n-esac\n+\t\tfi\n+\t\t;;\n+\tesac\n+\tshift\n+done\n \n rm -rf \"${GENIMAGE_TMP}\"\n \n","prefixes":["1/3"]}