cttyhack/tty/initramfs problem (take a number)

Ersin Akinci ersin.akinci at gmail.com
Sat Dec 5 03:57:42 UTC 2009


> If you think you know better, why do you ask?
>
> http://www.catb.org/~esr/faqs/smart-questions.html

Excuse me, I think you've misunderstood my question.  I will rephrase
it to make it clearer.

I'm trying to start the shell over a virtual tty in a minimal
initramfs + busybox environment without any login or user account
tools (no getty, login, etc.)  When my init script runs "/bin/sh" at
the end, it works but without job control because apparently it's not
using a "normal" tty.  So, my goal is to get the shell to use a
"normal" tty rather than /dev/console or anything else.  Now, AFAIK
there are two steps involved, neither of which I understand very well
and both of which I need some advice on:

1) Generating the correct tty device nodes
2) Making the shell use those device nodes

You suggested that I create /dev/tty1, but as I understand it this is
using the "old", non-Unix98/devpts method, which in my first e-mail I
said I wasn't using.  When I mount devpts, however, /dev/pts is
completely empty.  I thought that maybe invoking getty magically
generates nodes in /dev/pts on demand, but you said that wasn't the
case.

So my question is how do I generate the proper /dev/pts nodes, and
then how do I get my shell to use them?  Your solution is perfectly
fine, except that I'm not using the /dev/ttyXX naming scheme with my
kernel or libc libraries.  Moreover, if you had read my last e-mail
you would notice that I tried your suggestion and that I'm still
getting the job control error.

Here's a copy of my initramfs init script:

#!/bin/sh

export PATH="/usr/bin:/usr/sbin:/bin:/sbin"

mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devpts none /dev/pts -o gid=4,mode=620

echo 0 > /proc/sys/kernel/printk

echo
echo "Welcome to 420CDT Linux!"
echo
exec cttyhack sh


Thanks,
Ersin

On 12/4/09, Denys Vlasenko <vda.linux at googlemail.com> wrote:
> On Saturday 05 December 2009 02:01, Ersin Akinci wrote:
>> > Create /dev/tty1. Should look like this:
>>
>> Aren't the ttys supposed to be created by devpts under /dev/pts?  How
>> do I get it to do that?
>
> If you think you know better, why do you ask?
>
> http://www.catb.org/~esr/faqs/smart-questions.html
>
> --
> vda
>


-- 

=========

Ersin Y. Akinci -- http://www.ersinakinci.com


More information about the busybox mailing list