Discussion:
[busybox] No such device tty2, tty3, tty4 on embedded system
甜瓜
2008-05-20 12:59:00 UTC
Permalink
Howdy,
I use busybox on embedded system: PowerPC 405GP Walnut board
which only has a serial port for debugging. My busybox is built with default
menuconfig settings and make it into Ramdisk form. The linux kernel is
2.6.24.2. with the bootarg set to:
root=/dev/ram rw ip=XXX panic=1 console=ttyS0,115200
The booting process seems ok except starting busybox shell:
=============
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 132k init
init started: BusyBox v1.10.2 (2008-05-20 19:17:04 CST)
starting pid 14, tty '': '/etc/init.d/rcS'
Cannot run '/etc/init.d/rcS': No such file or directory
Please press Enter to activate this console.

Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address

process '-/bin/sh' (pid 16) exited. Scheduling for restart.
process '-/bin/sh' (pid 19) exited. Scheduling for restart.
process '-/bin/sh' (pid 22) exited. Scheduling for restart.

Can't open /dev/tty4: No such file or directory
Can't open /dev/tty3: No such device or address
Can't open /dev/tty2: No such device or address

process '-/bin/sh' (pid 59) exited. Scheduling for restart.
process '-/bin/sh' (pid 62) exited. Scheduling for restart.
process '-/bin/sh' (pid 65) exited. Scheduling for restart.
=============
The error message will show again and again. But when I type:
ls
the shell shows the directories that means busybox works fine.
Since the board only have ttyS0 ttyS1 available, how to disable
additional tty?

Thanks in advance.

----
ShenLei
Roberto A. Foglietta
2008-05-20 13:35:29 UTC
Permalink
Post by 甜瓜
Howdy,
I use busybox on embedded system: PowerPC 405GP Walnut board
which only has a serial port for debugging. My busybox is built with default
menuconfig settings and make it into Ramdisk form. The linux kernel is
root=/dev/ram rw ip=XXX panic=1 console=ttyS0,115200
=============
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 132k init
init started: BusyBox v1.10.2 (2008-05-20 19:17:04 CST)
starting pid 14, tty '': '/etc/init.d/rcS'
Cannot run '/etc/init.d/rcS': No such file or directory
Please press Enter to activate this console.
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address
process '-/bin/sh' (pid 16) exited. Scheduling for restart.
process '-/bin/sh' (pid 19) exited. Scheduling for restart.
process '-/bin/sh' (pid 22) exited. Scheduling for restart.
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty3: No such device or address
Can't open /dev/tty2: No such device or address
process '-/bin/sh' (pid 59) exited. Scheduling for restart.
process '-/bin/sh' (pid 62) exited. Scheduling for restart.
process '-/bin/sh' (pid 65) exited. Scheduling for restart.
=============
ls
the shell shows the directories that means busybox works fine.
Since the board only have ttyS0 ttyS1 available, how to disable
additional tty?
from target root console:

ln -sf /dev/null /dev/tty2
ln -sf /dev/null /dev/tty3
ln -sf /dev/null /dev/tty4

Cheers,
--
/roberto
Alessandro Rubini
2008-05-20 15:29:30 UTC
Permalink
Post by 甜瓜
I use busybox on embedded system: PowerPC 405GP Walnut board
which only has a serial port for debugging.
So you have no display, and no text console on the display.
Post by 甜瓜
My busybox is built with default menuconfig settings and make it
into Ramdisk form.
So, it looks like your inittab includes entries to run getty on the
text terminals.
Post by 甜瓜
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address
/dev/tty2 and /dev/tty3 exist on the filesystem but there is no associated
driver (no display, no text terminal). /dev/tty4 is not existing in the
filesystem.
Post by 甜瓜
The error message will show again and again.
You should fix your inittab so init won't try to run the getty process
on those devices.

/alessandro
Roberto A. Foglietta
2008-05-20 16:07:39 UTC
Permalink
Post by Alessandro Rubini
Post by 甜瓜
I use busybox on embedded system: PowerPC 405GP Walnut board
which only has a serial port for debugging.
So you have no display, and no text console on the display.
Post by 甜瓜
My busybox is built with default menuconfig settings and make it
into Ramdisk form.
So, it looks like your inittab includes entries to run getty on the
text terminals.
Post by 甜瓜
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address
/dev/tty2 and /dev/tty3 exist on the filesystem but there is no associated
driver (no display, no text terminal). /dev/tty4 is not existing in the
filesystem.
Post by 甜瓜
The error message will show again and again.
You should fix your inittab so init won't try to run the getty process
on those devices.
I am not sure about him but mine /etc/inittab does not carry any
tty[2-5] but it showed the same messages and linking /dev/tty[2-5]
against /dev/null was the first workaround which shut up the busybox.
If it could be of any help my system is a UMLinux but before launching
it I unset the DISPLAY environment variable:

