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>
This commit is contained in:
Jordan K. Hubbard 1995-05-18 15:29:47 +00:00
parent 36678611e6
commit a2b4e70705
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8601
13 changed files with 159 additions and 157 deletions

View File

@ -62,17 +62,14 @@ makedevs.c: dev2c.sh Makefile rtermcap
./rtermcap vt100 | \ ./rtermcap vt100 | \
file2c 'const char termcap_vt100[] = {' ',0};' \ file2c 'const char termcap_vt100[] = {' ',0};' \
>> makedevs.tmp >> makedevs.tmp
file2c 'const u_char font_iso_8x14[] = {' '};' \ cat ${.CURDIR}/../../share/syscons/fonts/iso-8x16.fnt | \
< ${.CURDIR}/../../share/syscons/fonts/iso-8x14.fnt \ uudecode | file2c 'const u_char font_iso_8x16[] = {' '};' \
>> makedevs.tmp >> makedevs.tmp
file2c 'const u_char font_cp850_8x14[] = {' '};' \ cat ${.CURDIR}/../../share/syscons/fonts/cp850-8x16.fnt | \
< ${.CURDIR}/../../share/syscons/fonts/cp850-8x14.fnt \ uudecode | file2c 'const u_char font_cp850_8x16[] = {' '};' \
>> makedevs.tmp >> makedevs.tmp
file2c 'const u_char font_koi8_r_8x14[] = {' '};' \ cat ${.CURDIR}/../../share/syscons/fonts/koi8-r-8x16.fnt | \
< ${.CURDIR}/../../share/syscons/fonts/koi8-r-8x14.fnt \ uudecode | file2c 'const u_char font_koi8_r_8x16[] = {' '};' \
>> makedevs.tmp
file2c 'const u_char koi8_r2cp866[] = {' '};' \
< ${.CURDIR}/../../share/syscons/scrnmaps/koi8-r2cp866 \
>> makedevs.tmp >> makedevs.tmp
mv makedevs.tmp makedevs.c mv makedevs.tmp makedevs.c

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next * This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite. * generation being essentially a complete rewrite.
* *
* $Id: lang.c,v 1.1 1995/05/04 19:48:12 jkh Exp $ * $Id: lang.c,v 1.2 1995/05/05 23:47:41 jkh Exp $
* *
* Copyright (c) 1995 * Copyright (c) 1995
* Jordan Hubbard. All rights reserved. * Jordan Hubbard. All rights reserved.
@ -46,7 +46,7 @@
void void
lang_set_Danish(char *str) lang_set_Danish(char *str)
{ {
systemChangeFont(font_iso_8x14); systemChangeFont(font_iso_8x16);
systemChangeLang("da_DK.ISO8859-1"); systemChangeLang("da_DK.ISO8859-1");
systemChangeTerminal("cons25l1", termcap_cons25l1, systemChangeTerminal("cons25l1", termcap_cons25l1,
"cons25l1-m", termcap_cons25l1_m); "cons25l1-m", termcap_cons25l1_m);
@ -55,7 +55,7 @@ lang_set_Danish(char *str)
void void
lang_set_Dutch(char *str) lang_set_Dutch(char *str)
{ {
systemChangeFont(font_iso_8x14); systemChangeFont(font_iso_8x16);
systemChangeLang("nl_NL.ISO8859-1"); systemChangeLang("nl_NL.ISO8859-1");
systemChangeTerminal("cons25l1", termcap_cons25l1, systemChangeTerminal("cons25l1", termcap_cons25l1,
"cons25l1-m", termcap_cons25l1_m); "cons25l1-m", termcap_cons25l1_m);
@ -64,7 +64,7 @@ lang_set_Dutch(char *str)
void void
lang_set_English(char *str) lang_set_English(char *str)
{ {
systemChangeFont("font_cp850_8x14"); systemChangeFont(font_cp850_8x16);
systemChangeLang("en_US.ISO8859-1"); systemChangeLang("en_US.ISO8859-1");
systemChangeTerminal("cons25", termcap_cons25, systemChangeTerminal("cons25", termcap_cons25,
"cons25-m", termcap_cons25_m); "cons25-m", termcap_cons25_m);
@ -73,7 +73,7 @@ lang_set_English(char *str)
void void
lang_set_French(char *str) lang_set_French(char *str)
{ {
systemChangeFont(font_iso_8x14); systemChangeFont(font_iso_8x16);
systemChangeLang("fr_FR.ISO8859-1"); systemChangeLang("fr_FR.ISO8859-1");
systemChangeTerminal("cons25l1", termcap_cons25l1, systemChangeTerminal("cons25l1", termcap_cons25l1,
"cons25l1-m", termcap_cons25l1_m); "cons25l1-m", termcap_cons25l1_m);
@ -82,7 +82,7 @@ lang_set_French(char *str)
void void
lang_set_German(char *str) lang_set_German(char *str)
{ {
systemChangeFont(font_iso_8x14); systemChangeFont(font_iso_8x16);
systemChangeLang("de_DE.ISO8859-1"); systemChangeLang("de_DE.ISO8859-1");
systemChangeTerminal("cons25l1", termcap_cons25l1, systemChangeTerminal("cons25l1", termcap_cons25l1,
"cons25l1-m", termcap_cons25l1_m); "cons25l1-m", termcap_cons25l1_m);
@ -91,7 +91,7 @@ lang_set_German(char *str)
void void
lang_set_Italian(char *str) lang_set_Italian(char *str)
{ {
systemChangeFont(font_iso_8x14); systemChangeFont(font_iso_8x16);
systemChangeLang("it_IT.ISO8859-1"); systemChangeLang("it_IT.ISO8859-1");
systemChangeTerminal("cons25l1", termcap_cons25l1, systemChangeTerminal("cons25l1", termcap_cons25l1,
"cons25l1-m", termcap_cons25l1_m); "cons25l1-m", termcap_cons25l1_m);
@ -101,7 +101,7 @@ lang_set_Italian(char *str)
void void
lang_set_Japanese(char *str) lang_set_Japanese(char *str)
{ {
systemChangeFont(font_iso_8x14); systemChangeFont(font_iso_8x16);
systemChangeLang("ja_JP.ROMAJI"); systemChangeLang("ja_JP.ROMAJI");
systemChangeTerminal("cons25", termcap_cons25, systemChangeTerminal("cons25", termcap_cons25,
"cons25-m", termcap_cons25_m); "cons25-m", termcap_cons25_m);
@ -110,7 +110,7 @@ lang_set_Japanese(char *str)
void void
lang_set_Norwegian(char *str) lang_set_Norwegian(char *str)
{ {
systemChangeFont(font_iso_8x14); systemChangeFont(font_iso_8x16);
systemChangeLang("no_NO.ISO8859-1"); systemChangeLang("no_NO.ISO8859-1");
systemChangeTerminal("cons25l1", termcap_cons25l1, systemChangeTerminal("cons25l1", termcap_cons25l1,
"cons25l1-m", termcap_cons25l1_m); "cons25l1-m", termcap_cons25l1_m);
@ -119,9 +119,8 @@ lang_set_Norwegian(char *str)
void void
lang_set_Russian(char *str) lang_set_Russian(char *str)
{ {
systemChangeFont(font_koi8_r_8x14); systemChangeFont(font_koi8_r_8x16);
systemChangeLang("ru_SU.KOI8-R"); systemChangeLang("ru_SU.KOI8-R");
systemChangeScreenmap(koi8_r2cp866);
systemChangeTerminal("cons25r", termcap_cons25r, systemChangeTerminal("cons25r", termcap_cons25r,
"cons25r-m", termcap_cons25r_m); "cons25r-m", termcap_cons25r_m);
} }
@ -129,7 +128,7 @@ lang_set_Russian(char *str)
void void
lang_set_Spanish(char *str) lang_set_Spanish(char *str)
{ {
systemChangeFont(font_iso_8x14); systemChangeFont(font_iso_8x16);
systemChangeLang("es_ES.ISO8859-1"); systemChangeLang("es_ES.ISO8859-1");
systemChangeTerminal("cons25l1", termcap_cons25l1, systemChangeTerminal("cons25l1", termcap_cons25l1,
"cons25l1-m", termcap_cons25l1_m); "cons25l1-m", termcap_cons25l1_m);
@ -138,7 +137,7 @@ lang_set_Spanish(char *str)
void void
lang_set_Swedish(char *str) lang_set_Swedish(char *str)
{ {
systemChangeFont(font_iso_8x14); systemChangeFont(font_iso_8x16);
systemChangeLang("sv_SV.ISO8859-1"); systemChangeLang("sv_SV.ISO8859-1");
systemChangeTerminal("cons25l1", termcap_cons25l1, systemChangeTerminal("cons25l1", termcap_cons25l1,
"cons25l1-m", termcap_cons25l1_m); "cons25l1-m", termcap_cons25l1_m);

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next * This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite. * 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 * Copyright (c) 1995
* Jordan Hubbard. All rights reserved. * Jordan Hubbard. All rights reserved.
@ -279,10 +279,9 @@ extern const char termcap_cons25r[];
extern const char termcap_cons25r_m[]; extern const char termcap_cons25r_m[];
extern const char termcap_cons25l1[]; extern const char termcap_cons25l1[];
extern const char termcap_cons25l1_m[]; extern const char termcap_cons25l1_m[];
extern const u_char font_iso_8x14[]; extern const u_char font_iso_8x16[];
extern const u_char font_cp850_8x14[]; extern const u_char font_cp850_8x16[];
extern const u_char font_koi8_r_8x14[]; extern const u_char font_koi8_r_8x16[];
extern const u_char koi8_r2cp866[];
/* media.c */ /* media.c */
extern int mediaSetCDROM(char *str); extern int mediaSetCDROM(char *str);

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next * This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite. * 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 * Jordan Hubbard
* *
@ -221,7 +221,7 @@ void
systemChangeFont(const u_char font[]) systemChangeFont(const u_char font[])
{ {
if (OnVTY) { 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")); msgConfirm("Sorry! Unable to load font for %s", getenv("LANG"));
} }
} }
@ -236,30 +236,26 @@ void
systemChangeTerminal(char *color, const u_char c_term[], systemChangeTerminal(char *color, const u_char c_term[],
char *mono, const u_char m_term[]) char *mono, const u_char m_term[])
{ {
if (!OnSerial) { if (OnVTY) {
if (ColorDisplay) { if (ColorDisplay) {
setenv("TERM", color, 1); setenv("TERM", color, 1);
setenv("TERMCAP", c_term, 1); setenv("TERMCAP", c_term, 1);
/* setterm(color); */ reset_shell_mode();
setterm(color);
init_acs();
cbreak(); noecho();
} }
else { else {
setenv("TERM", mono, 1); setenv("TERM", mono, 1);
setenv("TERMCAP", m_term, 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 */ /* Execute a system command, with varargs */
int int
vsystem(char *fmt, ...) vsystem(char *fmt, ...)

View File

@ -26,35 +26,44 @@ int
set_termcap(void) set_termcap(void)
{ {
char *term; char *term;
int stat;
OnVTY = OnSerial = FALSE; OnVTY = OnSerial = FALSE;
if (getpid() != 1)
DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644);
term = getenv("TERM"); term = getenv("TERM");
if (term == NULL) { stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);
if (ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay) < 0) { if (stat < 0) {
if (!term) {
if (setenv("TERM", "vt100", 1) < 0) if (setenv("TERM", "vt100", 1) < 0)
return -1; return -1;
if (setenv("TERMCAP", termcap_vt100, 1) < 0) if (setenv("TERMCAP", termcap_vt100, 1) < 0)
return -1; 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 { 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; return 0;
} }

View File

@ -62,17 +62,14 @@ makedevs.c: dev2c.sh Makefile rtermcap
./rtermcap vt100 | \ ./rtermcap vt100 | \
file2c 'const char termcap_vt100[] = {' ',0};' \ file2c 'const char termcap_vt100[] = {' ',0};' \
>> makedevs.tmp >> makedevs.tmp
file2c 'const u_char font_iso_8x14[] = {' '};' \ cat ${.CURDIR}/../../share/syscons/fonts/iso-8x16.fnt | \
< ${.CURDIR}/../../share/syscons/fonts/iso-8x14.fnt \ uudecode | file2c 'const u_char font_iso_8x16[] = {' '};' \
>> makedevs.tmp >> makedevs.tmp
file2c 'const u_char font_cp850_8x14[] = {' '};' \ cat ${.CURDIR}/../../share/syscons/fonts/cp850-8x16.fnt | \
< ${.CURDIR}/../../share/syscons/fonts/cp850-8x14.fnt \ uudecode | file2c 'const u_char font_cp850_8x16[] = {' '};' \
>> makedevs.tmp >> makedevs.tmp
file2c 'const u_char font_koi8_r_8x14[] = {' '};' \ cat ${.CURDIR}/../../share/syscons/fonts/koi8-r-8x16.fnt | \
< ${.CURDIR}/../../share/syscons/fonts/koi8-r-8x14.fnt \ uudecode | file2c 'const u_char font_koi8_r_8x16[] = {' '};' \
>> makedevs.tmp
file2c 'const u_char koi8_r2cp866[] = {' '};' \
< ${.CURDIR}/../../share/syscons/scrnmaps/koi8-r2cp866 \
>> makedevs.tmp >> makedevs.tmp
mv makedevs.tmp makedevs.c mv makedevs.tmp makedevs.c

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next * This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite. * 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 * Copyright (c) 1995
* Jordan Hubbard. All rights reserved. * Jordan Hubbard. All rights reserved.
@ -279,10 +279,9 @@ extern const char termcap_cons25r[];
extern const char termcap_cons25r_m[]; extern const char termcap_cons25r_m[];
extern const char termcap_cons25l1[]; extern const char termcap_cons25l1[];
extern const char termcap_cons25l1_m[]; extern const char termcap_cons25l1_m[];
extern const u_char font_iso_8x14[]; extern const u_char font_iso_8x16[];
extern const u_char font_cp850_8x14[]; extern const u_char font_cp850_8x16[];
extern const u_char font_koi8_r_8x14[]; extern const u_char font_koi8_r_8x16[];
extern const u_char koi8_r2cp866[];
/* media.c */ /* media.c */
extern int mediaSetCDROM(char *str); extern int mediaSetCDROM(char *str);

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next * This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite. * 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 * Jordan Hubbard
* *
@ -221,7 +221,7 @@ void
systemChangeFont(const u_char font[]) systemChangeFont(const u_char font[])
{ {
if (OnVTY) { 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")); msgConfirm("Sorry! Unable to load font for %s", getenv("LANG"));
} }
} }
@ -236,30 +236,26 @@ void
systemChangeTerminal(char *color, const u_char c_term[], systemChangeTerminal(char *color, const u_char c_term[],
char *mono, const u_char m_term[]) char *mono, const u_char m_term[])
{ {
if (!OnSerial) { if (OnVTY) {
if (ColorDisplay) { if (ColorDisplay) {
setenv("TERM", color, 1); setenv("TERM", color, 1);
setenv("TERMCAP", c_term, 1); setenv("TERMCAP", c_term, 1);
/* setterm(color); */ reset_shell_mode();
setterm(color);
init_acs();
cbreak(); noecho();
} }
else { else {
setenv("TERM", mono, 1); setenv("TERM", mono, 1);
setenv("TERMCAP", m_term, 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 */ /* Execute a system command, with varargs */
int int
vsystem(char *fmt, ...) vsystem(char *fmt, ...)

View File

@ -26,35 +26,44 @@ int
set_termcap(void) set_termcap(void)
{ {
char *term; char *term;
int stat;
OnVTY = OnSerial = FALSE; OnVTY = OnSerial = FALSE;
if (getpid() != 1)
DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644);
term = getenv("TERM"); term = getenv("TERM");
if (term == NULL) { stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);
if (ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay) < 0) { if (stat < 0) {
if (!term) {
if (setenv("TERM", "vt100", 1) < 0) if (setenv("TERM", "vt100", 1) < 0)
return -1; return -1;
if (setenv("TERMCAP", termcap_vt100, 1) < 0) if (setenv("TERMCAP", termcap_vt100, 1) < 0)
return -1; 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 { 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; return 0;
} }

View File

@ -62,17 +62,14 @@ makedevs.c: dev2c.sh Makefile rtermcap
./rtermcap vt100 | \ ./rtermcap vt100 | \
file2c 'const char termcap_vt100[] = {' ',0};' \ file2c 'const char termcap_vt100[] = {' ',0};' \
>> makedevs.tmp >> makedevs.tmp
file2c 'const u_char font_iso_8x14[] = {' '};' \ cat ${.CURDIR}/../../share/syscons/fonts/iso-8x16.fnt | \
< ${.CURDIR}/../../share/syscons/fonts/iso-8x14.fnt \ uudecode | file2c 'const u_char font_iso_8x16[] = {' '};' \
>> makedevs.tmp >> makedevs.tmp
file2c 'const u_char font_cp850_8x14[] = {' '};' \ cat ${.CURDIR}/../../share/syscons/fonts/cp850-8x16.fnt | \
< ${.CURDIR}/../../share/syscons/fonts/cp850-8x14.fnt \ uudecode | file2c 'const u_char font_cp850_8x16[] = {' '};' \
>> makedevs.tmp >> makedevs.tmp
file2c 'const u_char font_koi8_r_8x14[] = {' '};' \ cat ${.CURDIR}/../../share/syscons/fonts/koi8-r-8x16.fnt | \
< ${.CURDIR}/../../share/syscons/fonts/koi8-r-8x14.fnt \ uudecode | file2c 'const u_char font_koi8_r_8x16[] = {' '};' \
>> makedevs.tmp
file2c 'const u_char koi8_r2cp866[] = {' '};' \
< ${.CURDIR}/../../share/syscons/scrnmaps/koi8-r2cp866 \
>> makedevs.tmp >> makedevs.tmp
mv makedevs.tmp makedevs.c mv makedevs.tmp makedevs.c

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next * This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite. * 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 * Copyright (c) 1995
* Jordan Hubbard. All rights reserved. * Jordan Hubbard. All rights reserved.
@ -279,10 +279,9 @@ extern const char termcap_cons25r[];
extern const char termcap_cons25r_m[]; extern const char termcap_cons25r_m[];
extern const char termcap_cons25l1[]; extern const char termcap_cons25l1[];
extern const char termcap_cons25l1_m[]; extern const char termcap_cons25l1_m[];
extern const u_char font_iso_8x14[]; extern const u_char font_iso_8x16[];
extern const u_char font_cp850_8x14[]; extern const u_char font_cp850_8x16[];
extern const u_char font_koi8_r_8x14[]; extern const u_char font_koi8_r_8x16[];
extern const u_char koi8_r2cp866[];
/* media.c */ /* media.c */
extern int mediaSetCDROM(char *str); extern int mediaSetCDROM(char *str);

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next * This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite. * 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 * Jordan Hubbard
* *
@ -221,7 +221,7 @@ void
systemChangeFont(const u_char font[]) systemChangeFont(const u_char font[])
{ {
if (OnVTY) { 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")); msgConfirm("Sorry! Unable to load font for %s", getenv("LANG"));
} }
} }
@ -236,30 +236,26 @@ void
systemChangeTerminal(char *color, const u_char c_term[], systemChangeTerminal(char *color, const u_char c_term[],
char *mono, const u_char m_term[]) char *mono, const u_char m_term[])
{ {
if (!OnSerial) { if (OnVTY) {
if (ColorDisplay) { if (ColorDisplay) {
setenv("TERM", color, 1); setenv("TERM", color, 1);
setenv("TERMCAP", c_term, 1); setenv("TERMCAP", c_term, 1);
/* setterm(color); */ reset_shell_mode();
setterm(color);
init_acs();
cbreak(); noecho();
} }
else { else {
setenv("TERM", mono, 1); setenv("TERM", mono, 1);
setenv("TERMCAP", m_term, 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 */ /* Execute a system command, with varargs */
int int
vsystem(char *fmt, ...) vsystem(char *fmt, ...)

View File

@ -26,35 +26,44 @@ int
set_termcap(void) set_termcap(void)
{ {
char *term; char *term;
int stat;
OnVTY = OnSerial = FALSE; OnVTY = OnSerial = FALSE;
if (getpid() != 1)
DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644);
term = getenv("TERM"); term = getenv("TERM");
if (term == NULL) { stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);
if (ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay) < 0) { if (stat < 0) {
if (!term) {
if (setenv("TERM", "vt100", 1) < 0) if (setenv("TERM", "vt100", 1) < 0)
return -1; return -1;
if (setenv("TERMCAP", termcap_vt100, 1) < 0) if (setenv("TERMCAP", termcap_vt100, 1) < 0)
return -1; 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 { 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; return 0;
} }