AnsweredAssumed Answered

Need to add custom script as service in init.rc for Android 9

Question asked by vinothkumar s on Sep 19, 2019
Latest reply on Oct 9, 2019 by vinothkumar s

Dear NXP,


I am working on i.MX 6Quad SABRE-SD with Android 9. I am planning to add USB Re-flash (custom script) service in Android 9.


I done the below configuration to start the service. But, the service is not started. Please let me know if I miss anything.


Below are the configuration,


1. Copy this script ( to the following location

2. Add the following command
            /device/fsl/imx6dq/sabresd_6dq/ system/bin/
            To Copy command to copy to /system/bin location in the following file under following section PRODUCT_COPY_FILES


3. Add USB-UPDATE into the PRODUCT_PACKAGE section of file


4. Define the service in file init.rc
            service usb-update /system/bin/
                     class main

                     user root

                     group root system
                     seclabel u:r: usb-update:s0


5. Add a new Domain “usb-update

      a. Create the file in the following location,
              And add the following content,
                # USB-UPDATE service
               type usb-update, domain;
               type usb-update_exec, exec_type, file_type;



b. Add the Label “/system/bin/” to device/fsl/imx6dq/sepolicy/ file_contexts
            /system/bin/usb-update     u:object_r: usb-update_exec:s0




Thanks & Regards,