http://lugge.wikidot.com/tar2loop

and the used busybox is the last version 1.10.2, config could be
retrieved here:

http://lugge.wikidot.com/local--files/tar2loop/busybox.config

here the /etc/inittab:

# This is run first except when booting in single-user mode
#
::sysinit:/etc/rc.sh

# /bin/sh invocations on selected ttys
#
# Start an "askfirst" shell on the console (whatever that may be)
::askfirst:-/bin/sh
# Start an "askfirst" shell on /dev/tty2-4
#tty2::askfirst:-/bin/sh
#tty3::askfirst:-/bin/sh
#tty4::askfirst:-/bin/sh

# Stuff to do when restarting the init process
::restart:/sbin/init

# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/shutdown

Cheers,
--
/roberto
Denys Vlasenko
2008-05-20 20:04:44 UTC
Permalink
Post by Roberto A. Foglietta
I am not sure about him but mine /etc/inittab does not carry any
tty[2-5] but it showed the same messages and linking /dev/tty[2-5]
against /dev/null was the first workaround which shut up the busybox.
If it could be of any help my system is a UMLinux but before launching
http://lugge.wikidot.com/tar2loop
and the used busybox is the last version 1.10.2, config could be
http://lugge.wikidot.com/local--files/tar2loop/busybox.config
# This is run first except when booting in single-user mode
#
::sysinit:/etc/rc.sh
# /bin/sh invocations on selected ttys
#
# Start an "askfirst" shell on the console (whatever that may be)
::askfirst:-/bin/sh
# Start an "askfirst" shell on /dev/tty2-4
#tty2::askfirst:-/bin/sh
#tty3::askfirst:-/bin/sh
#tty4::askfirst:-/bin/sh
# Stuff to do when restarting the init process
::restart:/sbin/init
# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/shutdown
I guess you have CONFIG_FEATURE_USE_INITTAB off,
and your /etc/inittab just gets ignored.

--
vda
Roberto A. Foglietta
2008-05-20 20:15:25 UTC
Permalink
2008/5/20 Denys Vlasenko <vda.linux at googlemail.com>:

[cut]
Post by Denys Vlasenko
Post by Roberto A. Foglietta
http://lugge.wikidot.com/local--files/tar2loop/busybox.config
CONFIG_FEATURE_USE_INITTAB=y
Post by Denys Vlasenko
I guess you have CONFIG_FEATURE_USE_INITTAB off,
and your /etc/inittab just gets ignored.
AFAIK that feature is on as you can read in the link.
Anyway tomorrow I will check again using bbconfig.
If inittab feature is really on I will post the error messages.

Cheers,
--
/roberto
Roberto A. Foglietta
2008-05-21 07:08:18 UTC
Permalink
Post by Denys Vlasenko
Post by Roberto A. Foglietta
I am not sure about him but mine /etc/inittab does not carry any
tty[2-5] but it showed the same messages and linking /dev/tty[2-5]
against /dev/null was the first workaround which shut up the busybox.
If it could be of any help my system is a UMLinux but before launching
http://lugge.wikidot.com/tar2loop
and the used busybox is the last version 1.10.2, config could be
http://lugge.wikidot.com/local--files/tar2loop/busybox.config
# This is run first except when booting in single-user mode
#
::sysinit:/etc/rc.sh
# /bin/sh invocations on selected ttys
#
# Start an "askfirst" shell on the console (whatever that may be)
::askfirst:-/bin/sh
# Start an "askfirst" shell on /dev/tty2-4
#tty2::askfirst:-/bin/sh
#tty3::askfirst:-/bin/sh
#tty4::askfirst:-/bin/sh
# Stuff to do when restarting the init process
::restart:/sbin/init
# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/shutdown
I guess you have CONFIG_FEATURE_USE_INITTAB off,
and your /etc/inittab just gets ignored.
# bbconfig | grep -i INITTAB
CONFIG_FEATURE_USE_INITTAB=y

printouts without any /dev/tty5:

VFS: Mounted root (ext2 filesystem) readonly.
line_ioctl: tty0: unknown ioctl: 0x541e
init: can't log to /dev/tty5
init started: BusyBox v1.10.2 (2008-05-16 19:01:32 CEST)
init: can't log to /dev/tty5

printouts with a regular /dev/tty5

Please press Enter to activate this console.
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
init: can't log to /dev/tty5
starting pid 658, tty '': '-/bin/sh'

# ls -al /dev/tty5
crw-r--r-- 1 0 0 4, 5 May 21 07:02 /dev/tty5

in order to shut up the busybox I have to still link /dev/null to /dev/tty5

It is fine for me do that because it is a dummy virtual machine

