Index: distrib/utils/sysinst/arch/hpcarm/md.c =================================================================== RCS file: /cvsroot/src/distrib/utils/sysinst/arch/hpcarm/md.c,v retrieving revision 1.7 diff -u -p -r1.7 md.c --- distrib/utils/sysinst/arch/hpcarm/md.c 19 Sep 2009 14:57:28 -0000 1.7 +++ distrib/utils/sysinst/arch/hpcarm/md.c 3 Sep 2010 12:31:25 -0000 @@ -59,7 +59,33 @@ md_init(void) void md_init_set_status(int minimal) { - (void)minimal; + static const struct { + const char *name; + const int set; + } kern_sets[] = { + { "IPAQ", SET_KERNEL_IPAQ }, + { "JORNADA720", SET_KERNEL_JORNADA720 }, + { "WZERO3", SET_KERNEL_WZERO3 } + }; + static const int mib[2] = {CTL_KERN, KERN_VERSION}; + size_t len; + char *version; + u_int i; + + /* check INSTALL kernel name to select an appropriate kernel set */ + /* XXX: hw.cpu_model has a processor name on arm ports */ + sysctl(mib, 2, NULL, &len, NULL, 0); + version = malloc(len); + if (version == NULL) + return; + sysctl(mib, 2, version, &len, NULL, 0); + for (i = 0; i < __arraycount(kern_sets); i++) { + if (strstr(version, kern_sets[i].name) != NULL) { + set_kernel_set(kern_sets[i].set); + break; + } + } + free(version); } int Index: distrib/utils/sysinst/arch/hpcarm/md.h =================================================================== RCS file: /cvsroot/src/distrib/utils/sysinst/arch/hpcarm/md.h,v retrieving revision 1.5 diff -u -p -r1.5 md.h --- distrib/utils/sysinst/arch/hpcarm/md.h 10 May 2010 16:33:45 -0000 1.5 +++ distrib/utils/sysinst/arch/hpcarm/md.h 3 Sep 2010 12:31:25 -0000 @@ -63,6 +63,10 @@ #define SET_KERNEL_2_NAME "kern-JORNADA720" #define SET_KERNEL_3_NAME "kern-WZERO3" +#define SET_KERNEL_IPAQ SET_KERNEL_1 +#define SET_KERNEL_JORNADA720 SET_KERNEL_2 +#define SET_KERNEL_WZERO3 SET_KERNEL_3 + /* * Machine-specific command to write a new label to a disk.