whyred: Import ramdisk from miui

This commit is contained in:
Shahan-mik3 2018-06-04 23:23:57 +05:30 committed by Vasishath Kaushal
parent 6b91d2100f
commit d7699194e4
27 changed files with 11564 additions and 0 deletions

View file

@ -215,5 +215,34 @@ PRODUCT_PACKAGES += \
libandroid_net \
netutils-wrapper-1.0
# Ramdisk
PRODUCT_PACKAGES += \
fstab.qcom \
init.qcom.rc \
init.class_main.sh \
init.qcom.sh \
init.qcom.sensors.sh \
init.qcom.usb.rc \
init.msm.usb.configfs.rc \
init.target.rc \
init.crda.sh \
init.mdm.sh \
init.qcom.class_core.sh \
init.qcom.coex.sh \
init.qcom.crashdata.sh \
init.qcom.early_boot.sh \
init.qcom.efs.sync.sh \
init.qcom.sdio.sh \
init.qcom.syspart_fixup.sh \
init.qcom.usb.sh \
init.qcom.wifi.sh \
init.qti.fm.sh \
init.qti.ims.sh \
ueventd.rc
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/rootdir/bin/init.qti.qseecomd.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qti.qseecomd.sh \
$(LOCAL_PATH)/rootdir/etc/init.qcom.post_boot.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.post_boot.sh
# Call the proprietary setup
$(call inherit-product, vendor/xiaomi/whyred/whyred-vendor.mk)

179
rootdir/Android.mk Normal file
View file

@ -0,0 +1,179 @@
LOCAL_PATH:= $(call my-dir)
# Common init scripts
include $(CLEAR_VARS)
LOCAL_MODULE := fstab.qcom
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := root/fstab.qcom
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.rc
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := root/init.qcom.rc
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/init/hw
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.class_main.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.class_main.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.sensors.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.sensors.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.usb.rc
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := root/init.qcom.usb.rc
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/init/hw
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.msm.usb.configfs.rc
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := root/init.msm.usb.configfs.rc
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/init/hw
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.target.rc
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := root/init.target.rc
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/init/hw
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := ueventd.rc
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := root/ueventd.rc
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.crda.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.crda.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.mdm.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.mdm.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.class_core.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.class_core.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.coex.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.coex.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.crashdata.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.crashdata.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.early_boot.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.early_boot.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.efs.sync.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.efs.sync.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.sdio.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.sdio.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.syspart_fixup.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.syspart_fixup.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.usb.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.usb.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.wifi.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.wifi.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.fm.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.fm.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.ims.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := root/init.qcom.ims.sh
LOCAL_VENDOR_MODULE := true
include $(BUILD_PREBUILT)

View file

@ -0,0 +1,35 @@
#!/vendor/bin/sh
# Copyright (c) 2016, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
while [ "$registered" != "true" ]
do
sleep 0.1
registered="`getprop sys.listeners.registered`"
done

File diff suppressed because it is too large Load diff

21
rootdir/root/fstab.qcom Normal file
View file

@ -0,0 +1,21 @@
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#TODO: Add 'check' as fs_mgr_flags with data partition.
# Currently we dont have e2fsck compiled. So fs check would failed.
# Non-A/B fstab.qcom variant
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,noatime,lazytime,errors=panic wait,resize,check,encryptable=footer,crashcheck,quota
/devices/soc/c084000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
/dev/block/bootdevice/by-name/cust /cust ext4 ro,nosuid,nodev,barrier=1 wait,check
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/bluetooth /bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
/devices/soc/a800000.ssusb/a800000.dwc3/xhci-hcd.0.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
/dev/block/bootdevice/by-name/dsp /dsp ext4 ro,nosuid,nodev,barrier=1 wait
/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,nodev,noatime,barrier=1 wait
/dev/block/bootdevice/by-name/persist /persist ext4 nosuid,nodev,barrier=1,noatime wait,check
/dev/block/bootdevice/by-name/persistbak /persistbak ext4 nosuid,nodev,barrier=1,noatime wait,check

102
rootdir/root/init.class_main.sh Executable file
View file

@ -0,0 +1,102 @@
#! /vendor/bin/sh
# Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# start ril-daemon only for targets on which radio is present
#
baseband=`getprop ro.baseband`
sgltecsfb=`getprop persist.vendor.radio.sglte_csfb`
datamode=`getprop persist.data.mode`
case "$baseband" in
"apq" | "sda" )
setprop ro.radio.noril yes
stop ril-daemon
esac
case "$baseband" in
"msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3")
start qmuxd
esac
case "$baseband" in
"msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx")
start ipacm-diag
start ipacm
case "$baseband" in
"svlte2a" | "csfb")
start qmiproxy
;;
"sglte" | "sglte2" )
if [ "x$sgltecsfb" != "xtrue" ]; then
start qmiproxy
else
setprop persist.vendor.radio.voice.modem.index 0
fi
;;
"dsda2")
setprop persist.radio.multisim.config dsda
esac
multisim=`getprop persist.radio.multisim.config`
if [ "$multisim" = "dsds" ] || [ "$multisim" = "dsda" ]; then
start ril-daemon2
elif [ "$multisim" = "tsts" ]; then
start ril-daemon2
start ril-daemon3
fi
case "$datamode" in
"tethered")
start qti
start port-bridge
;;
"concurrent")
start qti
start netmgrd
start port-bridge
;;
*)
start netmgrd
;;
esac
esac
#
# Allow persistent faking of bms
# User needs to set fake bms charge in persist.bms.fake_batt_capacity
#
fake_batt_capacity=`getprop persist.bms.fake_batt_capacity`
case "$fake_batt_capacity" in
"") ;; #Do nothing here
* )
echo "$fake_batt_capacity" > /sys/class/power_supply/battery/capacity
;;
esac

35
rootdir/root/init.crda.sh Executable file
View file

@ -0,0 +1,35 @@
#! /vendor/bin/sh
# Copyright (c) 2012, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
country=`getprop wlan.crda.country`
# crda takes input in COUNTRY environment variable
if [ $country != "" ]
then
COUNTRY="$country" /system/bin/crda
fi

34
rootdir/root/init.mdm.sh Executable file
View file

@ -0,0 +1,34 @@
#! /vendor/bin/sh
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
baseband=`getprop ro.baseband`
if [ "$baseband" = "mdm" ] || [ "$baseband" = "mdm2" ]; then
start mdm_helper
fi

View file

@ -0,0 +1,902 @@
# Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# USB compositions
on property:sys.usb.config=mass_storage && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "msc"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0xF000
symlink /config/usb_gadget/g1/functions/mass_storage.0 /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mass_storage,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mass_storage,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb_msc"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x9015
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/mass_storage.0 /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x901D
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x900E
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,serial_cdev,rmnet,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmnet,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Default composition"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x9091
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,serial_cdev,rmnet && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Default comp without ADB"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x9092
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.tethering=true
write /sys/class/net/rndis0/queues/rx-0/rps_cpus ${sys.usb.rps_mask}
on property:sys.usb.config=rndis
setprop sys.usb.config rndis,${persist.sys.usb.config.extra}
on property:sys.usb.config=rndis,none && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x2717
write /config/usb_gadget/g1/idProduct 0xFF80
symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
write /config/usb_gadget/g1/configs/b.1/f1/wceis 1
setprop sys.usb.state rndis
on property:sys.usb.config=rndis,adb
setprop sys.usb.config rndis,${persist.sys.usb.config.extra},adb
on property:sys.usb.config=rndis,none,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,none,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x2717
write /config/usb_gadget/g1/idProduct 0xFF88
symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
write /config/usb_gadget/g1/configs/b.1/f1/wceis 1
setprop sys.usb.state rndis,adb
on property:sys.usb.config=rndis,diag && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x902C
symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state rndis
on property:sys.usb.config=rndis,diag,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x902D
symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state rndis,adb
on property:sys.usb.config=rndis,serial_cdev && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_dun"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90B3
symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state rndis
on property:sys.usb.config=rndis,serial_cdev,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,serial_cdev,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_dun_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90B4
symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state rndis,adb
on property:sys.usb.config=rndis,serial_cdev,diag && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_dun_diag"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90B5
symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state rndis
on property:sys.usb.config=rndis,serial_cdev,diag,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,serial_cdev,diag,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_dun_diag"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90B6
symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state rndis,adb
on property:sys.usb.config=mtp,diag && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_diag"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x901B
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mtp,diag,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,diag,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_diag_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x903A
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,qdss && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x904A
write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,qdss,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,qdss,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x9060
write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,qdss,rmnet && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss_rmnet"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x9083
write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,qdss,rmnet,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,qdss,rmnet,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss_rmnet_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x9084
write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f4
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis,diag,qdss && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_qdss"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x9081
write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1
symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis,diag,qdss,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,qdss,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_qdss_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x9082
write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1
symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=ncm && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ncm"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0xA4A1
symlink /config/usb_gadget/g1/functions/ncm.0 /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=ncm,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ncm,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ncm_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x908C
symlink /config/usb_gadget/g1/functions/ncm.0 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,serial_cdev && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x9004
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,adb,serial_cdev && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,adb,serial_cdev && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_adb_dun"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x901f
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,serial_cdev,rmnet,dpl && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun_rmnet_dpl"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90b7
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.dpl /config/usb_gadget/g1/configs/b.1/f4
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,serial_cdev,rmnet,dpl,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmnet,dpl,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun_rmnet_dpl_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90b8
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.dpl /config/usb_gadget/g1/configs/b.1/f4
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis,diag,dpl && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_dpl"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90bf
symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.dpl /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state rndis
on property:sys.usb.config=rndis,diag,dpl,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,dpl,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_dpl_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90c0
symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.dpl /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state rndis,adb
on property:sys.usb.config=ccid && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ccid"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90CE
symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=ccid,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ccid,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ccid_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90CF
symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=ccid,diag && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ccid_diag"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90D0
symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=ccid,diag,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ccid,diag,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ccid_diag_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90D1
symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,serial_cdev,rmnet,ccid && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun_rmnet_ccid"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90D2
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f4
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,serial_cdev,rmnet,ccid,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmnet,ccid,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun_rmnet_ccid_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90D3
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f4
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_mdm,rmnet && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_diag_mdm,qdss_qdss_mdm_dun_dun_mdm_rmnet"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90D7
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/diag.diag_mdm /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/qdss.qdss_mdm /config/usb_gadget/g1/configs/b.1/f4
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f5
symlink /config/usb_gadget/g1/functions/cser.dun.2 /config/usb_gadget/g1/configs/b.1/f6
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f7
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_mdm,rmnet,adb && property:sys.usb.configfs=1
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_mdm,rmnet,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_diag_mdm,qdss_qdss_mdm_dun_dun_mdm_rmnet_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rm /config/usb_gadget/g1/configs/b.1/f6
rm /config/usb_gadget/g1/configs/b.1/f7
rm /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/idVendor 0x05C6
write /config/usb_gadget/g1/idProduct 0x90D8
symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/diag.diag_mdm /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/qdss.qdss_mdm /config/usb_gadget/g1/configs/b.1/f4
symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f5
symlink /config/usb_gadget/g1/functions/cser.dun.2 /config/usb_gadget/g1/configs/b.1/f6
symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f7
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f8
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=adb && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x2717
write /config/usb_gadget/g1/idProduct 0xFF08
on property:sys.usb.config=mtp && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x2717
write /config/usb_gadget/g1/idProduct 0xFF40
on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x2717
write /config/usb_gadget/g1/idProduct 0xFF48
on property:sys.usb.config=ptp && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x2717
write /config/usb_gadget/g1/idProduct 0xFF10
on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x2717
write /config/usb_gadget/g1/idProduct 0xFF18
on property:sys.usb.config=accessory && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x2d00
on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x2d01
on property:sys.usb.config=audio_source && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x2d02
on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x2d03
on property:sys.usb.config=accessory,audio_source && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x2d04
on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x2d05
on property:sys.usb.config=midi && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x4ee8
on property:sys.usb.config=midi,adb && property:sys.usb.configfs=1
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x4ee9

View file

@ -0,0 +1,216 @@
#!/vendor/bin/sh
# Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Set platform variables
target=`getprop ro.board.platform`
if [ -f /sys/devices/soc0/hw_platform ]; then
soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null
else
soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null
fi
if [ -f /sys/devices/soc0/soc_id ]; then
soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null
else
soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null
fi
if [ -f /sys/devices/soc0/platform_version ]; then
soc_hwver=`cat /sys/devices/soc0/platform_version` 2> /dev/null
else
soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null
fi
# Dynamic Memory Managment (DMM) provides a sys file system to the userspace
# that can be used to plug in/out memory that has been configured as unstable.
# This unstable memory can be in Active or In-Active State.
# Each of which the userspace can request by writing to a sys file.
#
# ro.dev.dmm = 1; Indicates that DMM is enabled in the Android User Space. This
# property is set in the Android system properties file.
#
# If ro.dev.dmm.dpd.start_address is set here then the target has a memory
# configuration that supports DynamicMemoryManagement.
init_DMM()
{
block=-1
case "$target" in
"msm7630_surf" | "msm7630_1x" | "msm7630_fusion" | "msm8960")
;;
*)
return
;;
esac
mem="/sys/devices/system/memory"
op=`cat $mem/movable_start_bytes`
case "$op" in
"0")
log -p i -t DMM DMM Disabled. movable_start_bytes not set: $op
;;
"$mem/movable_start_bytes: No such file or directory ")
log -p i -t DMM DMM Disabled. movable_start_bytes does not exist: $op
;;
*)
log -p i -t DMM DMM available. movable_start_bytes at $op
movable_start_bytes=0x`cat $mem/movable_start_bytes`
block_size_bytes=0x`cat $mem/block_size_bytes`
block=$((#${movable_start_bytes}/${block_size_bytes}))
chown -h system.system $mem/memory$block/state
chown -h system.system $mem/probe
chown -h system.system $mem/active
chown -h system.system $mem/remove
case "$target" in
"msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
echo $movable_start_bytes > $mem/probe
case "$?" in
"0")
log -p i -t DMM $movable_start_bytes to physical hotplug succeeded.
;;
*)
log -p e -t DMM $movable_start_bytes to physical hotplug failed.
return
;;
esac
echo online > $mem/memory$block/state
case "$?" in
"0")
log -p i -t DMM \'echo online\' to logical hotplug succeeded.
;;
*)
log -p e -t DMM \'echo online\' to logical hotplug failed.
return
;;
esac
;;
esac
setprop ro.dev.dmm.dpd.start_address $movable_start_bytes
setprop ro.dev.dmm.dpd.block $block
;;
esac
case "$target" in
"msm8960")
return
;;
esac
# For 7X30 targets:
# ro.dev.dmm.dpd.start_address is set when the target has a 2x256Mb memory
# configuration. This is also used to indicate that the target is capable of
# setting EBI-1 to Deep Power Down or Self Refresh.
op=`cat $mem/low_power_memory_start_bytes`
case "$op" in
"0")
log -p i -t DMM Self-Refresh-Only Disabled. low_power_memory_start_bytes not set:$op
;;
"$mem/low_power_memory_start_bytes No such file or directory ")
log -p i -t DMM Self-Refresh-Only Disabled. low_power_memory_start_bytes does not exist:$op
;;
*)
log -p i -t DMM Self-Refresh-Only available. low_power_memory_start_bytes at $op
;;
esac
}
#
# For controlling console and shell on console on 8960 - perist.serial.enable 8960
# On other target use default ro.debuggable property.
#
serial=`getprop persist.serial.enable`
dserial=`getprop ro.debuggable`
case "$target" in
"msm8960")
case "$serial" in
"0")
echo 0 > /sys/devices/platform/msm_serial_hsl.0/console
;;
"1")
echo 1 > /sys/devices/platform/msm_serial_hsl.0/console
start console
;;
*)
case "$dserial" in
"1")
start console
;;
esac
;;
esac
;;
"msm8610" | "msm8974" | "msm8226")
case "$serial" in
"0")
echo 0 > /sys/devices/f991f000.serial/console
;;
"1")
echo 1 > /sys/devices/f991f000.serial/console
start console
;;
*)
case "$dserial" in
"1")
start console
;;
esac
;;
esac
;;
*)
case "$dserial" in
"1")
start console
;;
esac
;;
esac
case "$target" in
"msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
insmod /system/lib/modules/ss_mfcinit.ko
insmod /system/lib/modules/ss_vencoder.ko
insmod /system/lib/modules/ss_vdecoder.ko
chmod -h 0666 /dev/ss_mfc_reg
chmod -h 0666 /dev/ss_vdec
chmod -h 0666 /dev/ss_venc
init_DMM
;;
"msm8960")
init_DMM
;;
esac

