Specifications
14.3.33. Telnet / SSH (dropbear) server not working
Question:
The telnet server is running on the target but when I try to login I get this error message:
$ telnet 192.168.20.12
telnet 192.168.20.12
Trying 192.168.20.12...
Connected to 192.168.20.12.
Escape character is '^]'.
telnetd: All network ports in use.
Connection closed by foreign host.
The dropbear ssh server fails in a similar fashion:
$ ssh root@192.168.20.12
root@192.168.20.12's password:
PTY allocation request failed on channel 0
shell request failed on channel 0
Answer:
Application software on the target cannot open a PTY (pseudo terminal) to handle the incoming
request. To understand the problem, we have to be aware that the linux kernel and glibc support two
schemes to handle PTYs. The deprecated scheme is hooked to the kernel option
CONFIG_LEGACY_PTYS and at runtime uses (static) device files /dev/ptyxx and /dev/ttyxx
for the master- and the slave ends of the PTYs. For this to work, you need the kernel support and
/dev/[pt]tyxx pairs (where xx usually is a letter in the range p-z followed by a hexadecimal
digit) in the target file system.
The regular support is coupled to the linux kernel option CONFIG_UNIX98_PTYS and the devpts
virtual filesystem which has to be mounted on the target. Together with the device special file
/dev/ptmx this will dynamically create device files for the allocated PTYs below the mount point.
To use it, the device file has to exist and the filesystem needs to be mounted, e.g. like this:
# mkdir /dev/pts
# mknod c 5 2 /dev/ptmx
# mount -t devpts devpts /dev/pts
14.4. Self
14.4.1. How to Add Files to a SELF Ramdisk
It is not always necessary to rebuild a SELF based ramdisk image if you want to modify or to extend it.
Especially during development it is often eaiser to unpack it, modify it, and re-pack it again. To do so, you
have to understand the internal structure of the uRamdisk (resp. pRamdisk) images files as used with the
U-Boot (old: PPCBoot) boot loader:
The uRamdisk image contains two parts:
a 64 byte U-Boot header•
a (usually gzip compressed) ramdisk image•
To modify the contents you have to extract, uncompress and mount the ramdisk image. This can be done as
follows:
14.4.1. How to Add Files to a SELF Ramdisk 198