root shell on serial console

3 posts
by recliq » Thu Jun 28, 2012 5:08 pm

first off I have to say I love the raspbian image. It's much more responsive than the armel builds, especially when run from USB HDD ;D
But I'm missing the root console on the serial interface. The normal debian squeeze and wheezy images for Raspberry Pi give you a root shell on the serial console.

As far as I understood so far, it looks like the init script is inside the kernel.img so I haven't tampered with that yet.

Is is possible to add /bin/sh as last command to the init script to get a root shell on serial console?

Posts: 38
Joined: Wed Jun 13, 2012 4:56 pm
by mpthompson » Thu Jun 28, 2012 5:36 pm
I haven't tried using the serial port attached to my Raspberry Pi under Raspbian (or any other Linux). However, usually console logins on any device including the serial port is controlled from the /etc/inittab file. You may want to look through this file on the Foundations image and find which line an /sbin/getty is spawned on the serial device. You should then be able to copy that line to the /etc/inittab file in Raspbian and see a login appear on your serial port.

If the Foundation is starting an actually shell on the serial line instead of a getty, then they could be doing this a number of ways and you just have to poke around until you found out what they are doing, unless someone else can tell us.
User avatar
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
by recliq » Thu Jun 28, 2012 6:10 pm
Thank you very much for the tip mpthompson, of course you are right.

I guess I should have googled this before posting dumb questions... :oops:

The missing lines to get a shell on serial console in raspbian /etc/inittab are these:
Code: Select all
#Spawn a getty on Raspberry Pi serial line
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

Posts: 38
Joined: Wed Jun 13, 2012 4:56 pm