cttyhack/tty/initramfs problem (take a number)

Denys Vlasenko vda.linux at googlemail.com
Sat Dec 5 00:56:59 UTC 2009


On Saturday 05 December 2009 00:28, Ersin Akinci wrote:
> I have a question about getting a shell started up, which will no
> doubt sound familiar and similar to the 100 other e-mails like this,
> yet after reading everything I'm still not sure what to do.
> 
> Basically, I'm trying to bring up a single user shell on a minimal
> initramfs without having to bother with init, inittab, getty, or any
> of that.  Running /bin/sh at the end of my init script results in no
> job control, as everyone knows.  Instead, you're supposed to run the
> shell on a normal tty, but with Unix98 pty control there are no fixed
> tty device nodes in /dev.  These are generated on the fly, but I don't
> know how.

Where exactly do you want shell prompt to appear?

> I think that getty does so (can someone please confirm this?),

No, it does not.

> but 
> again, I don't want to use getty or any login tools.  Actually, I
> wouldn't mind using getty so long as I don't have to deal with any of
> the login/user stuff (i.e., if I could bypass login altogether).  I
> tried using cttyhack /bin/sh, but that gives me "can't open
> '/dev/tty1': No such file or directory".

Aha. You are running it on Linux virtual ttys.

> What should I do?

Create /dev/tty1. Should look like this:

# ls -l /dev/tty1
crw-rw----    1 root     root       4,   1 Dec  4 20:26 /dev/tty1

--
vda


More information about the busybox mailing list