If you like to receive more feedback or suggest different
configuration options I will try and feedback.

http://lugge.wikidot.com/local--files/tar2loop/busybox.config

Cheers,
--
/roberto
Roberto A. Foglietta
2008-05-20 20:15:25 UTC
Permalink
2008/5/20 Denys Vlasenko <vda.linux at googlemail.com>:

[cut]
Post by Denys Vlasenko
Post by Roberto A. Foglietta
http://lugge.wikidot.com/local--files/tar2loop/busybox.config
CONFIG_FEATURE_USE_INITTAB=y
Post by Denys Vlasenko
I guess you have CONFIG_FEATURE_USE_INITTAB off,
and your /etc/inittab just gets ignored.
AFAIK that feature is on as you can read in the link.
Anyway tomorrow I will check again using bbconfig.
If inittab feature is really on I will post the error messages.

Cheers,
--
/roberto
Roberto A. Foglietta
2008-05-21 07:08:18 UTC
Permalink
Post by Denys Vlasenko
Post by Roberto A. Foglietta
I am not sure about him but mine /etc/inittab does not carry any
tty[2-5] but it showed the same messages and linking /dev/tty[2-5]
against /dev/null was the first workaround which shut up the busybox.
If it could be of any help my system is a UMLinux but before launching
http://lugge.wikidot.com/tar2loop
and the used busybox is the last version 1.10.2, config could be
http://lugge.wikidot.com/local--files/tar2loop/busybox.config
# This is run first except when booting in single-user mode
#
::sysinit:/etc/rc.sh
# /bin/sh invocations on selected ttys
#
# Start an "askfirst" shell on the console (whatever that may be)
::askfirst:-/bin/sh
# Start an "askfirst" shell on /dev/tty2-4
#tty2::askfirst:-/bin/sh
#tty3::askfirst:-/bin/sh
#tty4::askfirst:-/bin/sh
# Stuff to do when restarting the init process
::restart:/sbin/init
# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/shutdown
I guess you have CONFIG_FEATURE_USE_INITTAB off,
and your /etc/inittab just gets ignored.
# bbconfig | grep -i INITTAB
CONFIG_FEATURE_USE_INITTAB=y

printouts without any /dev/tty5:

VFS: Mounted root (ext2 filesystem) readonly.
line_ioctl: tty0: unknown ioctl: 0x541e
init: can't log to /dev/tty5
init started: BusyBox v1.10.2 (2008-05-16 19:01:32 CEST)
init: can't log to /dev/tty5

printouts with a regular /dev/tty5

Please press Enter to activate this console.
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
init: can't log to /dev/tty5
starting pid 658, tty '': '-/bin/sh'

# ls -al /dev/tty5
crw-r--r-- 1 0 0 4, 5 May 21 07:02 /dev/tty5

in order to shut up the busybox I have to still link /dev/null to /dev/tty5

It is fine for me do that because it is a dummy virtual machine

If you like to receive more feedback or suggest different
configuration options I will try and feedback.

http://lugge.wikidot.com/local--files/tar2loop/busybox.config

Cheers,
--
/roberto
甜瓜
2008-05-21 04:58:40 UTC
Permalink
Post by Roberto A. Foglietta
Post by Alessandro Rubini
Post by 甜瓜
I use busybox on embedded system: PowerPC 405GP Walnut board
which only has a serial port for debugging.
So you have no display, and no text console on the display.
Post by 甜瓜
My busybox is built with default menuconfig settings and make it
into Ramdisk form.
So, it looks like your inittab includes entries to run getty on the
text terminals.
Post by 甜瓜
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address
/dev/tty2 and /dev/tty3 exist on the filesystem but there is no associated
driver (no display, no text terminal). /dev/tty4 is not existing in the
filesystem.
Post by 甜瓜
The error message will show again and again.
You should fix your inittab so init won't try to run the getty process
on those devices.
I am not sure about him but mine /etc/inittab does not carry any
tty[2-5] but it showed the same messages and linking /dev/tty[2-5]
against /dev/null was the first workaround which shut up the busybox.
If it could be of any help my system is a UMLinux but before launching
http://lugge.wikidot.com/tar2loop
and the used busybox is the last version 1.10.2, config could be
http://lugge.wikidot.com/local--files/tar2loop/busybox.config
# This is run first except when booting in single-user mode
#
::sysinit:/etc/rc.sh
# /bin/sh invocations on selected ttys
#
# Start an "askfirst" shell on the console (whatever that may be)
::askfirst:-/bin/sh
# Start an "askfirst" shell on /dev/tty2-4
#tty2::askfirst:-/bin/sh
#tty3::askfirst:-/bin/sh
#tty4::askfirst:-/bin/sh
# Stuff to do when restarting the init process
::restart:/sbin/init
# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/shutdown
I follow your inittab. It works fine! Thanks to all of you for quick responds.

