How to do autologin on systemd (yocto)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to do autologin on systemd (yocto)

5,692 Views
xinyu_chen
NXP Employee
NXP Employee

Hi,

I try to modify the systemd getty service: /etc/systemd/system/getty.target.wants/getty@tty1.service, by changing the:

ExecStart=-/sbin/agetty --noclear %I $TERM

to

ExecStart=-/sbin/agetty -a root --noclear %I $TERM

But it does not work correctly. Anybody has the experience?

Thanks.

1 Reply

4,027 Views
xinyu_chen
NXP Employee
NXP Employee

Ok, done by myself.

cp /lib/systemd/system/serial-getty@.service /etc/systemd/system/getty.target.wants/serial-getty@<console>.service

<console> aligned with the kernel commandline.

And append the "-a root" for auto login:

ExecStart=-/sbin/agetty -8 -a root -L %I 115200 $TERM