115
rootdir/root/init.qcom.coex.sh Executable file
View file

@ -0,0 +1,115 @@
#! /vendor/bin/sh
# Copyright (c) 2009-2010, 2012, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
LOG_TAG="qcom-bt-wlan-coex"
LOG_NAME="${0}:"
coex_pid=""
ath_wlan_supported=`getprop wlan.driver.ath`
loge ()
{
/system/bin/log -t $LOG_TAG -p e "$LOG_NAME $@"
}
logi ()
{
/system/bin/log -t $LOG_TAG -p i "$LOG_NAME $@"
}
failed ()
{
loge "$1: exit code $2"
exit $2
}
start_coex ()
{
case "$ath_wlan_supported" in
"2")
echo "ATH WLAN Chip ID AR6004 is enabled"
/system/bin/abtfilt -d -z -n -m -a -w wlan0 &
;;
"1")
echo "ATH WLAN Chip ID is enabled"
# Must have -d -z -n -v -s -w wlan0 parameters for atheros btfilter.
/system/bin/abtfilt -d -z -n -v -q -s -w wlan0 &
;;
"0")
echo "WCN WLAN Chip ID is enabled"
# Must have -o turned on to avoid daemon (otherwise we cannot get pid)
/system/bin/btwlancoex -o $opt_flags &
;;
*)
echo "NO WLAN Chip ID is enabled, so enabling ATH as default"
# Must have -d -z -n -v -s -w wlan0 parameters for atheros btfilter.
/system/bin/abtfilt -d -z -n -v -q -s -w wlan0 &
;;
esac
coex_pid=$!
logi "start_coex: pid = $coex_pid"
}
kill_coex ()
{
logi "kill_coex: pid = $coex_pid"
kill -TERM $coex_pid
# this shell doesn't exit now -- wait returns for normal exit
}
# mimic coex options parsing -- maybe a waste of effort
USAGE="${0} [-o] [-c] [-r] [-i] [-h]"
while getopts "ocrih" f
do
case $f in
o | c | r | i | h) opt_flags="$opt_flags -$f" ;;
\?) echo $USAGE; exit 1;;
esac
done
# init does SIGTERM on ctl.stop for service
trap "kill_coex" TERM INT
#Selectively start coex module
target=`getprop ro.board.platform`
if [ "$target" == "msm8960" ] && [ "$ath_wlan_supported" != "2" ]; then
logi "btwlancoex/abtfilt is not needed"
else
# Build settings may not produce the coex executable
if ls /system/bin/btwlancoex || ls /system/bin/abtfilt
then
start_coex
wait $coex_pid
logi "Coex stopped"
else
logi "btwlancoex/abtfilt not available"
fi
fi
exit 0

View file

@ -0,0 +1,48 @@
#!/vendor/bin/sh
# Copyright (c) 2017, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
abnormalcnt="persist.vendor.crash.cnt"
abnormal_cnt=`getprop $abnormalcnt`
crash_detect=`getprop persist.vendor.crash.detect`
if [ "$abnormal_cnt" = "" ]
then
setprop $abnormalcnt 0
fi
if [ "$crash_detect" = "true" ]
then
abnormal_cnt=`expr $abnormal_cnt + 1`
setprop $abnormalcnt $abnormal_cnt
elif [ "$crash_detect" = "false" ];then
setprop persist.vendor.crash.detect true
else
setprop persist.vendor.crash.detect true
fi

View file

@ -0,0 +1,511 @@
#! /vendor/bin/sh
# Copyright (c) 2012-2013,2016 The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
export PATH=/vendor/bin
# Set platform variables
if [ -f /sys/devices/soc0/hw_platform ]; then
soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null
else
soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null
fi
if [ -f /sys/devices/soc0/soc_id ]; then
soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null
else
soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null
fi
if [ -f /sys/devices/soc0/platform_version ]; then
soc_hwver=`cat /sys/devices/soc0/platform_version` 2> /dev/null
else
soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null
fi
if [ -f /sys/class/graphics/fb0/virtual_size ]; then
res=`cat /sys/class/graphics/fb0/virtual_size` 2> /dev/null
fb_width=${res%,*}
fi
log -t BOOT -p i "MSM target '$1', SoC '$soc_hwplatform', HwID '$soc_hwid', SoC ver '$soc_hwver'"
#For drm based display driver
vbfile=/sys/module/drm/parameters/vblankoffdelay
if [ -w $vbfile ]; then
echo -1 > $vbfile
else
log -t DRM_BOOT -p w "file: '$vbfile' or perms doesn't exist"
fi
target=`getprop ro.board.platform`
case "$target" in
"msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
case "$soc_hwplatform" in
"FFA" | "SVLTE_FFA")
# linking to surf_keypad_qwerty.kcm.bin instead of surf_keypad_numeric.kcm.bin so that
# the UI keyboard works fine.
ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin
;;
"Fluid")
setprop ro.sf.lcd_density 240
setprop qcom.bt.dev_power_class 2
;;
*)
ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin
;;
esac
;;
"msm8660")
case "$soc_hwplatform" in
"Fluid")
setprop ro.sf.lcd_density 240
;;
"Dragon")
setprop ro.sound.alsa "WM8903"
;;
esac
;;
"msm8960")
# lcd density is write-once. Hence the separate switch case
case "$soc_hwplatform" in
"Liquid")
if [ "$soc_hwver" == "196608" ]; then # version 0x30000 is 3D sku
setprop ro.sf.hwrotation 90
fi
setprop ro.sf.lcd_density 160
;;
"MTP")
setprop ro.sf.lcd_density 240
;;
*)
case "$soc_hwid" in
"109")
setprop ro.sf.lcd_density 160
;;
*)
setprop ro.sf.lcd_density 240
;;
esac
;;
esac
#Set up composition type based on the target
case "$soc_hwid" in
87)
#8960
setprop debug.composition.type dyn
;;
153|154|155|156|157|138)
#8064 V2 PRIME | 8930AB | 8630AB | 8230AB | 8030AB | 8960AB
setprop debug.composition.type c2d
;;
*)
esac
;;
"msm8974")
case "$soc_hwplatform" in
"Liquid")
setprop ro.sf.lcd_density 160
# Liquid do not have hardware navigation keys, so enable
# Android sw navigation bar
setprop ro.hw.nav_keys 0
;;
"Dragon")
setprop ro.sf.lcd_density 240
;;
*)
setprop ro.sf.lcd_density 320
;;
esac
;;
"msm8226")
case "$soc_hwplatform" in
*)
setprop ro.sf.lcd_density 320
;;
esac
;;
"msm8610" | "apq8084" | "mpq8092")
case "$soc_hwplatform" in
*)
setprop ro.sf.lcd_density 240
;;
esac
;;
"apq8084")
case "$soc_hwplatform" in
"Liquid")
setprop ro.sf.lcd_density 320
# Liquid do not have hardware navigation keys, so enable
# Android sw navigation bar
setprop ro.hw.nav_keys 0
;;
"SBC")
setprop ro.sf.lcd_density 200
# SBC do not have hardware navigation keys, so enable
# Android sw navigation bar
setprop qemu.hw.mainkeys 0
;;
*)
setprop ro.sf.lcd_density 480
;;
esac
;;
"msm8996")
case "$soc_hwplatform" in
"Dragon")
setprop ro.sf.lcd_density 240
setprop qemu.hw.mainkeys 0
;;
"ADP")
setprop ro.sf.lcd_density 160
setprop qemu.hw.mainkeys 0
;;
"SBC")
setprop ro.sf.lcd_density 240
setprop qemu.hw.mainkeys 0
;;
*)
setprop ro.sf.lcd_density 560
;;
esac
;;
"msm8937" | "msm8940")
# Set ro.opengles.version based on chip id.
# MSM8937 and MSM8940 variants supports OpenGLES 3.1
# 196608 is decimal for 0x30000 to report version 3.0
# 196609 is decimal for 0x30001 to report version 3.1
# 196610 is decimal for 0x30002 to report version 3.2
case "$soc_hwid" in
294|295|296|297|298|313)
setprop ro.opengles.version 196610
;;
303|307|308|309|320)
# Vulkan is not supported for 8917 variants
setprop ro.opengles.version 196608
setprop persist.graphics.vulkan.disable true
;;
*)
setprop ro.opengles.version 196608
;;
esac
;;
"msm8909")
case "$soc_hwplatform" in
*)
setprop persist.graphics.vulkan.disable true
;;
esac
;;
"msm8998" | "apq8098_latv")
case "$soc_hwplatform" in
*)
setprop ro.sf.lcd_density 560
if [ ! -e /dev/kgsl-3d0 ]; then
setprop persist.sys.force_sw_gles 1
setprop sdm.idle_time 0
else
setprop persist.sys.force_sw_gles 0
fi
;;
esac
case "$soc_hwid" in
"319") #apq8098_latv
echo "\n==Loading ALX module==\n"
insmod /system/lib/modules/alx.ko
;;
esac
;;
"sdm845")
case "$soc_hwplatform" in
*)
setprop ro.sf.lcd_density 560
if [ ! -e /dev/kgsl-3d0 ]; then
setprop persist.sys.force_sw_gles 1
setprop sdm.idle_time 0
else
setprop persist.sys.force_sw_gles 0
fi
;;
esac
;;
"msm8953")
cap_ver=`cat /sys/devices/soc/1d00000.qcom,vidc/capability_version` 2> /dev/null
if [ $cap_ver -eq 1 ]; then
setprop media.msm8953.version 1
fi
;;
"msm8952")
case "$soc_hwid" in
278)
setprop media.msm8956hw 1
if [ -f /sys/devices/soc0/platform_version ]; then
hw_ver=`cat /sys/devices/soc.0/1d00000.qcom,vidc/version` 2> /dev/null
if [ $hw_ver -eq 1 ]; then
setprop media.msm8956.version 1
fi
fi
;;
266|277)
setprop media.msm8956hw 1
if [ -f /sys/devices/soc0/platform_version ]; then
hw_ver=`cat /sys/devices/soc.0/1d00000.qcom,vidc/version` 2> /dev/null
if [ $hw_ver -eq 1 ]; then
setprop media.msm8956.version 1
fi
fi
;;
264)
setprop persist.graphics.vulkan.disable true
;;
esac
;;
esac
# In mpss AT version is greater than 3.1, need
# to use the new vendor-ril which supports L+L feature
# otherwise use the existing old one.
if [ -f /firmware/verinfo/ver_info.txt ]; then
modem=`cat /firmware/verinfo/ver_info.txt |
sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' |
sed 's/.*AT.\(.*\)/\1/g' | cut -d \- -f 1`
zygote=`getprop ro.zygote`
case "$zygote" in
"zygote64_32")
if [ "$modem" \< "3.1" ]; then
setprop vendor.rild.libpath "/vendor/lib64/libril-qc-qmi-1.so"
else
setprop vendor.rild.libpath "/vendor/lib64/libril-qc-hal-qmi.so"
fi
;;
"zygote32")
if [ "$modem" \< "3.1" ]; then
setprop vendor.rild.libpath "/vendor/lib/libril-qc-qmi-1.so"
else
setprop vendor.rild.libpath "/vendor/lib/libril-qc-hal-qmi.so"
fi
;;
esac
fi
if [ -f /firmware/verinfo/ver_info.txt ]; then
# In mpss AT version is greater than 3.1, need
# to use the new vendor-ril which supports L+L feature
# otherwise use the existing old one.
modem=`cat /firmware/verinfo/ver_info.txt |
sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' |
sed 's/.*MPSS.\(.*\)/\1/g' | cut -d \. -f 1`
if [ "$modem" = "AT" ]; then
version=`cat /firmware/verinfo/ver_info.txt |
sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' |
sed 's/.*AT.\(.*\)/\1/g' | cut -d \- -f 1`
if [ ! -z $version ]; then
zygote=`getprop ro.zygote`
case "$zygote" in
"zygote64_32")
if [ "$version" \< "3.1" ]; then
setprop vendor.rild.libpath "/vendor/lib64/libril-qc-qmi-1.so"
else
setprop vendor.rild.libpath "/vendor/lib64/libril-qc-hal-qmi.so"
fi
;;
"zygote32")
if [ "$version" \< "3.1" ]; then
echo "legacy qmi load for TA less than 3.1"
setprop vendor.rild.libpath "/vendor/lib/libril-qc-qmi-1.so"
else
setprop vendor.rild.libpath "/vendor/lib/libril-qc-hal-qmi.so"
fi
;;
esac
fi
# In mpss TA version is greater than 3.0, need
# to use the new vendor-ril which supports L+L feature
# otherwise use the existing old one.
elif [ "$modem" = "TA" ]; then
version=`cat /firmware/verinfo/ver_info.txt |
sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' |
sed 's/.*TA.\(.*\)/\1/g' | cut -d \- -f 1`
if [ ! -z $version ]; then
zygote=`getprop ro.zygote`
case "$zygote" in
"zygote64_32")
if [ "$version" \< "3.0" ]; then
setprop vendor.rild.libpath "/vendor/lib64/libril-qc-qmi-1.so"
else
setprop vendor.rild.libpath "/vendor/lib64/libril-qc-hal-qmi.so"
fi
;;
"zygote32")
if [ "$version" \< "3.0" ]; then
setprop vendor.rild.libpath "/vendor/lib/libril-qc-qmi-1.so"
else
setprop vendor.rild.libpath "/vendor/lib/libril-qc-hal-qmi.so"
fi
;;
esac
fi
fi;
fi
baseband=`getprop ro.baseband`
#enable atfwd daemon all targets except sda, apq, qcs
case "$baseband" in
"apq" | "sda" | "qcs" )
setprop persist.radio.atfwd.start false;;
*)
setprop persist.radio.atfwd.start true;;
esac
#set default lcd density
#Since lcd density has read only
#property, it will not overwrite previous set
#property if any target is setting forcefully.
# Setup display nodes & permissions
# HDMI can be fb1 or fb2
# Loop through the sysfs nodes and determine
# the HDMI(dtv panel)
function set_perms() {
#Usage set_perms <filename> <ownership> <permission>
chown -h $2 $1
chmod $3 $1
}
function setHDMIPermission() {
file=/sys/class/graphics/fb$1
dev_file=/dev/graphics/fb$1
dev_gfx_hdmi=/devices/virtual/switch/hdmi
set_perms $file/hpd system.graphics 0664
set_perms $file/res_info system.graphics 0664
set_perms $file/vendor_name system.graphics 0664
set_perms $file/product_description system.graphics 0664
set_perms $file/video_mode system.graphics 0664
set_perms $file/format_3d system.graphics 0664
set_perms $file/s3d_mode system.graphics 0664
set_perms $file/dynamic_fps system.graphics 0664
set_perms $file/msm_fb_dfps_mode system.graphics 0664
set_perms $file/hdr_stream system.graphics 0664
set_perms $file/cec/enable system.graphics 0664
set_perms $file/cec/logical_addr system.graphics 0664
set_perms $file/cec/rd_msg system.graphics 0664
set_perms $file/pa system.graphics 0664
set_perms $file/cec/wr_msg system.graphics 0600
set_perms $file/hdcp/tp system.graphics 0664
set_perms $file/hdmi_audio_cb audioserver.audio 0600
set_perms $file/pll_enable system.graphics 0664
set_perms $file/hdmi_ppm system.graphics 0664
ln -s $dev_file $dev_gfx_hdmi
}
# check for the type of driver FB or DRM
fb_driver=/sys/class/graphics/fb0
if [ -e "$fb_driver" ]
then
# check for HDMI connection
for fb_cnt in 0 1 2 3
do
file=/sys/class/graphics/fb$fb_cnt/msm_fb_panel_info
if [ -f "$file" ]
then
cat $file | while read line; do
case "$line" in
*"is_pluggable"*)
case "$line" in
*"1"*)
setHDMIPermission $fb_cnt
esac
esac
done
fi
done
# check for mdp caps
file=/sys/class/graphics/fb0/mdp/caps
if [ -f "$file" ]
then
setprop debug.gralloc.gfx_ubwc_disable 1
cat $file | while read line; do
case "$line" in
*"ubwc"*)
setprop debug.gralloc.enable_fb_ubwc 1
setprop debug.gralloc.gfx_ubwc_disable 0
esac
done
fi
file=/sys/class/graphics/fb0
if [ -d "$file" ]
then
set_perms $file/idle_time system.graphics 0664
set_perms $file/dynamic_fps system.graphics 0664
set_perms $file/dyn_pu system.graphics 0664
set_perms $file/modes system.graphics 0664
set_perms $file/mode system.graphics 0664
set_perms $file/msm_cmd_autorefresh_en system.graphics 0664
fi
# set lineptr permissions for all displays
for fb_cnt in 0 1 2 3
do
file=/sys/class/graphics/fb$fb_cnt
if [ -f "$file/lineptr_value" ]; then
set_perms $file/lineptr_value system.graphics 0664
fi
if [ -f "$file/msm_fb_persist_mode" ]; then
set_perms $file/msm_fb_persist_mode system.graphics 0664
fi
done
fi
boot_reason=`cat /proc/sys/kernel/boot_reason`
reboot_reason=`getprop ro.boot.alarmboot`
power_off_alarm_file=`cat /persist/alarm/powerOffAlarmSet`
if [ "$boot_reason" = "3" ] || [ "$reboot_reason" = "true" ]; then
if [ "$power_off_alarm_file" = "1" ]
then
setprop ro.alarm_boot true
setprop debug.sf.nobootanimation 1
fi
else
setprop ro.alarm_boot false
fi
# copy GPU frequencies to system property
if [ -f /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies ]; then
gpu_freq=`cat /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies` 2> /dev/null
setprop ro.gpu.available_frequencies "$gpu_freq"
fi