Best regards,

---
ShenLei
Denys Vlasenko
2008-05-21 08:07:44 UTC
Permalink
Post by Roberto A. Foglietta
Post by Alessandro Rubini
Post by 甜瓜
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address
/dev/tty2 and /dev/tty3 exist on the filesystem but there is no associated
driver (no display, no text terminal). /dev/tty4 is not existing in the
filesystem.
Post by 甜瓜
The error message will show again and again.
You should fix your inittab so init won't try to run the getty process
on those devices.
I am not sure about him but mine /etc/inittab does not carry any
tty[2-5] but it showed the same messages and linking /dev/tty[2-5]
against /dev/null was the first workaround which shut up the busybox.
If it could be of any help my system is a UMLinux but before launching
# bbconfig | grep -i INITTAB
CONFIG_FEATURE_USE_INITTAB=y
VFS: Mounted root (ext2 filesystem) readonly.
line_ioctl: tty0: unknown ioctl: 0x541e
init: can't log to /dev/tty5
init started: BusyBox v1.10.2 (2008-05-16 19:01:32 CEST)
init: can't log to /dev/tty5
printouts with a regular /dev/tty5
Please press Enter to activate this console.
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
This is a *different message*.

bbox init with CONFIG_FEATURE_INIT_SYSLOG off outputs
error messages to /dev/tty5. This is not new.
Although I do not understand why is it so. Looks strangely arbitrary...
do we need to change that? How?

Regarding "xterm_open": this is definitely does not come from busybox,
you run some application which expects to be run from X.
--
vda
Roberto A. Foglietta
2008-05-21 08:27:55 UTC
Permalink
Post by Denys Vlasenko
Post by Roberto A. Foglietta
Post by Alessandro Rubini
Post by 甜瓜
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address
/dev/tty2 and /dev/tty3 exist on the filesystem but there is no associated
driver (no display, no text terminal). /dev/tty4 is not existing in the
filesystem.
Post by 甜瓜
The error message will show again and again.
You should fix your inittab so init won't try to run the getty process
on those devices.
I am not sure about him but mine /etc/inittab does not carry any
tty[2-5] but it showed the same messages and linking /dev/tty[2-5]
against /dev/null was the first workaround which shut up the busybox.
If it could be of any help my system is a UMLinux but before launching
Yes I messed up the time correlation events :

a) see the same messages
b) I made links to /dev/null
c) I commented out ttys in inittab
d) restored original ttyN devices
e) still have warning about tty5

In fact I wrote "... was the first workaround which shut up the ..."
because I was just acknowledged that about tty5 busybox still warning
loudly even using a proper inittab. I am sorry my message was not as
much precise as it would be.
Post by Denys Vlasenko
Post by Roberto A. Foglietta
# bbconfig | grep -i INITTAB
CONFIG_FEATURE_USE_INITTAB=y
VFS: Mounted root (ext2 filesystem) readonly.
line_ioctl: tty0: unknown ioctl: 0x541e
init: can't log to /dev/tty5
init started: BusyBox v1.10.2 (2008-05-16 19:01:32 CEST)
init: can't log to /dev/tty5
printouts with a regular /dev/tty5
Please press Enter to activate this console.
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
This is a *different message*.
bbox init with CONFIG_FEATURE_INIT_SYSLOG off outputs
error messages to /dev/tty5. This is not new.
Although I do not understand why is it so. Looks strangely arbitrary...
do we need to change that? How?
Sorry, what appear strangely arbitrary? and change what? I always use
1.0.x and 1.2.x version of busybox and this is the first time I am
using "new" busybox. I think is natural having to familiarize with new
bb and its options.
Post by Denys Vlasenko
Regarding "xterm_open": this is definitely does not come from busybox,
you run some application which expects to be run from X.
Yes it depends on User Mode Linux.

Cheers,
--
/roberto
Denys Vlasenko
2008-05-21 16:33:43 UTC
Permalink
Post by Roberto A. Foglietta
Post by Denys Vlasenko
bbox init with CONFIG_FEATURE_INIT_SYSLOG off outputs
error messages to /dev/tty5. This is not new.
Although I do not understand why is it so. Looks strangely arbitrary...
do we need to change that? How?
Sorry, what appear strangely arbitrary? and change what? I always use
1.0.x and 1.2.x version of busybox and this is the first time I am
using "new" busybox. I think is natural having to familiarize with new
bb and its options.
I mean - this "log to vc #5" behavior seems to be arbitrary.
Why vc #5 and not #6? Why vc and not serial line? and so on.

You just got bitten by this arbitrariness. Good moment to think
what can be a better behavior.

