Skip to content

Commit

Permalink
Inital rebase for PB2-690Y
Browse files Browse the repository at this point in the history
Signed-off-by: yshalsager <[email protected]>
  • Loading branch information
yshalsager committed Nov 30, 2019
1 parent f1c97da commit f48f52f
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 134 deletions.
2 changes: 1 addition & 1 deletion Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# *not* include it on all devices, so it is safe even with hardware-specific
# components.

ifneq ($(filter kenzo,$(TARGET_DEVICE)),)
ifneq ($(filter PB2PRO,$(TARGET_DEVICE)),)

LOCAL_PATH := $(call my-dir)

Expand Down
2 changes: 1 addition & 1 deletion AndroidProducts.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
#

PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/omni_kenzo.mk
$(LOCAL_DIR)/omni_PB2PRO.mk
12 changes: 5 additions & 7 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DEVICE_TREE := device/xiaomi/kenzo
DEVICE_TREE := device/lenovo/PB2PRO

# Bootloader
TARGET_BOOTLOADER_BOARD_NAME := msm8952
Expand All @@ -22,8 +22,6 @@ TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := cortex-a53

# Kernel
#TARGET_KERNEL_SOURCE := kernel/xiaomi/msm8956
#TARGET_KERNEL_CONFIG := twrp_defconfig
TARGET_KERNEL_ARCH := arm64
TARGET_KERNEL_HEADER_ARCH := arm64

Expand All @@ -39,22 +37,22 @@ BOARD_MKBOOTIMG_ARGS := --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 -
BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864
BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 67108864
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560
BOARD_USERDATAIMAGE_PARTITION_SIZE := 26838785024
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 5368709120
BOARD_USERDATAIMAGE_PARTITION_SIZE := 55490624512
BOARD_FLASH_BLOCK_SIZE := 131072

# File systems
BOARD_HAS_LARGE_FILESYSTEM := true
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true
TARGET_USERIMAGES_USE_F2FS := false

# TWRP specific build flags
TW_THEME := portrait_hdpi
RECOVERY_SDCARD_ON_DATA := true
TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
TARGET_RECOVERY_QCOM_RTC_FIX := true
TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/devices/platform/msm_hsusb/gadget/lun0/file
TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness
TW_BRIGHTNESS_PATH := /sys/devices/soc.0/78b6000.i2c/i2c-2/2-0036/backlight/lm36923/brightness
TW_DEFAULT_BRIGHTNESS := 80
TW_DEFAULT_EXTERNAL_STORAGE := true
TW_EXCLUDE_SUPERSU := true
Expand Down
Binary file modified Image.gz-dtb
Binary file not shown.
17 changes: 2 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
## TWRP device tree for Xiaomi Redmi Note 3 (kenzo)

