diff --git a/BoardConfig.mk b/BoardConfig.mk index d22f76f9..15dfacfa 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -53,13 +53,17 @@ BOARD_BOOTIMAGE_PARTITION_SIZE := 0x04000000 BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x04000000 BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3221225472 BOARD_USERDATAIMAGE_PARTITION_SIZE := 58846064640 # (58846081024-16384) +BOARD_VENDORIMAGE_PARTITION_SIZE := 872415232 BOARD_CACHEIMAGE_PARTITION_SIZE := 402653184 BOARD_PERSISTIMAGE_PARTITION_SIZE := 33554432 BOARD_FLASH_BLOCK_SIZE := 262144 # (BOARD_KERNEL_PAGESIZE * 64) # Recovery -BOARD_HAS_LARGE_FILESYSTEM := true TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_USE_F2FS := true +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 +TARGET_COPY_OUT_VENDOR := vendor +BOARD_HAS_LARGE_FILESYSTEM := true # TWRP Configuration TW_THEME := portrait_hdpi @@ -72,6 +76,6 @@ TARGET_RECOVERY_QCOM_RTC_FIX := true TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888" TARGET_RECOVERY_FSTAB := $(LOCAL_PATH)/twrp.fstab BOARD_SUPPRESS_SECURE_ERASE := true -RECOVERY_SDCARD_ON_DATA := true -RECOVERY_GRAPHICS_USE_LINELENGTH := true +TW_IGNORE_MISC_WIPE_DATA := true TW_INPUT_BLACKLIST := "hbtp_vm" +TW_HAS_EDL_MODE := true diff --git a/Image.gz-dtb b/Image.gz-dtb index 032d1e5a..4d7d87ff 100644 Binary files a/Image.gz-dtb and b/Image.gz-dtb differ diff --git a/README.md b/README.md new file mode 100644 index 00000000..4348eeff --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# Device Tree for Xiaomi Redmi Note 4 & 4x (Mido) + +Kernel source: "https://github.com/TheScarastic/android_kernel_xiaomi_msm8953" + +## Spec Sheet + +| Feature | Specification | +| :---------------------- | :-------------------------------- | +| CPU | Octa-core 2.0 GHz Cortex-A53 | +| Chipset | Qualcomm MSM8953 Snapdragon 625 | +| GPU | Adreno 506 | +| Memory | 2/3/4 GB | +| Shipped Android Version | 6.0.1 | +| Storage | 32/64 GB | +| MicroSD | Up to 256 GB | +| Battery | 4100 mAh (non-removable) | +| Dimensions | 151 x 76 x 8.5 mm | +| Display | 1920x1080 pixels, 5.5 (~401 PPI) | +| Rear Camera | 13 MP, LED flash | +| Front Camera | 5 MP | +| Release Date | January 2017 | + +## Device Picture + +![Redmi Note 4](http://i01.appmifile.com/webfile/globalimg/7/537557F3-A4F1-2490-E9D3-138B2A11DBF6.png "Redmi Note 4") diff --git a/cryptfs_hw/Android.mk b/cryptfs_hw/Android.mk deleted file mode 100644 index 48d8d109..00000000 --- a/cryptfs_hw/Android.mk +++ /dev/null @@ -1,53 +0,0 @@ -# -# Copyright (c) 2014, The Linux Foundation. All rights reserved. -# -# 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) - -include $(CLEAR_VARS) - -LOCAL_PROPRIETARY_MODULE := true - -sourceFiles := \ - cryptfs_hw.c - -commonSharedLibraries := \ - libcutils \ - libutils \ - libdl \ - libhardware -commonIncludes := \ - hardware/libhardware/include/hardware/ - -LOCAL_C_INCLUDES := $(commonIncludes) -LOCAL_SRC_FILES := $(sourceFiles) - -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE:= libcryptfs_hw -LOCAL_SHARED_LIBRARIES := $(commonSharedLibraries) - -LOCAL_MODULE_OWNER := qcom - -ifeq ($(TARGET_SWV8_DISK_ENCRYPTION),true) -LOCAL_CFLAGS += -DCONFIG_SWV8_DISK_ENCRYPTION -endif - -# USE_ICE_FOR_STORAGE_ENCRYPTION would be true in future if -# TARGET_USE_EMMC_USE_ICE is set -ifeq ($(TARGET_USE_UFS_ICE),true) -LOCAL_CFLAGS += -DUSE_ICE_FOR_STORAGE_ENCRYPTION -endif - -include $(BUILD_SHARED_LIBRARY) diff --git a/cryptfs_hw/cryptfs_hw.c b/cryptfs_hw/cryptfs_hw.c deleted file mode 100644 index caaeea3a..00000000 --- a/cryptfs_hw/cryptfs_hw.c +++ /dev/null @@ -1,322 +0,0 @@ -/* 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. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cutils/log.h" -#include "cutils/properties.h" -#include "cutils/android_reboot.h" -#include "keymaster_common.h" -#include "hardware.h" - - -// When device comes up or when user tries to change the password, user can -// try wrong password upto a certain number of times. If user enters wrong -// password further, HW would wipe all disk encryption related crypto data -// and would return an error ERR_MAX_PASSWORD_ATTEMPTS to VOLD. VOLD would -// wipe userdata partition once this error is received. -#define ERR_MAX_PASSWORD_ATTEMPTS -10 -#define QSEECOM_DISK_ENCRYPTION 1 -#define QSEECOM_UFS_ICE_DISK_ENCRYPTION 3 -#define QSEECOM_SDCC_ICE_DISK_ENCRYPTION 4 -#define MAX_PASSWORD_LEN 32 -#define QTI_ICE_STORAGE_UFS 1 -#define QTI_ICE_STORAGE_SDCC 2 - -/* Operations that be performed on HW based device encryption key */ -#define SET_HW_DISK_ENC_KEY 1 -#define UPDATE_HW_DISK_ENC_KEY 2 -#define MAX_DEVICE_ID_LENGTH 4 /* 4 = 3 (MAX_SOC_ID_LENGTH) + 1 */ - -static unsigned int cpu_id[] = { - 239, /* MSM8939 SOC ID */ -}; - -#define KEYMASTER_PARTITION_NAME "/dev/block/bootdevice/by-name/keymaster" - -static int loaded_library = 0; -static int (*qseecom_create_key)(int, void*); -static int (*qseecom_update_key)(int, void*, void*); -static int (*qseecom_wipe_key)(int); - -static int map_usage(int usage) -{ - int storage_type = is_ice_enabled(); - if (usage == QSEECOM_DISK_ENCRYPTION) { - if (storage_type == QTI_ICE_STORAGE_UFS) { - return QSEECOM_UFS_ICE_DISK_ENCRYPTION; - } - else if (storage_type == QTI_ICE_STORAGE_SDCC) { - return QSEECOM_SDCC_ICE_DISK_ENCRYPTION ; - } - } - return usage; -} - -static unsigned char* get_tmp_passwd(const char* passwd) -{ - int passwd_len = 0; - unsigned char * tmp_passwd = NULL; - if(passwd) { - tmp_passwd = (unsigned char*)malloc(MAX_PASSWORD_LEN); - if(tmp_passwd) { - memset(tmp_passwd, 0, MAX_PASSWORD_LEN); - passwd_len = (strlen(passwd) > MAX_PASSWORD_LEN) ? MAX_PASSWORD_LEN : strlen(passwd); - memcpy(tmp_passwd, passwd, passwd_len); - } else { - SLOGE("%s: Failed to allocate memory for tmp passwd \n", __func__); - } - } else { - SLOGE("%s: Passed argument is NULL \n", __func__); - } - return tmp_passwd; -} - -static void wipe_userdata() -{ - mkdir("/cache/recovery", 0700); - int fd = open("/cache/recovery/command", O_RDWR|O_CREAT|O_TRUNC|O_NOFOLLOW, 0600); - if (fd >= 0) { - write(fd, "--wipe_data", strlen("--wipe_data") + 1); - close(fd); - } else { - SLOGE("could not open /cache/recovery/command\n"); - } - android_reboot(ANDROID_RB_RESTART2, 0, "recovery"); -} - -static int load_qseecom_library() -{ - const char *error = NULL; - if (loaded_library) - return loaded_library; - -#ifdef __LP64__ - void * handle = dlopen("/vendor/lib64/libQSEEComAPI.so", RTLD_NOW); -#else - void * handle = dlopen("/vendor/lib/libQSEEComAPI.so", RTLD_NOW); -#endif - if(handle) { - dlerror(); /* Clear any existing error */ - *(void **) (&qseecom_create_key) = dlsym(handle,"QSEECom_create_key"); - - if((error = dlerror()) == NULL) { - SLOGD("Success loading QSEECom_create_key \n"); - *(void **) (&qseecom_update_key) = dlsym(handle,"QSEECom_update_key_user_info"); - if ((error = dlerror()) == NULL) { - SLOGD("Success loading QSEECom_update_key_user_info\n"); - *(void **) (&qseecom_wipe_key) = dlsym(handle,"QSEECom_wipe_key"); - if ((error = dlerror()) == NULL) { - loaded_library = 1; - SLOGD("Success loading QSEECom_wipe_key \n"); - } - else - SLOGE("Error %s loading symbols for QSEECom APIs \n", error); - } - else - SLOGE("Error %s loading symbols for QSEECom APIs \n", error); - } - } else { - SLOGE("Could not load libQSEEComAPI.so \n"); - } - - if(error) - dlclose(handle); - - return loaded_library; -} - -/* - * For NON-ICE targets, it would return 0 on success. On ICE based targets, - * it would return key index in the ICE Key LUT - */ -static int set_key(const char* currentpasswd, const char* passwd, const char* enc_mode, int operation) -{ - int err = -1; - if (is_hw_disk_encryption(enc_mode) && load_qseecom_library()) { - unsigned char* tmp_passwd = get_tmp_passwd(passwd); - unsigned char* tmp_currentpasswd = get_tmp_passwd(currentpasswd); - if(tmp_passwd) { - if (operation == UPDATE_HW_DISK_ENC_KEY) { - if (tmp_currentpasswd) - err = qseecom_update_key(map_usage(QSEECOM_DISK_ENCRYPTION), tmp_currentpasswd, tmp_passwd); - } else if (operation == SET_HW_DISK_ENC_KEY) { - err = qseecom_create_key(map_usage(QSEECOM_DISK_ENCRYPTION), tmp_passwd); - } - if(err < 0) { - if(ERR_MAX_PASSWORD_ATTEMPTS == err) - wipe_userdata(); - } - free(tmp_passwd); - free(tmp_currentpasswd); - } - } - return err; -} - -int set_hw_device_encryption_key(const char* passwd, const char* enc_mode) -{ - return set_key(NULL, passwd, enc_mode, SET_HW_DISK_ENC_KEY); -} - -int update_hw_device_encryption_key(const char* oldpw, const char* newpw, const char* enc_mode) -{ - return set_key(oldpw, newpw, enc_mode, UPDATE_HW_DISK_ENC_KEY); -} - -unsigned int is_hw_disk_encryption(const char* encryption_mode) -{ - int ret = 0; - if(encryption_mode) { - if (!strcmp(encryption_mode, "aes-xts")) { - SLOGD("HW based disk encryption is enabled \n"); - ret = 1; - } - } - return ret; -} - -int clear_hw_device_encryption_key(void) -{ - if (load_qseecom_library()) - return qseecom_wipe_key(map_usage(QSEECOM_DISK_ENCRYPTION)); - - return 0; -} - -/* - * By default HW FDE is enabled, if the execution comes to - * is_hw_fde_enabled() API then for specific device/soc id, - * HW FDE is disabled. - */ -#ifdef CONFIG_SWV8_DISK_ENCRYPTION -unsigned int is_hw_fde_enabled(void) -{ - unsigned int device_id = -1; - unsigned int array_size; - unsigned int status = 1; - FILE *fd = NULL; - unsigned int i; - int ret = -1; - char buf[MAX_DEVICE_ID_LENGTH]; - - fd = fopen("/sys/devices/soc0/soc_id", "r"); - if (fd) { - ret = fread(buf, 1, MAX_DEVICE_ID_LENGTH, fd); - fclose(fd); - } else { - fd = fopen("/sys/devices/system/soc/soc0/id", "r"); - if (fd) { - ret = fread(buf, 1, MAX_DEVICE_ID_LENGTH, fd); - fclose(fd); - } - } - - if (ret > 0) { - device_id = atoi(buf); - } else { - SLOGE("Failed to read device id"); - return status; - } - - array_size = sizeof(cpu_id) / sizeof(cpu_id[0]); - for (i = 0; i < array_size; i++) { - if (device_id == cpu_id[i]) { - status = 0; - break; - } - } - - return status; -} -#else -unsigned int is_hw_fde_enabled(void) -{ - return 1; -} -#endif - -int is_ice_enabled(void) -{ - char prop_storage[PATH_MAX]; - int storage_type = 0; - int fd; - - if (property_get("ro.boot.bootdevice", prop_storage, "")) { - if (strstr(prop_storage, "ufs")) { - /* All UFS based devices has ICE in it. So we dont need - * to check if corresponding device exists or not - */ - storage_type = QTI_ICE_STORAGE_UFS; - } else if (strstr(prop_storage, "sdhc")) { - if (access("/dev/icesdcc", F_OK) != -1) - storage_type = QTI_ICE_STORAGE_SDCC; - } - } - return storage_type; -} - -static int get_keymaster_version() -{ - int rc = -1; - const hw_module_t* mod; - rc = hw_get_module_by_class(KEYSTORE_HARDWARE_MODULE_ID, NULL, &mod); - if (rc) { - SLOGE("could not find any keystore module"); - return rc; - } - - return mod->module_api_version; -} - -int should_use_keymaster() -{ - /* HW FDE key would be tied to keymaster only if: - * New Keymaster is available - * keymaster partition exists on the device - */ - int rc = 0; - if (get_keymaster_version() != KEYMASTER_MODULE_API_VERSION_1_0) { - SLOGI("Keymaster version is not 1.0"); - return rc; - } - - if (access(KEYMASTER_PARTITION_NAME, F_OK) == -1) { - SLOGI("Keymaster partition does not exists"); - return rc; - } - - return 1; -} diff --git a/cryptfs_hw/cryptfs_hw.h b/cryptfs_hw/cryptfs_hw.h deleted file mode 100644 index c443798d..00000000 --- a/cryptfs_hw/cryptfs_hw.h +++ /dev/null @@ -1,48 +0,0 @@ -/* 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. - */ - -#ifndef __CRYPTFS_HW_H_ -#define __CRYPTFS_HW_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -unsigned int wipe_hw_device_encryption_key(const char*); -int set_hw_device_encryption_key(const char*, const char*); -int update_hw_device_encryption_key(const char*, const char*, const char*); -int clear_hw_device_encryption_key(void); -unsigned int is_hw_disk_encryption(const char*); -unsigned int is_hw_fde_enabled(void); -int is_ice_enabled(void); -int should_use_keymaster(); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/omni.dependencies b/omni.dependencies index 396ae9d1..25824fc5 100644 --- a/omni.dependencies +++ b/omni.dependencies @@ -3,6 +3,6 @@ "remote":"github", "repository": "TeamWin/android_device_qcom_common", "target_path": "device/qcom/common", - "revision":"android-6.0" + "revision":"android-8.0" } ] diff --git a/omni_mido.mk b/omni_mido.mk index 12e475fb..c5e0adff 100644 --- a/omni_mido.mk +++ b/omni_mido.mk @@ -27,11 +27,11 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) # Charger -PRODUCT_PACKAGES += \ +#PRODUCT_PACKAGES += \ charger_res_images # Time Zone data for recovery -PRODUCT_COPY_FILES += \ +#PRODUCT_COPY_FILES += \ bionic/libc/zoneinfo/tzdata:recovery/root/system/usr/share/zoneinfo/tzdata ## Device identifier. This must come after all inclusions diff --git a/recovery/root/fstab.qcom b/recovery/root/fstab.qcom index ab46188c..8625e9f4 100644 --- a/recovery/root/fstab.qcom +++ b/recovery/root/fstab.qcom @@ -2,18 +2,21 @@ # 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 -# -/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults -/dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults +# +/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults +/dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults -/dev/block/bootdevice/by-name/system /system ext4 ro wait -/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,noatime,noauto_da_alloc wait,check,encryptable=footer,formattable,length=-16384 -/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,nodev,noatime wait,formattable,check -/dev/block/bootdevice/by-name/persist /persist ext4 nosuid,nodev wait,check -/dev/block/bootdevice/by-name/dsp /dsp ext4 ro,nosuid,nodev wait -/dev/block/bootdevice/by-name/modem /firmware vfat ro,context=u:object_r:firmware_file:s0,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 wait -/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults -/dev/block/bootdevice/by-name/config /frp emmc defaults defaults +/dev/block/bootdevice/by-name/system /system ext4 ro wait,recoveryonly +/dev/block/bootdevice/by-name/cust /vendor ext4 ro wait,recoveryonly +/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,data_flush wait,check,encryptable=footer,quota,formattable +/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,noatime,noauto_da_alloc wait,check,encryptable=footer,quota,formattable +/dev/block/bootdevice/by-name/cache /cache f2fs nosuid,nodev,noatime,inline_xattr,flush_merge,data_flush wait,formattable,check +/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,nodev,noatime wait,formattable,check +/dev/block/bootdevice/by-name/persist /persist ext4 nosuid,nodev,noatime wait,check +/dev/block/bootdevice/by-name/dsp /dsp ext4 ro,nosuid,nodev wait +/dev/block/bootdevice/by-name/modem /firmware vfat ro,context=u:object_r:firmware_file:s0,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 wait +/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults +/dev/block/bootdevice/by-name/config /frp emmc defaults defaults -/devices/soc/7864900.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=footer -/devices/soc/7000000.ssusb/7000000.dwc3/xhci-hcd.0.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto +/devices/soc/7864900.sdhci/mmc_host* auto auto defaults wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=userdata +/devices/soc/7000000.ssusb/7000000.dwc3/xhci-hcd.0.auto* auto auto defaults wait,voldmanaged=usb:auto diff --git a/recovery/root/init.recovery.qcom.rc b/recovery/root/init.recovery.qcom.rc index cd7e528a..52fe523d 100755 --- a/recovery/root/init.recovery.qcom.rc +++ b/recovery/root/init.recovery.qcom.rc @@ -26,6 +26,10 @@ # on fs + # symlink + wait /dev/block/platform/soc/${ro.boot.bootdevice} + symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice + # Needed to make qseecomd work in recovery chmod 0777 /dev/qseecom chmod 0664 /dev/ion diff --git a/recovery/root/sbin/wipe_misc b/recovery/root/sbin/wipe_misc new file mode 100755 index 00000000..64f194a2 --- /dev/null +++ b/recovery/root/sbin/wipe_misc @@ -0,0 +1,5 @@ +#!/sbin/sh + +dd if=/dev/zero of=/dev/block/bootdevice/by-name/misc bs=16384 2>/dev/null + +echo "Done." diff --git a/recovery/root/ueventd.qcom.rc b/recovery/root/ueventd.qcom.rc index a2146ad2..cb1f07b0 100644 --- a/recovery/root/ueventd.qcom.rc +++ b/recovery/root/ueventd.qcom.rc @@ -103,12 +103,20 @@ /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/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 @@ -131,9 +139,10 @@ /dev/msm_vidc_enc 0660 system audio /dev/msm_rotator 0660 system system /dev/hw_random 0600 root root -/dev/adsprpc-smd 0664 system system +/dev/sdsprpc-smd 0660 system system #permissions for 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 @@ -211,6 +220,12 @@ /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 system +/sys/devices/virtual/input/input* set_delay_ms 0660 system system # vm_bms /dev/vm_bms 0660 system system @@ -250,3 +265,8 @@ # 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 + +# lirc +/dev/lirc0 0660 system system diff --git a/recovery/root/vendor/firmware b/recovery/root/vendor/firmware new file mode 120000 index 00000000..7e3eb1ee --- /dev/null +++ b/recovery/root/vendor/firmware @@ -0,0 +1 @@ +/firmware/image \ No newline at end of file diff --git a/recovery/root/vendor/lib64/lib-sec-disp.so b/recovery/root/vendor/lib64/lib-sec-disp.so index 21444958..c08dec73 100644 Binary files a/recovery/root/vendor/lib64/lib-sec-disp.so and b/recovery/root/vendor/lib64/lib-sec-disp.so differ diff --git a/recovery/root/vendor/lib64/libGPreqcancel.so b/recovery/root/vendor/lib64/libGPreqcancel.so index dbd2ffcf..066f8755 100644 Binary files a/recovery/root/vendor/lib64/libGPreqcancel.so and b/recovery/root/vendor/lib64/libGPreqcancel.so differ diff --git a/recovery/root/vendor/lib64/libGPreqcancel_svc.so b/recovery/root/vendor/lib64/libGPreqcancel_svc.so index 23c35551..be12b919 100644 Binary files a/recovery/root/vendor/lib64/libGPreqcancel_svc.so and b/recovery/root/vendor/lib64/libGPreqcancel_svc.so differ diff --git a/recovery/root/vendor/lib64/libQSEEComAPI.so b/recovery/root/vendor/lib64/libQSEEComAPI.so index f7b608b6..75cbd7a2 100644 Binary files a/recovery/root/vendor/lib64/libQSEEComAPI.so and b/recovery/root/vendor/lib64/libQSEEComAPI.so differ diff --git a/recovery/root/vendor/lib64/libSecureUILib.so b/recovery/root/vendor/lib64/libSecureUILib.so index b7c9c12c..3508b6bb 100644 Binary files a/recovery/root/vendor/lib64/libSecureUILib.so and b/recovery/root/vendor/lib64/libSecureUILib.so differ diff --git a/recovery/root/vendor/lib64/libStDrvInt.so b/recovery/root/vendor/lib64/libStDrvInt.so index b5c5ad19..31db9f5b 100644 Binary files a/recovery/root/vendor/lib64/libStDrvInt.so and b/recovery/root/vendor/lib64/libStDrvInt.so differ diff --git a/recovery/root/vendor/lib64/libbinder.so b/recovery/root/vendor/lib64/libbinder.so new file mode 100644 index 00000000..fd28eb2f Binary files /dev/null and b/recovery/root/vendor/lib64/libbinder.so differ diff --git a/recovery/root/vendor/lib64/libdiag.so b/recovery/root/vendor/lib64/libdiag.so index cec22b53..90ce91a9 100644 Binary files a/recovery/root/vendor/lib64/libdiag.so and b/recovery/root/vendor/lib64/libdiag.so differ diff --git a/recovery/root/vendor/lib64/libdrmfs.so b/recovery/root/vendor/lib64/libdrmfs.so index fed5150f..d4baa750 100644 Binary files a/recovery/root/vendor/lib64/libdrmfs.so and b/recovery/root/vendor/lib64/libdrmfs.so differ diff --git a/recovery/root/vendor/lib64/libdrmtime.so b/recovery/root/vendor/lib64/libdrmtime.so index 0fd0adb4..95506532 100644 Binary files a/recovery/root/vendor/lib64/libdrmtime.so and b/recovery/root/vendor/lib64/libdrmtime.so differ diff --git a/recovery/root/vendor/lib64/libkeymaster1.so b/recovery/root/vendor/lib64/libkeymaster1.so new file mode 100644 index 00000000..a5bff131 Binary files /dev/null and b/recovery/root/vendor/lib64/libkeymaster1.so differ diff --git a/recovery/root/vendor/lib64/libkeymaster_messages.so b/recovery/root/vendor/lib64/libkeymaster_messages.so new file mode 100644 index 00000000..96156db6 Binary files /dev/null and b/recovery/root/vendor/lib64/libkeymaster_messages.so differ diff --git a/recovery/root/vendor/lib64/libkeystore_binder.so b/recovery/root/vendor/lib64/libkeystore_binder.so new file mode 100644 index 00000000..019661d1 Binary files /dev/null and b/recovery/root/vendor/lib64/libkeystore_binder.so differ diff --git a/recovery/root/vendor/lib64/libqisl.so b/recovery/root/vendor/lib64/libqisl.so index 6981c602..9434b5de 100644 Binary files a/recovery/root/vendor/lib64/libqisl.so and b/recovery/root/vendor/lib64/libqisl.so differ diff --git a/recovery/root/vendor/lib64/librpmb.so b/recovery/root/vendor/lib64/librpmb.so index 774c4123..481b969c 100644 Binary files a/recovery/root/vendor/lib64/librpmb.so and b/recovery/root/vendor/lib64/librpmb.so differ diff --git a/recovery/root/vendor/lib64/libsecureui.so b/recovery/root/vendor/lib64/libsecureui.so index eaba03b2..8097a2cb 100644 Binary files a/recovery/root/vendor/lib64/libsecureui.so and b/recovery/root/vendor/lib64/libsecureui.so differ diff --git a/recovery/root/vendor/lib64/libsecureui_svcsock.so b/recovery/root/vendor/lib64/libsecureui_svcsock.so index fb4a2bba..43f6e884 100644 Binary files a/recovery/root/vendor/lib64/libsecureui_svcsock.so and b/recovery/root/vendor/lib64/libsecureui_svcsock.so differ diff --git a/recovery/root/vendor/lib64/libsecureuisvc_jni.so b/recovery/root/vendor/lib64/libsecureuisvc_jni.so index 8ee9e90f..ace88ff5 100644 Binary files a/recovery/root/vendor/lib64/libsecureuisvc_jni.so and b/recovery/root/vendor/lib64/libsecureuisvc_jni.so differ diff --git a/recovery/root/vendor/lib64/libsoftkeymaster.so b/recovery/root/vendor/lib64/libsoftkeymaster.so new file mode 100644 index 00000000..77b773b9 Binary files /dev/null and b/recovery/root/vendor/lib64/libsoftkeymaster.so differ diff --git a/recovery/root/vendor/lib64/libsoftkeymasterdevice.so b/recovery/root/vendor/lib64/libsoftkeymasterdevice.so new file mode 100644 index 00000000..4051d0c4 Binary files /dev/null and b/recovery/root/vendor/lib64/libsoftkeymasterdevice.so differ diff --git a/recovery/root/vendor/lib64/libssd.so b/recovery/root/vendor/lib64/libssd.so index 18e03e5d..2cd5d26e 100644 Binary files a/recovery/root/vendor/lib64/libssd.so and b/recovery/root/vendor/lib64/libssd.so differ diff --git a/recovery/root/vendor/lib64/libtime_genoff.so b/recovery/root/vendor/lib64/libtime_genoff.so index c2e82f29..538c2127 100644 Binary files a/recovery/root/vendor/lib64/libtime_genoff.so and b/recovery/root/vendor/lib64/libtime_genoff.so differ diff --git a/twrp.fstab b/twrp.fstab index 70233162..cf2acbed 100644 --- a/twrp.fstab +++ b/twrp.fstab @@ -3,15 +3,15 @@ # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK /system ext4 /dev/block/bootdevice/by-name/system flags=display="System" -/data ext4 /dev/block/bootdevice/by-name/userdata flags=length=-16384 +/system_image emmc /dev/block/bootdevice/by-name/system flags=backup=0 +/vendor ext4 /dev/block/bootdevice/by-name/cust flags=display="Vendor";backup=1;wipeingui +/vendor_image emmc /dev/block/bootdevice/by-name/cust flags=backup=0 +/data ext4 /dev/block/bootdevice/by-name/userdata flags=encryptable=footer;length=-16384 /cache ext4 /dev/block/bootdevice/by-name/cache flags=display="Cache" -/cust ext4 /dev/block/bootdevice/by-name/cust flags=display="Cust";backup=1 + /recovery emmc /dev/block/bootdevice/by-name/recovery flags=display="Recovery";backup=1 /boot emmc /dev/block/bootdevice/by-name/boot flags=display="Boot" /misc emmc /dev/block/bootdevice/by-name/misc flags=display="Misc" -/efs1 emmc /dev/block/bootdevice/by-name/modemst1 flags=display="EFS";backup=1 -/efs2 emmc /dev/block/bootdevice/by-name/modemst2 flags=backup=1;subpartitionof=/efs1 -/firmware vfat /dev/block/bootdevice/by-name/modem flags=display="Firmware";backup=1;mounttodecrypt /persist ext4 /dev/block/bootdevice/by-name/persist flags=display="Persist";backup=1 /sdcard1 auto /dev/block/mmcblk1p1 flags=display="MicroSD";storage;wipeingui;removable @@ -26,6 +26,8 @@ /devcfg emmc /dev/block/bootdevice/by-name/devcfg flags=backup=1;subpartitionof=/aboot # Modem backup/restore +/firmware vfat /dev/block/bootdevice/by-name/modem flags=display="Firmware";backup=1;mounttodecrypt +/firmware_image emmc /dev/block/bootdevice/by-name/modem flags=display="Modem";flashimg=1 /dsp emmc /dev/block/bootdevice/by-name/dsp flags=backup=1;subpartitionof=/firmware # EFS backup/restore