mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 06/14] test: emulate.pl: fix firmware use with non-tuxmake out-of-tree build
Date: Tue, 11 Apr 2023 09:14:28 +0200	[thread overview]
Message-ID: <20230411071436.1630752-7-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230411071436.1630752-1-a.fatoum@pengutronix.de>

The YAMLs may contain URLs for firmware that needs to be fetched before
starting Qemu. This firmware needs to be installed where Qemu will find
it, which is _not_ the source directory for out-of-tree builds. This
adjust the path.

Fixes: 7271ce78d0fc ("test: add emulate.pl, a runner for barebox on emulated targets")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/emulate.pl | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/test/emulate.pl b/test/emulate.pl
index b5e2188b86dd..a4ca6b7aee6e 100755
--- a/test/emulate.pl
+++ b/test/emulate.pl
@@ -18,6 +18,17 @@ my @QEMU_INTERACTIVE_OPTS = qw(-serial mon:stdio -trace file=/dev/null);
 
 my %targets;
 
+my $LG_BUILDDIR;
+
+if (exists $ENV{KBUILD_OUTPUT}) {
+    $LG_BUILDDIR = $ENV{KBUILD_OUTPUT};
+} elsif (-d 'build') {
+    $LG_BUILDDIR = 'build';
+} else {
+    $LG_BUILDDIR = getcwd();
+}
+
+
 for my $arch (glob dirname(__FILE__) . "/*/") {
     for my $cfg (glob "$arch/*.yaml") {
 	my $linkdest = readlink $cfg // '';
@@ -152,7 +163,7 @@ sub process {
 		    or die "Failed to download resource `$v': $?\n";
 	    }
 
-	    symlink_force("$dir/$k", "$k") unless $tuxmake;
+	    symlink_force("$dir/$k", "$LG_BUILDDIR/$k") unless $tuxmake;
 	}
 
 	if ($shell) {
@@ -388,20 +399,11 @@ sub rel2abs {
 
 sub abs_configpath {
     my ($path, $args) = @_;
-    my $LG_BUILDDIR;
 
     return unless defined $path;
     $path = $args->{target}{images}{$path};
     return unless defined $path;
 
-    if (exists $ENV{KBUILD_OUTPUT}) {
-	$LG_BUILDDIR = $ENV{KBUILD_OUTPUT};
-    } elsif (-d 'build') {
-	$LG_BUILDDIR = 'build';
-    } else {
-	$LG_BUILDDIR = getcwd();
-    }
-
     $path =~ s/\$LG_BUILDDIR\b/$LG_BUILDDIR/g;
 
     return rel2abs($path, $args->{builddir})
-- 
2.39.2




  parent reply	other threads:[~2023-04-11  7:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11  7:14 [PATCH master 00/14] treewide: fixes for master Ahmad Fatoum
2023-04-11  7:14 ` [PATCH master 01/14] test: riscv: fix YAMLs after defconfig rename Ahmad Fatoum
2023-04-11  7:14 ` [PATCH master 02/14] RISC-V: board-dt-2nd: fix hang in startup Ahmad Fatoum
2023-04-11  7:14 ` [PATCH master 03/14] RISC-V: sifive: disable non-functional SPI nodes Ahmad Fatoum
2023-04-11  7:14 ` [PATCH master 04/14] video: qemu-ramfb: reduce -ENODEV lo level to debug Ahmad Fatoum
2023-04-11  7:14 ` [PATCH master 05/14] gpiolib: fix gpio label generation with gpiod_get Ahmad Fatoum
2023-04-11  7:14 ` Ahmad Fatoum [this message]
2023-04-11  7:14 ` [PATCH master 07/14] RISC-V: restrict GCC optimization some more Ahmad Fatoum
2023-04-11  7:14 ` [PATCH master 08/14] RISC-V: configs: rv64i_defconfig: disable SBI serial Ahmad Fatoum
2023-04-11  7:14 ` [PATCH master 09/14] net: dsa: realtek: include needed headers directly Ahmad Fatoum
2023-04-11  7:14 ` [PATCH master 10/14] net: linux/mdio.h: add missing init.h header Ahmad Fatoum
2023-04-11  7:14 ` [PATCH master 11/14] Kbuild: export CROSS_PKG_CONFIG Ahmad Fatoum
2023-04-11  7:14 ` [PATCH master 12/14] treewide: fix includes missed by multiarch support Ahmad Fatoum
2023-04-11  7:14 ` [PATCH master 13/14] mci: dw_mmc: make reset optional Ahmad Fatoum
2023-04-11  7:14 ` [PATCH master 14/14] kbuild: remove useless use of /usr/bin/env Ahmad Fatoum
2023-04-11 11:57   ` Sascha Hauer
2023-04-11 11:44 ` [PATCH master 00/14] treewide: fixes for master Sascha Hauer

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=20230411071436.1630752-7-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox