ash: Can't access tty problems (initramfs)

Dallas Clement dallas.a.clement at gmail.com
Fri May 18 00:57:04 UTC 2007


On Fri, 2007-05-18 at 01:49 +0200, Denis Vlasenko wrote:
> On Friday 18 May 2007 01:28, Denis Vlasenko wrote:
> > Boot with init=/bin/ash, and you will get "Can't access tty" message.
> > That's because fd# 0,1,2 are opened to /dev/console.
> > Now execute this in ash:
> > 
> > # exec /bin/ash </dev/tty1 >/dev/tty1 2>&1
> > 
> > This one will work ok, because fds are opened to /dev/tty0,
> > which can be a controlling tty.
> 
> :(  please s/tty0/tty1/ above...
> 
> --
> vda

This is what my init.ash contains.  I'm still getting the "can't access
tty" message.  Do you see anything else wrong?

------------------

##!/bin/ash

echo "Mounting real root file system..."

mount -t sysfs none /sys
mount -t proc none /proc

mount -t ext2 /dev/hdf1 /mnt/realroot

# Chain to real filesystem
echo "Chaining to real file system..."
#exec switch_root /mnt/realroot/sbin/init "$@"
</mnt/realroot/dev/console >$/mnt/realroot/dev/console

exec /bin/ash </dev/tty0 >/dev/tty0 2>&1

------------------

My initramfs config for the tty/console devices is:

nod /dev/tty0 666 0 5 c 4 0
nod /dev/tty1 666 0 5 c 4 1
nod /dev/tty2 666 0 5 c 4 2
nod /dev/tty3 666 0 5 c 4 3
nod /dev/tty4 666 0 5 c 4 4
nod /dev/tty5 666 0 5 c 4 5
nod /dev/tty6 666 0 5 c 4 6
nod /dev/tty7 666 0 5 c 4 7
nod /dev/tty8 666 0 5 c 4 8
nod /dev/ttyS0 666 0 5 c 5 0
nod /dev/console 644 0 0 c 5 1






More information about the busybox mailing list