Auto login and execute the custom script on bootup on iMX8M Mini

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

Auto login and execute the custom script on bootup on iMX8M Mini

1,670 Views
sreedhar_appala
Contributor IV

Hi,

I am working with Yocto linux build, BSP linux kernel version 4.14.78_2.0.0

working on the iMX8M Mini EVK target.

I have added my executing commands at /etc/rc.local before exit 0.

But i could not see those commands executing.

ps: I could not find the /etc/inittab.

Could you please let us know how to do this.

thank you, sreedhar

Labels (1)
0 Kudos
3 Replies

1,466 Views
b36401
NXP Employee
NXP Employee

Please make sure that you are using "right" /etc/rc.local file.
I mean possibly your OS uses ramdisk and updating the file on live filesystem gets overwrited with unpacking ramdisk image.

Also please make sure that executing of this script does not stop somewhere before your command.

On my board I added a simple command into /etc/rc.local file:

root@imx8qmmek:~# tail -2 /etc/rc.local
echo test > /test.txt
exit 0
root@imx8qmmek:~#

Then I rebooted the board and got the result:

root@imx8qmmek:~# cat /test.txt
test
root@imx8qmmek:~#


As for autologin please try to add "-a root" (or some other user) into ExecStart option
of /etc/systemd/system/getty.target.wants/serial-getty@ttyAMA0.service file this way:

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

991 Views
Mike_Chen
Contributor I

Hi, 

How to prevent to print following message?

localhost login: root (automatic login)

0 Kudos

1,466 Views
sreedhar_appala
Contributor IV

Thank you Victor, it worked for me.

0 Kudos