[kvm-unit-tests PATCH 2/6] mkstandalone: fix generation for arm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The mkstandalone rewrite now packages the architecture run scripts.
This brings many benefits, but at the cost of no longer being able
to source additional files from the run script, at least not while
in standalone mode. We can live with that, but arm/run was sourcing
config.mak, so we need to stop that in standalone mode, as well as
to provide the standalone arm/run script what it needs.

Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
---
 arm/run                 | 10 ++++++----
 scripts/mkstandalone.sh | 11 ++++++++++-
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/arm/run b/arm/run
index 4a648697d7fb5..0158ca5649a9f 100755
--- a/arm/run
+++ b/arm/run
@@ -1,10 +1,12 @@
 #!/bin/bash
 
-if [ ! -f config.mak ]; then
-	echo run ./configure first. See ./configure -h
-	exit 2
+if [ -z "$STANDALONE" ]; then
+	if [ ! -f config.mak ]; then
+		echo "run ./configure && make first. See ./configure -h"
+		exit 2
+	fi
+	source config.mak
 fi
-source config.mak
 processor="$PROCESSOR"
 
 if [ -c /dev/kvm ]; then
diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
index 58910059a3559..b0f1e7c098afb 100755
--- a/scripts/mkstandalone.sh
+++ b/scripts/mkstandalone.sh
@@ -29,12 +29,21 @@ temp_file ()
 	echo "chmod +x \$$var"
 }
 
+config_export ()
+{
+	echo "export $(grep ^${1}= config.mak)"
+}
+
 generate_test ()
 {
 	local args=( $(escape "${@}") )
 
 	echo "#!/bin/bash"
-	grep '^ARCH=' config.mak
+	echo "export STANDALONE=yes"
+	echo "export HOST=\$(uname -m | sed -e s/i.86/i386/ | sed -e 's/arm.*/arm/')"
+	config_export ARCH
+	config_export ARCH_NAME
+	config_export PROCESSOR
 
 	if [ ! -f $kernel ]; then
 		echo 'echo "skip '"$testname"' (test kernel not present)"'
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux