Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst/arch/i386 When not using the serial console...



details:   https://anonhg.NetBSD.org/src/rev/231dfc1c6360
branches:  trunk
changeset: 433458:231dfc1c6360
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Sep 15 18:04:21 2018 +0000

description:
When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.

diffstat:

 usr.sbin/sysinst/arch/i386/md.c |  26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diffs (61 lines):

diff -r 06d1584f82a1 -r 231dfc1c6360 usr.sbin/sysinst/arch/i386/md.c
--- a/usr.sbin/sysinst/arch/i386/md.c   Sat Sep 15 17:42:38 2018 +0000
+++ b/usr.sbin/sysinst/arch/i386/md.c   Sat Sep 15 18:04:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.12 2018/09/15 17:42:38 martin Exp $ */
+/*     $NetBSD: md.c,v 1.13 2018/09/15 18:04:21 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -68,6 +68,8 @@
 static int md_read_bootcode(const char *, struct mbr_sector *);
 static unsigned int get_bootmodel(void);
 
+static int conmib[] = {CTL_MACHDEP, CPU_CONSDEV};
+
 void
 md_init(void)
 {
@@ -313,7 +315,6 @@
                "com3kbd" /* CONSDEV_COM3KBD */ };
        static struct x86_boot_params boottype =
                {sizeof boottype, 0, 5, 0, 9600, { '\0' }, "", 0};
-       static int conmib[] = {CTL_MACHDEP, CPU_CONSDEV};
        struct termios t;
        dev_t condev;
 
@@ -380,6 +381,9 @@
 void
 md_cleanup_install(void)
 {
+       size_t len;
+       dev_t condev;
+
 #ifndef DEBUG
        enable_rc_conf();
        add_rc_conf("wscons=YES\n");
@@ -400,6 +404,24 @@
                            "H;$!d;g;w /etc/ttys' /etc/ttys");
 
 #endif
+
+       /*
+        * 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, nelem(conmib), &condev, &len, NULL, 0) != -1
+           && (condev & ~3) != 0x800) {
+
+               /*
+                * Current console is not com*, assume ttyE*.
+                * Modify /etc/ttys to use wsvt25 for all ports.
+                */
+
+               run_program(RUN_CHROOT,
+                           "sed -an -e 's/vt100/wsvt25/g;"
+                           "H;$!d;g;w  /etc/ttys' /etc/ttys");
+       }
 }
 
 int



Home | Main Index | Thread Index | Old Index