Android add boot script

Recently, it is necessary to add a self-starting script in android5.1. It is not successful to directly write the instructions to be executed by the script to init.rc. You can write the instructions to a sh script and use init.rc to execute the sh script to succeed. (Init.rc or init.{$BOARD_NAME}.rc)

Things to note are:

1. The first line of the sh script cannot be omitted

#!/system/bin/sh

Note: This is sh on Android devices

2. The permissions of the sh script must be executable. In addition to adding service to init.rc, you also need to modify the permissions of the sh script before this

chown root shell /system/etc/my.sh
chmod 0755 /system/etc/my.sh
service mount-usbfs /system/etc/my.sh
    class main
    user root
    group root
    oneshot

device/nexell/s5p4418_drone/init.rc

Guess you like

Origin blog.csdn.net/Lwjobs/article/details/107643254