Re: TERM defaults to linux even on serial console (where vt102 would be more appropriate)
Erik Andersen wrote:
> On Tue Feb 15, 2000 at 11:42:48AM +0100, Eric Delaunay wrote:
> >
> > > Thoughts? Sound agreeable?
> >
> > I can provide you a patch I wrote for init.c to implement my thoughts.
>
> Does the version now in CVS look agreeable?
Well, I'd rather like to let the user a chance to overwrite TERM at boot time.
However it seems there still is a problem: when I pass TERM=vt100 at boot
time, kernel is calling the first program with the following environment:
HOME=/
TERM=linux
TERM=vt100
There are two TERM lines ;((
It appears that init is getting the former while, when booting directly to
/bin/sh, sh is getting the latter. Therefore init ignores any TERM=xxx passed
to kernel command line. It always deals with TERM=linux ;(
Should I file a bug against the kernel itself? Or could the bug be fixed in
getenv()?
Nevertheless, could you add the next fix, please?
--- boot-floppies-20000218.orig/utilities/busybox/init.c Fri Feb 18 22:14:02 2000
+++ boot-floppies-20000218/utilities/busybox/init.c Sat Feb 19 22:23:50 2000
@@ -315,7 +315,8 @@
log = NULL;
secondConsole = NULL;
/* Force the TERM setting to vt102 for serial console */
- snprintf(termType, sizeof(termType) - 1, "TERM=vt102");
+ if (strcmp( termType, "TERM=linux" ) == 0)
+ snprintf(termType, sizeof(termType) - 1, "TERM=vt102");
message(LOG | CONSOLE,
"serial console detected. Disabling virtual terminals.\r\n");
}
--
Eric Delaunay | S'il n'y a pas de solution, c'est qu'il n'y
delaunay@lix.polytechnique.fr | a pas de problème. Devise Shadok.
Reply to: