initial upload
This commit is contained in:
parent
37b46d3aa3
commit
b9ab0621d2
2 changed files with 311 additions and 0 deletions
90
recovery/root/init.recovery.qcom.rc
Normal file
90
recovery/root/init.recovery.qcom.rc
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
# Copyright (c) 2017-2018, 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
import /init.recovery.qcom_decrypt.rc
|
||||||
|
|
||||||
|
on early-init
|
||||||
|
start set_permissive
|
||||||
|
|
||||||
|
on fs
|
||||||
|
wait /dev/block/platform/soc/${ro.boot.bootdevice}
|
||||||
|
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
|
||||||
|
|
||||||
|
on property:init.svc.fastbootd=running
|
||||||
|
# Load prebuild kernel modules in fastboot mode
|
||||||
|
mount /vendor_dlkm
|
||||||
|
insmod /vendor_dlkm/lib/modules/ili9882_mmi.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/msm_drm.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/mmi_annotate.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/mmi_info.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/mmi_relay.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/mmi_charger.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/mmi_sys_temp.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/moto_f_mass_storage.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/sensors_class.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/touchscreen_mmi.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/stmicro_mmi.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/goodix_brl_mmi.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/sx937x_sar.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/bm_adsp_ulog.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/qti_glink_charger.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/qpnp_adaptive_charge.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/q6_pdr_dlkm.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/q6_notifier_dlkm.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/snd_event_dlkm.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/gpr_dlkm.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/spf_core_dlkm.ko
|
||||||
|
insmod /vendor_dlkm/lib/modules/adsp_loader_dlkm.ko
|
||||||
|
setprop twrp.modules.loaded true
|
||||||
|
|
||||||
|
on post-fs && property:init.svc.fastbootd=stopped
|
||||||
|
# Trigger loading kernel modules in normal mode
|
||||||
|
setprop twrp.modules.loaded true
|
||||||
|
|
||||||
|
on property:twrp.modules.loaded=true
|
||||||
|
# Load kernel modules and ADSP firmware for PMIC
|
||||||
|
wait /sys/kernel/boot_adsp/boot
|
||||||
|
start runatboot
|
||||||
|
wait /sys/class/power_supply/battery
|
||||||
|
|
||||||
|
on post-fs
|
||||||
|
start boot-hal-1-2
|
||||||
|
|
||||||
|
on boot
|
||||||
|
start health-hal-2-1
|
||||||
|
|
||||||
|
service set_permissive /system/bin/set_permissive.sh
|
||||||
|
user root
|
||||||
|
group root
|
||||||
|
oneshot
|
||||||
|
seclabel u:r:recovery:s0
|
||||||
|
|
||||||
|
service runatboot /system/bin/runatboot.sh
|
||||||
|
user root
|
||||||
|
group root
|
||||||
|
oneshot
|
||||||
|
seclabel u:r:recovery:s0
|
221
recovery/root/init.recovery.usb.rc
Normal file
221
recovery/root/init.recovery.usb.rc
Normal file
|
@ -0,0 +1,221 @@
|
||||||
|
# Copyright (c) 2011-2016, 2018-2021 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 charger
|
||||||
|
mount configfs none /config
|
||||||
|
mkdir /config/usb_gadget/g1 0770
|
||||||
|
mkdir /config/usb_gadget/g1/strings/0x409 0770
|
||||||
|
write /config/usb_gadget/g1/bcdUSB 0x0200
|
||||||
|
write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
|
||||||
|
write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
|
||||||
|
mkdir /config/usb_gadget/g1/functions/mass_storage.0
|
||||||
|
mkdir /config/usb_gadget/g1/configs/b.1 0770
|
||||||
|
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770
|
||||||
|
write /config/usb_gadget/g1/configs/b.1/MaxPower 900
|
||||||
|
write /config/usb_gadget/g1/strings/0x409/product ${vendor.usb.product_string}
|
||||||
|
wait /sys/class/udc/${sys.usb.controller}
|
||||||
|
setprop sys.usb.configfs 1
|
||||||
|
setprop vendor.usb.use_ffs_mtp 1
|
||||||
|
|
||||||
|
on init
|
||||||
|
setprop sys.usb.configfs 1
|
||||||
|
|
||||||
|
on property:ro.boot.usbcontroller=*
|
||||||
|
setprop sys.usb.controller ${ro.boot.usbcontroller}
|
||||||
|
wait /sys/bus/platform/devices/${ro.boot.usb.dwc3_msm:-a600000.ssusb}/mode
|
||||||
|
write /sys/bus/platform/devices/${ro.boot.usb.dwc3_msm:-a600000.ssusb}/mode peripheral
|
||||||
|
wait /sys/class/udc/${ro.boot.usbcontroller} 1
|
||||||
|
|
||||||
|
on post-fs
|
||||||
|
mount configfs none /config
|
||||||
|
mkdir /config/usb_gadget/g1 0770
|
||||||
|
mkdir /config/usb_gadget/g2 0770
|
||||||
|
mkdir /config/usb_gadget/g1/strings/0x409 0770
|
||||||
|
mkdir /config/usb_gadget/g2/strings/0x409 0770
|
||||||
|
write /config/usb_gadget/g1/bcdUSB 0x0200
|
||||||
|
write /config/usb_gadget/g2/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/g2/strings/0x409/serialnumber ${ro.serialno}
|
||||||
|
write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
|
||||||
|
write /config/usb_gadget/g2/strings/0x409/manufacturer ${ro.product.manufacturer}
|
||||||
|
write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
|
||||||
|
write /config/usb_gadget/g2/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/ffs.adb
|
||||||
|
mkdir /config/usb_gadget/g1/configs/b.1 0770
|
||||||
|
mkdir /config/usb_gadget/g2/configs/b.1 0770
|
||||||
|
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770
|
||||||
|
mkdir /config/usb_gadget/g2/configs/b.1/strings/0x409 0770
|
||||||
|
write /config/usb_gadget/g1/configs/b.1/MaxPower 900
|
||||||
|
write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
|
||||||
|
write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100"
|
||||||
|
write /config/usb_gadget/g1/functions/diag.diag/serial ${ro.serialno}
|
||||||
|
mkdir /dev/usb-ffs 0775 shell system
|
||||||
|
mkdir /dev/usb-ffs/adb 0770 shell system
|
||||||
|
mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=1000,rmode=0770,fmode=0660
|
||||||
|
setprop sys.usb.mtp.device_type 3
|
||||||
|
|
||||||
|
on post-fs && property:vendor.usb.use_ffs_mtp=1
|
||||||
|
mkdir /config/usb_gadget/g1/functions/ffs.mtp
|
||||||
|
mkdir /dev/usb-ffs/mtp 0770 mtp mtp
|
||||||
|
mount functionfs mtp /dev/usb-ffs/mtp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1
|
||||||
|
|
||||||
|
on boot && property:vendor.usb.use_gadget_hal=1
|
||||||
|
setprop sys.usb.configfs 2
|
||||||
|
|
||||||
|
on property:sys.usb.config=* && property:sys.usb.configfs=2
|
||||||
|
setprop vendor.usb.config ${sys.usb.config}
|
||||||
|
|
||||||
|
on property:vendor.usb.config=* && property:sys.usb.configfs=2
|
||||||
|
start usbd
|
||||||
|
|
||||||
|
on property:sys.usb.config=none && property:sys.usb.configfs=1
|
||||||
|
write /config/usb_gadget/g1/UDC "none"
|
||||||
|
stop adbd
|
||||||
|
setprop sys.usb.ffs.ready 0
|
||||||
|
write /config/usb_gadget/g1/bDeviceClass 0
|
||||||
|
write /config/usb_gadget/g1/bDeviceSubClass 0
|
||||||
|
write /config/usb_gadget/g1/bDeviceProtocol 0
|
||||||
|
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
|
||||||
|
rmdir /config/usb_gadget/g1/functions/rndis.gs4
|
||||||
|
setprop sys.usb.state ${sys.usb.config}
|
||||||
|
|
||||||
|
on property:init.svc.adbd=stopped
|
||||||
|
setprop sys.usb.ffs.ready 0
|
||||||
|
|
||||||
|
#
|
||||||
|
# USB compositions
|
||||||
|
#
|
||||||
|
# Following are the triggers to configure various combinations of functions into a USB
|
||||||
|
# composition. Each correspond to a unique VID/PID.
|
||||||
|
#
|
||||||
|
on property:sys.usb.config=* && property:sys.usb.configfs=1
|
||||||
|
rm /config/usb_gadget/g1/os_desc/b.1
|
||||||
|
|
||||||
|
on property:sys.usb.config=none && 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
|
||||||
|
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
|
||||||
|
rm /config/usb_gadget/g1/configs/b.1/f9
|
||||||
|
|
||||||
|
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
|
||||||
|
rm /config/usb_gadget/g1/configs/b.1/f9
|
||||||
|
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
|
||||||
|
rm /config/usb_gadget/g1/configs/b.1/f9
|
||||||
|
symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
|
||||||
|
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=adb && property:sys.usb.configfs=1
|
||||||
|
start adbd
|
||||||
|
|
||||||
|
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && property:sys.usb.configfs=1
|
||||||
|
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
|
||||||
|
symlink /config/usb_gadget/g1/functions/ffs.adb /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=mtp && property:sys.usb.configfs=1
|
||||||
|
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp"
|
||||||
|
symlink /config/usb_gadget/g1/functions/mtp.gs0 /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=mtp,adb && property:sys.usb.configfs=1
|
||||||
|
start adbd
|
||||||
|
|
||||||
|
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
|
||||||
|
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb"
|
||||||
|
symlink /config/usb_gadget/g1/functions/mtp.gs0 /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=adb && property:sys.usb.configfs=1
|
||||||
|
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||||
|
write /config/usb_gadget/g1/idProduct 0x4ee7
|
||||||
|
symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
|
||||||
|
|
||||||
|
on property:sys.usb.config=mtp && property:sys.usb.configfs=1
|
||||||
|
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||||
|
write /config/usb_gadget/g1/idProduct 0x4ee1
|
||||||
|
symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
|
||||||
|
|
||||||
|
on property:sys.usb.config=mtp && property:vendor.usb.use_ffs_mtp=1 && property:sys.usb.configfs=1
|
||||||
|
symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1
|
||||||
|
symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
|
||||||
|
|
||||||
|
on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
|
||||||
|
write /config/usb_gadget/g1/idVendor 0x18d1
|
||||||
|
write /config/usb_gadget/g1/idProduct 0x4ee2
|
||||||
|
|
||||||
|
on property:sys.usb.config=mtp,adb && property:vendor.usb.use_ffs_mtp=1 && property:sys.usb.configfs=1
|
||||||
|
symlink /config/usb_gadget/g1/functions/ffs.mtp /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/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
|
||||||
|
|
Loading…
Reference in a new issue