diff options
author | jkh <jkh@FreeBSD.org> | 1995-05-18 15:29:47 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-05-18 15:29:47 +0000 |
commit | 05d53ab3a72fad10e4cd054385a989463c149d09 (patch) | |
tree | ddee1673e860ccbd6ed71f546ee602b5cdd073ff /usr.sbin/sysinstall | |
parent | a2aa8e6d938599429cc618b57d5f766d09743aa9 (diff) | |
download | FreeBSD-src-05d53ab3a72fad10e4cd054385a989463c149d09.zip FreeBSD-src-05d53ab3a72fad10e4cd054385a989463c149d09.tar.gz |
1. Use 8x16 fonts.
2. Don't use russian screenmap - apparently not necessary with right font.
3. Dequote bogusly quoted font name in english language setting.
4. Use setterm() and hack around an undesirable side-effect (cbreak is unset).
5. be smarter about setting OnVTY, and use it in cases where it makes sense.
Submitted by: Nickolay N. Dudorov <nnd@gw.itfs.nsk.su>
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r-- | usr.sbin/sysinstall/Makefile | 15 | ||||
-rw-r--r-- | usr.sbin/sysinstall/sysinstall.h | 9 | ||||
-rw-r--r-- | usr.sbin/sysinstall/system.c | 26 | ||||
-rw-r--r-- | usr.sbin/sysinstall/termcap.c | 47 |
4 files changed, 49 insertions, 48 deletions
diff --git a/usr.sbin/sysinstall/Makefile b/usr.sbin/sysinstall/Makefile index 949b57d..0fb300a 100644 --- a/usr.sbin/sysinstall/Makefile +++ b/usr.sbin/sysinstall/Makefile @@ -62,17 +62,14 @@ makedevs.c: dev2c.sh Makefile rtermcap ./rtermcap vt100 | \ file2c 'const char termcap_vt100[] = {' ',0};' \ >> makedevs.tmp - file2c 'const u_char font_iso_8x14[] = {' '};' \ - < ${.CURDIR}/../../share/syscons/fonts/iso-8x14.fnt \ + cat ${.CURDIR}/../../share/syscons/fonts/iso-8x16.fnt | \ + uudecode | file2c 'const u_char font_iso_8x16[] = {' '};' \ >> makedevs.tmp - file2c 'const u_char font_cp850_8x14[] = {' '};' \ - < ${.CURDIR}/../../share/syscons/fonts/cp850-8x14.fnt \ + cat ${.CURDIR}/../../share/syscons/fonts/cp850-8x16.fnt | \ + uudecode | file2c 'const u_char font_cp850_8x16[] = {' '};' \ >> makedevs.tmp - file2c 'const u_char font_koi8_r_8x14[] = {' '};' \ - < ${.CURDIR}/../../share/syscons/fonts/koi8-r-8x14.fnt \ - >> makedevs.tmp - file2c 'const u_char koi8_r2cp866[] = {' '};' \ - < ${.CURDIR}/../../share/syscons/scrnmaps/koi8-r2cp866 \ + cat ${.CURDIR}/../../share/syscons/fonts/koi8-r-8x16.fnt | \ + uudecode | file2c 'const u_char font_koi8_r_8x16[] = {' '};' \ >> makedevs.tmp mv makedevs.tmp makedevs.c diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index e3f00f0..b8452c2 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.17 1995/05/16 11:37:25 jkh Exp $ + * $Id: sysinstall.h,v 1.18 1995/05/17 14:39:56 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -279,10 +279,9 @@ extern const char termcap_cons25r[]; extern const char termcap_cons25r_m[]; extern const char termcap_cons25l1[]; extern const char termcap_cons25l1_m[]; -extern const u_char font_iso_8x14[]; -extern const u_char font_cp850_8x14[]; -extern const u_char font_koi8_r_8x14[]; -extern const u_char koi8_r2cp866[]; +extern const u_char font_iso_8x16[]; +extern const u_char font_cp850_8x16[]; +extern const u_char font_koi8_r_8x16[]; /* media.c */ extern int mediaSetCDROM(char *str); diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index 713092f..23dffe9 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/sysinstall/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.13 1995/05/18 02:42:33 jkh Exp $ + * $Id: system.c,v 1.14 1995/05/18 09:02:02 jkh Exp $ * * Jordan Hubbard * @@ -221,7 +221,7 @@ void systemChangeFont(const u_char font[]) { if (OnVTY) { - if (ioctl(0, PIO_FONT8x14, font) < 0) + if (ioctl(0, PIO_FONT8x16, font) < 0) msgConfirm("Sorry! Unable to load font for %s", getenv("LANG")); } } @@ -236,30 +236,26 @@ void systemChangeTerminal(char *color, const u_char c_term[], char *mono, const u_char m_term[]) { - if (!OnSerial) { + if (OnVTY) { if (ColorDisplay) { setenv("TERM", color, 1); setenv("TERMCAP", c_term, 1); - /* setterm(color); */ + reset_shell_mode(); + setterm(color); + init_acs(); + cbreak(); noecho(); } else { setenv("TERM", mono, 1); setenv("TERMCAP", m_term, 1); - /* setterm(mono); */ + reset_shell_mode(); + setterm(mono); + init_acs(); + cbreak(); noecho(); } } } -void -systemChangeScreenmap(const u_char newmap[]) -{ - if (OnVTY) { - if (ioctl(0, PIO_SCRNMAP, newmap) < 0) - msgConfirm("Sorry! Unable to load the screenmap for %s", - getenv("LANG")); - } -} - /* Execute a system command, with varargs */ int vsystem(char *fmt, ...) diff --git a/usr.sbin/sysinstall/termcap.c b/usr.sbin/sysinstall/termcap.c index 86e758a..2cd8158 100644 --- a/usr.sbin/sysinstall/termcap.c +++ b/usr.sbin/sysinstall/termcap.c @@ -26,35 +26,44 @@ int set_termcap(void) { char *term; + int stat; OnVTY = OnSerial = FALSE; + if (getpid() != 1) + DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644); term = getenv("TERM"); - if (term == NULL) { - if (ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay) < 0) { + stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay); + if (stat < 0) { + if (!term) { if (setenv("TERM", "vt100", 1) < 0) return -1; if (setenv("TERMCAP", termcap_vt100, 1) < 0) return -1; - DebugFD = dup(1); - OnSerial = TRUE; - } else if (ColorDisplay) { - if (setenv("TERM", "cons25", 1) < 0) - return -1; - if (setenv("TERMCAP", termcap_cons25, 1) < 0) - return -1; - DebugFD = open("/dev/ttyv1", O_WRONLY); - OnVTY = TRUE; - } else { - if (setenv("TERM", "cons25-m", 1) < 0) - return -1; - if (setenv("TERMCAP", termcap_cons25_m, 1) < 0) - return -1; - DebugFD = open("/dev/ttyv1", O_WRONLY); - OnVTY = TRUE; } + if (DebugFD == -1) + DebugFD = dup(1); + OnSerial = TRUE; } else { - DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644); + if (ColorDisplay) { + if (!term) { + if (setenv("TERM", "cons25", 1) < 0) + return -1; + if (setenv("TERMCAP", termcap_cons25, 1) < 0) + return -1; + } + } + else { + if (!term) { + if (setenv("TERM", "cons25-m", 1) < 0) + return -1; + if (setenv("TERMCAP", termcap_cons25_m, 1) < 0) + return -1; + } + } + if (DebugFD == -1) + DebugFD = open("/dev/ttyv1", O_WRONLY); + OnVTY = TRUE; } return 0; } |