Would you like init to just log to console - say, fd #2 which
is passed to init by the kernel?
--
vda
Roberto A. Foglietta
2008-05-21 16:59:06 UTC
Permalink
Post by Denys Vlasenko
Post by Roberto A. Foglietta
Post by Denys Vlasenko
bbox init with CONFIG_FEATURE_INIT_SYSLOG off outputs
error messages to /dev/tty5. This is not new.
Although I do not understand why is it so. Looks strangely arbitrary...
do we need to change that? How?
Sorry, what appear strangely arbitrary? and change what? I always use
1.0.x and 1.2.x version of busybox and this is the first time I am
using "new" busybox. I think is natural having to familiarize with new
bb and its options.
I mean - this "log to vc #5" behavior seems to be arbitrary.
Why vc #5 and not #6? Why vc and not serial line? and so on.
You just got bitten by this arbitrariness. Good moment to think
what can be a better behavior.
Would you like init to just log to console - say, fd #2 which
is passed to init by the kernel?
IMHO passing arbitrary arguments to kernel in not standard board
could not an easy thing.

I would prefer choose by:

1) config in which console logs fall in case syslog is not initialized.
2) previous one choose could be overwritten by a special inittab line
3) previous twos could be overwritten by kernel line arguments with
syslog=ttyN or syslog=ttySn

and fd #2 kernel argument seem too less auto-explicative.

I hope this helps,
--
/roberto
Denys Vlasenko
2008-05-21 23:27:26 UTC
Permalink
Post by Roberto A. Foglietta
Post by Denys Vlasenko
Post by Roberto A. Foglietta
Sorry, what appear strangely arbitrary? and change what? I always use
1.0.x and 1.2.x version of busybox and this is the first time I am
using "new" busybox. I think is natural having to familiarize with new
bb and its options.
I mean - this "log to vc #5" behavior seems to be arbitrary.
Why vc #5 and not #6? Why vc and not serial line? and so on.
You just got bitten by this arbitrariness. Good moment to think
what can be a better behavior.
Would you like init to just log to console - say, fd #2 which
is passed to init by the kernel?
IMHO passing arbitrary arguments to kernel in not standard board
could not an easy thing.
What arguments?
Post by Roberto A. Foglietta
1) config in which console logs fall in case syslog is not initialized.
2) previous one choose could be overwritten by a special inittab line
3) previous twos could be overwritten by kernel line arguments with
syslog=ttyN or syslog=ttySn
and fd #2 kernel argument seem too less auto-explicative.
Well, it's sort of standard behavior of unix programs to use standard
output/standard error fds for logging. init also has such descriptors open.
They are open to console by the kernel before init is executed.

Added bonus: almost everybody have console configured so that output
can me made visible for humans (this is needed to debug kernel
boot problems), so automatically init's messages will also be visible.

The downside is that these messages may intermigle with getty/shell/etc
output if console is also used for login.
--
vda
Denys Vlasenko
2008-05-21 23:27:26 UTC
Permalink
Post by Roberto A. Foglietta
Post by Denys Vlasenko
Post by Roberto A. Foglietta
Sorry, what appear strangely arbitrary? and change what? I always use
1.0.x and 1.2.x version of busybox and this is the first time I am
using "new" busybox. I think is natural having to familiarize with new
bb and its options.
I mean - this "log to vc #5" behavior seems to be arbitrary.
Why vc #5 and not #6? Why vc and not serial line? and so on.
You just got bitten by this arbitrariness. Good moment to think
what can be a better behavior.
Would you like init to just log to console - say, fd #2 which
is passed to init by the kernel?
IMHO passing arbitrary arguments to kernel in not standard board
could not an easy thing.
What arguments?
Post by Roberto A. Foglietta
1) config in which console logs fall in case syslog is not initialized.
2) previous one choose could be overwritten by a special inittab line
3) previous twos could be overwritten by kernel line arguments with
syslog=ttyN or syslog=ttySn
and fd #2 kernel argument seem too less auto-explicative.
Well, it's sort of standard behavior of unix programs to use standard
output/standard error fds for logging. init also has such descriptors open.
They are open to console by the kernel before init is executed.

Added bonus: almost everybody have console configured so that output
can me made visible for humans (this is needed to debug kernel
boot problems), so automatically init's messages will also be visible.

The downside is that these messages may intermigle with getty/shell/etc
output if console is also used for login.
--
vda

