From patchwork Sat Jul 13 19:22:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fiona Klute X-Patchwork-Id: 1960220 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WLyz9184lz1xqj for ; Sun, 14 Jul 2024 05:22:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7CC57820A1; Sat, 13 Jul 2024 19:22:41 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Om-RF9eRvBH1; Sat, 13 Jul 2024 19:22:40 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org D78DB82085 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id D78DB82085; Sat, 13 Jul 2024 19:22:38 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id EB3251BF3F6 for ; Sat, 13 Jul 2024 19:22:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D82E0401D8 for ; Sat, 13 Jul 2024 19:22:34 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id v99leW5S_etz for ; Sat, 13 Jul 2024 19:22:34 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=212.227.17.22; helo=mout.gmx.net; envelope-from=fiona.klute@gmx.de; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 746F7400BF DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 746F7400BF Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by smtp2.osuosl.org (Postfix) with ESMTPS id 746F7400BF for ; Sat, 13 Jul 2024 19:22:33 +0000 (UTC) X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from haruka.lan ([85.22.112.6]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MowKc-1s0YVF2gH8-00hE6v; Sat, 13 Jul 2024 21:22:15 +0200 To: buildroot@buildroot.org Date: Sat, 13 Jul 2024 21:22:06 +0200 Message-ID: <20240713192207.873065-1-fiona.klute@gmx.de> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:yMTyxmuViq/opyhhJCZGq/pv2VwwmyCOA8yL4xwVVlXQfAdvyOK +Rz5PJlkwfGAH39UPHeerZtAih8NIqcTaZyP+rLogMCzanpVrCV0u/KPxMUaOwhCrI+CHcT zpTShgq1U/MM3QNMWSwmwxjkqR6fHx6ji9kTkP/KEZ6MG3LrAtP+Ih2pqtgyLWL99tMgElD ZuE6PKUvzqBvCPT6CV6Pg== UI-OutboundReport: notjunk:1;M01:P0:IJsxO1t0ZeA=;NsoXlrNaL71qD3PB/XXF9AikzpI f83Hol9qDbYSlaemLHuL8vZp1l7ePsN6KvLXoXi3UNBTqBR0EfcGjbrhMa8RpNwpWYLxkqYPj +WCPUaz+0vHhJaKM52GM4WPifYUHz1VequhBGDKyR+S9Vvq7NfUNQ6X+r4NS/V5Iwtq9vMQQ+ q59301I8rD1ZSWgwxCjeUUNKKulOvqib+d/bLqWIBGFXotm7SsXQP75WUa2CCeyhBuy4GWK5q tjH7E/tb0cU2vAlRIbknVMs3Mg/T9Fdn1XwuVdKzjKjM1wUW0bC5Ann8Awf9xa8SlZ/+o/Zij D19FAvGC8GkgBwg6oMCzKuUiI3BaBolUcEpbeh1zQ5T9xp8vFAtKheSluAKFJsOjotdZEtOiZ YZm17bdZzk01YQxBSKtUUISYUBlCLmvnhx3bgtqyvG2HqVDyyplTXJw9KWkmY2Ssf7SuSh41i 71B5GIu7Rb3/vodT37wDABT/L1HmiXdd9Pd+KNWX+8XssVdX+kzW3CXJGqXCFXPqTR1ZE6Ok3 fVlQCHcynONzFwKBLxxTMoSYpe86IUlq7HxaRGMa04rXabTXXTokVhTZ9r3ee4o7cBIO32oUI Ml333HFslnGlDeAbSJCUu4d3ibuW/KB4VO1wv2SA+gqChIU2L6H7V08hxF8TDU2uiiaWVqyyR IRo5Da0h3KDn3wHmqfzFmSbp9sb3LFqTrqYggMQmIULdRwxDH6b6bBiY24jZR/h1S8vJ8I1qN sWorsG11jt6TqlIJxJ0yl8gQ8KNqGQ39mCe3LHr+4AKP3mwfh1cCCmcE84uTyXOuaDOeaX4We kni2SUzyNE+apO2Yz5w7eaqg== X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1720898535; x=1721503335; i=fiona.klute@gmx.de; bh=7/edHMCe9EqveKDGs9fiTAyy2NPNVcgTqquTIU+nLCs=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-ID: MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=VK8MBFSgY6SENWgvpzPFb6u/0QfgFoVGDZnzYRTdwr6qQvJ7r1VjL+t9ccT3//ht Q13F4jvdQQP8BdcARJp+s3xsjs8Lqgrg5j5///t9UX1zHlcCHJvgmthjSuO7heJ1r ZCsA/iBzVaazY3DABrMKfPgbTM3ZC5PzTcOpDaiLvQbcLMeUik1WDLRDBxNrpMcbH 0MiG6RPPQ2rhvQSJOKLbSTBDbv+fdR4bCfTU/r+xgmRSlki4EAj3Xc8ZqPrI+NM/t M/pW1k6/VUUei+f/hOXMF0C8mfsJsfLED5ldUpF3eeBRM02LTT0UPKtFB1Bw6g1wm rG1XaIMPEG7SI/OD0w== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=fiona.klute@gmx.de header.a=rsa-sha256 header.s=s31663417 header.b=VK8MBFSg Subject: [Buildroot] [PATCH v3 1/2] utils/docker-run: mount and pass BR2_EXTERNAL dirs X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Fiona Klute via buildroot From: Fiona Klute Reply-To: Fiona Klute Cc: Thomas Petazzoni , Brandon Maier , "Fiona Klute \(WIWA\)" , Ricardo Martincoski Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" From: "Fiona Klute (WIWA)" The BR2_EXTERNAL environment variable is passed into the container, and each path listed in it mounted. This allows using external trees when running a build using utils/docker-run. Testing the existence of the variable instead of a non-empty value allows passing an empty BR2_EXTERNAL variable to disable currently set external trees. Signed-off-by: Fiona Klute (WIWA) Reviewed-by: Brandon Maier --- Changes v2 -> v3: * Use read to make the loop that creates mount options more robust, removing pre-exisiting shellcheck override. Suggested by Brandon Maier. Changes v1 -> v2: * Correctly handle spaces in external tree paths utils/docker-run | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) -- 2.45.2 diff --git a/utils/docker-run b/utils/docker-run index 1adb02d74e..dbb9c45fdd 100755 --- a/utils/docker-run +++ b/utils/docker-run @@ -90,10 +90,17 @@ if [ "${BR2_DL_DIR}" ]; then docker_opts+=( --env BR2_DL_DIR ) fi -# shellcheck disable=SC2013 # can't use while-read because of the assignment -for dir in $(printf '%s\n' "${mountpoints[@]}" |LC_ALL=C sort -u); do +if [ -v BR2_EXTERNAL ]; then + IFS=":" read -r -a br2_ext_arr <<< "${BR2_EXTERNAL}" + for br2_ext in "${br2_ext_arr[@]}"; do + mountpoints+=( "${br2_ext}" ) + done + docker_opts+=( --env BR2_EXTERNAL ) +fi + +while IFS=$'\n' read -r dir; do docker_opts+=( --mount "type=bind,src=${dir},dst=${dir}" ) -done +done < <(printf '%s\n' "${mountpoints[@]}" | LC_ALL=C sort -u) if tty -s; then docker_opts+=( -t ) From patchwork Sat Jul 13 19:22:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fiona Klute X-Patchwork-Id: 1960219 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WLyz40qJTz1xqj for ; Sun, 14 Jul 2024 05:22:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B3A6D80DB9; Sat, 13 Jul 2024 19:22:37 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id FPS0DD2GnuqE; Sat, 13 Jul 2024 19:22:36 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org BD6CC81E69 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id BD6CC81E69; Sat, 13 Jul 2024 19:22:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id A17121BF3F6 for ; Sat, 13 Jul 2024 19:22:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8F22860605 for ; Sat, 13 Jul 2024 19:22:34 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id AjM3AJ745-Fm for ; Sat, 13 Jul 2024 19:22:34 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=212.227.17.21; helo=mout.gmx.net; envelope-from=fiona.klute@gmx.de; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 22998605F5 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 22998605F5 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by smtp3.osuosl.org (Postfix) with ESMTPS id 22998605F5 for ; Sat, 13 Jul 2024 19:22:32 +0000 (UTC) X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from haruka.lan ([85.22.112.6]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N3KTy-1sJBoQ1HqE-00rBsv; Sat, 13 Jul 2024 21:22:16 +0200 To: buildroot@buildroot.org Date: Sat, 13 Jul 2024 21:22:07 +0200 Message-ID: <20240713192207.873065-2-fiona.klute@gmx.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240713192207.873065-1-fiona.klute@gmx.de> References: <20240713192207.873065-1-fiona.klute@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:gGbauvNzDks9CqAEWNL9L1c3iu+T7tEZs+b2N0dgWL6LKv/lUyv TUk1FKG08XCSUCcVUVHuFzT3ldeaR3qR5dYoJp9++4ayxX1+XrLKe00Vfo1XuLqcmPoqJpa tsvBq3d/vHxJS3sjbn83EXiSzh5jNrvuezCshVMB24Gmx503U6fQbyAQ9ucWH5Fn1BrUVvF zOSlOSdaLtuqF+cZ6OSfg== UI-OutboundReport: notjunk:1;M01:P0:3Pm7QBUsOQg=;fNlD6+rcp/hJRux0rAI+MO3Shbc XLt9yTxI1n/Ziq+9N+IseXwHQDsTWCJjibkvmYQQFw3O6onqqCAWnHZJEe9gzvTlX8mCPwbQ8 XIme6Xdn79M9VVCRAbcVWMxNOJKRo0bW4fYOPuEZogr4uwXiEiNw+jGxReolcqpLVwOqlslzM RS+Q/OUdZvRF1V2vODt5LgkXh/xBIVSm200iQpbVXRdnPioHvE79o7PyGG2aot8aRKzZScN1M XeG/eWFc5dN/GznTgH5s6+WBpshhGl4sNlJ+t7ldMRl8udUzjrF1GOh7CuLhkKNeEUVVK/7tJ xN83+QIfRUdNgGcrWwRYfEpSdIpWOC1OSC4BDKbiYmAasIQl5/Pa7sgCiA0GWyqCi9U56khGd eqasC0/0xf4qBjj4PB15XhauswB+Dk5CqAeS3CZf/QizTsE1OWQpSe8pYtkdLnF2iJHA/flya lE/eco2EzOkIrEAtYJ3qgmk+eA0wibpfmS5htyW0x9Sd3P9vWEj5XOVBs9xlhvwubOsHyOhYF hQV/ur+A+ymNhPALxip8ne7x53vnTUFzwRQkrV3Yp2/zoxtZTBSIElDQ+fxAdlgmzeYFH/p52 9rfZw6gl9yaxSakoJclrT5oBKuoUWj8sH3Ojo+taDqqdwVMi4LqDFOFd202wI0keprR0HgEgX RrC2MR0TkK2nDyHaUUkqUXGJX1JfXk6hxo7ng78vnXPgz8mtANCTha8vhFnrOOeIyVMwlvDxy BQTRhGyb3LSLWeqFp1wx1pY66eHeefyke9uQ6/bju5MUkW+UtrbQuAQb6ssbv/Xti17wqRxgZ MAKX5sF20HR5N83pbO9iyPEQ== X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1720898536; x=1721503336; i=fiona.klute@gmx.de; bh=29CreRqaesWH7SwAe6tuFeWmGQOvILnMnJzj7qHAaOA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-ID:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=tn5BleFdtyS3yYq7l2pJC5vBR7dDiVBPuZl5raOwIYnzUL/NcfRcMX4wR4hpKAsD gez5gmEBAom7Ui7SROS5EgsHTYv3+fNC0PFqKCo9Yy9SUMqI4oU5Q+/oxiUbaA+pL 26oEg3+mYhYf7zSnwbQt2gdKPgzYr2NahqiUn43vcCYtt2H8//F2OR6bmCXcfJc80 C6CoFtjetMCR/Qsm0lhZPfvr1y2xfKuZ7qE3xQh/56VZ9kPPsDHEpjOLhSdvWMGiQ KXkPDTH3u2vftE6WNkcv0S3pxOyw/U2hXXJGPwcJKOqM0lFHusiadsn2wdhUxAHe0 jieMffXygCM3+D1c7Q== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=gmx.de header.i=fiona.klute@gmx.de header.a=rsa-sha256 header.s=s31663417 header.b=tn5BleFd Subject: [Buildroot] [PATCH v3 2/2] support/scripts/br2-external: allow spaces in dirname X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Fiona Klute via buildroot From: Fiona Klute Reply-To: Fiona Klute Cc: Thomas Petazzoni , Brandon Maier , "Fiona Klute \(WIWA\)" , Ricardo Martincoski Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" From: "Fiona Klute (WIWA)" "make list-defconfigs" and "make nconfig" work in the container used by utils/docker-run with external trees with spaces in the directory name. Other build steps may or may not work. Signed-off-by: Fiona Klute (WIWA) Reviewed-by: Brandon Maier --- This is mostly a proof-of-concept to show the previous patch works, there might still be things that break in other parts of the build. I have not checked if "printf '%q'" works in Bash 3.1 (like a comment claims the script needs to support, not sure if still current). Changes v1 -> v2: * Added this patch support/scripts/br2-external | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.45.2 diff --git a/support/scripts/br2-external b/support/scripts/br2-external index 8aea479d20..b8b6179aa8 100755 --- a/support/scripts/br2-external +++ b/support/scripts/br2-external @@ -34,7 +34,8 @@ main() { trap "error 'unexpected error while generating ${ofile}\n'" ERR mkdir -p "${outputdir}" - do_validate "${outputdir}" ${@//:/ } + IFS=":" read -r -a br2_extdirs <<< "${@}" + do_validate "${outputdir}" "${br2_extdirs[@]}" do_mk "${outputdir}" do_kconfig "${outputdir}" } @@ -144,9 +145,9 @@ do_mk() { eval br2_ver="\"\${BR2_EXT_VERS_${br2_name}}\"" printf '\n' printf 'BR2_EXTERNAL_NAMES += %s\n' "${br2_name}" - printf 'BR2_EXTERNAL_DIRS += %s\n' "${br2_ext}" - printf 'BR2_EXTERNAL_MKS += %s/external.mk\n' "${br2_ext}" - printf 'export BR2_EXTERNAL_%s_PATH = %s\n' "${br2_name}" "${br2_ext}" + printf 'BR2_EXTERNAL_DIRS += %q\n' "${br2_ext}" + printf 'BR2_EXTERNAL_MKS += %q/external.mk\n' "${br2_ext}" + printf 'export BR2_EXTERNAL_%s_PATH = %q\n' "${br2_name}" "${br2_ext}" printf 'export BR2_EXTERNAL_%s_DESC = %s\n' "${br2_name}" "${br2_desc}" printf 'export BR2_EXTERNAL_%s_VERSION = %s\n' "${br2_name}" "${br2_ver}" done