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 (usb-update.sh) to the following location
/device/fsl/imx6dq/sabresd_6dq
2. Add the following command
/device/fsl/imx6dq/sabresd_6dq/usb-update.sh: system/bin/usb-update.sh
To Copy command to copy usb-update.sh to /system/bin location in the following file sabresd_6dqr.mk under following section PRODUCT_COPY_FILES
3. Add USB-UPDATE into the PRODUCT_PACKAGE section of sabresd_6dqr.mk file
4. Define the service in file init.rc
service usb-update /system/bin/ usb-update.sh
class main
user root
group root system
oneshot
seclabel u:r: usb-update:s0
5. Add a new Domain “usb-update”
a. Create the file in the following location,
/device/fsl/imx6dq/sabresd_6dq/sepolicy/usb-update.te
And add the following content,
# USB-UPDATE service
type usb-update, domain;
type usb-update_exec, exec_type, file_type;
init_deamon_domain(foo)
b. Add the Label “/system/bin/usb-update.sh” to device/fsl/imx6dq/sepolicy/ file_contexts
/system/bin/usb-update u:object_r: usb-update_exec:s0
Thanks & Regards,
VinothS.
1. Add the script to the following location
/device/fsl/imx6dq/sabresd_6dq/usb-update.sh
2. Add the following command in the sabresd_6dqr.mk file under PRODUCT_COPY_FILES section,
/device/fsl/imx6dq/sabresd_6dq/usb-update.sh: system/bin/usb-update.sh
3. Add USB-UPDATE into the PRODUCT_PACKAGE section of sabresd_6dqr.mk file
4. Modify PRODUCT_FULL_TREBLE_OVERRIDE := false in sabresd_6dqr.mk file
5. Define the service in init.rc file
service usb-update /system/bin/ usb-update.sh
class main
user root
oneshot
seclabel u:r: usb-update:s0
6. Add a new Domain named as usb-update
a. Create the file in the following location,
/device/fsl/imx6dq/sabresd_6dq/sepolicy/usb-update.te
And add the following content,
# USB-UPDATE service
type usb-update, domain;
type usb-update_exec, exec_type, file_type;
init_deamon_domain(foo)
domain_auto_trans(init, shell_exec, usb-update)
b. Add the Label “/system/bin/usb-update.sh” to device/fsl/imx6dq/sepolicy/ file_contexts
/system/bin/usb-update seclabel u:r: usb-update:s0
Regards,
Tommaso
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/dda6f816-758d-4663-9ed2-ad62c58af759%40googlegroups.com.