[Linux-Xtensa] Using /dev/ttyS1 for initial console
Mahavir Prasad
er.mahavir at gmail.com
Wed Mar 7 00:56:37 PST 2012
Hello Max,
I tried adding the following in /etc/inittab
*::respawn:/sbin/getty -L console 38400 vt100*
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):
*
#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();
....
}
Thanks and Regards,
Mahavir
On Wed, Mar 7, 2012 at 12:43 AM, Mahavir Prasad <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> 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/2d7ea3b5/attachment.html
More information about the linux-xtensa
mailing list