diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..214e274 --- /dev/null +++ b/Android.mk @@ -0,0 +1,23 @@ +# +# Copyright (C) 2020 The Android Open Source Project +# Copyright (C) 2020 The TWRP Open Source Project +# Copyright (C) 2020 SebaUbuntu's TWRP device tree generator +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_PATH := $(call my-dir) + +ifeq ($(TARGET_DEVICE), monet) +include $(call all-subdir-makefiles,$(LOCAL_PATH)) +endif \ No newline at end of file diff --git a/AndroidProducts.mk b/AndroidProducts.mk new file mode 100644 index 0000000..f808dd1 --- /dev/null +++ b/AndroidProducts.mk @@ -0,0 +1,20 @@ +# +# Copyright (C) 2020 The Android Open Source Project +# Copyright (C) 2020 The TWRP Open Source Project +# Copyright (C) 2020 SebaUbuntu's TWRP device tree generator +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +PRODUCT_MAKEFILES := \ + $(LOCAL_DIR)/omni_monet.mk \ No newline at end of file diff --git a/BoardConfig.mk b/BoardConfig.mk new file mode 100644 index 0000000..0135cc8 --- /dev/null +++ b/BoardConfig.mk @@ -0,0 +1,86 @@ +# +# Copyright (C) 2020 The Android Open Source Project +# Copyright (C) 2020 The TWRP Open Source Project +# Copyright (C) 2020 SebaUbuntu's TWRP device tree generator +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +DEVICE_PATH := device/xiaomi/monet + +# For building with minimal manifest +ALLOW_MISSING_DEPENDENCIES := true + +# Architecture +TARGET_ARCH := arm64 +TARGET_ARCH_VARIANT := armv8-a +TARGET_CPU_ABI := arm64-v8a +TARGET_CPU_ABI2 := +TARGET_CPU_VARIANT := generic + +TARGET_2ND_ARCH := arm +TARGET_2ND_ARCH_VARIANT := armv7-a-neon +TARGET_2ND_CPU_ABI := armeabi-v7a +TARGET_2ND_CPU_ABI2 := armeabi +TARGET_2ND_CPU_VARIANT := generic +TARGET_BOARD_SUFFIX := _64 +TARGET_USES_64_BIT_BINDER := true + +# Assert +TARGET_OTA_ASSERT_DEVICE := monet,vangogh + +# File systems +BOARD_HAS_LARGE_FILESYSTEM := true +#BOARD_RECOVERYIMAGE_PARTITION_SIZE := 134217728 # This is the maximum known partition size, but it can be higher, so we just omit it +BOARD_SYSTEMIMAGE_PARTITION_TYPE := ext4 +BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_USE_F2FS := true +TARGET_COPY_OUT_VENDOR := vendor + +# Kernel +BOARD_KERNEL_CMDLINE := console=ttyMSM0,115200n8 androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 service_locator.enable=1 androidboot.usbcontroller=a600000.dwc3 swiotlb=2048 cgroup.memory=nokmem,nosocket androidboot.selinux=permissive androidboot.init_fatal_reboot_target=recovery buildvariant=eng +TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilt/Image.gz +TARGET_PREBUILT_DTB := $(DEVICE_PATH)/prebuilt/dtb.img +BOARD_PREBUILT_DTBOIMAGE := $(DEVICE_PATH)/prebuilt/dtbo.img +BOARD_INCLUDE_RECOVERY_DTBO := true +BOARD_BOOTIMG_HEADER_VERSION := 2 +BOARD_KERNEL_BASE := 0x00000000 +BOARD_KERNEL_PAGESIZE := 4096 +BOARD_RAMDISK_OFFSET := 0x01000000 +BOARD_KERNEL_TAGS_OFFSET := 0x00000100 +BOARD_FLASH_BLOCK_SIZE := 262144 # (BOARD_KERNEL_PAGESIZE * 64) +BOARD_MKBOOTIMG_ARGS += --ramdisk_offset $(BOARD_RAMDISK_OFFSET) +BOARD_MKBOOTIMG_ARGS += --tags_offset $(BOARD_KERNEL_TAGS_OFFSET) +BOARD_MKBOOTIMG_ARGS += --dtb $(TARGET_PREBUILT_DTB) +BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOTIMG_HEADER_VERSION) +BOARD_KERNEL_IMAGE_NAME := Image.gz +TARGET_KERNEL_ARCH := arm64 +TARGET_KERNEL_HEADER_ARCH := arm64 +TARGET_KERNEL_SOURCE := kernel/xiaomi/monet +TARGET_KERNEL_CONFIG := monet_defconfig + +# Platform +TARGET_BOARD_PLATFORM := lito + +# Hack: prevent anti rollback +PLATFORM_SECURITY_PATCH := 2099-12-31 +PLATFORM_VERSION := 16.1.0 + +# TWRP Configuration +TW_THEME := portrait_hdpi +TW_EXTRA_LANGUAGES := true +TW_SCREEN_BLANK_ON_BOOT := true +TW_INPUT_BLACKLIST := "hbtp_vm" +TW_USE_TOOLBOX := true \ No newline at end of file diff --git a/device.mk b/device.mk new file mode 100644 index 0000000..4953de1 --- /dev/null +++ b/device.mk @@ -0,0 +1,20 @@ +# +# Copyright (C) 2020 The Android Open Source Project +# Copyright (C) 2020 The TWRP Open Source Project +# Copyright (C) 2020 SebaUbuntu's TWRP device tree generator +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_PATH := device/xiaomi/monet + diff --git a/omni_monet.mk b/omni_monet.mk new file mode 100644 index 0000000..cc92a49 --- /dev/null +++ b/omni_monet.mk @@ -0,0 +1,38 @@ +# +# Copyright (C) 2020 The Android Open Source Project +# Copyright (C) 2020 The TWRP Open Source Project +# Copyright (C) 2020 SebaUbuntu's TWRP device tree generator +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Inherit from those products. Most specific first. +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product-if-exists, $(SRC_TARGET_DIR)/product/embedded.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) + +# Inherit from monet device +$(call inherit-product, device/xiaomi/monet/device.mk) + +# Inherit some common Omni stuff. +$(call inherit-product, vendor/omni/config/common.mk) +$(call inherit-product, vendor/omni/config/gsm.mk) + +# Device identifier. This must come after all inclusions +PRODUCT_DEVICE := monet +PRODUCT_NAME := omni_monet +PRODUCT_BRAND := Xiaomi +PRODUCT_MODEL := Xiaomi +PRODUCT_MANUFACTURER := xiaomi +PRODUCT_RELEASE_NAME := Xiaomi Xiaomi \ No newline at end of file diff --git a/prebuilt/Image.gz b/prebuilt/Image.gz new file mode 100644 index 0000000..dcdbff2 Binary files /dev/null and b/prebuilt/Image.gz differ diff --git a/prebuilt/dtb.img b/prebuilt/dtb.img new file mode 100644 index 0000000..7b4894c Binary files /dev/null and b/prebuilt/dtb.img differ diff --git a/prebuilt/dtbo.img b/prebuilt/dtbo.img new file mode 100644 index 0000000..9733ea5 Binary files /dev/null and b/prebuilt/dtbo.img differ diff --git a/recovery.fstab b/recovery.fstab new file mode 100644 index 0000000..bba844b --- /dev/null +++ b/recovery.fstab @@ -0,0 +1,14 @@ +# mount point fstype device flags +/system ext4 system flags=display="System";backup=1;logical; +/system_image emmc system flags=display="System image";backup=1;flashimg=1;logical; +/product ext4 product flags=display="Product";backup=1;logical; +/product_image emmc product flags=display="Product image";backup=1;flashimg=1;logical; +/vendor ext4 vendor flags=display="Vendor";backup=1;logical; +/vendor_image emmc vendor flags=display="Vendor image";backup=1;flashimg=1;logical; +/odm ext4 odm flags=display="Odm";backup=1;logical; +/odm_image emmc odm flags=display="Odm image";backup=1;flashimg=1;logical; +/data f2fs /dev/block/bootdevice/by-name/userdata flags=display="Data"; +/cache ext4 /dev/block/bootdevice/by-name/cache flags=display="Cache"; +/boot emmc /dev/block/bootdevice/by-name/boot flags=display="Boot";backup=1;flashimg=1; +/recovery emmc /dev/block/bootdevice/by-name/recovery flags=display="Recovery";backup=1;flashimg=1; +/misc emmc /dev/block/bootdevice/by-name/misc flags=display="Misc";backup=1;flashimg=1; diff --git a/recovery/root/init.rc b/recovery/root/init.rc new file mode 100644 index 0000000..8542196 --- /dev/null +++ b/recovery/root/init.rc @@ -0,0 +1,212 @@ +import /init.recovery.logd.rc +import /init.recovery.ldconfig.rc +import /init.recovery.mksh.rc +import /init.recovery.usb.rc +import /init.recovery.service.rc +import /init.recovery.vold_decrypt.rc +import /init.recovery.${ro.hardware}.rc + +on early-init + # Set the security context of /postinstall if present. + restorecon /postinstall + + # ueventd wants to write to /acct + mount cgroup none /acct cpuacct + mkdir /acct/uid + start ueventd + +on init + export PATH /sbin:/system/bin + export LD_LIBRARY_PATH /system/lib64 + + export ANDROID_ROOT /system + export ANDROID_DATA /data + export EXTERNAL_STORAGE /sdcard + + symlink /proc/self/fd/0 /dev/stdin + symlink /proc/self/fd/1 /dev/stdout + symlink /proc/self/fd/2 /dev/stderr + + symlink /system/bin /bin + symlink /system/etc /etc + + mount cgroup none /acct cpuacct + mkdir /acct/uid + + mkdir /system + mkdir /data + mkdir /cache + mkdir /sideload + mkdir /mnt/system + mount tmpfs tmpfs /tmp + + chown root shell /tmp + chmod 0775 /tmp + + write /proc/sys/kernel/panic_on_oops 1 + write /proc/sys/vm/max_map_count 1000000 + +on boot + ifup lo + hostname localhost + domainname localdomain + + class_start default + +# Load properties, pre-Android 6.0 +on load_all_props_action + load_all_props + +# Load properties, Android 6.0+ +on load_system_props_action + load_system_props + +# Load properties, Android 6.0+, vendor init lives here +on load_persist_props_action + load_persist_props + +on firmware_mounts_complete + rm /dev/.booting + +# Mount filesystems and start core system services. +on late-init + trigger early-fs + trigger fs + trigger post-fs + trigger post-fs-data + + # Load properties, pre-Android 6.0 + trigger load_all_props_action + + # Load properties from /system/ + /factory after fs mount. Place + # this in another action so that the load will be scheduled after the prior + # issued fs triggers have completed. + trigger load_system_props_action + + # Load properties, Android 6.0+, vendor init lives here + trigger load_persist_props_action + + # Remove a file to wake up anything waiting for firmware + trigger firmware_mounts_complete + + trigger early-boot + trigger boot + +on property:sys.powerctl=* + powerctl ${sys.powerctl} + +service ueventd /system/bin/ueventd + critical + seclabel u:r:ueventd:s0 + +service adbd /system/bin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery + disabled + socket adbd stream 660 system system + seclabel u:r:adbd:s0 + +# Always start adbd on userdebug and eng builds +on property:ro.debuggable=1 + #write /sys/class/android_usb/android0/enable 1 + #start adbd + setprop service.adb.root 1 + +service fastbootd /system/bin/fastbootd + disabled + group system + seclabel u:r:fastbootd:s0 + +# Restart adbd so it can run as root +on property:service.adb.root=1 + restart adbd + +# Always start adbd on userdebug and eng builds +on fs && property:ro.debuggable=1 + setprop sys.usb.config adb + +on fs && property:sys.usb.configfs=1 + mount configfs none /config + mkdir /config/usb_gadget/g1 0770 shell shell + write /config/usb_gadget/g1/idVendor 0x18D1 + mkdir /config/usb_gadget/g1/strings/0x409 0770 + 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/ffs.adb + mkdir /config/usb_gadget/g1/functions/ffs.fastboot + mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell + mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell + +on fs && property:sys.usb.configfs=0 + write /sys/class/android_usb/android0/f_ffs/aliases adb,fastboot + write /sys/class/android_usb/android0/idVendor 18D1 + write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer} + write /sys/class/android_usb/android0/iProduct ${ro.product.model} + write /sys/class/android_usb/android0/iSerial ${ro.serialno} + +on fs + mount pstore pstore /sys/fs/pstore + mkdir /dev/usb-ffs 0770 shell shell + mkdir /dev/usb-ffs/adb 0770 shell shell + mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 + mkdir /dev/usb-ffs/fastboot 0770 system system + mount functionfs fastboot /dev/usb-ffs/fastboot rmode=0770,fmode=0660,uid=1000,gid=1000 + +on property:sys.usb.config=adb + start adbd + +on property:sys.usb.config=fastboot + start fastbootd + +on property:sys.usb.config=none && property:sys.usb.configfs=0 + stop adbd + stop fastboot + write /sys/class/android_usb/android0/enable 0 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=adb && property:sys.usb.configfs=0 + write /sys/class/android_usb/android0/idProduct D001 + write /sys/class/android_usb/android0/functions adb + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=sideload && property:sys.usb.configfs=0 + write /sys/class/android_usb/android0/idProduct D001 + write /sys/class/android_usb/android0/functions adb + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=fastboot && property:sys.usb.configfs=0 + write /sys/class/android_usb/android0/idProduct 4EE0 + write /sys/class/android_usb/android0/functions fastboot + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +# Configfs triggers +on property:sys.usb.config=none && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/UDC "none" + stop adbd + stop fastbootd + setprop sys.usb.ffs.ready 0 + rm /config/usb_gadget/g1/configs/b.1/f1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=sideload && property:sys.usb.ffs.ready=1 && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0xD001 + 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=adb && property:sys.usb.ffs.ready=1 && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0xD001 + 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=fastboot && property:sys.usb.ffs.ready=1 && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4EE0 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "fastboot" + symlink /config/usb_gadget/g1/functions/ffs.fastboot /config/usb_gadget/g1/configs/b.1/f1 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} diff --git a/recovery/root/init.recovery.hlthchrg.rc b/recovery/root/init.recovery.hlthchrg.rc new file mode 100644 index 0000000..8a49c86 --- /dev/null +++ b/recovery/root/init.recovery.hlthchrg.rc @@ -0,0 +1,5 @@ +# charger for Android 8.0 and up + +service charger /charger -r + critical + seclabel u:r:charger:s0 diff --git a/recovery/root/init.recovery.ldconfig.rc b/recovery/root/init.recovery.ldconfig.rc new file mode 100644 index 0000000..c99f802 --- /dev/null +++ b/recovery/root/init.recovery.ldconfig.rc @@ -0,0 +1,2 @@ +on fs + export LD_CONFIG_FILE /system/etc/ld.config.txt diff --git a/recovery/root/init.recovery.logd.rc b/recovery/root/init.recovery.logd.rc new file mode 100644 index 0000000..29db6be --- /dev/null +++ b/recovery/root/init.recovery.logd.rc @@ -0,0 +1,13 @@ +on late-init + start logd + +service logd /system/bin/logd + class core + socket logdr seqpacket 0666 root root + socket logdw dgram+passcred 0222 root root + file /proc/kmsg r + file /dev/kmsg w + user root + group root + capabilities SYSLOG AUDIT_CONTROL SETGID SETUID + seclabel u:r:logd:s0 diff --git a/recovery/root/init.recovery.qcom.rc b/recovery/root/init.recovery.qcom.rc new file mode 100644 index 0000000..9f93064 --- /dev/null +++ b/recovery/root/init.recovery.qcom.rc @@ -0,0 +1,113 @@ +# Copyright (c) 2009-2012, 2014-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. +# + +on fs + wait /dev/block/platform/soc/${ro.boot.bootdevice} + symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice + chmod 0660 /dev/qseecom + chown system drmrpc /dev/qseecom + chmod 0664 /dev/ion + chown system system /dev/ion + install_keyring + +on early-fs + start vold + +on init + start hwservicemanager + setprop crypto.ready 1 + +service sbinqseecomd /sbin/qseecomd + user root + group root + disabled + seclabel u:r:recovery:s0 + +service hwservicemanager /system/bin/hwservicemanager + user root + group root + disabled + onrestart setprop hwservicemanager.ready false + seclabel u:r:recovery:s0 + +service servicemanager /system/bin/servicemanager + user root + group root readproc + disabled + seclabel u:r:recovery:s0 + +service keystore_auth /system/bin/keystore_auth + oneshot + user system + group root + disabled + seclabel u:r:recovery:s0 + +# keystore is started and stopped on demand by TWRP +service keystore /system/bin/keystore /tmp/misc/keystore + user root + group root drmrpc readproc + disabled + seclabel u:r:recovery:s0 + +service gatekeeper-1-0 /sbin/android.hardware.gatekeeper@1.0-service-qti + user root + group root + disabled + seclabel u:r:recovery:s0 + +service keymaster-4-0 /sbin/android.hardware.keymaster@4.0-service-qti + user root + group root + disabled + seclabel u:r:recovery:s0 + +service unified-script /sbin/unified-script.sh + user root + group root + disabled + oneshot + seclabel u:r:recovery:s0 + +on boot + setprop sys.usb.config adb +# chmod 0777 /sbin/unified-script.sh +# start unified-script + +on property:crypto.ready=0 + stop sbinqseecomd + stop keymaster-4-0 + stop gatekeeper-1-0 + stop servicemanager + +on property:crypto.ready=1 + start sbinqseecomd + +on property:vendor.sys.listeners.registered=true + start keymaster-4-0 + start gatekeeper-1-0 + start servicemanager diff --git a/recovery/root/init.recovery.service.rc b/recovery/root/init.recovery.service.rc new file mode 100644 index 0000000..410efff --- /dev/null +++ b/recovery/root/init.recovery.service.rc @@ -0,0 +1,9 @@ +on boot + +# For starting recovery on 5.0 and newer +service recovery /system/bin/recovery + socket recovery stream 422 system system + seclabel u:r:recovery:s0 + +on early-init + write /sys/fs/selinux/enforce 0 diff --git a/recovery/root/init.recovery.usb.rc b/recovery/root/init.recovery.usb.rc new file mode 100644 index 0000000..14fec8d --- /dev/null +++ b/recovery/root/init.recovery.usb.rc @@ -0,0 +1,124 @@ +# Copyright (c) 2011-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. +# + +on boot + write /sys/class/android_usb/android0/iSerial ${ro.serialno} + 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/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/rndis.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/rmnet_bam.rmnet_bam_dmux + mkdir /config/usb_gadget/g1/functions/rmnet_bam.dpl_bam_dmux + mkdir /config/usb_gadget/g1/functions/ncm.0 + mkdir /config/usb_gadget/g1/functions/ccid.ccid + mkdir /config/usb_gadget/g1/functions/uac2.0 + mkdir /config/usb_gadget/g1/functions/uvc.0 + 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/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 + 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 + write /sys/class/android_usb/android0/f_ffs/aliases adb + setprop vendor.usb.controller ${sys.usb.controller} + +on property:sys.usb.config=none + 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 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_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 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x9039 + 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 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "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 + write /config/usb_gadget/g1/idVendor 0x18d1 + write /config/usb_gadget/g1/idProduct 0x4ee7 + 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} \ No newline at end of file diff --git a/recovery/root/ueventd.qcom.rc b/recovery/root/ueventd.qcom.rc new file mode 100644 index 0000000..7f0b1ed --- /dev/null +++ b/recovery/root/ueventd.qcom.rc @@ -0,0 +1,409 @@ +# Copyright (c) 2012-2015, 2017-2019, 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. +# + +# Firmware directory Path +# Below macro will be read by uevent and path will +# be added to search path for firmware loading +firmware_directories /vendor/firmware_mnt/image/ + +# the DIAG device node is not world writable/readable. +/dev/diag 0660 system oem_2901 + +/dev/xlog 0660 system audio + +/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/ipa_odl_ctl 0660 radio radio +/dev/ipa_adpl 0660 system oem_2905 +/dev/synx_device 0660 root camera +/dev/hab 0666 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/cvp* 0660 system camera +/dev/media* 0660 system camera +/dev/v4l-subdev* 0660 system camera +/dev/qseecom 0660 system drmrpc +/dev/qce 0660 system drmrpc +/dev/smcinvoke 0660 system drmrpc +/dev/qsee_ipc_irq_spss 0660 system drmrpc +/dev/seemplog 0660 system system +/dev/pft 0660 system drmrpc +/dev/spcom 0660 system system +/dev/spss_utils 0660 system system +/dev/sp_kernel 0660 system system +/dev/sp_nvm 0660 system system +/dev/sp_ssr 0660 system system +/dev/sp_keymaster 0660 system system +/dev/sec_nvm_* 0660 system system +/dev/cryptoapp 0660 system system +/dev/spdaemon_ssr 0660 system system +/dev/iuicc 0660 system system +/dev/iuicc0 0660 system system +/dev/iuicc1 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/adsprpc-smd-secure 0644 system system +/dev/system_health_monitor 0644 radio system +/dev/mdss_rotator 0664 system system + +#QDSS +/dev/byte-cntr 0660 system oem_2902 +/dev/mhi_qdss 0660 system oem_2902 +/sys/class/qdss_bridge/mhi_qdss mode 0660 system oem_2902 + +#qg +/dev/qg 0660 system system +/dev/qg_battery 0660 system system + +#qvr +/dev/qvr_external_sensor_ioctl 0660 system system +/sys/kernel/qvr_external_sensor/fd 0660 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/i2c-7 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 +/dev/spidev2.0 0660 system audio +/dev/aud_pasthru_adsp 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 +/dev/sensors 0660 system system +/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 +/sys/devices/platform/soc/a98000.i2c/i2c-2/2-0020/input/input* secure_touch 0440 system drmrpc +/sys/devices/platform/soc/a98000.i2c/i2c-2/2-0020/input/input* secure_touch_enable 0660 system drmrpc +/sys/devices/platform/soc/a84000.i2c/i2c-2/2-0020/input/input* secure_touch 0440 system drmrpc +/sys/devices/platform/soc/a84000.i2c/i2c-2/2-0020/input/input* secure_touch_enable 0660 system drmrpc + +# GNSS Device premissions +/dev/gnss_sirf 0660 gps gps + +# 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 +/dev/wigig_sensing 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 + +#spi ir nodes +/dev/ir_spi 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/qbt* 0660 system system +/sys/class/fts/touch_aoi aoi_set 0660 root system +/sys/class/fts/touch_aoi power_set 0660 root 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 +/dev/block/platform/soc/7c4000.sdhci/by-name/frp 0600 system system +/dev/block/platform/soc/4744000.sdhci/by-name/frp 0600 system system +/dev/block/platform/soc/4804000.ufshc/by-name/frp 0600 system system + +# This is temporary while using SD card for initial bring-up +/dev/block/platform/soc/8804000.sdhci/by-name/frp 0600 system system + +# Kmsg device +/dev/kmsg 0620 root system + +# LED class devices +/sys/class/leds/red delay_on 0640 system system +/sys/class/leds/red delay_off 0640 system system +/sys/class/leds/red breath 0640 system system +/sys/class/leds/green delay_on 0640 system system +/sys/class/leds/green delay_off 0640 system system +/sys/class/leds/green breath 0640 system system +/sys/class/leds/blue delay_on 0640 system system +/sys/class/leds/blue delay_off 0640 system system +/sys/class/leds/blue breath 0640 system system + +# NPU device +/dev/msm_npu 0644 system system + +# USB role switch +/sys/class/dual_role_usb/* data_role 0660 system system +/sys/class/dual_role_usb/* power_role 0660 system system +/sys/class/dual_role_usb/* mode 0660 system system + +#Memory Offline +/sys/devices/system/memory/memory* state 0660 system system + +/sys/devices/virtual/hdcp/msm_hdcp min_level_change 0664 system graphics + +# sys-fs display +/sys/class/graphics/fb* hpd 0664 system graphics +/sys/class/graphics/fb* res_info 0664 system graphics +/sys/class/graphics/fb* vendor_name 0664 system graphics +/sys/class/graphics/fb* product_description 0664 system graphics +/sys/class/graphics/fb* video_mode 0664 system graphics +/sys/class/graphics/fb* format_3d 0664 system graphics +/sys/class/graphics/fb* s3d_mode 0664 system graphics +/sys/class/graphics/fb* dynamic_fps 0664 system graphics +/sys/class/graphics/fb* msm_fb_dfps_mode 0664 system graphics +/sys/class/graphics/fb* hdr_stream 0664 system graphics +/sys/class/graphics/fb* cec/enable 0664 system graphics +/sys/class/graphics/fb* cec/logical_addr 0664 system graphics +/sys/class/graphics/fb* cec/rd_msg 0664 system graphics +/sys/class/graphics/fb* pa 0664 system graphics +/sys/class/graphics/fb* cec/wr_msg 0600 system graphics +/sys/class/graphics/fb* hdcp/tp 0664 system graphics +/sys/class/graphics/fb* hdcp2p2/min_level_change 0660 system graphics +/sys/class/graphics/fb* hdmi_audio_cb 0600 audioserver audio + +/sys/class/graphics/fb* lineptr_value 0664 system graphics +/sys/class/graphics/fb* msm_fb_persist_mode 0664 system graphics + +/sys/class/graphics/fb0 idle_time 0664 system graphics +/sys/class/graphics/fb0 dynamic_fps 0664 system graphics +/sys/class/graphics/fb0 dyn_pu 0664 system graphics +/sys/class/graphics/fb0 modes 0664 system graphics +/sys/class/graphics/fb0 mode 0664 system graphics +/sys/class/graphics/fb0 msm_cmd_autorefresh_en 0664 system graphics + +# Elliptic +/dev/elliptic0 0644 system system +/dev/elliptic1 0644 system system diff --git a/recovery/root/ueventd.rc b/recovery/root/ueventd.rc new file mode 100644 index 0000000..451f5ad --- /dev/null +++ b/recovery/root/ueventd.rc @@ -0,0 +1,69 @@ +firmware_directories /etc/firmware/ /odm/firmware/ /vendor/firmware/ /firmware/image/ +uevent_socket_rcvbuf_size 16M + +subsystem graphics + devname uevent_devpath + dirname /dev/graphics + +subsystem drm + devname uevent_devpath + dirname /dev/dri + +subsystem input + devname uevent_devpath + dirname /dev/input + +subsystem sound + devname uevent_devpath + dirname /dev/snd + +# ueventd can only set permissions on device nodes and their associated +# sysfs attributes, not on arbitrary paths. +# +# format for /dev rules: devname mode uid gid +# format for /sys rules: nodename attr mode uid gid +# shortcut: "mtd@NN" expands to "/dev/mtd/mtdNN" + +/dev/null 0666 root root +/dev/zero 0666 root root +/dev/full 0666 root root +/dev/ptmx 0666 root root +/dev/tty 0666 root root +/dev/random 0666 root root +/dev/urandom 0666 root root +# Make HW RNG readable by group system to let EntropyMixer read it. +/dev/hw_random 0440 root system +/dev/ashmem 0666 root root +/dev/binder 0666 root root +/dev/hwbinder 0666 root root +/dev/vndbinder 0666 root root + +/dev/pmsg0 0222 root log + +# kms driver for drm based gpu +/dev/dri/* 0666 root graphics + +# these should not be world writable +/dev/uhid 0660 uhid uhid +/dev/uinput 0660 uhid uhid +/dev/rtc0 0640 system system +/dev/tty0 0660 root system +/dev/graphics/* 0660 root graphics +/dev/input/* 0660 root input +/dev/v4l-touch* 0660 root input +/dev/snd/* 0660 system audio +/dev/bus/usb/* 0660 root usb +/dev/mtp_usb 0660 root mtp +/dev/usb_accessory 0660 root usb +/dev/tun 0660 system vpn + +# CDMA radio interface MUX +/dev/ppp 0660 radio vpn + +# sysfs properties +/sys/devices/platform/trusty.* trusty_version 0440 root log +/sys/devices/virtual/input/input* enable 0660 root input +/sys/devices/virtual/input/input* poll_delay 0660 root input +/sys/devices/virtual/usb_composite/* enable 0664 root system +/sys/devices/system/cpu/cpu* cpufreq/scaling_max_freq 0664 system system +/sys/devices/system/cpu/cpu* cpufreq/scaling_min_freq 0664 system system diff --git a/vendorsetup.sh b/vendorsetup.sh new file mode 100644 index 0000000..4cb3981 --- /dev/null +++ b/vendorsetup.sh @@ -0,0 +1,20 @@ +# +# Copyright (C) 2020 The Android Open Source Project +# Copyright (C) 2020 The TWRP Open Source Project +# Copyright (C) 2020 SebaUbuntu's TWRP device tree generator +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +add_lunch_combo omni_monet-userdebug +add_lunch_combo omni_monet-eng \ No newline at end of file