[Top][All Lists]

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

[Qemu-devel] [PATCH] update-linux-headers.sh: Don't hard code list of ar

From: Peter Maydell
Subject: [Qemu-devel] [PATCH] update-linux-headers.sh: Don't hard code list of architectures
Date: Tue, 17 Jul 2012 17:41:47 +0100

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 <address@hidden>
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
-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"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]