| Summary: | sysinstall(8): [patch] if installing on a serial console, enable getty on ttyd0. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | ambrisko <ambrisko> | ||||
| Component: | bin | Assignee: | Bruce Cran <brucec> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.2-RELEASE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
ambrisko
2000-11-25 21:50:00 UTC
Responsible Changed From-To: freebsd-bugs->murray Looks like a good idea. I will work on this. Responsible Changed From-To: murray->ambrisko I think this is a good idea Doug, I hope you can commit this. ;) Responsible Changed From-To: ambrisko->freebsd-qa Reasssign to current maintainers of sysinstall after a long period of inactivity on this PR. Responsible Changed From-To: freebsd-bugs->brucec Take. Author: brucec Date: Wed Jun 23 14:11:34 2010 New Revision: 209467 URL: http://svn.freebsd.org/changeset/base/209467 Log: When installing on a machine which doesn't have a VGA card installed, enable a getty on the serial port so that it's possible to login when the system is rebooted. PR: bin/23098 Submitted by: Doug Ambrisko <ambrisko at whistle.com> Reviewed by: randi Approved by: rrs (mentor) MFC after: 1 month Modified: head/usr.sbin/sysinstall/install.c Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Wed Jun 23 14:06:05 2010 (r209466) +++ head/usr.sbin/sysinstall/install.c Wed Jun 23 14:11:34 2010 (r209467) @@ -877,6 +877,9 @@ installConfigure(void) int installFixupBase(dialogMenuItem *self) { + FILE *orig, *new; + char buf[1024]; + char *pos; #if defined(__i386__) || defined(__amd64__) FILE *fp; #endif @@ -895,6 +898,32 @@ installFixupBase(dialogMenuItem *self) fclose(fp); } #endif + + /* 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,"ttyu0")){ + 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 #2: We leave /etc in a bad state */ chmod("/etc", 0755); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" State Changed From-To: open->patched Fixed in HEAD. Author: brucec Date: Sat Aug 7 12:41:12 2010 New Revision: 211009 URL: http://svn.freebsd.org/changeset/base/211009 Log: MFC r209467: When installing on a machine which doesn't have a VGA card installed, enable a getty on the serial port so that it's possible to login when the system is rebooted. PR: bin/23098 Submitted by: Doug Ambrisko <ambrisko at whistle.com> Approved by: rrs (mentor) Modified: stable/8/usr.sbin/sysinstall/install.c Directory Properties: stable/8/usr.sbin/sysinstall/ (props changed) Modified: stable/8/usr.sbin/sysinstall/install.c ============================================================================== --- stable/8/usr.sbin/sysinstall/install.c Sat Aug 7 12:21:29 2010 (r211008) +++ stable/8/usr.sbin/sysinstall/install.c Sat Aug 7 12:41:12 2010 (r211009) @@ -875,6 +875,9 @@ installConfigure(void) int installFixupBase(dialogMenuItem *self) { + FILE *orig, *new; + char buf[1024]; + char *pos; FILE *fp; #ifdef __ia64__ const char *efi_mntpt; @@ -891,6 +894,32 @@ installFixupBase(dialogMenuItem *self) fclose(fp); } #endif + + /* 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,"ttyu0")){ + 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 #2: We leave /etc in a bad state */ chmod("/etc", 0755); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" Author: brucec Date: Sat Aug 7 12:46:49 2010 New Revision: 211010 URL: http://svn.freebsd.org/changeset/base/211010 Log: MFC r209467: When installing on a machine which doesn't have a VGA card installed, enable a getty on the serial port so that it's possible to login when the system is rebooted. PR: bin/23098 Submitted by: Doug Ambrisko <ambrisko at whistle.com> Approved by: rrs (mentor) Modified: stable/7/usr.sbin/sysinstall/install.c Directory Properties: stable/7/usr.sbin/sysinstall/ (props changed) Modified: stable/7/usr.sbin/sysinstall/install.c ============================================================================== --- stable/7/usr.sbin/sysinstall/install.c Sat Aug 7 12:41:12 2010 (r211009) +++ stable/7/usr.sbin/sysinstall/install.c Sat Aug 7 12:46:49 2010 (r211010) @@ -839,6 +839,9 @@ installConfigure(void) int installFixupBase(dialogMenuItem *self) { + FILE *orig, *new; + char buf[1024]; + char *pos; FILE *fp; #ifdef __ia64__ const char *efi_mntpt; @@ -855,6 +858,32 @@ installFixupBase(dialogMenuItem *self) fclose(fp); } #endif + + /* 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 #2: We leave /etc in a bad state */ chmod("/etc", 0755); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" State Changed From-To: patched->closed Fix has been merged to stable/7 and stable/8. |