summaryrefslogtreecommitdiff
path: root/kexec
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2009-11-26 09:44:46 +1100
committerSimon Horman <horms@verge.net.au>2009-11-26 09:44:46 +1100
commit5545216da4360d6494cc7ba574e04620a826a332 (patch)
tree6b6135dca409276cac785d3bc2c7188deb0cada2 /kexec
parent90ddba23d1abdd727aabbf1070904ae172ebb273 (diff)
arm: fix architecture detection
There are many variants of arm and it seems to be impractical to add them all to the arches array. Instead just match on the leading "arm" portion of the utsname. I have made this specific to arm for now, as I'm not sure what fallout might occur if it was made more generic. e.g. arch ppc matching utsname ppc64 is a concern. Based on variants of this patch submitted by Andrea Adami and Marc Andre Tanner, and feedback from Magnus Damm. Cc: Andrea Adami <andrea.adami@gmail.com> Cc: Marc Andre Tanner <mat@brain-dump.org> Cc: Magnus Damm <magnus.damm@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec')
-rw-r--r--kexec/arch/arm/kexec-arm.c2
-rw-r--r--kexec/phys_arch.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/kexec/arch/arm/kexec-arm.c b/kexec/arch/arm/kexec-arm.c
index 3fdf839..4b4a659 100644
--- a/kexec/arch/arm/kexec-arm.c
+++ b/kexec/arch/arm/kexec-arm.c
@@ -113,8 +113,6 @@ int arch_process_options(int argc, char **argv)
const struct arch_map_entry arches[] = {
{ "arm", KEXEC_ARCH_ARM },
- { "armv6l", KEXEC_ARCH_ARM },
- { "armv7l", KEXEC_ARCH_ARM },
{ 0 },
};
diff --git a/kexec/phys_arch.c b/kexec/phys_arch.c
index ff8c28b..1571a0f 100644
--- a/kexec/phys_arch.c
+++ b/kexec/phys_arch.c
@@ -13,9 +13,14 @@ long physical_arch(void)
return -1;
}
- for (i = 0; arches[i].machine; ++i)
+ for (i = 0; arches[i].machine; ++i) {
if (strcmp(utsname.machine, arches[i].machine) == 0)
return arches[i].arch;
+ if ((strcmp(arches[i].machine, "arm") == 0) &&
+ (strncmp(utsname.machine, arches[i].machine,
+ strlen(arches[i].machine)) == 0))
+ return arches[i].arch;
+ }
fprintf(stderr, "Unsupported machine type: %s\n",
utsname.machine);