View file

@ -0,0 +1,35 @@
#! /vendor/bin/sh
# Copyright (c) 2012, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
PATH=/system/bin:$PATH
export PATH
cat /sys/devices/platform/rs300000a7.65536/force_sync
cat /sys/devices/platform/rs300100a7.65536/force_sync

View file

@ -0,0 +1,402 @@
#
# Copyright (c) 2009-2016, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Define fastmmi
service fastmmi /vendor/bin/mmi
user root
group root
disabled
service mmid /vendor/bin/mmid
user root
group root
disabled
on property:sys.boot_mode=ffbm
write ${persist.vendor.mmi.misc_dev_path} "ffbm-01"
on property:sys.boot_mode=qmmi
write ${persist.vendor.mmi.misc_dev_path} "ffbm-02"
on property:sys.boot_mode=normal
write ${persist.vendor.mmi.misc_dev_path} "normal"
# Creating a scratch storage on /data for factory testing.
on factory-fs && property:ro.bootmode=ffbm-00
mount tmpfs tmpfs /data
on factory-fs && property:ro.bootmode=ffbm-01
mount tmpfs tmpfs /data
on post-fs-data
setprop persist.sys.usb.ffbm-00.func diag,serial_cdev,rmnet,adb
setprop persist.sys.usb.ffbm-01.func diag,serial_cdev,rmnet,adb
setprop persist.sys.usb.ffbm-02.func diag,serial_cdev,rmnet,adb
on mmi && property:ro.bootmode=ffbm-00
# ========================================================
# This is FFBM only settings.
# ========================================================
#mkdir for factory data files.
mkdir /persist/FTM_AP 0750 root root
# basic network init
ifup lo
hostname localhost
domainname localdomain
# Memory management. Basic kernel parameters, and allow the high
# level system server to be able to adjust the kernel OOM driver
# parameters to match how it is managing things.
write /proc/sys/vm/overcommit_memory 1
write /proc/sys/vm/min_free_order_shift 4
chown root system /sys/module/lowmemorykiller/parameters/adj
chmod 0664 /sys/module/lowmemorykiller/parameters/adj
chown root system /sys/module/lowmemorykiller/parameters/minfree
chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
# Tweak background writeout
write /proc/sys/vm/dirty_expire_centisecs 200
write /proc/sys/vm/dirty_background_ratio 5
# Permissions for System Server and daemons.
chown radio system /sys/android_power/state
chown radio system /sys/android_power/request_state
chown radio system /sys/android_power/acquire_full_wake_lock
chown radio system /sys/android_power/acquire_partial_wake_lock
chown radio system /sys/android_power/release_wake_lock
chown system system /sys/power/autosleep
chown system system /sys/power/state
chown system system /sys/power/wakeup_count
chown radio wakelock /sys/power/wake_lock
chown radio wakelock /sys/power/wake_unlock
chmod 0660 /sys/power/state
chmod 0660 /sys/power/wake_lock
chmod 0660 /sys/power/wake_unlock
chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads
chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost
chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost
chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
# Assume SMP uses shared cpufreq policy for all CPUs
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chown system system /sys/class/leds/vibrator/trigger
chown system system /sys/class/leds/vibrator/activate
chown system system /sys/class/leds/vibrator/brightness
chown system system /sys/class/leds/vibrator/duration
chown system system /sys/class/leds/vibrator/state
chown system system /sys/class/timed_output/vibrator/enable
chown system system /sys/class/leds/keyboard-backlight/brightness
chown system system /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/jogball-backlight/brightness
chown system system /sys/class/leds/red/brightness
chown system system /sys/class/leds/green/brightness
chown system system /sys/class/leds/blue/brightness
chown system system /sys/class/leds/red/device/grpfreq
chown system system /sys/class/leds/red/device/grppwm
chown system system /sys/class/leds/red/device/blink
chown system system /sys/module/sco/parameters/disable_esco
chown system system /sys/kernel/ipv4/tcp_wmem_min
chown system system /sys/kernel/ipv4/tcp_wmem_def
chown system system /sys/kernel/ipv4/tcp_wmem_max
chown system system /sys/kernel/ipv4/tcp_rmem_min
chown system system /sys/kernel/ipv4/tcp_rmem_def
chown system system /sys/kernel/ipv4/tcp_rmem_max
chown root radio /proc/cmdline
# Define default initial receive window size in segments.
setprop net.tcp.default_init_rwnd 60
chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power
chown bluetooth net_bt /sys/class/rfkill/rfkill0/type
chown bluetooth net_bt /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /proc/bluetooth/sleep/proto
chown bluetooth bluetooth /sys/module/hci_uart/parameters/ath_lpm
chown bluetooth bluetooth /sys/module/hci_uart/parameters/ath_btwrite
chown system system /sys/module/sco/parameters/disable_esco
chown bluetooth bluetooth /sys/module/hci_smd/parameters/hcismd_set
chown system system /sys/module/msm_core/parameters/polling_interval
chown system system /sys/module/msm_core/parameters/disabled
chown system system /sys/kernel/debug/msm_core/enable
chown system system /sys/kernel/debug/msm_core/ptable
chown system system /sys/kernel/boot_slpi/ssr
chown system system /sys/module/radio_iris_transport/parameters/fmsmd_set
chmod 0660 /sys/module/bluetooth_power/parameters/power
chmod 0660 /sys/module/hci_smd/parameters/hcismd_set
chmod 0660 /sys/module/radio_iris_transport/parameters/fmsmd_set
chmod 0660 /sys/class/rfkill/rfkill0/state
chmod 0660 /proc/bluetooth/sleep/proto
chown bluetooth net_bt /dev/ttyHS0
chmod 0660 /sys/module/hci_uart/parameters/ath_lpm
chmod 0660 /sys/module/hci_uart/parameters/ath_btwrite
chmod 0660 /dev/ttyHS0
chown bluetooth bluetooth /sys/devices/platform/msm_serial_hs.0/clock
chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock
chmod 0660 /dev/ttyHS2
chown bluetooth bluetooth /dev/ttyHS2
chown bluetooth net_bt /sys/class/rfkill/rfkill0/device/extldo
chmod 0660 /sys/class/rfkill/rfkill0/device/extldo
#Create QMUX deamon socket area
mkdir /dev/socket/qmux_radio 0770 radio radio
chmod 2770 /dev/socket/qmux_radio
mkdir /dev/socket/qmux_audio 0770 media audio
chmod 2770 /dev/socket/qmux_audio
mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth
chmod 2770 /dev/socket/qmux_bluetooth
mkdir /dev/socket/qmux_gps 0770 gps gps
chmod 2770 /dev/socket/qmux_gps
mkdir /persist/drm 0770 system system
mkdir /persist/bluetooth 0770 bluetooth bluetooth
mkdir /persist/misc 0770 system system
mkdir /persist/alarm 0770 system system
mkdir /persist/time 0770 system system
mkdir /persist/secnvm 0770 system system
#Create NETMGR daemon socket area
mkdir /dev/socket/netmgr 0750 radio radio
setprop wifi.interface wlan0
# Define TCP buffer sizes for various networks
# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
setprop net.tcp.buffersize.wifi 524288,2097152,4194304,262144,524288,1048576
setprop ro.telephony.call_ring.multiple false
#enable camera read sensors data
setprop persist.camera.gyro.disable 0
#Remove SUID bit for iproute2 ip tool
chmod 0755 /system/bin/ip
chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state
# Define TCP buffer sizes for various networks
# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
setprop net.tcp.buffersize.default 4096,87380,524288,4096,16384,110208
setprop net.tcp.buffersize.lte 2097152,4194304,8388608,262144,524288,1048576
setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
setprop net.tcp.buffersize.hspa 4094,87380,1220608,4096,16384,1220608
setprop net.tcp.buffersize.hsupa 4094,87380,1220608,4096,16384,1220608
setprop net.tcp.buffersize.hsdpa 4094,87380,1220608,4096,16384,1220608
setprop net.tcp.buffersize.hspap 4094,87380,1220608,4096,16384,1220608
setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
setprop net.tcp.buffersize.evdo 4094,87380,524288,4096,16384,262144
setprop net.tcp.2g_init_rwnd 10
# Assign TCP buffer thresholds to be ceiling value of technology maximums
# Increased technology maximums should be reflected here.
write /proc/sys/net/core/rmem_max 8388608
write /proc/sys/net/core/wmem_max 8388608
# To prevent out of order acknowledgements from making
# connection tracking to treat them as not belonging to
# the connection they belong to.
# Otherwise, a weird issue happens in which some long
# connections on high-throughput links get dropped when
# an ack packet comes out of order
write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 1
# Set the console loglevel to < KERN_INFO
# Set the default message loglevel to KERN_INFO
write /proc/sys/kernel/printk "6 6 1 7"
# Allow access for CCID command/response timeout configuration
chown system system /sys/module/ccid_bridge/parameters/bulk_msg_timeout
# bond0 used by FST Manager
chown wifi wifi /sys/class/net/bond0/bonding/queue_id
# Allow access to emmc rawdump block partition and dload sysfs node
chown root system /dev/block/bootdevice/by-name/rawdump
chmod 0660 /dev/block/bootdevice/by-name/rawdump
chown root system /sys/kernel/dload/emmc_dload
chmod 0660 /sys/kernel/dload/emmc_dload
chown root system /dev/block/bootdevice/by-name/ramdump -p /dev/block/
chmod 0660 /dev/block/bootdevice/by-name/ramdump -p /dev/block/
chown root system /sys/kernel/dload/dload_mode
chmod 0660 /sys/kernel/dload/dload_mode
chown system system /sys/class/backlight/panel0-backlight/brightness
chown system system /sys/class/backlight/panel0-backlight/max_brightness
# Allow access to sensors device attributes
chown system system /sys/class/sensors/MPU6050-accel/enable
chown system system /sys/class/sensors/MPU6050-accel/poll_delay
chown system system /sys/class/sensors/MPU6050-gyro/enable
chown system system /sys/class/sensors/MPU6050-gyro/poll_delay
# Create directory used for display
mkdir /persist/display 0770 system graphics
# Create vpp directory
mkdir /persist/vpp 0770 media media
# load WIGIG platform driver
insmod /vendor/lib/modules/msm_11ad_proxy.ko
setprop sys.usb.configfs 0
#Config USB for FFBM
write /sys/class/android_usb/android0/iSerial ${ro.serialno}
mkdir /dev/usb-ffs 0770 shell shell
mkdir /dev/usb-ffs/adb 0770 shell shell
mount configfs none /config
mkdir /config/usb_gadget/g1 0770 shell shell
mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell
write /config/usb_gadget/g1/bcdUSB 0x0200
write /config/usb_gadget/g1/os_desc/use 1
write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
mkdir /config/usb_gadget/g1/functions/mass_storage.0
mkdir /config/usb_gadget/g1/functions/mtp.gs0
mkdir /config/usb_gadget/g1/functions/ptp.gs1
mkdir /config/usb_gadget/g1/functions/accessory.gs2
mkdir /config/usb_gadget/g1/functions/audio_source.gs3
mkdir /config/usb_gadget/g1/functions/midi.gs5
mkdir /config/usb_gadget/g1/functions/ffs.adb
mkdir /config/usb_gadget/g1/functions/diag.diag
mkdir /config/usb_gadget/g1/functions/diag.diag_mdm
mkdir /config/usb_gadget/g1/functions/cser.dun.0
mkdir /config/usb_gadget/g1/functions/cser.nmea.1
mkdir /config/usb_gadget/g1/functions/cser.dun.2
mkdir /config/usb_gadget/g1/functions/gsi.rmnet
mkdir /config/usb_gadget/g1/functions/gsi.rndis
mkdir /config/usb_gadget/g1/functions/gsi.dpl
mkdir /config/usb_gadget/g1/functions/qdss.qdss
mkdir /config/usb_gadget/g1/functions/qdss.qdss_mdm
mkdir /config/usb_gadget/g1/functions/rndis_bam.rndis
mkdir /config/usb_gadget/g1/functions/rmnet_bam.rmnet
mkdir /config/usb_gadget/g1/functions/rmnet_bam.dpl
mkdir /config/usb_gadget/g1/functions/ncm.0
mkdir /config/usb_gadget/g1/functions/ccid.ccid
mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100"
symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
write /sys/class/android_usb/android0/f_ffs/aliases adb
# A/B update verifier that marks a successful boot.
exec_start update_verifier_nonencrypted
#mkdir for factory data files.
mkdir /persist/FTM_AP 0750 root root
#set property for sys.usb.config
setprop sys.usb.config diag,serial_cdev,rmnet,adb
#Start the following services needed for fftm
start servicemanager
start surfaceflinger
start qcom-usb-sh
start logd
start debuggerd
start debuggerd64
start per_mgr
start qcom-sh
start ril-daemon
start config_bluetooth
start sensors
start media
start fastmmi
start wcnss-service
# start qcom-post-boot to set the misc partition path property value
start qcom-post-boot
on mmi && property:ro.bootmode=ffbm-01
# ========================================================
# This is FFBM only settings.
# ========================================================
#mkdir for factory data files.
mkdir /persist/FTM_AP 0750 root root
start fastmmi
## start qcom-post-boot to set the misc partition path property value
start qcom-post-boot
on ffbm
trigger early-fs
trigger factory-fs
trigger fs
trigger post-fs
# Mount fstab in init.{$device}.rc by mount_all with '--late' parameter
# to only mount entries with 'latemount'. This is needed if '--early' is
# specified in the previous mount_all command on the fs stage.
# With /system mounted and properties form /system + /factory available,
# some services can be started.
trigger late-fs
# Now we can mount /data. File encryption requires keymaster to decrypt
# /data, which in turn can only be loaded when system properties are present.
trigger post-fs-data
# Now we can start zygote for devices with file based encryption
trigger zygote-start
# Load persist properties and override properties (if enabled) from /data.
trigger load_persist_props_action
# Remove a file to wake up anything waiting for firmware.
trigger firmware_mounts_complete
trigger early-boot
trigger boot
trigger mmi

