Console problem

Denys Vlasenko vda.linux at googlemail.com
Thu Jun 5 00:46:32 UTC 2008


On Wednesday 04 June 2008 18:51, Nicolas Dichtel wrote:
> Hi all,
> 
> I was using busybox-1.01 for a long time and recently I've switched to
> busybox-1.10.2. On x86, there is no problem, but on MIPS architecture,
> the console does not work properly: need to type second character to make
> the first appear.

Please give more details. You need to type every char twice or what?
What program is receiving your keypresses? getty? shell? How exactly
do you start it (command line, etc)? Can you show ls -l /proc/$PID/fd
of this program and also ls -l /proc/1/fd?

Do you have any console=XXX or CONSOLE=XXX params on kernel command line?

> If I apply this patch:
> 
> --- busybox/init/init.c 2008-04-17 11:13:25.000000000 +0200
> +++ busybox-new/init/init.c     2008-05-20 16:47:00.000000000 +0200
> @@ -873,6 +873,9 @@ int init_main(int argc ATTRIBUTE_UNUSED,
> 
>          /* Figure out where the default console should be */
>          console_init();
> +       close(0);
> +       close(1);
> +       close(2);
>          set_sane_term();
>          chdir("/");
>          setsid();
> 
> the problem is solved. Of course, some log messages are hidden with this patch.
> I didn't find a better way to fix that problem. Any ideas ?

Sorry, but I don't like it. Not only you deprive all future children
from knowing what console is, you risk starting them with
stdio CLOSED - which is very bad, a lot of programs have bugs
where they overwrite random files if they are run with stdio closed.



More information about the busybox mailing list