Add to `.repo/local_manifests/kenzo.xml`:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/xiaomi/kenzo" name="android_device_xiaomi_kenzo" remote="TeamWin" revision="android-7.1" />
</manifest>
```

Then run `repo sync` to check it out.
## TWRP device tree for Lenovo Phab 2 Pro (PB2-690Y)

To build:

```sh
. build/envsetup.sh
lunch omni_kenzo-eng
lunch omni_PB2PRO-eng
make -j8 recoveryimage
```

Kernel sources are available at: https://github.com/LineageOS/android_kernel_xiaomi_msm8956
12 changes: 6 additions & 6 deletions omni_kenzo.mk → omni_PB2PRO.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Release name
PRODUCT_RELEASE_NAME := kenzo
PRODUCT_RELEASE_NAME := PB2PRO

# Inherit from the common Open Source product configuration
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
Expand All @@ -12,8 +12,8 @@ PRODUCT_PACKAGES += \
charger

## Device identifier. This must come after all inclusions
PRODUCT_DEVICE := kenzo
PRODUCT_NAME := omni_kenzo
PRODUCT_BRAND := Xiaomi
PRODUCT_MODEL := Redmi Note 3
PRODUCT_MANUFACTURER := Xiaomi
PRODUCT_DEVICE := PB2PRO
PRODUCT_NAME := omni_PB2PRO
PRODUCT_BRAND := Lenovo
PRODUCT_MODEL := Phab 2 Pro
PRODUCT_MANUFACTURER := Lenovo
66 changes: 34 additions & 32 deletions recovery.fstab
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
/system ext4 /dev/block/bootdevice/by-name/system
/system_image emmc /dev/block/bootdevice/by-name/system
/data ext4 /dev/block/bootdevice/by-name/userdata flags=length=-16384
/cache ext4 /dev/block/bootdevice/by-name/cache
/cust ext4 /dev/block/bootdevice/by-name/cust flags=display="Cust"
/boot emmc /dev/block/bootdevice/by-name/boot
/recovery emmc /dev/block/bootdevice/by-name/recovery flags=backup=1
/aboot emmc /dev/block/bootdevice/by-name/aboot flags=display="Aboot";backup=1
/abootbak emmc /dev/block/bootdevice/by-name/abootbak flags=subpartitionof=/aboot;backup=1
/boot emmc /dev/block/bootdevice/by-name/boot flags=display="Boot";backup=1
/recovery emmc /dev/block/bootdevice/by-name/recovery flags=display="Recovery";backup=1
/splash emmc /dev/block/bootdevice/by-name/splash flags=display="Splash";backup=1;flashimg=1
/system_image emmc /dev/block/bootdevice/by-name/system
/system ext4 /dev/block/bootdevice/by-name/system
/persist ext4 /dev/block/bootdevice/by-name/persist flags=display="Persist";backup=1
/cache ext4 /dev/block/bootdevice/by-name/cache
/data ext4 /dev/block/bootdevice/by-name/userdata length=-16384,flags=encryptable=footer
/misc emmc /dev/block/bootdevice/by-name/misc flags=display="Misc"
/firmware vfat /dev/block/bootdevice/by-name/modem flags=display="Modem";fsflags="nosuid,nodev";backup=1

# For bootloader commands to recovery
/misc emmc /dev/block/bootdevice/by-name/misc
/sbl1 emmc /dev/block/bootdevice/by-name/sbl1 flags=display="Firmware-update";backup=1
/sbl1bak emmc /dev/block/bootdevice/by-name/sbl1bak flags=subpartitionof=/sbl1;backup=1
/tz emmc /dev/block/bootdevice/by-name/tz flags=subpartitionof=/sbl1;backup=1
/tzbak emmc /dev/block/bootdevice/by-name/tzbak flags=subpartitionof=/sbl1;backup=1
/rpm emmc /dev/block/bootdevice/by-name/rpm flags=subpartitionof=/sbl1;backup=1
/rpmbak emmc /dev/block/bootdevice/by-name/rpmbak flags=subpartitionof=/sbl1;backup=1
/mdtp emmc /dev/block/bootdevice/by-name/mdtp flags=subpartitionof=/sbl1;backup=1
/devcfg emmc /dev/block/bootdevice/by-name/devcfg flags=subpartitionof=/sbl1;backup=1
/devcfgbak emmc /dev/block/bootdevice/by-name/devcfgbak flags=subpartitionof=/sbl1;backup=1
/keymaster emmc /dev/block/bootdevice/by-name/keymaster flags=subpartitionof=/sbl1;backup=1
/keymasterbak emmc /dev/block/bootdevice/by-name/keymasterbak flags=subpartitionof=/sbl1;backup=1
/cmnlib emmc /dev/block/bootdevice/by-name/cmnlib flags=subpartitionof=/sbl1;backup=1
/cmnlibbak emmc /dev/block/bootdevice/by-name/cmnlibbak flags=subpartitionof=/sbl1;backup=1
/cmnlib64 emmc /dev/block/bootdevice/by-name/cmnlib64 flags=subpartitionof=/sbl1;backup=1
/cmnlib64bak emmc /dev/block/bootdevice/by-name/cmnlib64bak flags=subpartitionof=/sbl1;backup=1

# Firmware
/firmware vfat /dev/block/bootdevice/by-name/modem flags=backup=1;display="Firmware";mounttodecrypt
/frp emmc /dev/block/bootdevice/by-name/config flags=display="Frp";wipeingui
/fsg emmc /dev/block/bootdevice/by-name/fsg flags=display="Efs";backup=1
/modemst1 emmc /dev/block/bootdevice/by-name/modemst1 flags=subpartitionof=/fsg;backup=1
/modemst2 emmc /dev/block/bootdevice/by-name/modemst2 flags=subpartitionof=/fsg;backup=1
/mota emmc /dev/block/bootdevice/by-name/mota

/aboot emmc /dev/block/bootdevice/by-name/aboot flags=backup=1;display="Bootloader"
/cmnlib emmc /dev/block/bootdevice/by-name/cmnlib flags=backup=1;subpartitionof=/aboot
/hyp emmc /dev/block/bootdevice/by-name/hyp flags=backup=1;subpartitionof=/aboot
/tz emmc /dev/block/bootdevice/by-name/tz flags=backup=1;subpartitionof=/aboot
/rpm emmc /dev/block/bootdevice/by-name/rpm flags=backup=1;subpartitionof=/aboot
/keymaster emmc /dev/block/bootdevice/by-name/keymaster flags=backup=1;subpartitionof=/aboot
/devcfg emmc /dev/block/bootdevice/by-name/devcfg flags=backup=1;subpartitionof=/aboot

# Modem backup/restore
/modem emmc /dev/block/bootdevice/by-name/modem flags=backup=1;display="Modem"
/dsp emmc /dev/block/bootdevice/by-name/dsp flags=backup=1;subpartitionof=/modem

# EFS backup/restore
/efs1 emmc /dev/block/bootdevice/by-name/modemst1 flags=backup=1;display="EFS"
/efs2 emmc /dev/block/bootdevice/by-name/modemst2 flags=backup=1;subpartitionof=/efs1
/efsg emmc /dev/block/bootdevice/by-name/fsg flags=backup=1;subpartitionof=/efs1
/efsc emmc /dev/block/bootdevice/by-name/fsc flags=backup=1;subpartitionof=/efs1

# Removable devices
/sdcard1 auto /dev/block/mmcblk1p1 flags=display="MicroSD";storage;wipeingui;removable
/usb-otg auto /dev/block/sda1 flags=display="USB OTG";storage;wipeingui;removable
/external_sd auto /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display="Micro SDCard";storage;wipeingui;removable
/usbotg auto /dev/block/sda1 /dev/block/sda flags=display="Usb-Otg";storage;wipeingui;removable
2 changes: 0 additions & 2 deletions recovery/root/fstab.qcom
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
/dev/block/bootdevice/by-name/boot /boot emmc defaults recoveryonly
/dev/block/bootdevice/by-name/recovery /recovery emmc defaults recoveryonly
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard wait
/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,inline_xattr,data_flush wait,check,encryptable=footer,formattable,length=-16384
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,noatime,barrier=1,noauto_da_alloc wait,check,encryptable=footer,formattable,length=-16384
/dev/block/bootdevice/by-name/cache /cache f2fs nosuid,nodev,noatime,inline_xattr,flush_merge,data_flush wait,check,formattable
/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,nodev,noatime,barrier=1 wait,check,formattable
/dev/block/bootdevice/by-name/persist /persist ext4 nosuid,nodev,barrier=1 wait
/dev/block/bootdevice/by-name/config /frp emmc defaults defaults
Expand Down
63 changes: 6 additions & 57 deletions recovery/root/init.recovery.usb.rc
Original file line number Diff line number Diff line change
@@ -1,81 +1,30 @@
# Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

on fs
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

write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 2717
write /sys/class/android_usb/android0/idProduct 904D
write /sys/class/android_usb/android0/idVendor 18D1
write /sys/class/android_usb/android0/idProduct 4EE2
write /sys/class/android_usb/android0/f_ffs/aliases adb
write /sys/class/android_usb/android0/functions mtp,adb
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}

setprop sys.usb.config ${persist.sys.usb.config}

on property:sys.usb.config=none
stop adbd
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/bDeviceClass 0
setprop sys.usb.state ${sys.usb.config}

# ADB only USB configuration
# This is the fallback configuration if the
# USB manager fails to set a standard configuration
on property:sys.usb.config=adb
stop adbd
on property:sys.usb.config=mass_storage,adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 05C6
write /sys/class/android_usb/android0/idProduct 9015
write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state ${sys.usb.config}

on property:sys.usb.config=mass_storage,adb
stop adbd
on property:sys.usb.config=mtp,adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 05C6
write /sys/class/android_usb/android0/idProduct 9015
write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state ${sys.usb.config}

on property:sys.usb.config=mtp,adb
stop adbd
on property:sys.usb.config=adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 2717
write /sys/class/android_usb/android0/idProduct ff48
write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/enable 1
write /sys/class/android_usb/android0/enable ${service.adb.root}
start adbd
setprop sys.usb.state ${sys.usb.config}
11 changes: 1 addition & 10 deletions recovery/root/ueventd.qcom.rc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/dev/kgsl-2d0 0666 root root
/dev/kgsl-2d1 0666 root root
/dev/ion 0664 system system
/dev/rtc0 0640 system system
/dev/rtc0 0660 system system
/dev/smd0 0660 system system
/dev/smd4 0660 system system
/dev/smd_cxm_qmi 0640 radio radio
Expand Down Expand Up @@ -116,8 +116,6 @@
/dev/jpeg3 0660 system camera
/dev/adsprpc-smd 0664 system system
/dev/system_health_monitor 0640 radio system
/dev/fpc1020 0666 system system

# wlan
/dev/wcnss_wlan 0660 system system
/dev/wcnss_ctrl 0660 system system
Expand Down Expand Up @@ -253,10 +251,3 @@

# Add device block for FRP
/dev/block/platform/soc.0/7824900.sdhci/by-name/config 0660 system system

# For lirc
/dev/lirc0 0660 system system

# FPC
/sys/devices/soc.0/fpc_fpc1020.* irq 0660 system system
/sys/devices/soc.0/fpc_fpc1020.* enable_wakeup 0660 system system
1 change: 0 additions & 1 deletion system.prop
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
ro.sf.lcd_density=440
ro.hardware.keystore=msm8952
persist.sys.usb.config=mtp,adb
4 changes: 2 additions & 2 deletions vendorsetup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
add_lunch_combo omni_kenzo-eng
add_lunch_combo omni_kenzo-userdebug
add_lunch_combo omni_PB2PRO-eng
add_lunch_combo omni_PB2PRO-userdebug

0 comments on commit f48f52f

Please sign in to comment.