1312
rootdir/root/init.qcom.rc Normal file

File diff suppressed because it is too large Load diff

78
rootdir/root/init.qcom.sdio.sh Executable file
View file

@ -0,0 +1,78 @@
#! /vendor/bin/sh
# Copyright (c) 2010, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# For successful WLAN card detection, WLAN needs SDIO polling turned on.
# This script can be used to turn on/off SDIO polling on appropriate
# SDIO slot on the MSM target (e.g. slot 3 on 7x30 surf).
arg=$1
target=`getprop ro.board.platform`
case "$target" in
"msm7627_6x")
echo 1 > /sys/devices/platform/msm_sdcc.1/polling
echo 1 > /sys/devices/platform/msm_sdcc.2/polling
;;
"msm7627_ffa")
echo 1 > /sys/devices/platform/msm_sdcc.2/polling
;;
"msm7627_surf")
echo 1 > /sys/devices/platform/msm_sdcc.1/polling
echo 1 > /sys/devices/platform/msm_sdcc.2/polling
;;
"msm7627a")
echo 1 > /sys/devices/platform/msm_sdcc.2/polling
;;
"msm7630_surf")
echo 1 > /sys/devices/platform/msm_sdcc.3/polling
;;
"msm7630_1x")
echo 1 > /sys/devices/platform/msm_sdcc.3/polling
;;
"msm7630_fusion")
echo 1 > /sys/devices/platform/msm_sdcc.3/polling
;;
"msm8660")
echo 1 > /sys/devices/platform/msm_sdcc.4/polling
;;
"msm8660_csfb")
echo 1 > /sys/devices/platform/msm_sdcc.4/polling
;;
esac
exit 0

View file

@ -0,0 +1,43 @@
#!/vendor/bin/sh
# Copyright (c) 2015, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# Function to start sensors for SSC enabled platforms
#
start_sensors()
{
if [ -c /dev/msm_dsps -o -c /dev/sensors ]; then
chmod -h 775 /persist/sensors
chmod -h 664 /persist/sensors/sensors_settings
mkdir -p /persist/sensors/registry/registry
chown -h system.root /persist/sensors/sensors_settings
start sensors
fi
}
start_sensors

470
rootdir/root/init.qcom.sh Normal file
View file

