From owner-freebsd-bugs Sat Nov 25 13:50: 9 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 3C93E37B4C5 for ; Sat, 25 Nov 2000 13:50:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id NAA67398; Sat, 25 Nov 2000 13:50:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from alpo.whistle.com (s206m1.whistle.com [207.76.206.1]) by hub.freebsd.org (Postfix) with ESMTP id 19DC137B479 for ; Sat, 25 Nov 2000 13:45:07 -0800 (PST) Received: from whistle.com (crab.whistle.com [207.76.205.112]) by alpo.whistle.com (8.9.1a/8.9.1) with ESMTP id NAA85209 for ; Sat, 25 Nov 2000 13:42:57 -0800 (PST) Received: (from ambrisko@localhost) by whistle.com (8.9.3/8.9.1) id NAA40712; Sat, 25 Nov 2000 13:42:10 -0800 (PST) (envelope-from ambrisko) Message-Id: <200011252142.NAA40712@whistle.com> Date: Sat, 25 Nov 2000 13:42:10 -0800 (PST) From: Doug Ambrisko Reply-To: ambrisko@whistle.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/23098: If installing on a serial console, enable getty on ttyd0. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 23098 >Category: bin >Synopsis: If installing on a serial console, enable getty on ttyd0. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Nov 25 13:50:00 PST 2000 >Closed-Date: >Last-Modified: >Originator: Doug Ambrisko >Release: FreeBSD 4.2-RELEASE i386 >Organization: Whistle >Environment: >Description: If you do an install via the serial port, Sysinstall correctly updates loader.conf so the kernel messages come up on the console. However, it should also enable a getty on the serial port as well so you can login to that port. This patch does that by changing "off" to "on " for ttyd0. Note I do not disable getty on ttyvX. It's probably fairly easy for the admin to just login as root on the serial port and disable getty on ttyvX if by chance no display or keyboard device is available to address that issue. This should make life a little easier for serial installations. >How-To-Repeat: >Fix: Index: install.c =================================================================== RCS file: /cvs/freebsd/src/release/sysinstall/install.c,v retrieving revision 1.268.2.15 diff -c -r1.268.2.15 install.c *** install.c 2000/10/31 21:33:23 1.268.2.15 --- install.c 2000/11/25 21:31:10 *************** *** 744,749 **** --- 744,752 ---- int i; FILE *fp; int kstat = 1; + FILE *orig, *new; + char buf[1024]; + char *pos; /* All of this is done only as init, just to be safe */ if (RunningAsInit) { *************** *** 780,787 **** "boot from the hard disk, I'm afraid!"); return DITEM_FAILURE; } } ! /* BOGON #1: Resurrect /dev after bin distribution screws it up */ dialog_clear_norefresh(); msgNotify("Remaking all devices.. Please wait!"); --- 783,815 ---- "boot from the hard disk, I'm afraid!"); return DITEM_FAILURE; } + + /* Fixup /etc/ttys to start a getty on the serial port. + This way after a serial installation you can login via + the serial port */ + + if (!OnVTY){ + if (((orig=fopen("/etc/ttys","r")) != NULL) && + ((new=fopen("/etc/ttys.tmp","w")) != NULL)) { + while (fgets(buf,sizeof(buf),orig)){ + if (strstr(buf,"ttyd0")){ + if ((pos=strstr(buf,"off"))){ + *pos++='o'; + *pos++='n'; + *pos++=' '; + } + } + fputs(buf,new); + } + fclose(orig); + fclose(new); + + rename("/etc/ttys.tmp","/etc/ttys"); + unlink("/etc/ttys.tmp"); + } + } } ! /* BOGON #1: Resurrect /dev after bin distribution screws it up */ dialog_clear_norefresh(); msgNotify("Remaking all devices.. Please wait!"); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message