diff --git a/BoardConfig.mk b/BoardConfig.mk index 20bbf76..9d60a32 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -50,23 +50,12 @@ TARGET_BOARD_PLATFORM := trinket TARGET_BOARD_PLATFORM_GPU := qcom-adreno640 # 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 swiotlb=1 earlycon=msm_geni_serial,0x4a90000 cgroup.memory=nokmem,nosocket androidboot.selinux=permissive androidboot.usbconfigfs=true BOARD_KERNEL_BASE := 0x00000000 +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 swiotlb=1 earlycon=msm_geni_serial,0x4a90000 cgroup.memory=nokmem,nosocket androidboot.selinux=permissive androidboot.usbconfigfs=true BOARD_KERNEL_PAGESIZE := 4096 -BOARD_KERNEL_TAGS_OFFSET := 0x00000100 -BOARD_RAMDISK_OFFSET := 0x01000000 -BOARD_KERNEL_IMAGE_NAME := Image.gz -TARGET_KERNEL_ARCH := arm64 -TARGET_KERNEL_HEADER_ARCH := arm64 -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_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-dtb +TARGET_FORCE_PREBUILT_KERNEL := true +TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilt/Image.gz-dtb # Avb BOARD_AVB_ENABLE := true @@ -82,16 +71,10 @@ BOARD_BOOTIMAGE_PARTITION_SIZE := 134217728 BOARD_RECOVERYIMAGE_PARTITION_SIZE := 67108864 BOARD_USERDATAIMAGE_PARTITION_SIZE := 52554612224 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 -BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := ext4 -BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4 -BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := ext4 -BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 -TARGET_COPY_OUT_ODM := odm -TARGET_COPY_OUT_PRODUCT := product -TARGET_COPY_OUT_SYSTEM_EXT := system_ext + TARGET_COPY_OUT_VENDOR := vendor # Partitions Dynamic @@ -101,9 +84,9 @@ BOARD_SUPER_PARTITION_VENDOR_DEVICE_SIZE := 1610612736 BOARD_SUPER_PARTITION_SYSTEM_DEVICE_SIZE := 4831838208 BOARD_SUPER_PARTITION_SIZE := $(shell expr $(BOARD_SUPER_PARTITION_VENDOR_DEVICE_SIZE) + $(BOARD_SUPER_PARTITION_SYSTEM_DEVICE_SIZE) ) -BOARD_SUPER_PARTITION_GROUPS := qti_dynamic_partitions -BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST := odm product system system_ext vendor -BOARD_QTI_DYNAMIC_PARTITIONS_SIZE := $(shell expr $(BOARD_SUPER_PARTITION_SIZE) - 4194304 ) +BOARD_SUPER_PARTITION_GROUPS := ginkgo_dynapart +BOARD_GINKGO_DYNAPART_PARTITION_LIST := odm product system system_ext vendor +BOARD_GINKGO_DYNAPART_SIZE := $(shell expr $(BOARD_SUPER_PARTITION_SIZE) - 4194304 ) # System as root BOARD_BUILD_SYSTEM_ROOT_IMAGE := false @@ -114,8 +97,8 @@ TARGET_USERIMAGES_USE_EXT4 := true TARGET_USERIMAGES_USE_F2FS := true # Init -TARGET_INIT_VENDOR_LIB := //$(DEVICE_PATH):libinit_ginkgo -TARGET_RECOVERY_DEVICE_MODULES := libinit_ginkgo +#TARGET_INIT_VENDOR_LIB := //$(DEVICE_PATH):libinit_ginkgo +#TARGET_RECOVERY_DEVICE_MODULES := libinit_ginkgo # Encryption BOARD_USES_METADATA_PARTITION := true @@ -169,7 +152,6 @@ TW_EXCLUDE_APEX := true TW_FRAMERATE := 60 TW_FORCE_KEYMASTER_VER := true TW_PREPARE_DATA_MEDIA_EARLY := true -TW_DEVICE_VERSION=FbeV2-A14 #Properties TW_OVERRIDE_SYSTEM_PROPS := \ @@ -178,10 +160,4 @@ TW_OVERRIDE_SYSTEM_PROPS := \ # TWRP Debug Flags TWRP_INCLUDE_LOGCAT := true TARGET_USES_LOGD := true - -# PBRP specific build flags -PB_DISABLE_DEFAULT_DM_VERITY := true -PB_DISABLE_DEFAULT_TREBLE_COMP := true - -# PB Torch PB_TORCH_PATH := "/sys/class/leds/led:torch_0" diff --git a/omni.dependencies b/omni.dependencies deleted file mode 100644 index 0a2cc6c..0000000 --- a/omni.dependencies +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "repository": "android_device_qcom_common", - "target_path": "device/qcom/common" - }, - { - "repository": "android_device_qcom_twrp-common", - "target_path": "device/qcom/twrp-common" - } -] diff --git a/prebuilt/Image.gz b/prebuilt/Image.gz-dtb similarity index 62% rename from prebuilt/Image.gz rename to prebuilt/Image.gz-dtb index 6f6c540..3b72f1d 100644 Binary files a/prebuilt/Image.gz and b/prebuilt/Image.gz-dtb differ diff --git a/prebuilt/dtbo.img b/prebuilt/dtbo.img deleted file mode 100644 index 2b77a25..0000000 Binary files a/prebuilt/dtbo.img and /dev/null differ diff --git a/recovery/root/init.recovery.qcom.rc b/recovery/root/init.recovery.qcom.rc index e7ed1f6..af37bb1 100644 --- a/recovery/root/init.recovery.qcom.rc +++ b/recovery/root/init.recovery.qcom.rc @@ -28,11 +28,14 @@ import /init.recovery.qcom_decrypt.rc on init -setprop prepdecrypt.loglevel 2 + setprop prepdecrypt.loglevel 2 + exec u:r:recovery:s0 -- /system/bin/merge-fstab.sh on fs wait /dev/block/platform/soc/${ro.boot.bootdevice} symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice - + mkdir /firmware + mount vfat /dev/block/bootdevice/by-name/modem /firmware ro + on boot start health-hal-2-0 diff --git a/recovery/root/system/bin/merge-fstab.sh b/recovery/root/system/bin/merge-fstab.sh new file mode 100644 index 0000000..5de89b6 --- /dev/null +++ b/recovery/root/system/bin/merge-fstab.sh @@ -0,0 +1,29 @@ +#!/system/bin/sh +# Determine the filesystem of a block device + +FBE=$(getprop ro.crypto.dm_default_key.options_format.version) + +# Check if EROFS filesystem is present +dd if=/dev/block/by-name/system bs=256k count=1 | strings | grep -q -E "ginkgo_erofs_dynapart" +ISEROFS=$? + +# Dynamic partitions +if dd if=/dev/block/by-name/system bs=256k count=1 | strings | grep -q -E "ginkgo_dynapart|qti_dynamic_partitions|ginkgo_erofs_dynapart"; then + if [ "$ISEROFS" -eq 0 ]; then + cat /system/etc/recovery.fstab.erofs >> /system/etc/recovery.fstab + else + cat /system/etc/recovery.fstab.ext4 >> /system/etc/recovery.fstab + fi + + if [ "$FBE" = "2" ]; then + cat /system/etc/recovery.fstab.fbev2 >> /system/etc/recovery.fstab + fi + + for p in system vendor; do + echo "/super_${p} emmc /dev/block/bootdevice/by-name/${p} flags=display=\"Super_${p}\";backup=1" >> /system/etc/twrp.flags + done +else + # Non-dynamic partitions + cat /system/etc/twrp.flags.nondynpart >> /system/etc/twrp.flags + cat /system/etc/recovery.fstab.fbev1 >> /system/etc/recovery.fstab +fi diff --git a/recovery/root/system/etc/recovery.fstab b/recovery/root/system/etc/recovery.fstab index 91bc58d..708861a 100644 --- a/recovery/root/system/etc/recovery.fstab +++ b/recovery/root/system/etc/recovery.fstab @@ -33,16 +33,8 @@ # Currently we dont have e2fsck compiled. So fs check would failed. # -system /system ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey -system_ext /system_ext ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount -product /product ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount -vendor /vendor ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount -odm /odm ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount /dev/block/bootdevice/by-name/cache /cache ext4 nosuid,noatime,nodev,barrier=1 wait -/dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,check,formattable,first_stage_mount -# Add fs_mgr flag - sysfs_path=/sys/devices/platform/soc/xxxx.[ufshc|sdhci] to userdata entry, based on UFS|eMMC device. -/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt latemount,wait,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,metadata_encryption=aes-256-xts:wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,quota,reservedsize=128M,checkpoint=fs # Need to have this entry in here even though the mount point itself is no longer needed. # The update_engine code looks for this entry in order to determine the boot device address # and fails if it does not find it. diff --git a/recovery/root/system/etc/recovery.fstab.erofs b/recovery/root/system/etc/recovery.fstab.erofs new file mode 100644 index 0000000..00931c7 --- /dev/null +++ b/recovery/root/system/etc/recovery.fstab.erofs @@ -0,0 +1,5 @@ +system /system erofs ro wait,avb,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey +system_ext /system_ext erofs ro wait,avb,logical,first_stage_mount +product /product erofs ro wait,avb,logical,first_stage_mount +vendor /vendor erofs ro wait,avb,logical,first_stage_mount +odm /odm erofs ro wait,avb,logical,first_stage_mount diff --git a/recovery/root/system/etc/recovery.fstab.ext4 b/recovery/root/system/etc/recovery.fstab.ext4 new file mode 100644 index 0000000..3fbe621 --- /dev/null +++ b/recovery/root/system/etc/recovery.fstab.ext4 @@ -0,0 +1,5 @@ +system /system ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey +system_ext /system_ext ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +product /product ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +vendor /vendor ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +odm /odm ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount diff --git a/recovery/root/system/etc/recovery.fstab.fbev1 b/recovery/root/system/etc/recovery.fstab.fbev1 new file mode 100644 index 0000000..e172188 --- /dev/null +++ b/recovery/root/system/etc/recovery.fstab.fbev1 @@ -0,0 +1,2 @@ +/dev/block/bootdevice/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,formattable,wrappedkey +/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,nodiscard,alloc_mode=reuse,fsync_mode=nobarrier,inlinecrypt latemount,wait,check,fileencryption=ice,wrappedkey,keydirectory=/metadata/vold/metadata_encryption,quota diff --git a/recovery/root/system/etc/recovery.fstab.fbev2 b/recovery/root/system/etc/recovery.fstab.fbev2 new file mode 100644 index 0000000..962ebc8 --- /dev/null +++ b/recovery/root/system/etc/recovery.fstab.fbev2 @@ -0,0 +1,2 @@ +/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,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt latemount,wait,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,metadata_encryption=aes-256-xts:wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,quota,reservedsize=128M,checkpoint=fs diff --git a/recovery/root/system/etc/twrp.flags b/recovery/root/system/etc/twrp.flags index 11cc690..00df27b 100644 --- a/recovery/root/system/etc/twrp.flags +++ b/recovery/root/system/etc/twrp.flags @@ -7,15 +7,7 @@ /dtbo emmc /dev/block/bootdevice/by-name/dtbo flags=backup=1;display="Dtbo";flashimg=1 /cache ext4 /dev/block/bootdevice/by-name/cache /recovery emmc /dev/block/bootdevice/by-name/recovery flags=backup=1 -/system_root ext4 /dev/block/bootdevice/by-name/system flags=display="System";backup=0;wipeingui -/system_ext ext4 /dev/block/bootdevice/by-name/system_ext flags=display="System_ext";backup=0;wipeingui -/vendor ext4 /dev/block/bootdevice/by-name/vendor flags=display="Vendor";backup=0;wipeingui - -/system_image emmc /dev/block/bootdevice/by-name/system -/vendor_image emmc /dev/block/bootdevice/by-name/vendor - /firmware vfat /dev/block/bootdevice/by-name/modem flags=display="Firmware";mounttodecrypt -/cust ext4 /dev/block/bootdevice/by-name/cust flags=display="Cust" /misc emmc /dev/block/bootdevice/by-name/misc /modem emmc /dev/block/bootdevice/by-name/modem flags=backup=1;display="Modem" /bluetooth emmc /dev/block/bootdevice/by-name/bluetooth flags=backup=1;subpartitionof=/modem diff --git a/recovery/root/system/etc/twrp.flags.nondynpart b/recovery/root/system/etc/twrp.flags.nondynpart new file mode 100644 index 0000000..bf2b6f0 --- /dev/null +++ b/recovery/root/system/etc/twrp.flags.nondynpart @@ -0,0 +1,4 @@ +/system_root ext4 /dev/block/bootdevice/by-name/system flags=display="System";backup=0;wipeingui +/vendor ext4 /dev/block/bootdevice/by-name/vendor flags=display="Vendor";backup=0;wipeingui +/system_image emmc /dev/block/bootdevice/by-name/system +/vendor_image emmc /dev/block/bootdevice/by-name/vendor