[poky] Serial console unusable with poky-image-sdk

Darren Hart dvhart at linux.intel.com
Fri Jan 28 08:44:25 PST 2011


On 01/27/2011 11:05 PM, Wolfgang Denk wrote:
> Dear Darren Hart,
>
> In message<4D41F2D6.4040406 at linux.intel.com>  you wrote:
>>
>>>> Is there a way to stop dbus-launch from concurring with a login shell
>>>> on the serial console port?
>>>
>>> This patch appears to be working fine for me:
>>>
>>>> From: Wolfgang Denk<wd at denx.de>
>>>> Subject: Stop dbus-launch from interfering with a serial console
>>>
>>> Signed-off-by: Wolfgang Denk<wd at denx.de>
>>> ---
>>>
>>> diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession
>>> index a87447a..0b73127 100644
>>> --- a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession
>>> +++ b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession
>>> @@ -2,7 +2,7 @@
>>>
>>>    if [ -x /usr/bin/dbus-launch ]; then
>>>        # As this is the X session script, always start a new DBus session.
>>> -    eval `dbus-launch --sh-syntax --exit-with-session`
>>> +    eval `dbus-launch --sh-syntax --exit-with-session</dev/null`
>>>        echo "D-BUS per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
>>>    fi
>>>
>>
>> you can also append "console=tty" to the kernel command line and the
>> serial console should work. I've run into this on a couple platforms as
>> well and addressed it this way. This isn't just an X11 issue as I
>> usually boot -minimal images.
>
> I think you misunderstand.  It is not that the serial console port is
> not working at all, or that there are any wrong assignments to the
> Linux console device.
>
> The problem is that after logging in both the shell and the
> dbus-launch processes will read from the same device, and it is pur
> chance which of these provesses will read which input character.
>
> The problem is that dbus-launch should not read from the console
> terminal at all, and this is what above patch enforces.

Actually, this is precisely the behavior I was seeing on other boards. 
The serial console would show all the output of the boot process and 
then present a getty. It would accept my login and my password, but as 
soon as I was logged in, things went weird. Only every Nth character I 
typed made it to the console, where N was somewhere between 2 and 30.

I believe this had something to do with the automatic consoles the 
kernel will setup based on the console= parameters. By default, the last 
console= parameter becomes /dev/console, if only serial is specified 
this seems to conflict with the getty started via inittab. If you add a 
second console directive after the first, /dev/console will point to 
that. console=/dev/tty0 works for example. Using /dev/tty however 
instructs the kernel to use an automatic console on all tty's - except 
the serial ports, which also resolves the problem for me.

What I haven't been able to explain yet is why just omitting the getty 
from the tty doesn't result in console on the serial port due to the 
kernel's automatic console thing. So clearly there are some gaps in my 
explanation here, but please try this approach and let me know what your 
results are. Based on that, we can dig a bit more and figure out how to 
best setup the console= directives on the default images.

Thanks,

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel



More information about the poky mailing list