Roberto A. Foglietta
2008-05-21 16:59:06 UTC
Permalink
Post by Denys Vlasenko
Post by Roberto A. Foglietta
Post by Denys Vlasenko
bbox init with CONFIG_FEATURE_INIT_SYSLOG off outputs
error messages to /dev/tty5. This is not new.
Although I do not understand why is it so. Looks strangely arbitrary...
do we need to change that? How?
Sorry, what appear strangely arbitrary? and change what? I always use
1.0.x and 1.2.x version of busybox and this is the first time I am
using "new" busybox. I think is natural having to familiarize with new
bb and its options.
I mean - this "log to vc #5" behavior seems to be arbitrary.
Why vc #5 and not #6? Why vc and not serial line? and so on.
You just got bitten by this arbitrariness. Good moment to think
what can be a better behavior.
Would you like init to just log to console - say, fd #2 which
is passed to init by the kernel?
IMHO passing arbitrary arguments to kernel in not standard board
could not an easy thing.

I would prefer choose by:

1) config in which console logs fall in case syslog is not initialized.
2) previous one choose could be overwritten by a special inittab line
3) previous twos could be overwritten by kernel line arguments with
syslog=ttyN or syslog=ttySn

and fd #2 kernel argument seem too less auto-explicative.

I hope this helps,
--
/roberto
Denys Vlasenko
2008-05-21 16:33:43 UTC
Permalink
Post by Roberto A. Foglietta
Post by Denys Vlasenko
bbox init with CONFIG_FEATURE_INIT_SYSLOG off outputs
error messages to /dev/tty5. This is not new.
Although I do not understand why is it so. Looks strangely arbitrary...
do we need to change that? How?
Sorry, what appear strangely arbitrary? and change what? I always use
1.0.x and 1.2.x version of busybox and this is the first time I am
using "new" busybox. I think is natural having to familiarize with new
bb and its options.
I mean - this "log to vc #5" behavior seems to be arbitrary.
Why vc #5 and not #6? Why vc and not serial line? and so on.

You just got bitten by this arbitrariness. Good moment to think
what can be a better behavior.

Would you like init to just log to console - say, fd #2 which
is passed to init by the kernel?
--
vda
Roberto A. Foglietta
2008-05-21 08:27:55 UTC
Permalink
Post by Denys Vlasenko
Post by Roberto A. Foglietta
Post by Alessandro Rubini
Post by 甜瓜
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address
/dev/tty2 and /dev/tty3 exist on the filesystem but there is no associated
driver (no display, no text terminal). /dev/tty4 is not existing in the
filesystem.
Post by 甜瓜
The error message will show again and again.
You should fix your inittab so init won't try to run the getty process
on those devices.
I am not sure about him but mine /etc/inittab does not carry any
tty[2-5] but it showed the same messages and linking /dev/tty[2-5]
against /dev/null was the first workaround which shut up the busybox.
If it could be of any help my system is a UMLinux but before launching
Yes I messed up the time correlation events :

a) see the same messages
b) I made links to /dev/null
c) I commented out ttys in inittab
d) restored original ttyN devices
e) still have warning about tty5

In fact I wrote "... was the first workaround which shut up the ..."
because I was just acknowledged that about tty5 busybox still warning
loudly even using a proper inittab. I am sorry my message was not as
much precise as it would be.
Post by Denys Vlasenko
Post by Roberto A. Foglietta
# bbconfig | grep -i INITTAB
CONFIG_FEATURE_USE_INITTAB=y
VFS: Mounted root (ext2 filesystem) readonly.
line_ioctl: tty0: unknown ioctl: 0x541e
init: can't log to /dev/tty5
init started: BusyBox v1.10.2 (2008-05-16 19:01:32 CEST)
init: can't log to /dev/tty5
printouts with a regular /dev/tty5
Please press Enter to activate this console.
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
This is a *different message*.
bbox init with CONFIG_FEATURE_INIT_SYSLOG off outputs
error messages to /dev/tty5. This is not new.
Although I do not understand why is it so. Looks strangely arbitrary...
do we need to change that? How?
Sorry, what appear strangely arbitrary? and change what? I always use
1.0.x and 1.2.x version of busybox and this is the first time I am
using "new" busybox. I think is natural having to familiarize with new
bb and its options.
Post by Denys Vlasenko
Regarding "xterm_open": this is definitely does not come from busybox,
you run some application which expects to be run from X.
Yes it depends on User Mode Linux.

Cheers,
--
/roberto
Denys Vlasenko
2008-05-20 20:04:44 UTC
Permalink
Post by Roberto A. Foglietta
I am not sure about him but mine /etc/inittab does not carry any
tty[2-5] but it showed the same messages and linking /dev/tty[2-5]
against /dev/null was the first workaround which shut up the busybox.
If it could be of any help my system is a UMLinux but before launching
http://lugge.wikidot.com/tar2loop
and the used busybox is the last version 1.10.2, config could be
http://lugge.wikidot.com/local--files/tar2loop/busybox.config
# This is run first except when booting in single-user mode
#
::sysinit:/etc/rc.sh
# /bin/sh invocations on selected ttys
#
# Start an "askfirst" shell on the console (whatever that may be)
::askfirst:-/bin/sh
# Start an "askfirst" shell on /dev/tty2-4
#tty2::askfirst:-/bin/sh
#tty3::askfirst:-/bin/sh
#tty4::askfirst:-/bin/sh
# Stuff to do when restarting the init process
::restart:/sbin/init
# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/shutdown
I guess you have CONFIG_FEATURE_USE_INITTAB off,
and your /etc/inittab just gets ignored.

