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

2012-05-12 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Sat May 12 08:31:53 UTC 2012

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

Log Message:
Add KURO-BOX/T4 support to sysinst. Tested good with the target
machine.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/distrib/utils/sysinst/arch/sandpoint/md.c

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/sandpoint/md.c
diff -u src/distrib/utils/sysinst/arch/sandpoint/md.c:1.39 src/distrib/utils/sysinst/arch/sandpoint/md.c:1.40
--- src/distrib/utils/sysinst/arch/sandpoint/md.c:1.39	Wed Jan 25 19:03:35 2012
+++ src/distrib/utils/sysinst/arch/sandpoint/md.c	Sat May 12 08:31:52 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.39 2012/01/25 19:03:35 phx Exp $ */
+/*	$NetBSD: md.c,v 1.40 2012/05/12 08:31:52 nisimura Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -77,7 +77,7 @@ md_init_set_status(int flags)
 	prodname = malloc(len);
 	sysctlbyname(mib_name, prodname, len, NULL, 0);
 
-	if (strcmp(prodname, kurobox) == 0)
+	if (strcmp(prodname, kurobox)==0 || strcmp(prodname, kurot4)==0)
 		/*
 		 * Running on a KuroBox family product, so enable KUROBOX
 		 */
@@ -175,7 +175,7 @@ md_cleanup_install(void)
 	 * Set the console speed in /etc/ttys depending on the board.
 	 * The default speed is 115200, which is patched when needed.
 	 */
-	if (strcmp(prodname, kurobox) == 0)
+	if (strcmp(prodname, kurobox)==0 || strcmp(prodname, kurot4)==0)
 		new_speed = 57600;			/* KuroBox */
 
 	else if (strcmp(prodname, dlink) == 0 ||	/* D-Link DSM-G600 */



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

2012-01-25 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Jan 25 19:03:35 UTC 2012

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

Log Message:
netboot is called altboot now


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/distrib/utils/sysinst/arch/sandpoint/md.c

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/sandpoint/md.c
diff -u src/distrib/utils/sysinst/arch/sandpoint/md.c:1.38 src/distrib/utils/sysinst/arch/sandpoint/md.c:1.39
--- src/distrib/utils/sysinst/arch/sandpoint/md.c:1.38	Fri Jan  6 20:52:43 2012
+++ src/distrib/utils/sysinst/arch/sandpoint/md.c	Wed Jan 25 19:03:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.38 2012/01/06 20:52:43 riz Exp $ */
+/*	$NetBSD: md.c,v 1.39 2012/01/25 19:03:35 phx Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -153,7 +153,7 @@ md_post_disklabel(void)
 int
 md_post_newfs(void)
 {
-	/* no boot blocks, we are using netboot */
+	/* no boot blocks, we are using altboot */
 	return 0;
 }
 



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

2012-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  6 20:52:43 UTC 2012

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

Log Message:
Don't use snprintf() to format, when run_program() will do it nicely on
its own.  Suggested by joerg.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/distrib/utils/sysinst/arch/sandpoint/md.c

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/sandpoint/md.c
diff -u src/distrib/utils/sysinst/arch/sandpoint/md.c:1.37 src/distrib/utils/sysinst/arch/sandpoint/md.c:1.38
--- src/distrib/utils/sysinst/arch/sandpoint/md.c:1.37	Fri Nov  4 11:27:04 2011
+++ src/distrib/utils/sysinst/arch/sandpoint/md.c	Fri Jan  6 20:52:43 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.37 2011/11/04 11:27:04 martin Exp $ */
+/*	$NetBSD: md.c,v 1.38 2012/01/06 20:52:43 riz Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -168,7 +168,6 @@ md_cleanup_install(void)
 {
 #ifndef DEBUG
 	int new_speed;
-	char sed_cmd[64];
 
 	enable_rc_conf();
 
@@ -187,9 +186,8 @@ md_cleanup_install(void)
 		new_speed = 0;
 
 	if (new_speed != 0) {
-		snprintf(sed_cmd, 64, sed -an -e 's/115200/%d/;H;$!d;g;w
+		run_program(RUN_CHROOT, sed -an -e 's/115200/%d/;H;$!d;g;w
 		/etc/ttys' /etc/ttys, new_speed);
-		run_program(RUN_CHROOT, sed_cmd);
 	}
 #endif
 }



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

2011-03-26 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sat Mar 26 22:16:33 UTC 2011

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

Log Message:
Remove debugging output.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/distrib/utils/sysinst/arch/sandpoint/md.c

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/sandpoint/md.c
diff -u src/distrib/utils/sysinst/arch/sandpoint/md.c:1.34 src/distrib/utils/sysinst/arch/sandpoint/md.c:1.35
--- src/distrib/utils/sysinst/arch/sandpoint/md.c:1.34	Sun Mar 20 12:43:40 2011
+++ src/distrib/utils/sysinst/arch/sandpoint/md.c	Sat Mar 26 22:16:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.34 2011/03/20 12:43:40 phx Exp $ */
+/*	$NetBSD: md.c,v 1.35 2011/03/26 22:16:33 phx Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -80,7 +80,6 @@
 	}
 	prodname = malloc(len);
 	sysctlbyname(mib_name, prodname, len, NULL, 0);
-printf(\n***\n*** Installing on %s\n***\n, prodname);
 
 	if (strcmp(prodname, kurobox) == 0)
 		/*



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

2011-03-20 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Mar 20 12:43:40 UTC 2011

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

Log Message:
Use sysctl-node machdep.prodfamily to decide about the kernel to install and
to fix the console speed in /etc/ttys.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/distrib/utils/sysinst/arch/sandpoint/md.c

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/sandpoint/md.c
diff -u src/distrib/utils/sysinst/arch/sandpoint/md.c:1.33 src/distrib/utils/sysinst/arch/sandpoint/md.c:1.34
--- src/distrib/utils/sysinst/arch/sandpoint/md.c:1.33	Tue Feb  1 01:42:14 2011
+++ src/distrib/utils/sysinst/arch/sandpoint/md.c	Sun Mar 20 12:43:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.33 2011/02/01 01:42:14 joerg Exp $ */
+/*	$NetBSD: md.c,v 1.34 2011/03/20 12:43:40 phx Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -41,7 +41,9 @@
 #include sys/param.h
 #include sys/sysctl.h
 #include sys/utsname.h
+
 #include stdio.h
+#include string.h
 #include util.h
 
 #include defs.h
@@ -49,6 +51,8 @@
 #include msg_defs.h
 #include menu_defs.h
 
+static char *prodname;
+
 void
 md_init(void)
 {
@@ -57,26 +61,35 @@
 void
 md_init_set_status(int flags)
 {
-	struct utsname instsys;
+	static const char mib_name[] = machdep.prodfamily;
+	static char unknown[] = unknown;
+	size_t len;
 
 	(void)flags;
 
 	/*
-	 * Get the name of the Install Kernel we are running under and
+	 * Determine the product family of the board we are running on and
 	 * enable the installation of the corresponding GENERIC kernel.
 	 *
 	 * Note:  In md.h the two kernels are disabled.  If they are
 	 *enabled there the logic here needs to be switched.
 	 */
