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: 10049 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id ABAA52402A for ; Tue, 17 Jul 2012 16:41:53 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 6C5C2A182D4 for ; Tue, 17 Jul 2012 16:41:53 +0000 (UTC) Received: by yenq6 with SMTP id q6so645908yen.11 for ; Tue, 17 Jul 2012 09:41:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=TPDiE1lJVPaNfQmOinQmaVdX57HYf8oz8m00Kgma+CI=; b=GFUIWwN4BTXMxWlYb42qUYpTXDbyb3e/ts9dRbM0nSoYicBgGKKQQUMyPyLIVoBO0k YYpQCAc20oQ5EsN3SmET2b9CRSPu23CDkxLMT61Aqt6z0xrOMe3p8vc7WhSb55/KWdvV /BsUvJJSoIZt94lQ/d+ESC8mWeMSHxkZa6zimQ3S40UX9L+EMhLI7XJ25jLHWmc4NJpi U//nwhEH/EeEgsWKFDWA8VUIwnbP/9dYCpB8zr7kF+84CTwL4E5p+K6E0GNrjgzpyBJv 4Davqw0at9NSCRDl5Z5OazlX2F41j3zV5PlNbS+pS6VwvxjtZsnSdNBQp6PhOWM0bW/V xPfQ== Received: by 10.50.203.39 with SMTP id kn7mr1975896igc.53.1342543312503; Tue, 17 Jul 2012 09:41:52 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.241.2 with SMTP id lc2csp21931ibb; Tue, 17 Jul 2012 09:41:51 -0700 (PDT) Received: by 10.216.173.136 with SMTP id v8mr1778080wel.167.1342543311202; Tue, 17 Jul 2012 09:41:51 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id g49si25013537wel.114.2012.07.17.09.41.50 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Jul 2012 09:41:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk 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 Cc: patches@linaro.org, Jan Kiszka Subject: [PATCH] update-linux-headers.sh: Don't hard code list of architectures 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-Gm-Message-State: ALoCoQkS5C3slMlQvTWQX0GpQW1Hzt1zobDHbwUDkZLL5FPJlmUfQMIqYPvGx3Ywrm93UhF9oYlI 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"