@ -0,0 +1,470 @@
#! /vendor/bin/sh
# Copyright (c) 2009-2016, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
target=`getprop ro.board.platform`
if [ -f /sys/devices/soc0/soc_id ]; then
platformid=`cat /sys/devices/soc0/soc_id`
else
platformid=`cat /sys/devices/system/soc/soc0/id`
fi
start_battery_monitor()
{
if ls /sys/bus/spmi/devices/qpnp-bms-*/fcc_data ; then
chown -h root.system /sys/module/pm8921_bms/parameters/*
chown -h root.system /sys/module/qpnp_bms/parameters/*
chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_data
chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_temp
chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_chgcyl
chmod 0660 /sys/module/qpnp_bms/parameters/*
chmod 0660 /sys/module/pm8921_bms/parameters/*
mkdir -p /data/bms
chown -h root.system /data/bms
chmod 0770 /data/bms
start battery_monitor
fi
}
start_charger_monitor()
{
if ls /sys/module/qpnp_charger/parameters/charger_monitor; then
chown -h root.system /sys/module/qpnp_charger/parameters/*
chown -h root.system /sys/class/power_supply/battery/input_current_max
chown -h root.system /sys/class/power_supply/battery/input_current_trim
chown -h root.system /sys/class/power_supply/battery/input_current_settled
chown -h root.system /sys/class/power_supply/battery/voltage_min
chmod 0664 /sys/class/power_supply/battery/input_current_max
chmod 0664 /sys/class/power_supply/battery/input_current_trim
chmod 0664 /sys/class/power_supply/battery/input_current_settled
chmod 0664 /sys/class/power_supply/battery/voltage_min
chmod 0664 /sys/module/qpnp_charger/parameters/charger_monitor
start charger_monitor
fi
}
start_vm_bms()
{
if [ -e /dev/vm_bms ]; then
chown -h root.system /sys/class/power_supply/bms/current_now
chown -h root.system /sys/class/power_supply/bms/voltage_ocv
chmod 0664 /sys/class/power_supply/bms/current_now
chmod 0664 /sys/class/power_supply/bms/voltage_ocv
start vm_bms
fi
}
start_msm_irqbalance_8939()
{
if [ -f /system/vendor/bin/msm_irqbalance ]; then
case "$platformid" in
"239" | "293" | "294" | "295" | "304" | "313")
start vendor.msm_irqbalance;;
esac
fi
}
start_msm_irqbalance_8952()
{
if [ -f /system/vendor/bin/msm_irqbalance ]; then
case "$platformid" in
"241" | "263" | "264" | "268" | "269" | "270" | "271")
start vendor.msm_irqbalance;;
esac
case "$platformid" in
"266" | "274" | "277" | "278")
start vendor.msm_irqbal_lb;;
esac
fi
}
start_msm_irqbalance660()
{
if [ -f /vendor/bin/msm_irqbalance ]; then
case "$platformid" in
"317" | "324" | "325" | "326" | "345" | "346")
start vendor.msm_irqbalance;;
"318" | "327")
start vendor.msm_irqbl_sdm630;;
esac
fi
}
start_msm_irqbalance()
{
if [ -f /vendor/bin/msm_irqbalance ]; then
start vendor.msm_irqbalance
fi
}
start_copying_prebuilt_qcril_db()
{
if [ -f /vendor/radio/qcril_database/qcril.db -a ! -f /data/vendor/radio/qcril.db ]; then
cp /vendor/radio/qcril_database/qcril.db /data/vendor/radio/qcril.db
chown -h radio.radio /data/vendor/radio/qcril.db
fi
}
baseband=`getprop ro.baseband`
echo 1 > /proc/sys/net/ipv6/conf/default/accept_ra_defrtr
case "$baseband" in
"svlte2a")
start bridgemgrd
;;
esac
case "$target" in
"msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
if [ -f /sys/devices/soc0/hw_platform ]; then
value=`cat /sys/devices/soc0/hw_platform`
else
value=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
case "$value" in
"Fluid")
start profiler_daemon;;
esac
;;
"msm8660" )
if [ -f /sys/devices/soc0/hw_platform ]; then
platformvalue=`cat /sys/devices/soc0/hw_platform`
else
platformvalue=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
case "$platformvalue" in
"Fluid")
start profiler_daemon;;
esac
;;
"msm8960")
case "$baseband" in
"msm")
start_battery_monitor;;
esac
if [ -f /sys/devices/soc0/hw_platform ]; then
platformvalue=`cat /sys/devices/soc0/hw_platform`
else
platformvalue=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
case "$platformvalue" in
"Fluid")
start profiler_daemon;;
"Liquid")
start profiler_daemon;;
esac
;;
"msm8974")
platformvalue=`cat /sys/devices/soc0/hw_platform`
case "$platformvalue" in
"Fluid")
start profiler_daemon;;
"Liquid")
start profiler_daemon;;
esac
case "$baseband" in
"msm")
start_battery_monitor
;;
esac
start_charger_monitor
;;
"sdm660")
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
else
hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
case "$soc_id" in
"317" | "324" | "325" | "326" | "318" | "327" )
case "$hw_platform" in
"Surf")
setprop qemu.hw.mainkeys 0
;;
"MTP")
setprop qemu.hw.mainkeys 0
;;
"RCM")
setprop qemu.hw.mainkeys 0
;;
"QRD")
setprop qemu.hw.mainkeys 0
;;
esac
;;
esac
start_msm_irqbalance660
;;
"apq8084")
platformvalue=`cat /sys/devices/soc0/hw_platform`
case "$platformvalue" in
"Fluid")
start profiler_daemon;;
"Liquid")
start profiler_daemon;;
esac
;;
"msm8226")
start_charger_monitor
;;
"msm8610")
start_charger_monitor
;;
"msm8916")
start_vm_bms
start_msm_irqbalance_8939
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
if [ -f /sys/devices/soc0/platform_subtype_id ]; then
platform_subtype_id=`cat /sys/devices/soc0/platform_subtype_id`
fi
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
fi
case "$soc_id" in
"239")
case "$hw_platform" in
"Surf")
case "$platform_subtype_id" in
"1")
setprop qemu.hw.mainkeys 0
;;
esac
;;
"MTP")
case "$platform_subtype_id" in
"3")
setprop qemu.hw.mainkeys 0
;;
esac
;;
esac
;;
esac
;;
"msm8994" | "msm8992" | "msm8998" | "apq8098_latv" | "sdm845")
start_msm_irqbalance
;;
"msm8996")
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
fi
case "$hw_platform" in
"MTP" | "CDP")
#Loop through the sysfs nodes and determine the correct sysfs to change the permission and ownership.
for count in 0 1 2 3 4 5 6 7 8 9 10
do
dir="/sys/devices/soc/75ba000.i2c/i2c-12/12-0020/input/input"$count
if [ -d "$dir" ]; then
chmod 0660 $dir/secure_touch_enable
chmod 0440 $dir/secure_touch
chown system.drmrpc $dir/secure_touch_enable
chown system.drmrpc $dir/secure_touch
break
fi
done
;;
esac
;;
"msm8909")
start_vm_bms
;;
"msm8952")
start_msm_irqbalance_8952
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
if [ -f /sys/devices/soc0/platform_subtype_id ]; then
platform_subtype_id=`cat /sys/devices/soc0/platform_subtype_id`
fi
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
fi
case "$soc_id" in
"264")
case "$hw_platform" in
"Surf")
case "$platform_subtype_id" in
"1" | "2")
setprop qemu.hw.mainkeys 0
;;
esac
;;
"MTP")
case "$platform_subtype_id" in
"3")
setprop qemu.hw.mainkeys 0
;;
esac
;;
"QRD")
case "$platform_subtype_id" in
"0")
setprop qemu.hw.mainkeys 0
;;
esac
;;
esac
;;
"266" | "274" | "277" | "278")
case "$hw_platform" in
"Surf" | "RCM")
if [ $panel_xres -eq 1440 ]; then
setprop qemu.hw.mainkeys 0
fi
;;
"MTP" | "QRD")
setprop qemu.hw.mainkeys 0
;;
esac
;;
esac
;;
"msm8937")
start_msm_irqbalance_8939
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
else
hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
case "$soc_id" in
"294" | "295" | "303" | "307" | "308" | "309" | "313" | "320")
case "$hw_platform" in
"Surf")
setprop qemu.hw.mainkeys 0
;;
"MTP")
setprop qemu.hw.mainkeys 0
;;
"RCM")
setprop qemu.hw.mainkeys 0
;;
"QRD")
setprop qemu.hw.mainkeys 0
;;
esac
;;
esac
;;
"msm8953")
start_msm_irqbalance_8939
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
else
hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform`
fi
case "$soc_id" in
"293" | "304" | "338" | "351" )
case "$hw_platform" in
"Surf")
setprop qemu.hw.mainkeys 0
;;
"MTP")
setprop qemu.hw.mainkeys 0
;;
"RCM")
setprop qemu.hw.mainkeys 0
;;
"QRD")
setprop qemu.hw.mainkeys 0
;;
esac
;;
esac
;;
esac
#
# Copy qcril.db if needed for RIL
#
start_copying_prebuilt_qcril_db
echo 1 > /data/vendor/radio/db_check_done
#
# Make modem config folder and copy firmware config to that folder for RIL
#
if [ -f /data/vendor/radio/ver_info.txt ]; then
prev_version_info=`cat /data/vendor/radio/ver_info.txt`
else
prev_version_info=""
fi
cur_version_info=`cat /firmware/verinfo/ver_info.txt`
if [ ! -f /firmware/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then
rm -rf /data/vendor/radio/modem_config
mkdir /data/vendor/radio/modem_config
chmod 770 /data/vendor/radio/modem_config
cp -r /firmware/image/modem_pr/mcfg/configs/* /data/vendor/radio/modem_config
chown -hR radio.radio /data/vendor/radio/modem_config
cp /firmware/verinfo/ver_info.txt /data/vendor/radio/ver_info.txt
chown radio.radio /data/vendor/radio/ver_info.txt
fi
cp /firmware/image/modem_pr/mbn_ota.txt /data/vendor/radio/modem_config
chown radio.radio /data/vendor/radio/modem_config/mbn_ota.txt
echo 1 > /data/vendor/radio/copy_complete
#check build variant for printk logging
#current default minimum boot-time-default
buildvariant=`getprop ro.build.type`
case "$buildvariant" in
"userdebug" | "eng")
#set default loglevel to KERN_INFO
echo "6 6 1 7" > /proc/sys/kernel/printk
;;
*)
#set default loglevel to KERN_WARNING
echo "4 4 1 4" > /proc/sys/kernel/printk
;;
esac

View file

@ -0,0 +1,80 @@
#! /vendor/bin/sh
# Copyright (c) 2012, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
target="$1"
serial="$2"
# No path is set up at this point so we have to do it here.
PATH=/sbin:/system/sbin:/system/bin:/system/xbin
export PATH
mount_needed=false;
if [ ! -f /system/etc/boot_fixup ];then
# This should be the first command
# remount system as read-write.
mount -o rw,remount,barrier=1 /system
mount_needed=true;
fi
# **** WARNING *****
# This runs in a single-threaded, critical path portion
# of the Android bootup sequence. This is to guarantee
# all necessary system partition fixups are done before
# the rest of the system starts up. Run any non-
# timing critical tasks in a separate process to
# prevent slowdown at boot.
# Run modem link script
if [ -f /system/etc/init.qcom.modem_links.sh ]; then
/system/vendor/bin/init.qcom.modem_links.sh
fi
# Run mdm link script
if [ -f /system/etc/init.qcom.mdm_links.sh ]; then
/system/vendor/bin/init.qcom.mdm_links.sh
fi
# Run wifi script
if [ -f /vendor/bin/init.qcom.wifi.sh ]; then
/vendor/bin/init.qcom.wifi.sh "$target" "$serial"
fi
# Run the sensor script
if [ -f /system/etc/init.qcom.sensor.sh ]; then
/system/vendor/bin/init.qcom.sensor.sh
fi
touch /system/etc/boot_fixup
if $mount_needed ;then
# This should be the last command
# remount system as read-only.
mount -o ro,remount,barrier=1 /system
fi

File diff suppressed because it is too large Load diff

392
rootdir/root/init.qcom.usb.sh Executable file
View file

@ -0,0 +1,392 @@
#!/vendor/bin/sh
# Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
chown -h root.system /sys/devices/platform/msm_hsusb/gadget/wakeup
chmod -h 220 /sys/devices/platform/msm_hsusb/gadget/wakeup
# Set platform variables
if [ -f /sys/devices/soc0/hw_platform ]; then
soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null
else
soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null
fi
if [ -f /sys/devices/soc0/machine ]; then
soc_machine=`cat /sys/devices/soc0/machine` 2> /dev/null
else
soc_machine=`cat /sys/devices/system/soc/soc0/machine` 2> /dev/null
fi
# Get hardware revision
if [ -f /sys/devices/soc0/revision ]; then
soc_revision=`cat /sys/devices/soc0/revision` 2> /dev/null
else
soc_revision=`cat /sys/devices/system/soc/soc0/revision` 2> /dev/null
fi
#
# Allow persistent usb charging disabling
# User needs to set usb charging disabled in persist.usb.chgdisabled
#
target=`getprop ro.board.platform`
usbchgdisabled=`getprop persist.usb.chgdisabled`
case "$usbchgdisabled" in
"") ;; #Do nothing here
* )
case $target in
"msm8660")
echo "$usbchgdisabled" > /sys/module/pmic8058_charger/parameters/disabled
echo "$usbchgdisabled" > /sys/module/smb137b/parameters/disabled
;;
"msm8960")
echo "$usbchgdisabled" > /sys/module/pm8921_charger/parameters/disabled
;;
esac
esac
usbcurrentlimit=`getprop persist.usb.currentlimit`
case "$usbcurrentlimit" in
"") ;; #Do nothing here
* )
case $target in
"msm8960")
echo "$usbcurrentlimit" > /sys/module/pm8921_charger/parameters/usb_max_current
;;
esac
esac
#
# Check ESOC for external MDM
#
# Note: currently only a single MDM is supported
#
if [ -d /sys/bus/esoc/devices ]; then
for f in /sys/bus/esoc/devices/*; do
if [ -d $f ]; then
if [ `grep "^MDM" $f/esoc_name` ]; then
esoc_link=`cat $f/esoc_link`
break
fi
fi
done
fi
target=`getprop ro.board.platform`
# soc_ids for 8937
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
#
# Allow USB enumeration with default PID/VID
#
baseband=`getprop ro.baseband`
echo 1 > /sys/class/android_usb/f_mass_storage/lun/nofua
usb_config=`getprop persist.sys.usb.config`
miui_release=`getprop ro.miui.ui.version.name`
miui_debuggable=`getprop ro.debuggable`
case "$usb_config" in
"" | "adb" | "none") #USB persist config not set, select default configuration
case "$esoc_link" in
"PCIe")
setprop persist.sys.usb.config diag,diag_mdm,serial_cdev,rmnet_qti_ether,mass_storage,adb
;;
*)
case "$baseband" in
"apq")
setprop persist.sys.usb.config diag,adb
;;
*)
case "$soc_hwplatform" in
"Dragon" | "SBC")
setprop persist.sys.usb.config diag,adb
;;
*)
soc_machine=${soc_machine:0:3}
case "$soc_machine" in
"SDA")
setprop persist.sys.usb.config diag,adb
;;
*)
case "$target" in
"msm8916")
setprop persist.sys.usb.config diag,serial_smd,rmnet_bam,adb
;;
"msm8994" | "msm8992")
setprop persist.sys.usb.config diag,serial_smd,serial_tty,rmnet_ipa,mass_storage,adb
;;
"msm8996")
setprop persist.sys.usb.config diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage,adb
;;
"msm8909")
setprop persist.sys.usb.config diag,serial_smd,rmnet_qti_bam,adb
;;
"msm8937")
case "$soc_id" in
"313" | "320")
setprop persist.sys.usb.config diag,serial_smd,rmnet_ipa,adb
;;
*)
setprop persist.sys.usb.config diag,serial_smd,rmnet_qti_bam,adb
;;
esac
;;
"msm8952" | "msm8953")
setprop persist.sys.usb.config diag,serial_smd,rmnet_ipa,adb
;;
"msm8998" | "sdm660" | "sdm636"| "apq8098_latv")
case "$miui_release" in
"")
case "$miui_debuggable" in
"1")
setprop persist.sys.usb.config diag,serial_cdev,rmnet,adb
;;
*)
setprop persist.sys.usb.config diag,serial_cdev,rmnet
;;
esac
;;
*)
case "$miui_debuggable" in
"1")
setprop persist.sys.usb.config adb
;;
*)
setprop persist.sys.usb.config none
;;
esac
;;
esac
;;
"sdm845")
setprop persist.sys.usb.config diag,serial_cdev,rmnet,dpl,adb
;;
*)
setprop persist.sys.usb.config diag,adb
;;
esac
;;
esac
;;
esac
;;
esac
;;
esac
;;
* ) ;; #USB persist config exists, do nothing
esac
# set USB controller's device node
case "$target" in
"msm8996")
setprop sys.usb.controller "6a00000.dwc3"
setprop sys.usb.rndis.func.name "rndis_bam"
setprop sys.usb.rmnet.func.name "rmnet_bam"
;;
"msm8998" | "apq8098_latv")
setprop sys.usb.controller "a800000.dwc3"
setprop sys.usb.rndis.func.name "gsi"
setprop sys.usb.rmnet.func.name "gsi"
;;
"sdm660")
setprop sys.usb.controller "a800000.dwc3"
setprop sys.usb.rndis.func.name "rndis_bam"
setprop sys.usb.rmnet.func.name "rmnet_bam"
echo 15916 > /sys/module/usb_f_qcrndis/parameters/rndis_dl_max_xfer_size
;;
"sdm845")
setprop sys.usb.controller "a600000.dwc3"
setprop sys.usb.rndis.func.name "gsi"
setprop sys.usb.rmnet.func.name "gsi"
;;
*)
;;
esac
# check configfs is mounted or not
if [ -d /config/usb_gadget ]; then
# Chip-serial is used for unique MSM identification in Product string
msm_serial=`cat /sys/devices/soc0/serial_number`;
msm_serial_hex=`printf %08X $msm_serial`
machine_type=`cat /sys/devices/soc0/machine`
product_string="$machine_type-$soc_hwplatform _SN:$msm_serial_hex"
echo "$product_string" > /config/usb_gadget/g1/strings/0x409/product
# ADB requires valid iSerialNumber; if ro.serialno is missing, use dummy
serialnumber=`cat /config/usb_gadget/g1/strings/0x409/serialnumber` 2> /dev/null
if [ "$serialnumber" == "" ]; then
serialno=1234567
echo $serialno > /config/usb_gadget/g1/strings/0x409/serialnumber
fi
persist_comp=`getprop persist.sys.usb.config`
comp=`getprop sys.usb.config`
echo $persist_comp
echo $comp
if [ "$comp" != "$persist_comp" ]; then
echo "setting sys.usb.config"
setprop sys.usb.config $persist_comp
fi
setprop sys.usb.configfs 1
else
persist_comp=`getprop persist.sys.usb.config`
comp=`getprop sys.usb.config`
echo $persist_comp
echo $comp
if [ "$comp" != "$persist_comp" ]; then
echo "setting sys.usb.config"
setprop sys.usb.config $persist_comp
fi
fi
#
# Do target specific things
#
case "$target" in
"msm8974")
# Select USB BAM - 2.0 or 3.0
echo ssusb > /sys/bus/platform/devices/usb_bam/enable
;;
"apq8084")
if [ "$baseband" == "apq" ]; then
echo "msm_hsic_host" > /sys/bus/platform/drivers/xhci_msm_hsic/unbind
fi
;;
"msm8226")
if [ -e /sys/bus/platform/drivers/msm_hsic_host ]; then
if [ ! -L /sys/bus/usb/devices/1-1 ]; then
echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind
fi
fi
;;
"msm8994" | "msm8992" | "msm8996" | "msm8953")
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports
echo 131072 > /sys/module/g_android/parameters/mtp_tx_req_len
echo 131072 > /sys/module/g_android/parameters/mtp_rx_req_len
;;
"msm8937")
case "$soc_id" in
"313" | "320")
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports
;;
esac
;;
esac
#
# set module params for embedded rmnet devices
#
rmnetmux=`getprop persist.rmnet.mux`
case "$baseband" in
"mdm" | "dsda" | "sglte2")
case "$rmnetmux" in
"enabled")
echo 1 > /sys/module/rmnet_usb/parameters/mux_enabled
echo 8 > /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links
echo 17 > /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev
;;
esac
echo 1 > /sys/module/rmnet_usb/parameters/rmnet_data_init
# Allow QMUX daemon to assign port open wait time
chown -h radio.radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait
;;
"dsda2")
echo 2 > /sys/module/rmnet_usb/parameters/no_rmnet_devs
echo hsicctl,hsusbctl > /sys/module/rmnet_usb/parameters/rmnet_dev_names
case "$rmnetmux" in
"enabled") #mux is neabled on both mdms
echo 3 > /sys/module/rmnet_usb/parameters/mux_enabled
echo 8 > /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links
echo 17 > write /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev
;;
"enabled_hsic") #mux is enabled on hsic mdm
echo 1 > /sys/module/rmnet_usb/parameters/mux_enabled
echo 8 > /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links
echo 17 > /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev
;;
"enabled_hsusb") #mux is enabled on hsusb mdm
echo 2 > /sys/module/rmnet_usb/parameters/mux_enabled
echo 8 > /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links
echo 17 > /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev
;;
esac
echo 1 > /sys/module/rmnet_usb/parameters/rmnet_data_init
# Allow QMUX daemon to assign port open wait time
chown -h radio.radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait
;;
esac
#
# Add support for exposing lun0 as cdrom in mass-storage
#
cdromname="/system/etc/cdrom_install.iso"
platformver=`cat /sys/devices/soc0/hw_platform`
case "$target" in
"msm8226" | "msm8610" | "msm8916")
case $platformver in
"QRD")
echo "mounting usbcdrom lun"
echo $cdromname > /sys/class/android_usb/android0/f_mass_storage/rom/file
chmod 0444 /sys/class/android_usb/android0/f_mass_storage/rom/file
;;
esac
;;
esac
#
# Initialize RNDIS Diag option. If unset, set it to 'none'.
#
diag_extra=`getprop persist.sys.usb.config.extra`
if [ "$diag_extra" == "" ]; then
setprop persist.sys.usb.config.extra none
fi
# soc_ids for 8937
if [ -f /sys/devices/soc0/soc_id ]; then
soc_id=`cat /sys/devices/soc0/soc_id`
else
soc_id=`cat /sys/devices/system/soc/soc0/id`
fi
# enable rps cpus on msm8937 target
setprop sys.usb.rps_mask 0
case "$soc_id" in
"294" | "295")
setprop sys.usb.rps_mask 40
;;
esac

505
rootdir/root/init.qcom.wifi.sh Executable file
View file

@ -0,0 +1,505 @@
#! /vendor/bin/sh
# Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# This script will load and unload the wifi driver to put the wifi in
# in deep sleep mode so that there won't be voltage leakage.
# Loading/Unloading the driver only incase if the Wifi GUI is not going
# to Turn ON the Wifi. In the Script if the wlan driver status is
# ok(GUI loaded the driver) or loading(GUI is loading the driver) then
# the script won't do anything. Otherwise (GUI is not going to Turn On
# the Wifi) the script will load/unload the driver
# This script will get called after post bootup.
target="$1"
serialno="$2"
btsoc=""
# No path is set up at this point so we have to do it here.
PATH=/sbin:/system/sbin:/system/bin:/system/xbin
export PATH
# Trigger WCNSS platform driver
trigger_wcnss()
{
# We need to trigger WCNSS platform driver, WCNSS driver
# will export a file which we must touch so that the
# driver knows that userspace is ready to handle firmware
# download requests.
# See if an appropriately named device file is present
wcnssnode=`ls /dev/wcnss*`
case "$wcnssnode" in
*wcnss*)
# Before triggering wcnss, let it know that
# caldata is available at userspace.
if [ -e /data/misc/wifi/WCNSS_qcom_wlan_cal.bin ]; then
calparm=`ls /sys/module/wcnsscore/parameters/has_calibrated_data`
if [ -e $calparm ] && [ ! -e /data/misc/wifi/WCN_FACTORY ]; then
echo 1 > $calparm
fi
fi
# There is a device file. Write to the file
# so that the driver knows userspace is
# available for firmware download requests
echo 1 > $wcnssnode
;;
*)
# There is not a device file present, so
# the driver must not be available
echo "No WCNSS device node detected"
;;
esac
# Plumb down the device serial number
if [ -f /sys/devices/*wcnss-wlan/serial_number ]; then
cd /sys/devices/*wcnss-wlan
echo $serialno > serial_number
cd /
elif [ -f /sys/devices/platform/wcnss_wlan.0/serial_number ]; then
echo $serialno > /sys/devices/platform/wcnss_wlan.0/serial_number
fi
}
case "$target" in
msm8974* | msm8226* | msm8610*)
# Check whether device is plugged on the HSIC bus
# Currently HSIC bus will be the first index
if [ -e /sys/bus/platform/drivers/msm_hsic_host ]; then
if [ ! -L /sys/bus/usb/devices/1-1 ]; then
echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind
fi
chown -h system.system /sys/bus/platform/drivers/msm_hsic_host/bind
chown -h system.system /sys/bus/platform/drivers/msm_hsic_host/unbind
chmod -h 0200 /sys/bus/platform/drivers/msm_hsic_host/bind
chmod -h 0200 /sys/bus/platform/drivers/msm_hsic_host/unbind
fi
wlanchip=""
# force ar6004 is ar6004_wlan.conf existed.
if [ -f /system/etc/firmware/ath6k/AR6004/ar6004_wlan.conf ]; then
wlanchip=`cat /system/etc/firmware/ath6k/AR6004/ar6004_wlan.conf`
fi
# auto detect ar6004-sdio card
# for ar6004-sdio card, the vendor id and device id is as the following
# vendor id device id
# 0x0271 0x0400
# 0x0271 0x0401
if [ "$wlanchip" == "" ]; then
sdio_vendors=`echo \`cat /sys/bus/mmc/devices/*/*/vendor\``
sdio_devices=`echo \`cat /sys/bus/mmc/devices/*/*/device\``
ven_idx=0
for vendor in $sdio_vendors; do
case "$vendor" in
"0x0271")
dev_idx=0
for device in $sdio_devices; do
if [ $ven_idx -eq $dev_idx ]; then
case "$device" in
"0x0400" | "0x0401" | "0x0402")
wlanchip="AR6004-SDIO"
;;
*)
;;
esac
fi
dev_idx=$(( $dev_idx + 1))
done
;;
*)
;;
esac
ven_idx=$(( $ven_idx + 1))
done
# auto detect ar6004-sdio card end
fi
# for ar6004-usb card, the vendor id and device id is as the following
# vendor id product id
# 0x0cf3 0x9374
# 0x0cf3 0x9372
if [ "$wlanchip" == "" ]; then
usb_vendors=`echo \`cat /sys/bus/usb/devices/*/*/idVendor\``
usb_products=`echo \`cat /sys/bus/usb/devices/*/*/idProduct\``
ven_idx=0
for vendor in $usb_vendors; do
case "$vendor" in
"0cf3")
dev_idx=0
for product in $usb_products; do
if [ $ven_idx -eq $dev_idx ]; then
case "$product" in
"9374" | "9372")
wlanchip="AR6004-USB"
;;
*)
;;
esac
fi
dev_idx=$(( $dev_idx + 1))
done
;;
*)
;;
esac
ven_idx=$(( $ven_idx + 1))
done
# auto detect ar6004-usb card end
fi
echo "The WLAN Chip ID is $wlanchip"
case "$wlanchip" in
"AR6004-USB")
echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind
setprop wlan.driver.ath 2
setprop qcom.bluetooth.soc ath3k
btsoc="ath3k"
rm /system/lib/modules/wlan.ko
ln -s /system/lib/modules/ath6kl-3.5/ath6kl_usb.ko \
/system/lib/modules/wlan.ko
rm /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
rm /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin_usb \
/system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin_usb \
/system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
rm /system/etc/firmware/ath6k/AR6004/hw3.0/bdata.bin
ln -s /system/etc/firmware/ath6k/AR6004/hw3.0/bdata.bin_usb \
/system/etc/firmware/ath6k/AR6004/hw3.0/bdata.bin
# Use different wpa_supplicant.conf template between wcn driver
# and ath6kl driver
rm /system/etc/wifi/wpa_supplicant.conf
ln -s /system/etc/wifi/wpa_supplicant_ath6kl.conf \
/system/etc/wifi/wpa_supplicant.conf
;;
"AR6004-SDIO")
setprop wlan.driver.ath 2
setprop qcom.bluetooth.soc ath3k
btsoc="ath3k"
# Chown polling nodes as needed from UI running on system server
chmod -h 0200 /sys/devices/msm_sdcc.1/polling
chmod -h 0200 /sys/devices/msm_sdcc.2/polling
chmod -h 0200 /sys/devices/msm_sdcc.3/polling
chmod -h 0200 /sys/devices/msm_sdcc.4/polling
chown -h system.system /sys/devices/msm_sdcc.1/polling
chown -h system.system /sys/devices/msm_sdcc.2/polling
chown -h system.system /sys/devices/msm_sdcc.3/polling
chown -h system.system /sys/devices/msm_sdcc.4/polling
rm /system/lib/modules/wlan.ko
ln -s /system/lib/modules/ath6kl-3.5/ath6kl_sdio.ko \
/system/lib/modules/wlan.ko
rm /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
rm /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin_sdio \
/system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin_sdio \
/system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
rm /system/etc/firmware/ath6k/AR6004/hw3.0/bdata.bin
ln -s /system/etc/firmware/ath6k/AR6004/hw3.0/bdata.bin_sdio \
/system/etc/firmware/ath6k/AR6004/hw3.0/bdata.bin
# Use different wpa_supplicant.conf template between wcn driver
# and ath6kl driver
rm /system/etc/wifi/wpa_supplicant.conf
ln -s /system/etc/wifi/wpa_supplicant_ath6kl.conf \
/system/etc/wifi/wpa_supplicant.conf
;;
*)
echo "*** WI-FI chip ID is not specified in /persist/wlan_chip_id **"
echo "*** Use the default WCN driver. **"
setprop wlan.driver.ath 0
rm /system/lib/modules/wlan.ko
ln -s /system/lib/modules/pronto/pronto_wlan.ko \
/system/lib/modules/wlan.ko
# Populate the writable driver configuration file
if [ ! -s /data/misc/wifi/WCNSS_qcom_cfg.ini ]; then
cp /system/etc/wifi/WCNSS_qcom_cfg.ini \
/data/misc/wifi/WCNSS_qcom_cfg.ini
chown -h system:wifi /data/misc/wifi/WCNSS_qcom_cfg.ini
chmod -h 660 /data/misc/wifi/WCNSS_qcom_cfg.ini
fi
# The property below is used in Qcom SDK for softap to determine
# the wifi driver config file
setprop wlan.driver.config /data/misc/wifi/WCNSS_qcom_cfg.ini
# Use different wpa_supplicant.conf template between wcn driver
# and ath6kl driver
rm /system/etc/wifi/wpa_supplicant.conf
ln -s /system/etc/wifi/wpa_supplicant_wcn.conf \
/system/etc/wifi/wpa_supplicant.conf
# Trigger WCNSS platform driver
trigger_wcnss &
;;
esac
;;
apq8084*)
echo "*** Use the CNSS CLD driver.**"
setprop wlan.driver.ath 0
# Use different wpa_supplicant.conf template between wcn driver
# and ath6kl driver
rm /system/etc/wifi/wpa_supplicant.conf
ln -s /system/etc/wifi/wpa_supplicant_wcn.conf \
/system/etc/wifi/wpa_supplicant.conf
;;
msm8960*)
# Move cfg80211.ko to prima directory, the default cfg80211.ko is
# for wcnss solution
if [ ! -L /system/lib/modules/cfg80211.ko ]; then
mv /system/lib/modules/cfg80211.ko /system/lib/modules/prima/
fi
wlanchip=""
if [ -f /system/etc/firmware/ath6k/AR6004/ar6004_wlan.conf ]; then
wlanchip=`cat /system/etc/firmware/ath6k/AR6004/ar6004_wlan.conf`
fi
if [ "$wlanchip" == "" ]; then
# auto detect ar6004-usb card
# for ar6004-usb card, the vendor id and device id is as the following
# vendor id product id
# 0x0cf3 0x9374
# 0x0cf3 0x9372
usb_vendors=`echo \`cat /sys/bus/usb/devices/*/*/idVendor\``
usb_products=`echo \`cat /sys/bus/usb/devices/*/*/idProduct\``
ven_idx=0
for vendor in $usb_vendors; do
case "$vendor" in
"0cf3")
dev_idx=0
for product in $usb_products; do
if [ $ven_idx -eq $dev_idx ]; then
case "$product" in
"9374" | "9372")
wlanchip="AR6004-USB"
;;
*)
;;
esac
fi
dev_idx=$(( $dev_idx + 1))
done
;;
*)
;;
esac
ven_idx=$(( $ven_idx + 1))
done
# auto detect ar6004-usb card end
fi
if [ "$wlanchip" == "" ]; then
# auto detect ar6004-sdio card
# for ar6004-sdio card, the vendor id and device id is
# as the following
# vendor id device id
# 0x0271 0x0400
# 0x0271 0x0401
sdio_vendors=`echo \`cat /sys/bus/mmc/devices/*/*/vendor\``
sdio_devices=`echo \`cat /sys/bus/mmc/devices/*/*/device\``
ven_idx=0
for vendor in $sdio_vendors; do
case "$vendor" in
"0x0271")
dev_idx=0
for device in $sdio_devices; do
if [ $ven_idx -eq $dev_idx ]; then
case "$device" in
"0x0400" | "0x0401")
wlanchip="AR6004-SDIO"
;;
*)
;;
esac
fi
dev_idx=$(( $dev_idx + 1))
done
;;
*)
;;
esac
ven_idx=$(( $ven_idx + 1))
done
# auto detect ar6004-sdio card end
fi
echo "The WLAN Chip ID is $wlanchip"
case "$wlanchip" in
"AR6004-USB")
setprop wlan.driver.ath 2
rm /system/lib/modules/wlan.ko
rm /system/lib/modules/cfg80211.ko
ln -s /system/lib/modules/ath6kl-3.5/ath6kl_usb.ko \
/system/lib/modules/wlan.ko
ln -s /system/lib/modules/ath6kl-3.5/cfg80211.ko \
/system/lib/modules/cfg80211.ko
rm /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
rm /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin_usb \
/system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin_usb \
/system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
# Use different wpa_supplicant.conf template between wcn driver
# and ath6kl driver
rm /system/etc/wifi/wpa_supplicant.conf
ln -s /system/etc/wifi/wpa_supplicant_ath6kl.conf \
/system/etc/wifi/wpa_supplicant.conf
;;
"AR6004-SDIO")
setprop wlan.driver.ath 2
setprop qcom.bluetooth.soc ath3k
btsoc="ath3k"
rm /system/lib/modules/wlan.ko
rm /system/lib/modules/cfg80211.ko
ln -s /system/lib/modules/ath6kl-3.5/ath6kl_sdio.ko \
/system/lib/modules/wlan.ko
ln -s /system/lib/modules/ath6kl-3.5/cfg80211.ko \
/system/lib/modules/cfg80211.ko
rm /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
rm /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin_sdio \
/system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin_sdio \
/system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
# Use different wpa_supplicant.conf template between wcn driver
# and ath6kl driver
rm /system/etc/wifi/wpa_supplicant.conf
ln -s /system/etc/wifi/wpa_supplicant_ath6kl.conf \
/system/etc/wifi/wpa_supplicant.conf
;;
*)
echo "*** WI-FI chip ID is not specified in /persist/wlan_chip_id **"
echo "*** Use the default WCN driver. **"
setprop wlan.driver.ath 0
rm /system/lib/modules/wlan.ko
rm /system/lib/modules/cfg80211.ko
ln -s /system/lib/modules/prima/prima_wlan.ko \
/system/lib/modules/wlan.ko
ln -s /system/lib/modules/prima/cfg80211.ko \
/system/lib/modules/cfg80211.ko
# The property below is used in Qcom SDK for softap to determine
# the wifi driver config file
setprop wlan.driver.config /data/misc/wifi/WCNSS_qcom_cfg.ini
# Use different wpa_supplicant.conf template between wcn driver
# and ath6kl driver
rm /system/etc/wifi/wpa_supplicant.conf
ln -s /system/etc/wifi/wpa_supplicant_wcn.conf \
/system/etc/wifi/wpa_supplicant.conf
# Trigger WCNSS platform driver
trigger_wcnss &
;;
esac
;;
msm7627a*)
# The default cfg80211 module is for volans
if [ ! -L /system/lib/modules/cfg80211.ko ]; then
mv /system/lib/modules/cfg80211.ko /system/lib/modules/volans/
fi
wlanchip=`cat /persist/wlan_chip_id`
echo "The WLAN Chip ID is $wlanchip"
case "$wlanchip" in
"ATH6KL")
setprop wlan.driver.ath 1
rm /system/lib/modules/wlan.ko
rm /system/lib/modules/cfg80211.ko
ln -s /system/lib/modules/ath6kl/ath6kl_sdio.ko \
/system/lib/modules/wlan.ko
ln -s /system/lib/modules/ath6kl/cfg80211.ko \
/system/lib/modules/cfg80211.ko
;;
"WCN1314")
setprop wlan.driver.ath 0
rm /system/lib/modules/wlan.ko
rm /system/lib/modules/cfg80211.ko
ln -s /system/lib/modules/volans/WCN1314_rf.ko \
/system/lib/modules/wlan.ko
ln -s /system/lib/modules/volans/cfg80211.ko \
/system/lib/modules/cfg80211.ko
;;
*)
setprop wlan.driver.ath 1
rm /system/lib/modules/wlan.ko
rm /system/lib/modules/cfg80211.ko
ln -s /system/lib/modules/ath6kl/ath6kl_sdio.ko \
/system/lib/modules/wlan.ko
ln -s /system/lib/modules/ath6kl/cfg80211.ko \
/system/lib/modules/cfg80211.ko
echo "************************************************************"
echo "*** Error:WI-FI chip ID is not specified in"
echo "/persist/wlan_chip_id"
echo "******* WI-FI may not work ***************************"
;;
esac
;;
msm7627*)
ln -s /data/hostapd/qcom_cfg.ini /etc/firmware/wlan/qcom_cfg.ini
ln -s /persist/qcom_wlan_nv.bin /etc/firmware/wlan/qcom_wlan_nv.bin
;;
msm8660*)
;;
msm7630*)
;;
*)
;;
esac

