From patchwork Sun Nov 15 14:36:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 1400447 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=D/AmZFhg; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CYvsS2sHrz9sSn for ; Mon, 16 Nov 2020 01:36:27 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1F83686A94; Sun, 15 Nov 2020 14:36:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X0LME88ETt62; Sun, 15 Nov 2020 14:36:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 8C22C86A79; Sun, 15 Nov 2020 14:36:23 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id EA0161BF293 for ; Sun, 15 Nov 2020 14:36:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id DC13720242 for ; Sun, 15 Nov 2020 14:36:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TVhUTXn8QrLt for ; Sun, 15 Nov 2020 14:36:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by silver.osuosl.org (Postfix) with ESMTPS id 581CB20198 for ; Sun, 15 Nov 2020 14:36:16 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id p22so21377588wmg.3 for ; Sun, 15 Nov 2020 06:36:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W2g6H5aTlcpSD98C6KjgTI+NSb4JZHwg3kVCDFpkkwE=; b=D/AmZFhgsisyIt0s1lfZ1DyxRa50vsH38ztkhsn26toRprSndJ4+c9XWR9gEyF4947 pC74q9pqLU8Qsx01EbASn/YOz2j8pwLUq7eGsS23bedNeLcfheJQNECg97q6dzcUmEya gqbLVfh+GjHg8yBzFNeeczgp6xX+G7ftRwha+UppCTiUDVbVfY6ZQW1NPsfTm0B7nh47 brUXY6/Sf7kRrY7s/ylInMj6OkwEXxsfRtBu6/vCT80NckYwQHEO7yx4JKJKtkoio9Wn asDotjHR5ZP9J7drNyhVN5wtIVOY9EudCpivlIDYvmrXMUQFNlzAjwttx0xwFNgbgXcO 12Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W2g6H5aTlcpSD98C6KjgTI+NSb4JZHwg3kVCDFpkkwE=; b=PMThHLUvtD/SGRTUFYXhb+EK2QXyGpDbalCTK2HkBesSDuwn4/eN6AAM4ts5SI+hqa TcfAGziG7FfPuqZE7CDXdxK2WY1wnz0ZcgIQKDKo5y8eY1mF9aZg9e/M1ZmYkFK7hkWR P8qCsRKlMaMB+htj9A/DDVIZs2gMLCeZwsxTAHhqR69fVBSnKOoo6Kpb8Zf4aGPCXnjH w2fiROHetx22ncUOjha36XHIsVKwQW7mGAxfgiZxpz13SGLOSpkKG+UZ5ujke8YPMaAC sEG78HIdjmdXbu7FILok/7FIQhAx5dAzaF3vwRZE3fVtBy2YDCSo0yk4mHNbm9JhqY4i FBsw== X-Gm-Message-State: AOAM533GhwJwvSpfjMGPM3eAlDFrmC5bGI3HUtwRokt7JtBX0AYgg15n +PSzC8bkgg31XO858ORmjsMmwG7Aygo= X-Google-Smtp-Source: ABdhPJwDL7TGPthhGbpe7cJLMphjlWSnjnVYA+6tif2LqElptU8eoNexXUHSaeZfJT4SjYu54LK0GQ== X-Received: by 2002:a7b:cc84:: with SMTP id p4mr11336126wma.86.1605450974507; Sun, 15 Nov 2020 06:36:14 -0800 (PST) Received: from localhost.localdomain (2a01cb058f8a18003dbee9eed79eb521.ipv6.abo.wanadoo.fr. [2a01:cb05:8f8a:1800:3dbe:e9ee:d79e:b521]) by smtp.gmail.com with ESMTPSA id d3sm18754333wre.91.2020.11.15.06.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Nov 2020 06:36:13 -0800 (PST) From: Romain Naour To: buildroot@buildroot.org Date: Sun, 15 Nov 2020 15:36:07 +0100 Message-Id: <20201115143609.2160080-2-romain.naour@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201115143609.2160080-1-romain.naour@gmail.com> References: <20201115143609.2160080-1-romain.naour@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [=PATCH v3 2/4] board/qemu/post-image.sh: execute from BINARIES_DIR X-BeenThere: buildroot@busybox.net 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: , Cc: Romain Naour , "Yann E . MORIN" Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Usually the qemu command line start directly with "qemu-system- ...". But the command line for qemu_arm_vexpress_tz_defconfig start by doing "cd output/images && ../host/bin/qemu-system-arm". This is necessary since boot binaries, except BL1, are primarily loaded via semi-hosting so all binaries has to reside in the same directory as QEMU is started from [1]. To order to handle this case correctly, update the post-image.sh used by all qemu defconfigs to execute qemu from BINARIES_DIR. Since we have to change the current directory use a subshell to restore the current directory after Qemu execution. [1] https://github.com/ARM-software/arm-trusted-firmware/blob/4ebbea9592ab37fc62217d0ac62fa13a3e063527/docs/plat/qemu.rst Signed-off-by: Romain Naour Cc: Yann E. MORIN --- board/qemu/post-image.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/board/qemu/post-image.sh b/board/qemu/post-image.sh index f34bf5043a..b7ee418e07 100755 --- a/board/qemu/post-image.sh +++ b/board/qemu/post-image.sh @@ -19,9 +19,9 @@ if [ -z "${QEMU_CMD_LINE}" ]; then exit 0 fi -# Replace output/images path by ${BINARIES_DIR} since the script -# will be in the same directory as the kernel and the rootfs images. -QEMU_CMD_LINE="${QEMU_CMD_LINE//output\/images/\${BINARIES_DIR\}}" +# Remove output/images path since the script will be in +# the same directory as the kernel and the rootfs images. +QEMU_CMD_LINE="${QEMU_CMD_LINE//output\/images/}" # Remove -serial stdio if present, keep it as default args DEFAULT_ARGS="$(sed -r -e '/-serial stdio/!d; s/.*(-serial stdio).*/\1/' <<<"${QEMU_CMD_LINE}")" @@ -40,7 +40,9 @@ esac cat <<-_EOF_ > "${START_QEMU_SCRIPT}" #!/bin/sh + ( BINARIES_DIR="\${0%/*}/" + cd \${BINARIES_DIR} if [ "\${1}" = "serial-only" ]; then EXTRA_ARGS='${SERIAL_ARGS}' @@ -50,6 +52,7 @@ cat <<-_EOF_ > "${START_QEMU_SCRIPT}" export PATH="${HOST_DIR}/bin:\${PATH}" exec ${QEMU_CMD_LINE} \${EXTRA_ARGS} + ) _EOF_ chmod +x "${START_QEMU_SCRIPT}"