How to successfully execute a script from init.rc

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

How to successfully execute a script from init.rc

924 次查看
Shanga
Contributor III

We are using the i.MX8MP EVK and are trying to add a script to run after boot or after file system.we tried the below on  init.rc:

on property:sys.boot_completed=1
    start initAsic

service initAsic /system/xbin/script.sh
    seclabel u:r:init:s0
    user root
    group root
    oneshot
    disabled

The script's contents are,

 

echo "hello" > /data/local/tmp/file.test
iptables -P FORWARD DROP

 

However, we are not seeing the expected output after boot.The string "hello" is not seen in file.test
We have also run setenforce 0, but it hasn’t made any difference.

 

please share step for running script after boot or after file system is up

 #ANDROID14

0 项奖励
回复
1 回复

851 次查看
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Your init.rc seems correct, did you give your script the needed permission to write a file?
Which init.rc file are you modifying?
Also, did you rebuild your android image after the modifications?

Best regards/Saludos,
Aldo.

0 项奖励
回复