--
vda
甜瓜
2008-05-21 04:58:40 UTC
Permalink
Post by Roberto A. Foglietta
Post by Alessandro Rubini
Post by 甜瓜
I use busybox on embedded system: PowerPC 405GP Walnut board
which only has a serial port for debugging.
So you have no display, and no text console on the display.
Post by 甜瓜
My busybox is built with default menuconfig settings and make it
into Ramdisk form.
So, it looks like your inittab includes entries to run getty on the
text terminals.
Post by 甜瓜
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address
/dev/tty2 and /dev/tty3 exist on the filesystem but there is no associated
driver (no display, no text terminal). /dev/tty4 is not existing in the
filesystem.
Post by 甜瓜
The error message will show again and again.
You should fix your inittab so init won't try to run the getty process
on those devices.
I am not sure about him but mine /etc/inittab does not carry any
tty[2-5] but it showed the same messages and linking /dev/tty[2-5]
against /dev/null was the first workaround which shut up the busybox.
If it could be of any help my system is a UMLinux but before launching
http://lugge.wikidot.com/tar2loop
and the used busybox is the last version 1.10.2, config could be
http://lugge.wikidot.com/local--files/tar2loop/busybox.config
# This is run first except when booting in single-user mode
#
::sysinit:/etc/rc.sh
# /bin/sh invocations on selected ttys
#
# Start an "askfirst" shell on the console (whatever that may be)
::askfirst:-/bin/sh
# Start an "askfirst" shell on /dev/tty2-4
#tty2::askfirst:-/bin/sh
#tty3::askfirst:-/bin/sh
#tty4::askfirst:-/bin/sh
# Stuff to do when restarting the init process
::restart:/sbin/init
# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/shutdown
I follow your inittab. It works fine! Thanks to all of you for quick responds.

Best regards,

---
ShenLei
Denys Vlasenko
2008-05-21 08:07:44 UTC
Permalink
Post by Roberto A. Foglietta
Post by Alessandro Rubini
Post by 甜瓜
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address
/dev/tty2 and /dev/tty3 exist on the filesystem but there is no associated
driver (no display, no text terminal). /dev/tty4 is not existing in the
filesystem.
Post by 甜瓜
The error message will show again and again.
You should fix your inittab so init won't try to run the getty process
on those devices.
I am not sure about him but mine /etc/inittab does not carry any
tty[2-5] but it showed the same messages and linking /dev/tty[2-5]
against /dev/null was the first workaround which shut up the busybox.
If it could be of any help my system is a UMLinux but before launching
# bbconfig | grep -i INITTAB
CONFIG_FEATURE_USE_INITTAB=y
VFS: Mounted root (ext2 filesystem) readonly.
line_ioctl: tty0: unknown ioctl: 0x541e
init: can't log to /dev/tty5
init started: BusyBox v1.10.2 (2008-05-16 19:01:32 CEST)
init: can't log to /dev/tty5
printouts with a regular /dev/tty5
Please press Enter to activate this console.
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
xterm_open: $DISPLAY not set.
Failed to open console 5, err = -19
This is a *different message*.

bbox init with CONFIG_FEATURE_INIT_SYSLOG off outputs
error messages to /dev/tty5. This is not new.
Although I do not understand why is it so. Looks strangely arbitrary...
do we need to change that? How?

Regarding "xterm_open": this is definitely does not come from busybox,
you run some application which expects to be run from X.
--
vda
Roberto A. Foglietta
2008-05-20 16:07:39 UTC
Permalink
Post by Alessandro Rubini
Post by 甜瓜
I use busybox on embedded system: PowerPC 405GP Walnut board
which only has a serial port for debugging.
So you have no display, and no text console on the display.
Post by 甜瓜
My busybox is built with default menuconfig settings and make it
into Ramdisk form.
So, it looks like your inittab includes entries to run getty on the
text terminals.
Post by 甜瓜
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address
/dev/tty2 and /dev/tty3 exist on the filesystem but there is no associated
driver (no display, no text terminal). /dev/tty4 is not existing in the
filesystem.
Post by 甜瓜
The error message will show again and again.
You should fix your inittab so init won't try to run the getty process
on those devices.
I am not sure about him but mine /etc/inittab does not carry any
tty[2-5] but it showed the same messages and linking /dev/tty[2-5]
against /dev/null was the first workaround which shut up the busybox.
If it could be of any help my system is a UMLinux but before launching
it I unset the DISPLAY environment variable:

