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,688件の閲覧回数
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,484件の閲覧回数
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,009件の閲覧回数
Mike_Chen
Contributor I

Hi, 

How to prevent to print following message?

localhost login: root (automatic login)

0 件の賞賛

1,484件の閲覧回数
sreedhar_appala
Contributor IV

Thank you Victor, it worked for me.

0 件の賞賛