Module Name:    src
Committed By:   martin
Date:           Sun Jun  3 14:38:28 UTC 2018

Modified Files:
        src/usr.sbin/sysinst/arch/i386: md.c

Log Message:
Default console device and speed to that used by syinst


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/arch/i386/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/usr.sbin/sysinst/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.9 src/usr.sbin/sysinst/arch/i386/md.c:1.10
--- src/usr.sbin/sysinst/arch/i386/md.c:1.9	Sun Jun  3 13:16:30 2018
+++ src/usr.sbin/sysinst/arch/i386/md.c	Sun Jun  3 14:38:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.9 2018/06/03 13:16:30 martin Exp $ */
+/*	$NetBSD: md.c,v 1.10 2018/06/03 14:38:28 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -317,6 +317,19 @@ md_post_newfs(void)
 	struct termios t;
 	dev_t condev;
 
+	/*
+	 * Get console device, should either be ttyE0 or tty0n.
+	 * Too hard to double check, so just 'know' the device numbers.
+	 */
+	len = sizeof condev;
+	if (sysctl(conmib, __arraycount(conmib), &condev, &len, NULL, 0) != -1
+	    && (condev & ~3) == 0x800) {
+		/* Motherboard serial port */
+		boottype.bp_consdev = (condev & 3) + 1;
+		/* Defaulting the baud rate to that of stdin should suffice */
+		if (tcgetattr(0, &t) != -1)
+			boottype.bp_conspeed = t.c_ispeed;
+
 	if (pm == NULL || !pm->no_part) {
 		/*
 		 * Get console device, should either be ttyE0 or tty0n.

Reply via email to