From patchwork Tue Jul 17 16:41:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 171482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F072A2C007E for ; Wed, 18 Jul 2012 02:42:16 +1000 (EST) Received: from localhost ([::1]:45924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrAql-0005KV-1R for incoming@patchwork.ozlabs.org; Tue, 17 Jul 2012 12:42:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrAqb-0005Jf-Eu for qemu-devel@nongnu.org; Tue, 17 Jul 2012 12:42:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrAqT-0002Lr-4h for qemu-devel@nongnu.org; Tue, 17 Jul 2012 12:42:05 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:37078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrAqS-0002LI-UX for qemu-devel@nongnu.org; Tue, 17 Jul 2012 12:41:57 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1SrAqJ-0002rH-UK; Tue, 17 Jul 2012 17:41:47 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 17 Jul 2012 17:41:47 +0100 Message-Id: <1342543307-10964-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Jan Kiszka , patches@linaro.org Subject: [Qemu-devel] [PATCH] update-linux-headers.sh: Don't hard code list of architectures X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Rather than hardcoding the list of architectures in the kernel header update script, just import headers for every architecture which supports KVM. This reduces the number of QEMU files which need to be updated to add support for a new KVM architecture. It also means we won't break if the kernel drops support for an architecture in the future. Signed-off-by: Peter Maydell --- I'd like this for ARM, obviously. NB that this change will mean we'll pick up the ia64 kvm headers next time somebody does a kernel header update; this seems harmless (and perhaps even useful?). ia64 'make headers_install' is a bit noisy as of 3.5-rc5 but succeeds anyway. scripts/update-linux-headers.sh | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 9d2a4bc..2c76685 100755 --- a/scripts/update-linux-headers.sh +++ b/scripts/update-linux-headers.sh @@ -28,7 +28,16 @@ if [ -z "$output" ]; then output="$PWD" fi -for arch in x86 powerpc s390; do +# This will pick up non-directories too (eg "Kconfig") but we will +# ignore them in the next loop. +ARCHLIST=$(cd "$linux/arch" && echo *) + +for arch in $ARCHLIST; do + # Discard anything which isn't a KVM-supporting architecture + if ! [ -e "$linux/arch/$arch/include/asm/kvm.h" ]; then + continue + fi + make -C "$linux" INSTALL_HDR_PATH="$tmpdir" SRCARCH=$arch headers_install rm -rf "$output/linux-headers/asm-$arch"