90
rootdir/root/init.qti.fm.sh Executable file
View file

@ -0,0 +1,90 @@
#!/vendor/bin/sh
# Copyright (c) 2009-2011, 2015, 2017 The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
setprop hw.fm.init 0
mode=`getprop hw.fm.mode`
version=199217
LOG_TAG="qti-fm"
LOG_NAME="${0}:"
loge ()
{
/vendor/bin/log -t $LOG_TAG -p e "$LOG_NAME $@"
}
logi ()
{
/vendor/bin/log -t $LOG_TAG -p i "$LOG_NAME $@"
}
failed ()
{
loge "$1: exit code $2"
exit $2
}
logi "In FM shell Script"
logi "mode: $mode"
logi "Version : $version"
#$fm_qsoc_patches <fm_chipVersion> <enable/disable WCM>
#
case $mode in
"normal")
logi "inserting the radio transport module"
echo 1 > /sys/module/radio_iris_transport/parameters/fmsmd_set
/vendor/bin/fm_qsoc_patches $version 0
;;
"wa_enable")
/vendor/bin/fm_qsoc_patches $version 1
;;
"wa_disable")
/vendor/bin/fm_qsoc_patches $version 2
;;
*)
logi "Shell: Default case"
/vendor/bin/fm_qsoc_patches $version 0
;;
esac
exit_code_fm_qsoc_patches=$?
case $exit_code_fm_qsoc_patches in
0)
logi "FM QSoC calibration and firmware download succeeded"
;;
*)
failed "FM QSoC firmware download and/or calibration failed" $exit_code_fm_qsoc_patches
;;
esac
setprop hw.fm.init 1
exit 0

57
rootdir/root/init.qti.ims.sh Executable file
View file

@ -0,0 +1,57 @@
#! /vendor/bin/sh
# Copyright (c) 2014, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
dir0=/data
trigger_file=$dir0/ims_diabled
ims_disabled=`getprop persist.ims.disabled`
target=`getprop ro.build.product`
#if [ ! -e $trigger_file ]; then
# for future use in doing conditional debugging
#else
#
#fi
echo "$ims_disabled"
echo "$target"
if [ "$ims_disabled" = "0" ]; then
echo "ims will be enabled"
setprop service.qti.ims.enabled 1
exit
fi
if [ "$ims_disabled" = "1" ] || [ "$target" = "msm8909_512" ]; then
echo "ims is disabled"
setprop service.qti.ims.enabled 0
else
echo "ims is enabled"
setprop service.qti.ims.enabled 1
fi

692
rootdir/root/init.target.rc Normal file
View file

