Skip to content
Commit 10a130f9 authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by Peter Korsgaard
Browse files

initramfs/init: make sure that 0, 1, 2 fds are available



As the kernel doesn't automatically mount devtmpfs when an initramfs
is used, commit 424888e4 has
introduced a small wrapper script that mounts devtmpfs before starting
the real init.

Unfortunately, the problem is that in this case, the init process runs
without any 0, 1 and 2 file descriptors, so none of the
messages/errors printed by the various initialization scripts can be
seen. This is due to the fact the init process relies on 0, 1 and 2
being opened by the kernel before init is started. However, as
/dev/console isn't present on the filesystem at the time the kernel
tries to open the console to create the 0, 1 and 2 file descriptors,
the kernel fails on this and prints the famous "Warning: unable to
open an initial console".

The proposed workaround is to actually open 0, 1 and 2 to /dev/console
in the wrapper script, right after mounting the devtmpfs filesystem,
and before starting the real init. The "Warning" from the kernel is
still shown, but at least the messages from the init scripts are
visible.

Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent f940d760
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment