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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,920 次查看
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

标签 (1)
0 项奖励
回复
3 回复数

1,716 次查看
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

1,241 次查看
Mike_Chen
Contributor I

Hi, 

How to prevent to print following message?

localhost login: root (automatic login)

0 项奖励
回复

1,716 次查看
sreedhar_appala
Contributor IV

Thank you Victor, it worked for me.

0 项奖励
回复