update-linux-headers.sh: Don't hard code list of architectures
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. 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.
---
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(-)
scripts/update-linux-headers.sh +10 -1
@@ -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"
Signature · 1 line
1.7.5.4
Quoted 7 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. 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.
Quoted 6 lines
Signed-off-by Peter Maydell <[email protected]>---
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 'makeheaders_install' is a bit noisy as of 3.5-rc5 but succeeds anyway.
IA64 KVM support is dead and may be removed at some point from the kernel. What about blacklisting it here already to avoid that noise?
Quoted 17 lines
scripts/update-linux-headers.sh | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)scripts/update-linux-headers.sh +3
-1@@ -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 *)
scripts/update-linux-headers.sh if [ -z "$output" ]; then · line 43
Quoted 10 lines
scripts/update-linux-headers.sh +7
-0+ +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"
Looks good otherwise. Clearly better than a hardcoded list.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux
Quoted 15 lines · Jan Kiszka
Quoted 7 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. 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.
Quoted 6 lines
Signed-off-by Peter Maydell <[email protected]>---
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 'makeheaders_install' is a bit noisy as of 3.5-rc5 but succeeds anyway.
Quoted 2 lines
IA64 KVM support is dead and may be removed at some point from the kernel. What about blacklisting it here already to avoid that noise?
It's only noisy for the developer who runs the script, and if we blacklist it then we'll have to update the script again to remove it from the blacklist when it finally dies.
I don't feel very strongly about it, though, so I can add an
# Blacklist architectures which have KVM headers but are actually dead if [ "$arch" = "ia64" ]; then
continue
fi
to the patch if you want.
-- PMM
Quoted 16 lines · Peter Maydell
Quoted 15 lines · Jan Kiszka
Quoted 13 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. 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 <[email protected]>---
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 'makeheaders_install' is a bit noisy as of 3.5-rc5 but succeeds anyway.
Quoted 4 lines
Quoted 2 lines
IA64 KVM support is dead and may be removed at some point from the kernel. What about blacklisting it here already to avoid that noise?
It's only noisy for the developer who runs the script, and if
Developers are also human that may hate seeing this mess. :)
Quoted 2 lines
we blacklist it then we'll have to update the script again to remove it from the blacklist when it finally dies.
We /can/ clean this up then, but there will be no urgent need.
Quoted 9 lines
I don't feel very strongly about it, though, so I can add an
# Blacklist architectures which have KVM headers but are actually dead if [ "$arch" = "ia64" ]; then
continue
fito the patch if you want.
Yes, I would prefer doing this.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux