diff --git a/AndroidProducts.mk b/AndroidProducts.mk index f09ea92..5971026 100644 --- a/AndroidProducts.mk +++ b/AndroidProducts.mk @@ -15,4 +15,4 @@ # PRODUCT_MAKEFILES := \ - $(LOCAL_DIR)/lineage_renoir.mk + $(LOCAL_DIR)/twrp_renoir.mk diff --git a/BoardConfig.mk b/BoardConfig.mk index cadf8b9..1fbac1c 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -85,8 +85,9 @@ BOARD_KERNEL_CMDLINE += video=vfb:640x400,bpp=32,memsize=3072000 KERNEL_LD := LD=ld.lld TARGET_KERNEL_ADDITIONAL_FLAGS := DTC_EXT=$(shell pwd)/prebuilts/misc/linux-x86/dtc/dtc TARGET_KERNEL_CLANG_COMPILE := true -TARGET_KERNEL_CONFIG := vendor/renoir-qgki_defconfig +TARGET_KERNEL_CONFIG := renoir_defconfig TARGET_KERNEL_SOURCE := kernel/xiaomi/renoir +NEED_KERNEL_MODULE_RECOVERY := true # Metadata BOARD_USES_METADATA_PARTITION := true diff --git a/device.mk b/device.mk index 90232b0..f073293 100644 --- a/device.mk +++ b/device.mk @@ -64,7 +64,8 @@ TARGET_SCREEN_WIDTH := 1080 # Soong namespaces PRODUCT_SOONG_NAMESPACES += \ $(LOCAL_PATH) \ - hardware/qcom-caf/bootctrl + hardware/qcom-caf/bootctrl \ + vendor/qcom/opensource/commonsys-intf/display # Update engine PRODUCT_PACKAGES += \ @@ -95,14 +96,22 @@ TARGET_USES_MKE2FS := true TW_NO_SCREEN_BLANK := true TW_EXCLUDE_APEX := true +# Crypto +TW_INCLUDE_CRYPTO := true +TW_INCLUDE_CRYPTO_FBE := true +TW_INCLUDE_FBE_METADATA_DECRYPT := true +PLATFORM_SECURITY_PATCH := 2099-12-31 VENDOR_SECURITY_PATCH := 2099-12-31 +PLATFORM_VERSION := 16.1.0 +BOARD_USES_QCOM_FBE_DECRYPTION := true TARGET_RECOVERY_DEVICE_MODULES += \ libandroidicu \ libdisplayconfig.qti \ libion \ vendor.display.config@1.0 \ - vendor.display.config@2.0 + vendor.display.config@2.0 \ + libdisplayconfig.qti RECOVERY_LIBRARY_SOURCE_FILES += \ $(TARGET_OUT_SHARED_LIBRARIES)/libion.so \ diff --git a/recovery/root/init.recovery.qcom.rc b/recovery/root/init.recovery.qcom.rc index 72c66ed..5283e13 100644 --- a/recovery/root/init.recovery.qcom.rc +++ b/recovery/root/init.recovery.qcom.rc @@ -1,13 +1,5 @@ import /init.recovery.qcom_decrypt.rc -service touchfeature /system/bin/vendor.xiaomi.hw.touchfeature@1.0-service - user root - group root - setenv LD_LIBRARY_PATH /vendor/lib64:/vendor/lib:/system/lib64:/system/lib:/sbin - disabled - oneshot - seclabel u:r:recovery:s0 - on init write /sys/class/backlight/panel0-backlight/brightness 200 # Create location for fs_mgr to store abbreviated output from filesystem @@ -25,9 +17,3 @@ on fs on boot start health-hal-2-1 setprop sys.usb.config adb - - # Xiaomi touch - mknod /dev/xiaomi_touch c 10 120 - chown system system /dev/xiaomi-touch - chmod 0664 /dev/xiaomi-touch - start touchfeature diff --git a/recovery/root/system/bin/postrecoveryboot.sh b/recovery/root/system/bin/postrecoveryboot.sh new file mode 100755 index 0000000..92ae8f8 --- /dev/null +++ b/recovery/root/system/bin/postrecoveryboot.sh @@ -0,0 +1,61 @@ +#!/system/bin/sh + + +# find necessary modules for touchscreen, etc. to ensure no mismatch with kernel +copy-modules() +{ + if grep -Fq twrpfastboot /proc/cmdline + then + echo "using ramdisk modules (fastboot boot)" + return + fi + + if [ -f /lib/modules/modules.load.recovery -a -f /lib/modules/xiaomi_touch.ko ] && lsmod | grep -Fq xiaomi_touch + then + echo "using vendor_boot modules" + exit 0 + fi + + suffix=$(getprop ro.boot.slot_suffix) + if [ -z "$suffix" ] + then + suffix="_$(getprop ro.boot.slot)" + fi + + echo "using vendor$suffix modules" + mkdir /v + mount -t ext4 -o ro /dev/block/mapper/vendor$suffix /v + rm -f /vendor/lib/modules/* + cp -afR /v/lib/modules/* /vendor/lib/modules/ + umount /v + rmdir /v +} + +install-touch() +{ + if [ -f /lib/modules/modules.load.recovery -a -f /lib/modules/xiaomi_touch.ko ] && lsmod | grep -Fq xiaomi_touch + then + echo "vendor_boot touchscreen modules already loaded" + exit 0 + fi + + if [ ! -f /vendor/lib/modules/xiaomi_touch.ko ] + then + echo "! vendor touchscreen modules not found" + exit 1 + fi + + echo "loading vendor touchscreen modules" + for module in $(modprobe -D -d /vendor/lib/modules goodix_core focaltech_touch | grep modules) + do + insmod /vendor/lib/modules/$(basename $module) + done +} + +copy-modules +install-touch + +exit 0 + + + diff --git a/recovery/root/system/etc/recovery.fstab b/recovery/root/system/etc/recovery.fstab index 2d9be9a..55ecc56 100644 --- a/recovery/root/system/etc/recovery.fstab +++ b/recovery/root/system/etc/recovery.fstab @@ -40,5 +40,6 @@ system_ext /system_ext e product /product ext4 ro,barrier=1,discard wait,slotselect vendor /vendor ext4 ro,barrier=1,discard wait,slotselect odm /odm ext4 ro,barrier=1,discard wait,slotselect -/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,inlinecrypt,reserve_root=32768,resgid=1065,fsync_mode=nobarrier wait,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption +/dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,check,formattable,first_stage_mount +/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,nodiscard,inlinecrypt,reserve_root=32768,resgid=1065,fsync_mode=nobarrier latemount,wait,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,metadata_encryption=aes-256-xts:wrappedkey_v0,quota,reservedsize=128M,sysfs_path=/sys/devices/platform/soc/1d84000.ufshc,checkpoint=fs /dev/block/bootdevice/by-name/misc /misc emmc defaults defaults diff --git a/recovery/root/ueventd.rc b/recovery/root/ueventd.qcom.rc similarity index 100% rename from recovery/root/ueventd.rc rename to recovery/root/ueventd.qcom.rc diff --git a/recovery/root/vendor/bin/hw/vendor.xiaomi.hw.touchfeature@1.0-service b/recovery/root/vendor/bin/hw/vendor.xiaomi.hw.touchfeature@1.0-service deleted file mode 100644 index 16a8396..0000000 Binary files a/recovery/root/vendor/bin/hw/vendor.xiaomi.hw.touchfeature@1.0-service and /dev/null differ diff --git a/recovery/root/vendor/lib/hw/vendor.xiaomi.hw.touchfeature@1.0-impl.so b/recovery/root/vendor/lib/hw/vendor.xiaomi.hw.touchfeature@1.0-impl.so deleted file mode 100644 index 7e58140..0000000 Binary files a/recovery/root/vendor/lib/hw/vendor.xiaomi.hw.touchfeature@1.0-impl.so and /dev/null differ diff --git a/recovery/root/vendor/lib/vendor.xiaomi.hw.touchfeature@1.0.so b/recovery/root/vendor/lib/vendor.xiaomi.hw.touchfeature@1.0.so deleted file mode 100644 index 32a0ebc..0000000 Binary files a/recovery/root/vendor/lib/vendor.xiaomi.hw.touchfeature@1.0.so and /dev/null differ diff --git a/recovery/root/vendor/lib64/hw/vendor.xiaomi.hw.touchfeature@1.0-impl.so b/recovery/root/vendor/lib64/hw/vendor.xiaomi.hw.touchfeature@1.0-impl.so deleted file mode 100644 index 850825e..0000000 Binary files a/recovery/root/vendor/lib64/hw/vendor.xiaomi.hw.touchfeature@1.0-impl.so and /dev/null differ diff --git a/recovery/root/vendor/lib64/vendor.display.config@1.0.so b/recovery/root/vendor/lib64/vendor.display.config@1.0.so deleted file mode 100644 index 14972e7..0000000 Binary files a/recovery/root/vendor/lib64/vendor.display.config@1.0.so and /dev/null differ diff --git a/recovery/root/vendor/lib64/vendor.xiaomi.hw.touchfeature@1.0.so b/recovery/root/vendor/lib64/vendor.xiaomi.hw.touchfeature@1.0.so deleted file mode 100644 index 2c9bec5..0000000 Binary files a/recovery/root/vendor/lib64/vendor.xiaomi.hw.touchfeature@1.0.so and /dev/null differ diff --git a/lineage_renoir.mk b/twrp_renoir.mk similarity index 91% rename from lineage_renoir.mk rename to twrp_renoir.mk index 2612b33..4c63a35 100644 --- a/lineage_renoir.mk +++ b/twrp_renoir.mk @@ -22,11 +22,11 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk) $(call inherit-product, device/xiaomi/renoir/device.mk) # Inherit some common TWRP stuff. -$(call inherit-product, vendor/lineage/config/common_full_phone.mk) +$(call inherit-product, vendor/twrp/config/common.mk) # Device identifier. This must come after all inclusions PRODUCT_DEVICE := renoir -PRODUCT_NAME := lineage_renoir +PRODUCT_NAME := twrp_renoir PRODUCT_BRAND := Xiaomi PRODUCT_MODEL := Mi 11 Lite 5G PRODUCT_MANUFACTURER := Xiaomi