@ -0,0 +1,692 @@
# Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
on early-init
mkdir /firmware 0771 system system
mkdir /bt_firmware 0771 system system
mkdir /dsp 0771 media media
on init
write /dev/stune/foreground/schedtune.sched_boost_no_override 1
write /dev/stune/top-app/schedtune.sched_boost_no_override 1
write /dev/stune/schedtune.colocate 0
write /dev/stune/background/schedtune.colocate 0
write /dev/stune/system-background/schedtune.colocate 0
write /dev/stune/foreground/schedtune.colocate 0
write /dev/stune/top-app/schedtune.colocate 1
mkdir /cust 0771 system system
on fs
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
mount_all /vendor/etc/fstab.qcom
swapon_all /vendor/etc/fstab.qcom
# Keeping following partitions outside fstab file. As user may not have
# these partition flashed on the device. Failure to mount any partition in fstab file
# results in failure to launch late-start class.
mkdir /persist/data 0700 system system
mkdir /persist/bms 0700 root system
restorecon_recursive /persist
restorecon_recursive /persistbak
write /sys/kernel/boot_adsp/boot 1
chown system system /dev/goodix_fp
#chmod 0644 /dev/goodix_fp
on post-fs
start qseecomd
exec - system system -- /vendor/bin/init.qti.qseecomd.sh
write /dev/ipa 1
# We chown/chmod /cust again so because mount is run as root + defaults
chown system system /cust
chmod 0771 /cust
# We restorecon /cust in case the cust partition has been reset.
restorecon_recursive /cust
# create the lost+found directories, so as to enforce our permissions
mkdir /cust/lost+found 0770 root root
on init
write /sys/module/qpnp_rtc/parameters/poweron_alarm 1
on post-fs-data
mkdir /data/tombstones/modem 0771 system system
mkdir /data/tombstones/lpass 0771 system system
mkdir /data/tombstones/wcnss 0771 system system
mkdir /data/tombstones/dsps 0771 system system
mkdir /data/vendor/hbtp 0750 system system
mkdir /persist/qti_fp 0700 system system
mkdir /data/misc/seemp 0700 system system
mkdir /data/misc/tloc 0700 system drmrpc
start pa-cal-load
on boot
start rmt_storage
start rfs_access
write /dev/cpuset/top-app/cpus 0-7
write /dev/cpuset/foreground/cpus 0-7
write /dev/cpuset/foreground/boost/cpus 0-7
write /dev/cpuset/background/cpus 0-7
write /dev/cpuset/system-background/cpus 0-7
####Regionalization config and prop files####
chmod 0644 /persist/speccfg/spec
chmod 0644 /persist/speccfg/devicetype
chmod 0644 /persist/speccfg/mbnversion
chmod 0644 /persist/speccfg/.not_triggered
chmod 0644 /persist/speccfg/vendor_ro.prop
chmod 0644 /persist/speccfg/vendor_persist.prop
chmod 0644 /persist/speccfg/submask
chmod 0644 /persist/speccfg/partition
chown system system /persist/speccfg/spec
chown system system /persist/speccfg/devicetype
chown system system /persist/speccfg/mbnversion
chown system system /persist/speccfg/.not_triggered
chown system system /persist/speccfg/vendor_ro.prop
chown system system /persist/speccfg/vendor_persist.prop
chown system system /persist/speccfg/submask
chown system system /persist/speccfg/partition
# Touchscreen
chown system system /sys/class/input/input2/wake_gesture
#Load WLAN driver
insmod /vendor/lib/modules/wlan.ko
setprop wlan.driver.status "ok"
#Peripheral manager
service per_mgr /system/vendor/bin/pm-service
class core
user system
group system
ioprio rt 4
service per_proxy /system/vendor/bin/pm-proxy
class core
user system
group system
disabled
on property:init.svc.per_mgr=running
start per_proxy
on property:sys.shutdown.requested=*
stop per_proxy
#start camera server as daemon
#service qcamerasvr /system/bin/mm-qcamera-daemon
# class late_start
# user camera
# group camera system inet input graphics
## import cne init file
#on post-fs
# export LD_PRELOAD /vendor/lib/libNimsWrap.so
#
## Allow usb charging to be disabled peristently
#on property:persist.usb.chgdisabled=1
# write /sys/class/power_supply/battery/charging_enabled 0
#
#on property:persist.usb.chgdisabled=0
# write /sys/class/power_supply/battery/charging_enabled 1
#
#service qrngd /system/bin/qrngd -f
# class main
# user root
# group root
#
#service qrngp /system/bin/qrngp
# class main
# user root
# group root
# oneshot
# disabled
#
#on property:sys.boot_completed=1
# start qrngp
#
service qseecomd /vendor/bin/qseecomd
class core
user root
group root
#service mpdecision /system/vendor/bin/mpdecision --avg_comp
# user root
# disabled
#
#service qosmgrd /system/bin/qosmgr /system/etc/qosmgr_rules.xml
# user system
# group systemcu
# disabled
#
service thermal-engine /system/vendor/bin/thermal-engine
class main
user root
socket thermal-send-client stream 0666 system system
socket thermal-recv-client stream 0660 system system
socket thermal-recv-passive-client stream 0666 system system
socket thermal-send-rule stream 0660 system system
group root
#service security-check1 /sbin/security_boot_check system
# class core
# oneshot
#
#service security-check2 /sbin/security_boot_check recovery
# class core
# oneshot
#
service time_daemon /system/vendor/bin/time_daemon
class late_start
user root
group root
service adsprpcd_root /system/bin/adsprpcd
class main
user media
group media
service adsprpcd /system/vendor/bin/adsprpcd audiopd
class main
user media
group media
service hbtp /system/vendor/bin/hbtp_daemon
class main
user system
group system
disabled
service audiod /system/vendor/bin/audiod
class late_start
user system
group system
#
#service usf_tester /system/vendor/bin/usf_tester
# user system
# group system inet
# disabled
#
#service usf_epos /system/vendor/bin/usf_epos
# user system
# group system inet
# disabled
#
#service usf_gesture /system/vendor/bin/usf_gesture
# user system
# group system inet
# disabled
#
#service usf_sync_gesture /system/vendor/bin/usf_sync_gesture
# user system
# group system inet
# disabled
#
#service usf_p2p /system/vendor/bin/usf_p2p
# user system
# group system inet
# disabled
#
#service usf_hovering /system/vendor/bin/usf_hovering
# user system
# group system inet
# disabled
#
#service usf_proximity /system/vendor/bin/usf_proximity
# user system
# group system inet
# disabled
#
#service usf-post-boot /system/vendor/bin/sh /system/etc/usf_post_boot.sh
# class late_start
# user root
# disabled
# oneshot
#
#on property:init.svc.bootanim=stopped
# start usf-post-boot
#
#
#on boot
# insmod /system/lib/modules/adsprpc.ko
# insmod /system/lib/modules/mhi.ko
## access permission for secure touch
# chmod 0660 /sys/devices/f9966000.i2c/i2c-1/1-004a/secure_touch_enable
# chmod 0440 /sys/devices/f9966000.i2c/i2c-1/1-004a/secure_touch
# chmod 0660 /sys/devices/f9966000.i2c/i2c-1/1-0020/secure_touch_enable
# chmod 0440 /sys/devices/f9966000.i2c/i2c-1/1-0020/secure_touch
# chown system drmrpc /sys/devices/f9966000.i2c/i2c-1/1-004a/secure_touch_enable
# chown system drmrpc /sys/devices/f9966000.i2c/i2c-1/1-004a/secure_touch
# chown system drmrpc /sys/devices/f9966000.i2c/i2c-1/1-0020/secure_touch_enable
# chown system drmrpc /sys/devices/f9966000.i2c/i2c-1/1-0020/secure_touch
#
#
service imsqmidaemon /system/vendor/bin/imsqmidaemon
class main
user system
socket ims_qmid stream 0660 system radio
group radio log diag
service imsdatadaemon /system/vendor/bin/imsdatadaemon
class main
user system
socket ims_datad stream 0660 system radio
group system wifi radio inet log diag
disabled
#
#service mdm_helper /system/bin/mdm_helper
# class core
# onrestart setprop ro.service.mdm_helper_restarted "true"
# disabled
#
#service mdm_helper_proxy /system/bin/mdm_helper_proxy
# class core
# disabled
#
#service mdm_launcher /system/bin/sh /init.mdm.sh
# class main
# oneshot
#
#service qcamerasvr /system/bin/mm-qcamera-daemon
# class late_start
# user camera
# group camera system inet input graphics
#
# Stop mdm_helper_proxy in case of shutdown
#on property:sys.shutdown.requested=*
# stop mdm_helper_proxy
#
# Stop mdm_helper_proxy on APQ target
#on property:ro.radio.noril=yes
# stop mdm_helper_proxy
#
#on property:persist.airplane.mode.pwr.svg=enabled
# setprop ro.mdm_helper_proxy_req false
#
#on property:init.svc.ril-daemon=running
# setprop ro.mdm_helper_proxy_req true
#
## Start mdm_helper_proxy
#on property:ro.mdm_helper_proxy_req=true
# start mdm_helper_proxy
#
## QCA1530 SoC core detect
#service gnss-detect /system/vendor/bin/gnss.qca1530.sh detect
# class core
# oneshot
service energy-awareness /system/vendor/bin/energy-awareness
class main
user system
group system
oneshot
service mdtpd /system/vendor/bin/mdtpd
class late_start
user root
group system radio drmrpc
service pd_mapper /system/vendor/bin/pd-mapper
class core
#
## QCA1530 SoC late_start group trigger
#service gnss-init /system/vendor/bin/gnss.qca1530.sh init
# class late_start
# oneshot
#
## QCA1530 SoC Service Daemon
#service gnss-svcd /system/vendor/bin/gnss.qca1530.sh start
# class late_start
# user root
# group gps system qcom_diag diag log inet net_raw
# disabled
on property:vendor.ims.QMI_DAEMON_STATUS=1
start imsdatadaemon
service ims_rtp_daemon /system/vendor/bin/ims_rtp_daemon
class main
user system
group radio diag inet log
disabled
service vendor.imsrcsservice /system/vendor/bin/imsrcsd
class main
user system
group radio diag inet log
disabled
# add for HMI_L8866_A01-502: begin
on property:vendor.ims.DATA_DAEMON_STATUS=1
start ims_rtp_daemon
start vendor.imsrcsservice
setprop persist.rcs.supported 0
# add for HMI_L8866_A01-502: end
service ppd /system/vendor/bin/mm-pp-dpps
class late_start
user system
group system graphics
socket pps stream 0660 system system
disabled
on property:init.svc.surfaceflinger=stopped
stop ppd
on property:init.svc.surfaceflinger=running
start ppd
on property:init.svc.surfaceflinger=restarting
stop ppd
on property:init.svc.zygote=stopped
stop ppd
on property:init.svc.zygote=running
start ppd
on property:init.svc.zygote=restarting
stop ppd
on charger
load_system_props
start qcom-post-boot
start hvdcp_opti
setprop sys.usb.configfs 1
start power_off_alarm
#
#service nqs /system/bin/nqs
# class late_start
# socket nqs_qsb_comm stream 660 system system
# user system
# group drmrpc
#
#service adsprpcd /system/vendor/bin/adsprpcd
# class main
# user media
# group media
#
##Start picture quality tuning service
#service vqttoolservice /system/bin/vqttoolservice
# class late_start
# socket vqtss stream 0660 system system
# user system
# group system
service seempd /system/bin/seempd
class late_start
user system
group system sdcard_rw
socket seempdw dgram 0666 system system
service qfp-daemon /vendor/bin/qfp-daemon
class late_start
user system
group system drmrpc diag input
service tlocd /system/bin/tloc_daemon
class late_start
user system
group drmrpc
service hvdcp_opti /system/vendor/bin/hvdcp_opti
class main
user root
group system wakelock
service smcinvoked /system/bin/smcinvoked
class main
user system
group system
# smart pa cal tsx 08/26
service pa-cal-load /system/vendor/bin/smart-pa-cal -load
user root
group root
disabled
oneshot
# smart pa cal tsx 08/26
service smart-pa-cal /system/vendor/bin/smart-pa-cal -t 25 -c /system/vendor/etc/speaker.ftcfg -v -u
user root
group root
disabled
oneshot
on property:sys.pa-cal=0
stop smart-pa-cal
on property:sys.pa-cal=1
start smart-pa-cal
# audio loopback test begin tsx 08/26
service loopback_spk1 /system/vendor/bin/loopback.sh 1 1
user root
group root
disabled
oneshot
service loopback_spk0 /system/vendor/bin/loopback.sh 1 0
user root
group root
disabled
oneshot
service loopback_rec1 /system/vendor/bin/loopback.sh 2 1
user root
group root
disabled
oneshot
service loopback_rec0 /system/vendor/bin/loopback.sh 2 0
user root
group root
disabled
oneshot
service loopback_hand1 /system/vendor/bin/loopback.sh 3 1
user root
group root
disabled
oneshot
service loopback_hand0 /system/vendor/bin/loopback.sh 3 0
user root
group root
disabled
oneshot
service loopback_sec1 /system/vendor/bin/loopback.sh 4 1
user root
group root
disabled
oneshot
service loopback_sec0 /system/vendor/bin/loopback.sh 4 0
user root
group root
disabled
oneshot
service spk_playback1 /system/vendor/bin/loopback.sh 5 1
user root
group root
disabled
oneshot
service spk_playback0 /system/vendor/bin/loopback.sh 5 0
user root
group root
disabled
oneshot
on property:sys.loopback-spk=1
start loopback_spk1
on property:sys.loopback-spk=0
start loopback_spk0
on property:sys.loopback-rec=1
start loopback_rec1
on property:sys.loopback-rec=0
start loopback_rec0
on property:sys.loopback-mic1=1
start loopback_hand1
on property:sys.loopback-mic1=0
start loopback_hand0
on property:sys.loopback-mic2=1
start loopback_sec1
on property:sys.loopback-mic2=0
start loopback_sec0
on property:sys.spk-playback=1
start spk_playback1
on property:sys.spk-playback=0
start spk_playback0
service tinyhostless_spk /system/vendor/bin/tinyhostless -D 0 -P 35 -C 11 -p 8 -n 2 -c 1 -r 48000
user root
group root
disabled
oneshot
service tinyhostless /system/vendor/bin/tinyhostless -D 0 -P 5 -C 11 -p 8 -n 2 -c 1 -r 48000
user root
group root
disabled
oneshot
on property:sys.tinyhostless=0
stop tinyhostless
on property:sys.tinyhostless=1
start tinyhostless
on property:sys.tinyhostless-spk=0
stop tinyhostless_spk
on property:sys.tinyhostless-spk=1
start tinyhostless_spk
#audio loopback test end
on property:persist.sys.display_srgb=1
write /sys/class/graphics/fb0/msm_fb_srgb 1
on property:persist.sys.display_srgb=2
write /sys/class/graphics/fb0/msm_fb_srgb 2
service adswitch /vendor/bin/adswitch
user root
group root
disabled
oneshot
on property:sys.ad.enable=on
start adswitch
on property:sys.ad.enable=off
start adswitch
on property:sys.dynamic_debug=1
write /sys/kernel/debug/dynamic_debug/control "file q6afe.c +p"
write /sys/kernel/debug/dynamic_debug/control "file q6adm.c +p"
write /sys/kernel/debug/dynamic_debug/control "file msm-pcm-routing-v2.c +p"
write /sys/kernel/debug/dynamic_debug/control "file msm-dai-q6-v2.c +p"
write /sys/kernel/debug/dynamic_debug/control "file soc-core.c +p"
write /sys/kernel/debug/dynamic_debug/control "file soc-dapm.c +p"
write /sys/kernel/debug/dynamic_debug/control "file sdm660-internal.c +p"
write /sys/kernel/debug/dynamic_debug/control "file sdm660-common.c +p"
write /sys/kernel/debug/dynamic_debug/control "file msm-analog-cdc.c +p"
write /sys/kernel/debug/dynamic_debug/control "file msm-digital-cdc.c +p"
write /sys/kernel/debug/dynamic_debug/control "file wcd-mbhc-v2.c +p"
on property:sys.dynamic_debug=0
write /sys/kernel/debug/dynamic_debug/control "file q6afe.c -p"
write /sys/kernel/debug/dynamic_debug/control "file q6adm.c -p"
write /sys/kernel/debug/dynamic_debug/control "file msm-pcm-routing-v2.c -p"
write /sys/kernel/debug/dynamic_debug/control "file msm-dai-q6-v2.c -p"
write /sys/kernel/debug/dynamic_debug/control "file soc-core.c -p"
write /sys/kernel/debug/dynamic_debug/control "file soc-dapm.c -p"
write /sys/kernel/debug/dynamic_debug/control "file sdm660-internal.c -p"
write /sys/kernel/debug/dynamic_debug/control "file sdm660-common.c -p"
write /sys/kernel/debug/dynamic_debug/control "file msm-analog-cdc.c -p"
write /sys/kernel/debug/dynamic_debug/control "file msm-digital-cdc.c -p"
write /sys/kernel/debug/dynamic_debug/control "file wcd-mbhc-v2.c -p"
on property:persist.sys.display_ce=4
write /sys/class/graphics/fb0/msm_fb_ce 1
on property:persist.sys.display_ce=0
write /sys/class/graphics/fb0/msm_fb_ce 2
on property:persist.sys.display_cabc=1
write /sys/class/graphics/fb0/msm_fb_cabc 1
on property:persist.sys.display_cabc=2
write /sys/class/graphics/fb0/msm_fb_cabc 2
on property:persist.sys.display_gamma=1
write /sys/class/graphics/fb0/msm_fb_gamma 1
on property:persist.sys.display_gamma=2
write /sys/class/graphics/fb0/msm_fb_gamma 2
#add for wifi sar
service wifisarnear /vendor/bin/wifisarnear
user root
group root
oneshot
disabled
on property:sys.wifisarnear=1
start wifisarnear
service wifisarfar /vendor/bin/wifisarfar
user root
group root
oneshot
disabled
on property:sys.wifisarfar=1
start wifisarfar

