[Linux-Xtensa] Using /dev/ttyS1 for initial console

Piet Delaney pdelaney at tensilica.com
Wed Mar 7 01:58:10 PST 2012


Mahavir Prasad wrote:
> Hello Max,
>
> I tried adding the following in /etc/inittab
>   *::respawn:/sbin/getty -L console 38400 vt100*
*I just checked in a buildroot change to update the /etc/inittab.*
*It's working fine for me with a simple RAM based filesystem.*

> The login shell came on /dev/ttyS1 but I was not able to login. I was 
> getting incorrect login message.
> To resolve this I added the following entry in /etc/securetty
>    *console*
> After the above change I am able to login, but I got following message 
> after successful login:
>    *sh: can't access tty; job control turned off *
> On further searching, I found the following information:
>    http://www.busybox.net/FAQ.html#job_control
> The above link suggested setting noctty = 0 in drivers/char/tty_io.c. 
> I tried the suggestion (after adding a kernel configuration option for 
> the same) and the last error went away.
>
>
> However, if I add the following entry in /etc/inittab
>    *::respawn:-/bin/login*
>  and following entry in /etc/securetty
>    *console*
> I am able to login successfully and there is no "sh: can't access tty; 
> job control turned off" error. Only difference is that the welcome 
> message is not shown in this case.
>
> So, my question is whether the second method is appropriate or should 
> I use the first method?
>
> Also, I checked the busybox code for the welcome message. 
> "loginutils/login.c" only calls "print_login_prompt()". There is no 
> call to "print_login_issue(...)". If I need to show welcome message 
> before login, then I can make following changes (not tried these):
*I'm getting:*
------------------------------------------------------------------------------------------
Welcome to your custom Xtensa test_mmuhifi_c3 Tiny RamFS System
(none) login: root
[root@(none) ~]#
--------------------------------------------------------------------------------------------

*Which buildroot puts in /etc/issue:*
--------------------------------------------------------------------------------------------
[root@(none) ~]# *cat /etc/issue *

Welcome to your custom Xtensa test_mmuhifi_c3 Tiny RamFS System
[root@(none) ~]#
-----------------------------------------------------------------------------------------------


> *
> #define ISSUE "/etc/issue"*
> ....
>
> static void get_username_or_die(char *buf, int size_buf)
> {
>         int c, cntdown;
>
>         cntdown = EMPTY_USERNAME_COUNT;
> prompt:
> *#ifdef ISSUE
>         print_login_issue(ISSUE, NULL);
> #endif
> *        print_login_prompt();
>         ....
> }
*I wonder if this is a Ubuntu issue.

-piet*

>
>
> Thanks and Regards,
> Mahavir
>
> On Wed, Mar 7, 2012 at 12:43 AM, Mahavir Prasad <er.mahavir at gmail.com 
> <mailto:er.mahavir at gmail.com>> wrote:
>
>     Thanks Max!!!
>
>     Tomorrow, I will try out your suggestion and will update you with
>     the result.
>
>     Regards,
>     Mahavir
>
>
>     On Wed, Mar 7, 2012 at 12:18 AM, Max Filippov <jcmvbkbc at gmail.com
>     <mailto:jcmvbkbc at gmail.com>> wrote:
>
>         > I need to use /dev/ttyS1 for initial console. For this, I pass
>         > console=ttyS1,38400 as kernel parameter.
>         >
>         > However, until I modify the following entry (marked in bold)
>         in /etc/inittab
>         > file, I don't get console on /dev/ttyS1
>         >
>         > # Put a getty on the serial port
>         > # ttyS0::respawn:/sbin/getty -L ttyS0 38400 vt100
>         > ttyS1::respawn:/sbin/getty -L ttyS1 38400 vt100
>
>         The initial console is the device used by the kernel to output
>         its messages.
>         It is specified in the kernel command line. The login console
>         is the
>         device where
>         you run your login by means of getty/mgetty/whatever. These
>         two devices
>         need not to be related. If you want to run login on your
>         initial console, try
>
>         ::respawn:/sbin/getty -L console 38400 vt100
>
>         --
>         Thanks.
>         -- Max
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux-xtensa.org/pipermail/linux-xtensa/attachments/20120307/a230170d/attachment.html


More information about the linux-xtensa mailing list