http://lugge.wikidot.com/tar2loop

and the used busybox is the last version 1.10.2, config could be
retrieved here:

http://lugge.wikidot.com/local--files/tar2loop/busybox.config

here the /etc/inittab:

# This is run first except when booting in single-user mode
#
::sysinit:/etc/rc.sh

# /bin/sh invocations on selected ttys
#
# Start an "askfirst" shell on the console (whatever that may be)
::askfirst:-/bin/sh
# Start an "askfirst" shell on /dev/tty2-4
#tty2::askfirst:-/bin/sh
#tty3::askfirst:-/bin/sh
#tty4::askfirst:-/bin/sh

# Stuff to do when restarting the init process
::restart:/sbin/init

# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/shutdown

Cheers,
--
/roberto
甜瓜
2008-05-20 12:59:00 UTC
Permalink
Howdy,
I use busybox on embedded system: PowerPC 405GP Walnut board
which only has a serial port for debugging. My busybox is built with default
menuconfig settings and make it into Ramdisk form. The linux kernel is
2.6.24.2. with the bootarg set to:
root=/dev/ram rw ip=XXX panic=1 console=ttyS0,115200
The booting process seems ok except starting busybox shell:
=============
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 132k init
init started: BusyBox v1.10.2 (2008-05-20 19:17:04 CST)
starting pid 14, tty '': '/etc/init.d/rcS'
Cannot run '/etc/init.d/rcS': No such file or directory
Please press Enter to activate this console.

Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address

process '-/bin/sh' (pid 16) exited. Scheduling for restart.
process '-/bin/sh' (pid 19) exited. Scheduling for restart.
process '-/bin/sh' (pid 22) exited. Scheduling for restart.

Can't open /dev/tty4: No such file or directory
Can't open /dev/tty3: No such device or address
Can't open /dev/tty2: No such device or address

process '-/bin/sh' (pid 59) exited. Scheduling for restart.
process '-/bin/sh' (pid 62) exited. Scheduling for restart.
process '-/bin/sh' (pid 65) exited. Scheduling for restart.
=============
The error message will show again and again. But when I type:
ls
the shell shows the directories that means busybox works fine.
Since the board only have ttyS0 ttyS1 available, how to disable
additional tty?

Thanks in advance.

----
ShenLei
Roberto A. Foglietta
2008-05-20 13:35:29 UTC
Permalink
Post by 甜瓜
Howdy,
I use busybox on embedded system: PowerPC 405GP Walnut board
which only has a serial port for debugging. My busybox is built with default
menuconfig settings and make it into Ramdisk form. The linux kernel is
root=/dev/ram rw ip=XXX panic=1 console=ttyS0,115200
=============
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 132k init
init started: BusyBox v1.10.2 (2008-05-20 19:17:04 CST)
starting pid 14, tty '': '/etc/init.d/rcS'
Cannot run '/etc/init.d/rcS': No such file or directory
Please press Enter to activate this console.
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address
process '-/bin/sh' (pid 16) exited. Scheduling for restart.
process '-/bin/sh' (pid 19) exited. Scheduling for restart.
process '-/bin/sh' (pid 22) exited. Scheduling for restart.
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty3: No such device or address
Can't open /dev/tty2: No such device or address
process '-/bin/sh' (pid 59) exited. Scheduling for restart.
process '-/bin/sh' (pid 62) exited. Scheduling for restart.
process '-/bin/sh' (pid 65) exited. Scheduling for restart.
=============
ls
the shell shows the directories that means busybox works fine.
Since the board only have ttyS0 ttyS1 available, how to disable
additional tty?
from target root console:

ln -sf /dev/null /dev/tty2
ln -sf /dev/null /dev/tty3
ln -sf /dev/null /dev/tty4

Cheers,
--
/roberto
Alessandro Rubini
2008-05-20 15:29:30 UTC
Permalink
Post by 甜瓜
I use busybox on embedded system: PowerPC 405GP Walnut board
which only has a serial port for debugging.
So you have no display, and no text console on the display.
Post by 甜瓜
My busybox is built with default menuconfig settings and make it
into Ramdisk form.
So, it looks like your inittab includes entries to run getty on the
text terminals.
Post by 甜瓜
Can't open /dev/tty4: No such file or directory
Can't open /dev/tty2: No such device or address
Can't open /dev/tty3: No such device or address
/dev/tty2 and /dev/tty3 exist on the filesystem but there is no associated
driver (no display, no text terminal). /dev/tty4 is not existing in the
filesystem.
Post by 甜瓜
The error message will show again and again.
You should fix your inittab so init won't try to run the getty process
on those devices.

/alessandro
Loading...