]> git.proxmox.com Git - qemu.git/commitdiff
update-linux-headers.sh: Don't hard code list of architectures
authorPeter Maydell <peter.maydell@linaro.org>
Wed, 18 Jul 2012 10:11:09 +0000 (11:11 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Tue, 11 Sep 2012 21:14:49 +0000 (18:14 -0300)
Rather than hardcoding the list of architectures in the kernel
header update script, just import headers for every architecture
which supports KVM (with a blacklist exception for ia64 which
has KVM headers but is dead). This reduces the number of QEMU
files which need to be updated to add support for a new KVM
architecture.

Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
scripts/update-linux-headers.sh

index a639c5bff0d7c2d1bb65de82b50a70608d0e3b2a..53a6f8765049558ab9701486cf8fbb844f8e7545 100755 (executable)
@@ -28,7 +28,21 @@ 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
+
+    # Blacklist architectures which have KVM headers but are actually dead
+    if [ "$arch" = "ia64" ]; then
+        continue
+    fi
+
     make -C "$linux" INSTALL_HDR_PATH="$tmpdir" SRCARCH=$arch headers_install
 
     rm -rf "$output/linux-headers/asm-$arch"