CVS commit: src/distrib/utils/sysinst/arch/hpcarm

2010-09-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep  4 01:23:25 UTC 2010

Modified Files:
src/distrib/utils/sysinst/arch/hpcarm: md.c md.h

Log Message:
Add dumb code to select an appropriate kernel set to be installed
per running INSTALL kernel name taken from sysctl kern.version.

XXX: on all arm ports, sysctl hw.cpu_model returns a processor name,
XXX: not machine model as mentioned in sys/sysctl.h.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/distrib/utils/sysinst/arch/hpcarm/md.c
cvs rdiff -u -r1.5 -r1.6 src/distrib/utils/sysinst/arch/hpcarm/md.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/sysinst/arch/hpcarm/md.c
diff -u src/distrib/utils/sysinst/arch/hpcarm/md.c:1.7 src/distrib/utils/sysinst/arch/hpcarm/md.c:1.8
--- src/distrib/utils/sysinst/arch/hpcarm/md.c:1.7	Sat Sep 19 14:57:28 2009
+++ src/distrib/utils/sysinst/arch/hpcarm/md.c	Sat Sep  4 01:23:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.7 2009/09/19 14:57:28 abs Exp $ */
+/*	$NetBSD: md.c,v 1.8 2010/09/04 01:23:25 tsutsui Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -59,7 +59,33 @@
 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: src/distrib/utils/sysinst/arch/hpcarm/md.h
diff -u src/distrib/utils/sysinst/arch/hpcarm/md.h:1.5 src/distrib/utils/sysinst/arch/hpcarm/md.h:1.6
--- src/distrib/utils/sysinst/arch/hpcarm/md.h:1.5	Mon May 10 16:33:45 2010
+++ src/distrib/utils/sysinst/arch/hpcarm/md.h	Sat Sep  4 01:23:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.5 2010/05/10 16:33:45 tsutsui Exp $	*/
+/*	$NetBSD: md.h,v 1.6 2010/09/04 01:23:25 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -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.



CVS commit: src/distrib/utils/sysinst/arch/hpcarm

2010-05-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun May  2 13:52:01 UTC 2010

Modified Files:
src/distrib/utils/sysinst/arch/hpcarm: msg.md.de msg.md.en msg.md.es
msg.md.fr msg.md.pl

Log Message:
hpcarm doesn't have GENERIC or TX3912.
Use IPAQ and JORNADA720 instead in messages per md.h.

XXX1: hpcarm seems to have more kernels.
XXX2: hpcarm doesn't have a common INSTALL kernel so
  choosing a kernel set during sysinst doesn't make sense.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/sysinst/arch/hpcarm/msg.md.de \
src/distrib/utils/sysinst/arch/hpcarm/msg.md.pl
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/sysinst/arch/hpcarm/msg.md.en \
src/distrib/utils/sysinst/arch/hpcarm/msg.md.es
cvs rdiff -u -r1.3 -r1.4 src/distrib/utils/sysinst/arch/hpcarm/msg.md.fr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/sysinst/arch/hpcarm/msg.md.de
diff -u src/distrib/utils/sysinst/arch/hpcarm/msg.md.de:1.1 src/distrib/utils/sysinst/arch/hpcarm/msg.md.de:1.2
--- src/distrib/utils/sysinst/arch/hpcarm/msg.md.de:1.1	Fri Dec 30 11:40:23 2005
+++ src/distrib/utils/sysinst/arch/hpcarm/msg.md.de	Sun May  2 13:52:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.de,v 1.1 2005/12/30 11:40:23 rjs Exp $	*/
+/*	$NetBSD: msg.md.de,v 1.2 2010/05/02 13:52:00 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -102,7 +102,7 @@
 
 
 message set_kernel_1
-{Kernel (GENERIC)}
+{Kernel (IPAQ)}
 message set_kernel_2
-{Kernel (TX3912)}
+{Kernel (JORNADA720)}
 
Index: src/distrib/utils/sysinst/arch/hpcarm/msg.md.pl
diff -u src/distrib/utils/sysinst/arch/hpcarm/msg.md.pl:1.1 src/distrib/utils/sysinst/arch/hpcarm/msg.md.pl:1.2
--- src/distrib/utils/sysinst/arch/hpcarm/msg.md.pl:1.1	Fri Dec 30 11:40:23 2005
+++ src/distrib/utils/sysinst/arch/hpcarm/msg.md.pl	Sun May  2 13:52:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.pl,v 1.1 2005/12/30 11:40:23 rjs Exp $	*/
+/*	$NetBSD: msg.md.pl,v 1.2 2010/05/02 13:52:00 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -92,6 +92,6 @@
 (Odpowiedz 'nie' zabierze cie spowrotem do menu edycji partycji.)}
 
 message set_kernel_1
-{Kernel (GENERIC)}
+{Kernel (IPAQ)}
 message set_kernel_2
-{Kernel (TX3912)}
+{Kernel (JORNADA720)}

Index: src/distrib/utils/sysinst/arch/hpcarm/msg.md.en
diff -u src/distrib/utils/sysinst/arch/hpcarm/msg.md.en:1.2 src/distrib/utils/sysinst/arch/hpcarm/msg.md.en:1.3
--- src/distrib/utils/sysinst/arch/hpcarm/msg.md.en:1.2	Sat Feb  2 05:34:00 2008
+++ src/distrib/utils/sysinst/arch/hpcarm/msg.md.en	Sun May  2 13:52:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.en,v 1.2 2008/02/02 05:34:00 itohy Exp $	*/
+/*	$NetBSD: msg.md.en,v 1.3 2010/05/02 13:52:00 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -96,7 +96,7 @@
 (Answering 'no' will take you back to the partition edit menu.)}
 
 message set_kernel_1
-{Kernel (GENERIC)}
+{Kernel (IPAQ)}
 message set_kernel_2
-{Kernel (TX3912)}
+{Kernel (JORNADA720)}
 
Index: src/distrib/utils/sysinst/arch/hpcarm/msg.md.es
diff -u src/distrib/utils/sysinst/arch/hpcarm/msg.md.es:1.2 src/distrib/utils/sysinst/arch/hpcarm/msg.md.es:1.3
--- src/distrib/utils/sysinst/arch/hpcarm/msg.md.es:1.2	Sat Feb  2 05:34:00 2008
+++ src/distrib/utils/sysinst/arch/hpcarm/msg.md.es	Sun May  2 13:52:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.es,v 1.2 2008/02/02 05:34:00 itohy Exp $	*/
+/*	$NetBSD: msg.md.es,v 1.3 2010/05/02 13:52:00 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -96,7 +96,7 @@
 (Si contesta 'no' sera devuelto al menú de edicion de particiones.)}
 
 message set_kernel_1
-{Núcleo (GENERIC)}
+{Núcleo (IPAQ)}
 message set_kernel_2
-{Núcleo (TX3912)}
+{Núcleo (JORNADA720)}
 

Index: src/distrib/utils/sysinst/arch/hpcarm/msg.md.fr
diff -u src/distrib/utils/sysinst/arch/hpcarm/msg.md.fr:1.3 src/distrib/utils/sysinst/arch/hpcarm/msg.md.fr:1.4
--- src/distrib/utils/sysinst/arch/hpcarm/msg.md.fr:1.3	Sat Oct 24 12:47:30 2009
+++ src/distrib/utils/sysinst/arch/hpcarm/msg.md.fr	Sun May  2 13:52:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.fr,v 1.3 2009/10/24 12:47:30 stacktic Exp $	*/
+/*	$NetBSD: msg.md.fr,v 1.4 2010/05/02 13:52:00 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -96,6 +96,6 @@
 ('Non' vous ramènera au menu d'édition des partitions.)}
 
 message set_kernel_1
-{Kernel (GENERIC)}
+{Kernel (IPAQ)}
 message set_kernel_2
-{Kernel (TX3912)}
+{Kernel (JORNADA720)}