-uname(instsys);
-if (strstr(instsys.version, (INSTALL_KURO)))
+	if (sysctlbyname(mib_name, NULL, len, NULL, 0) != 0) {
+		prodname = unknown;
+		return;
+	}
+	prodname = malloc(len);
+	sysctlbyname(mib_name, prodname, len, NULL, 0);
+printf(\n***\n*** Installing on %s\n***\n, prodname);
+
+	if (strcmp(prodname, kurobox) == 0)
 		/*
-		 * Running the KuroBox Installation Kernel, so enable KUROBOX
+		 * Running on a KuroBox family product, so enable KUROBOX
 		 */
 		set_kernel_set(SET_KERNEL_2);
 else
 		/*
-		 * Running the GENERIC Installation Kernel, so enable GENERIC
+		 * Otherwise enable GENERIC
 		 */
 		set_kernel_set(SET_KERNEL_1);
 }
@@ -159,15 +172,30 @@
 md_cleanup_install(void)
 {
 #ifndef DEBUG
+	int new_speed;
+	char sed_cmd[64];
+
 	enable_rc_conf();
 
 	/*
-	 * For KUROBOX set the console speed to 57600 in /etc/ttys.
+	 * Set the console speed in /etc/ttys depending on the board.
+	 * The default speed is 115200, which is patched when needed.
 	 */
-	if (get_kernel_set() == SET_KERNEL_2)
-		run_program(RUN_CHROOT,
-		sed -an -e 's/115200/57600/;H;$!d;g;w /etc/ttys'
-		 /etc/ttys);
+	if (strcmp(prodname, kurobox) == 0)
+		new_speed = 57600;			/* KuroBox */
+
+	else if (strcmp(prodname, dlink) == 0 ||	/* D-Link DSM-G600 */
+	strcmp(prodname, nhnas) == 0)		/* NH23x, All6250 */
+		new_speed = 9600;
+	
+	else
+		new_speed = 0;
+
+	if (new_speed != 0) {
+		snprintf(sed_cmd, 64, sed -an -e 's/115200/%d/;H;$!d;g;w
+		/etc/ttys' /etc/ttys, new_speed);
+		run_program(RUN_CHROOT, sed_cmd);
+	}
 #endif
 }
 



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

2010-06-13 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Jun 13 15:32:00 UTC 2010

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

Log Message:
Automatically adjust the console speed to 57600 in /etc/ttys for KUROBOX
kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/distrib/utils/sysinst/arch/sandpoint/md.c

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/sandpoint/md.c
diff -u src/distrib/utils/sysinst/arch/sandpoint/md.c:1.31 src/distrib/utils/sysinst/arch/sandpoint/md.c:1.32
--- src/distrib/utils/sysinst/arch/sandpoint/md.c:1.31	Wed Jun  9 17:37:24 2010
+++ src/distrib/utils/sysinst/arch/sandpoint/md.c	Sun Jun 13 15:32:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.31 2010/06/09 17:37:24 phx Exp $ */
+/*	$NetBSD: md.c,v 1.32 2010/06/13 15:32:00 phx Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -160,6 +160,14 @@
 {
 #ifndef DEBUG
 	enable_rc_conf();
+
+	/*
+	 * For KUROBOX set the console speed to 57600 in /etc/ttys.
+	 */
+	if (get_kernel_set() == SET_KERNEL_2)
+		run_program(RUN_CHROOT,
+		sed -an -e 's/115200/57600/;H;$!d;g;w /etc/ttys'
+		 /etc/ttys);
 #endif
 }