From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: [kvm-unit-tests PATCH 2/6] mkstandalone: fix generation for arm Date: Fri, 22 Jan 2016 15:58:25 +0100 Message-ID: <1453474709-10679-3-git-send-email-drjones@redhat.com> References: <1453474709-10679-1-git-send-email-drjones@redhat.com> Cc: pbonzini@redhat.com, rkrcmar@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:59461 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752733AbcAVO6j (ORCPT ); Fri, 22 Jan 2016 09:58:39 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 1D60019CF65 for ; Fri, 22 Jan 2016 14:58:39 +0000 (UTC) In-Reply-To: <1453474709-10679-1-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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