302
rootdir/root/ueventd.rc Normal file
View file

@ -0,0 +1,302 @@
# Copyright (c) 2012-2015, 2017, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# the DIAG device node is not world writable/readable.
/dev/diag 0660 system oem_2901
/dev/genlock 0666 system system
/dev/wlan 0660 wifi wifi
/dev/kgsl 0666 system system
/dev/kgsl-3d0 0666 system system
/dev/kgsl-2d0 0666 root root
/dev/kgsl-2d1 0666 root root
/dev/ion 0664 system system
/dev/rtc0 0660 system system
/dev/smd0 0660 system system
/dev/smd4 0660 system system
/dev/smd_cxm_qmi 0640 radio radio
/dev/smd5 0660 system system
/dev/smd6 0660 system system
/dev/smd7 0660 bluetooth bluetooth
/dev/ccid_bridge 0660 system system
/dev/ipa 0660 radio radio
/dev/wwan_ioctl 0660 radio radio
/dev/ipaNatTable 0660 radio radio
/dev/rmnet_ctrl 0660 usb usb
/dev/dpl_ctrl 0660 usb usb
/dev/spidev7.1 0660 system system
#permissions for CSVT
/dev/smd11 0660 radio radio
#permsissions for BT/FM
/dev/smd2 0660 bluetooth bluetooth
/dev/smd3 0660 bluetooth bluetooth
/dev/btpower 0660 bluetooth system
#permissions for pta
/dev/pta 0660 system system
/dev/radio0 0640 system system
/dev/rfcomm0 0660 bluetooth bluetooth
/dev/ttyUSB0 0660 bluetooth bluetooth
/dev/smdcntl0 0640 radio radio
/dev/smdcntl1 0640 radio radio
/dev/smdcntl2 0640 radio radio
/dev/smdcntl3 0640 radio radio
/dev/smdcntl4 0640 radio radio
/dev/smdcntl5 0640 radio radio
/dev/smdcntl6 0640 radio radio
/dev/smdcntl7 0640 radio radio
/dev/smdcntl8 0640 radio radio
/dev/smdcnt_rev0 0640 radio radio
/dev/smdcnt_rev1 0640 radio radio
/dev/smdcnt_rev2 0640 radio radio
/dev/smdcnt_rev3 0640 radio radio
/dev/smdcnt_rev4 0640 radio radio
/dev/smdcnt_rev5 0640 radio radio
/dev/smdcnt_rev6 0640 radio radio
/dev/smdcnt_rev7 0640 radio radio
/dev/smdcnt_rev8 0640 radio radio
/dev/smuxctl32 0640 radio radio
/dev/sdioctl0 0640 radio radio
/dev/sdioctl1 0640 radio radio
/dev/sdioctl2 0640 radio radio
/dev/sdioctl3 0640 radio radio
/dev/sdioctl4 0640 radio radio
/dev/sdioctl5 0640 radio radio
/dev/sdioctl6 0640 radio radio
/dev/sdioctl7 0640 radio radio
/dev/sdioctl8 0640 radio radio
/dev/rmnet_mux_ctrl 0640 radio radio
/dev/hsicctl0 0640 radio radio
/dev/hsicctl1 0640 radio radio
/dev/hsicctl2 0640 radio radio
/dev/hsicctl3 0640 radio radio
/dev/hsicctl4 0640 radio radio
/dev/hsicctl5 0640 radio radio
/dev/hsicctl6 0640 radio radio
/dev/hsicctl7 0640 radio radio
/dev/hsicctl8 0640 radio radio
/dev/hsicctl9 0640 radio radio
/dev/hsicctl10 0640 radio radio
/dev/hsicctl11 0640 radio radio
/dev/hsicctl12 0640 radio radio
/dev/hsicctl13 0640 radio radio
/dev/hsicctl14 0640 radio radio
/dev/hsicctl15 0640 radio radio
/dev/hsicctl16 0640 radio radio
/dev/mhi_pipe_14 0640 radio radio
/dev/mhi_pipe_16 0640 radio radio
/dev/mhi_pipe_32 0640 radio radio
/dev/at_usb0 0640 radio radio
/dev/at_mdm0 0640 radio radio
/dev/video* 0660 system camera
/dev/media* 0660 system camera
/dev/v4l-subdev* 0660 system camera
/dev/qseecom 0660 system drmrpc
/dev/smcinvoke 0660 system system
/dev/qsee_ipc_irq_spss 0660 system drmrpc
/dev/seemplog 0660 system system
/dev/pft 0660 system drmrpc
/dev/spcom 0660 system system
/dev/sp_kernel 0660 system system
/dev/sp_ssr 0660 system system
/dev/sp_keymaster 0660 system system
/dev/cryptoapp 0660 system system
/dev/gemini0 0660 system camera
/dev/jpeg0 0660 system camera
/dev/jpeg1 0660 system camera
/dev/jpeg2 0660 system camera
/dev/jpeg3 0660 system camera
/dev/adsprpc-smd 0664 system system
/dev/system_health_monitor 0644 radio system
/dev/mdss_rotator 0664 system system
# fpc fingerprint
/sys/devices/soc/soc:fpc1020* hw_reset 0660 system system
/sys/devices/soc/soc:fpc1020* irq 0660 system system
/sys/devices/soc/soc:fpc1020* wakeup_enable 0660 system system
/sys/devices/soc/soc:fpc1020* fingerdown_wait 0220 system system
# wlan
/dev/wcnss_wlan 0660 system system
/dev/wcnss_ctrl 0660 system system
/sys/devices/soc/a000000.qcom,wcnss-wlan/net/wlan0/queues/rx-* rps_cpus 0660 system system
/sys/devices/soc/a000000.qcom,wcnss-wlan/net/p2p0/queues/rx-* rps_cpus 0660 system system
/dev/spidev0.0 0660 system audio
/dev/msm_camera/* 0660 system camera
/dev/gemini/ 0660 system camera
/dev/mercury0 0660 system camera
/dev/msm_vidc_reg 0660 system audio
/dev/msm_vidc_dec 0660 system audio
/dev/msm_vidc_dec_sec 0660 system audio
/dev/msm_vidc_enc 0660 system audio
/dev/msm_rotator 0660 system system
/dev/hw_random 0600 root root
/dev/sdsprpc-smd 0660 system system
#permissions for audio
/dev/wcd_dsp0_control 0660 system audio
/dev/wcd-dsp-glink 0660 system audio
/dev/audio_slimslave 0660 system audio
/dev/msm_qcelp 0660 system audio
/dev/msm_evrc 0660 system audio
/dev/msm_wma 0660 system audio
/dev/msm_wmapro 0660 system audio
/dev/msm_alac 0660 system audio
/dev/msm_ape 0660 system audio
/dev/msm_amrnb 0660 system audio
/dev/msm_amrwb 0660 system audio
/dev/msm_amrwbplus 0660 system audio
/dev/msm_aac 0660 system audio
/dev/msm_multi_aac 0660 system audio
/dev/msm_aac_in 0660 system audio
/dev/msm_qcelp_in 0660 system audio
/dev/msm_evrc_in 0660 system audio
/dev/msm_amrnb_in 0660 system audio
/dev/msm_amrwb_in 0660 system audio
/dev/msm_a2dp_in 0660 system audio
/dev/msm_ac3 0660 system audio
/dev/msm_audio_cal 0660 system audio
/dev/msm_hweffects 0660 system audio
/dev/msm_cad 0660 system audio
/dev/msm_fm 0660 system audio
/dev/msm_mvs 0660 system audio
/dev/msm_pcm_lp_dec 0660 system audio
/dev/msm_preproc_ctl 0660 system audio
/dev/msm_rtac 0660 system audio
/dev/msm_voicememo 0660 system audio
/dev/ttyHSL1 0660 system system
/dev/ttyHS1 0660 system system
/dev/mdm 0660 system radio
/sys/devices/virtual/smdpkt/smdcntl* open_timeout 0664 radio radio
/dev/sdio_tty_ciq_00 0660 system system
/dev/tty_sdio_00 0660 system system
/dev/ttyGS0 0660 system system
/dev/i2c-5 0660 media media
/dev/avtimer 0660 system audio
# DVB devices
/dev/dvb/adapter0/demux* 0440 media media
/dev/dvb/adapter0/dvr* 0660 media media
/dev/dvb/adapter0/video* 0660 media media
# Broadcast devices
/dev/tsc_mux0 0660 media media
/dev/tsc_ci0 0660 media media
# sensors
/sys/devices/i2c-12/12-* pollrate_ms 0664 system system
/sys/devices/f9925000.i2c/i2c-0/0-* enable 0660 input system
/sys/devices/f9925000.i2c/i2c-0/0-* poll_delay 0660 input system
/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* enable 0660 input system
/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* poll_delay 0660 input system
/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* enable_wakeup 0660 input system
/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* max_latency 0660 input system
/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* flush 0660 input system
/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* calibrate 0660 input system
/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* enable 0660 input system
/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* poll_delay 0660 input system
/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* enable_wakeup 0660 input system
/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* max_latency 0660 input system
/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* flush 0660 input system
/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* calibrate 0660 input system
/sys/devices/virtual/optical_sensors/proximity ps_adc 0660 input system
/sys/devices/virtual/optical_sensors/proximity ps_poll_delay 0660 input system
/sys/devices/virtual/optical_sensors/lightsensor ls_auto 0660 input system
/sys/devices/virtual/optical_sensors/lightsensor ls_poll_delay 0660 input system
/sys/devices/virtual/input/input* poll 0660 input system
/sys/devices/virtual/input/input* pollrate_ms 0660 input system
/sys/devices/soc/78b7000.i2c/i2c-3/3-0020/input/input* secure_touch 0440 system drmrpc
/sys/devices/soc/78b7000.i2c/i2c-3/3-0020/input/input* secure_touch_enable 0660 system drmrpc
/sys/devices/soc/78b7000.i2c/i2c-3/3-0038/input/input* secure_touch 0440 system drmrpc
/sys/devices/soc/78b7000.i2c/i2c-3/3-0038/input/input* secure_touch_enable 0660 system drmrpc
/sys/devices/soc/78b7000.i2c/i2c-3/3-004b/input/input* secure_touch 0440 system drmrpc
/sys/devices/soc/78b7000.i2c/i2c-3/3-004b/input/input* secure_touch_enable 0660 system drmrpc
/sys/devices/soc/c179000.i2c/i2c-5/5-0020/input/input* secure_touch 0440 system drmrpc
/sys/devices/soc/c179000.i2c/i2c-5/5-0020/input/input* secure_touch_enable 0660 system drmrpc
# laser sensor access
/sys/devices/virtual/input/input* enable_ps_sensor 0660 system input
/sys/devices/virtual/input/input* set_delay_ms 0660 system input
/sys/devices/virtual/input/input* do_flush 0660 system input
# vm_bms
/dev/vm_bms 0660 system system
/dev/battery_data 0660 system system
# wlan
/dev/wcnss_wlan 0660 system system
/dev/wcnss_ctrl 0660 system system
/sys/devices/soc/600000.qcom,pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net/wlan0/queues/rx-* rps_cpus 0660 system system
/sys/devices/soc/600000.qcom,pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net/p2p0/queues/rx-* rps_cpus 0660 system system
# wigig
/sys/bus/pci/drivers/wil6210* 0000:01:00.0/wil6210/fst_link_loss 0660 wifi wifi
/sys/bus/pci/drivers/wil6210* 0000:01:00.0/wil6210/thermal_throttling 0660 system system
/sys/bus/pci/drivers/wil6210* 0000:01:00.0/wil6210/snr_thresh 0660 wifi wifi
/sys/bus/pci/drivers/wil6210* 0000:01:00.0/net/wigig0/queues/rx-0/rps_cpus 0660 system system
/sys/bus/pci/drivers/wil6210* 0000:01:00.0/net/wigig0/gro_flush_timeout 0660 system system
/sys/devices/virtual/net/bond0 queues/rx-0/rps_cpus 0660 system system
#nfc permissions
/dev/nfc-nci 0660 nfc nfc
/dev/nq-nci 0660 nfc nfc
/dev/assd 0660 nfc nfc
# UIO devices
/dev/uio0 0660 system system
/dev/uio1 0660 system system
/dev/uio2 0660 system system
# SSR devices
/dev/subsys_* 0640 system system
# Ultrasound device
/dev/usf1 0660 system system
# Ramdump devices
/dev/ramdump* 0640 system system
# Fingerprint device
/dev/qbt1000 0660 system system
#ImproveTouch device
/dev/hbtp_input 0660 system system
/dev/hbtp_vm 0660 system system
# Add device block for FRP
/dev/block/platform/soc/7824900.sdhci/by-name/config 0600 system system
/dev/block/platform/soc/7464900.sdhci/by-name/frp 0600 system system
/dev/block/platform/soc/624000.ufshc/by-name/frp 0600 system system
/dev/block/platform/soc/1da4000.ufshc/by-name/frp 0600 system system
/dev/block/platform/soc/c0c4000.sdhci/by-name/frp 0600 system system
/dev/block/platform/soc/1d84000.ufshc/by-name/frp 0600 system system
# Kmsg device
/dev/kmsg 0620 root system