I am working on creating a real time kernel with RT-PREEMPT patch. I have created this kernel without graphic desktop. It comes up in the terminal mode with login prompt. The requirement is, it should boot and directly go to the shell prompt with root permission, without asking for login. How can this be done? Can you help me?
I have gotten it to work, but it is slightly different on Ubuntu.
sudo apt-get install mingetty
exec /sbin/getty -8 38400 tty1
exec /sbin/mingetty --autologin root --noclear tty1
Reboot and test.
This worked for me on Ubuntu 12.04, if this works for you and you need more tty's to autologin start changing tty2.conf - tty6.conf and you should be good to go.
In the modern world of systemd, here are the steps I took to get this working:
apt install mingetty
mkdir -p /firstname.lastname@example.org
Now run the following script:
cat > /email@example.com/override.conf <<- "_EOF_" [Service] ExecStart= ExecStart=-/sbin/mingetty --autologin root --noclear tty1 _EOF_
systemctl enable firstname.lastname@example.org
The above seems to be the cleanest option for systems that use Systemd that I could find. As an added bonus, if something breaks in the future, you can just run something like the following from a recovery live ISO (after mounting the root partition of course), to restore default behavior:
You can do this without any additional software
sudo vim /etc/inittab
1:2345:respawn:/sbin/getty 115200 tty1
and replace it with
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
so you are left with this
#1:2345:respawn:/sbin/getty 115200 tty1 1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1