Skip to contentSkip to conversation

update-linux-headers.sh: Don't hard code list of architectures

PATCH In review Peter Maydell 2 participants 4 messages Jul 18, 2012 – Aug 13, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 update-linux-headers.sh: Don't hard code list of architectures

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.

---
Changes v1->v2:
* added a blacklist for ia64, to avoid noise and importing a pointless set of headers that will get dropped later

 scripts/update-linux-headers.sh |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
scripts/update-linux-headers.sh +15 -1
index 9d2a4bc..57ce69f 100755
@@ -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"
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Peter Maydell

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.

Quoted 36 lines

---
Changes v1->v2:
* added a blacklist for ia64, to avoid noise and importing a pointless set of headers that will get dropped later

 scripts/update-linux-headers.sh |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
scripts/update-linux-headers.sh +15 -1
index 9d2a4bc..57ce69f 100755
@@ -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"
Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
#2 lore raw
In reply to Peter Maydell

Ping?

patchwork url: http://patchwork.ozlabs.org/patch/171628/

-- PMM

Quoted 47 lines · Peter Maydell

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.

---
Changes v1->v2:
* added a blacklist for ia64, to avoid noise and importing a pointless set of headers that will get dropped later

 scripts/update-linux-headers.sh |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
scripts/update-linux-headers.sh +15 -2
index 9d2a4bc..57ce69f 100755
@@ -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"
--

1.7.5.4

#3 lore raw

Ping^2?

Quoted 54 lines · Peter Maydell

Ping?

patchwork url: http://patchwork.ozlabs.org/patch/171628/

-- PMM

Quoted 47 lines · Peter Maydell

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.

---
Changes v1->v2:
* added a blacklist for ia64, to avoid noise and importing a pointless set of headers that will get dropped later

 scripts/update-linux-headers.sh |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
scripts/update-linux-headers.sh +15 -2
index 9d2a4bc..57ce69f 100755
@@ -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"
--

1.7.5.4