How to successfully execute a script from init.rc

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

How to successfully execute a script from init.rc

593 Views
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 Kudos
Reply
1 Reply

521 Views
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 Kudos
Reply