/dev/tty problem and solution

MSS II General talk

/dev/tty problem and solution

Postby bzhou » 24 Sep 2007 23:44

I flashed the modified 3.1.28 firmware with utelnetd and dropbear, and am trying out the optware packages, most things work fine. But there is one annoying problem, with symptoms of:

1. After login, Busybox shows
Code: Select all
can't access tty: job control turned off

2. /bin/more, /opt/bin/less, or any program that reads /dev/tty does not get any key press input
3. /opt/bin/ssh-keygen does not work, stops when reading /dev/tty
4. /opt/bin/ssh does not work, stops when reading /dev/tty

It turns out /dev/tty was symlinked to /dev/ttyS0.

So do the following
Code: Select all
# cd /dev
# rm -f tty
# mknod tty c 5 0
# chmod go+w tty


And everything's back to normal.

-Brian Zhou
bzhou
Senior Member
 
Posts: 101
Joined: 23 Sep 2007 05:08

Re: /dev/tty problem and solution

Postby stuart_f » 25 Sep 2007 17:29

Brian,

Great work. I wonder if the symlink was so that development boards (which presumably have the serial headers attached) could interact with the final firmware via the serial port. I can't think why else this has been done.

Not being able to read things with more was a bugbear before but works perfectly now. :D
stuart_f
Senior Member
 
Posts: 76
Joined: 17 Nov 2006 10:49

Re: /dev/tty problem and solution

Postby bzhou » 13 Oct 2007 05:01

Unfortunately the problem appears again after reboot regardless of kernel. It's really set in /etc/udev/rules.d/50-udev.rules

To fix permanently, follow the instruction on http://www.nslu2-linux.org/wiki/MSSII/HomePage 2nd tip, copied here
Code: Select all
# cp /etc/udev/rules.d/50-udev.rules /etc/udev/rules.d/50-udev.rules.orig
# sed -i -e '/ttyS0.*SYMLINK="tty"/d; /console.*MODE="0622"/aKERNEL=="tty",     NAME="%k", MODE="0666"' /etc/udev/rules.d/50-udev.rules


Basically it does the following change with /bin/sed
Code: Select all
--- 50-udev.rules.orig  2007-10-13 02:35:50.000000000 +0000
+++ 50-udev.rules       2007-10-13 02:38:10.000000000 +0000
@@ -52,13 +52,13 @@
KERNEL="socksys",      SYMLINK="nfsd"
KERNEL="mtd0",         SYMLINK="mtd"
KERNEL="ttyS0",                SYMLINK="console"
-KERNEL="ttyS0",                SYMLINK="tty"
KERNEL="null",         SYMLINK="XOR"

# set some udev overwritten device permissions
KERNEL=="zero",    NAME="%k", MODE="0666"
KERNEL=="null",    NAME="%k", MODE="0666"
KERNEL=="console", NAME="%k", MODE="0622"
+KERNEL=="tty",     NAME="%k", MODE="0666"
KERNEL=="random",  NAME="%k", MODE="0444"
KERNEL=="urandom", NAME="%k", MODE="0444"


I've tested it to work, without affecting serial console.
bzhou
Senior Member
 
Posts: 101
Joined: 23 Sep 2007 05:08


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests