From 2d366f43164f4e98f77e8aceae69e30c21511e8a Mon Sep 17 00:00:00 2001 From: bengris32 Date: Mon, 19 Feb 2024 16:18:02 +0000 Subject: [PATCH] rosemary: rootdir: Set permissions for USB service Change-Id: I046e5b7f062171862eba1532efd128e057940042 Signed-off-by: bengris32 --- rootdir/etc/init.mt6785.usb.rc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rootdir/etc/init.mt6785.usb.rc b/rootdir/etc/init.mt6785.usb.rc index 97885a6..6e34ca0 100644 --- a/rootdir/etc/init.mt6785.usb.rc +++ b/rootdir/etc/init.mt6785.usb.rc @@ -157,6 +157,18 @@ on boot # for usb otg sdcard hot plug detection write /sys/module/block/parameters/events_dfl_poll_msecs 1000 + # Set permissions for USB service + chown root system /sys/class/typec/port0/power_role + chown root system /sys/class/typec/port0/data_role + chown root system /sys/class/typec/port0/port_type + chown root system /sys/class/udc/${sys.usb.controller}/device/cmode + chown root system /sys/class/udc/${sys.usb.controller}/device/saving + chmod 664 /sys/class/typec/port0/power_role + chmod 664 /sys/class/typec/port0/data_role + chmod 664 /sys/class/typec/port0/port_type + chmod 664 /sys/class/udc/${sys.usb.controller}/device/cmode + chmod 664 /sys/class/udc/${sys.usb.controller}/device/saving + on property:dev.bootcomplete=1 write /config/usb_gadget/g1/strings/0x409/product ${ro.product.marketname}