We're hiring! Apply Now

Hovatek Forum DEVELOPMENT Android [HELP] Building TWRP From Source Issue

[HELP] Building TWRP From Source Issue

[HELP] Building TWRP From Source Issue

Pages (3): 1 2 3 Next
xXHenneBXx
xXHenneBXx
xXHenneBXx
Junior Member
21
27-03-2025, 05:35 PM
#1



so ive made a device tree using aospdtgen, and changing things as needed, im building fine, but when it come to flashing. it flashes !! but when i go to boot into TWRP.. ill explain process 

First it boots normal process of bootscreen/unlocked lock flag notice, then the backscreen will light up as if about to boot into TWP but it doesnt it just siply stays on bootscreen, but enters adb recovery in which doing some debugging is showing its on twrp build, but TWRP is not starting ?

this is my BoardConfig:

Code:

# Copyright (C) 2025 The Android Open Source Project
#
# SPDX-License-Identifier: Apache-2.0
#

DEVICE_PATH := device/umidigi/g2315guf_v1_gc_ym_a15c_t

# A/B
AB_OTA_UPDATER := true
AB_OTA_PARTITIONS += \
boot \
dtbo \
vbmeta \
odm \
product \
system\
vbmeta_system \
system_ext \
vbmeta_vendor \
vendor \
vendor_dlkm

BOARD_USES_RECOVERY_AS_BOOT := false
#TARGET_NO_KERNEL := false
#TARGET_NO_RECOVERY := true
TARGET_SUPPORTS_VNDK := true


# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_ABI:= arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := generic
TARGET_CPU_VARIANT_RUNTIME := cortex-a75
TARGET_SUPPORTS_64_BIT_APPS := true

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_2ND_CPU_VARIANT_RUNTIME := cortex-a55
TARGET_SUPPORTS_32_BIT_APPS := true


# Bootloader
TARGET_BOOTLOADER_BOARD_NAME := g2315guf_v1_gc_ym_a15c_t
TARGET_NO_BOOTLOADER := true

ENABLE_CPUSETS := true
ENABLE_SCHEDBOOST := true

# Display
TARGET_SCREEN_DENSITY := 320
TARGET_SCREEN_WIDTH := 720
TARGET_SCREEN_HEIGHT := 1650

# Kernel
KERNEL_VERSION := 5.4.210
BOARD_BOOT_HEADER_VERSION := 4
BOARD_KERNEL_BASE := 0x00000000
BOARD_KERNEL_CMDLINE := console=ttyS1,115200n8 buildvariant=user androidboot.selinux=permissive
BOARD_KERNEL_PAGESIZE := 4096
BOARD_KERNEL_OFFSET := 0x00008000
BOARD_RAMDISK_OFFSET := 0x05400000
BOARD_KERNEL_TAGS_OFFSET := 0x00000100
BOARD_DTB_OFFSET := 0x01f00000
TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilts/Image
TARGET_PREBUILT_DTB := $(DEVICE_PATH)/prebuilts/dtb.img
BOARD_MKBOOTIMG_ARGS += --dtb $(TARGET_PREBUILT_DTB)
BOARD_KERNEL_IMAGE_NAME := Image
BOARD_MKBOOTIMG_ARGS += --header_version 4
BOARD_MKBOOTIMG_ARGS += --ramdisk_offset $(BOARD_RAMDISK_OFFSET)
BOARD_MKBOOTIMG_ARGS += --tags_offset $(BOARD_KERNEL_TAGS_OFFSET)
BOARD_MKBOOTIMG_ARGS += --dtb_offset $(BOARD_DTB_OFFSET)
BOARD_MKBOOTIMG_ARGS += --kernel_offset $(BOARD_KERNEL_OFFSET)
BOARD_KERNEL_SEPARATED_DTBO := true
TARGET_PREBUILT_DTBOIMAGE := $(DEVICE_PATH)/prebuilts/dtbo.img

LIB_MODULES := $(wildcard $(DEVICE_PATH)/rootdir/lib/modules/*.ko)

BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := \
    modules.load.recovery \
    modules.alias \
    modules.load \
    $(LIB_MODULES)

BOARD_VENDOR_RAMDISK_KERNEL_MODULES := \
    $(patsubst %, $(TARGET_OUT_RECOVERY_ROOT)/lib/modules/%, $(notdir $(LIB_MODULES))) \

# Explicitly set the kernel version for depmod
KERNEL_VERSION := 5.4.210
BOARD_VENDOR_KERNEL_MODULES_DEPMOD_VERSION := $(KERNEL_VERSION)

# Kernel - prebuilt
TARGET_FORCE_PREBUILT_KERNEL := true
ifeq ($(TARGET_FORCE_PREBUILT_KERNEL),true)
TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilts/Image
TARGET_PREBUILT_DTB := $(DEVICE_PATH)/prebuilts/dtb.img
BOARD_MKBOOTIMG_ARGS += --dtb $(TARGET_PREBUILT_DTB)
BOARD_PREBUILT_DTBOIMAGE := $(DEVICE_PATH)/prebuilts/dtbo.img
BOARD_KERNEL_SEPARATED_DTBO := true
endif

# Partitions
BOARD_FLASH_BLOCK_SIZE := 262144 # (BOARD_KERNEL_PAGESIZE * 64)
BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864
BOARD_DTBOIMG_PARTITION_SIZE := 8388608
BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 104857600
BOARD_SUPER_PARTITION_SIZE := 3263332928
BOARD_SUPER_PARTITION_GROUPS := umidigi_dynamic_partitions
BOARD_UMIDIGI_DYNAMIC_PARTITIONS_PARTITION_LIST := \
    vendor \
    odm \
    system \
    product \
    vendor_dlkm \
    system_ext
BOARD_UMIDIGI_DYNAMIC_PARTITIONS_SIZE := 3274100736

BOARD_USES_METADATA_PARTITION := true

BOARD_HAS_LARGE_FILESYSTEM := true
BOARD_SYSTEMIMAGE_PARTITION_TYPE := ext4
BOARD_SYSTEMIMAGE_PARTITION_TYPE := erofs
BOARD_VENDORIMAGE_PARTITION_TYPE := ext4
BOARD_VENDORIMAGE_PARTITION_TYPE := erofs
BOARD_ODMIMAGE_PARTITION_TYPE := erofs
BOARD_PRODUCTIMAGE_PARTITION_TYPE := erofs
BOARD_SYSTEM_EXTIMAGE_PARTITION_TYPE := erofs
BOARD_VENDOR_DLKMIMAGE_PARTITION_TYPE := erofs
BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := ext4

# Platform
TARGET_BOARD_PLATFORM := ums9230

# Properties
TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop
TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop
TARGET_PRODUCT_PROP += $(DEVICE_PATH)/product.prop
TARGET_SYSTEM_EXT_PROP += $(DEVICE_PATH)/system_ext.prop
TARGET_ODM_PROP += $(DEVICE_PATH)/odm.prop
TARGET_VENDOR_DLKM_PROP += $(DEVICE_PATH)/vendor_dlkm.prop

# Workaround For TWRP
TARGET_COPY_OUT_VENDOR := vendor

# Ramdisk
#BOARD_USES_VENDOR_RAMDISK := true
BOARD_MOVE_VENDOR_RAMDISK_TO_VENDOR_BOOT := true
BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := true
BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT := true
BOARD_INCLUDE_VENDOR_RAMDISK_IN_VENDOR_BOOT := true
BOARD_VENDOR_RAMDISK_USE_LZ4 := true
BOARD_VENDOR_RAMDISK_COMPRESSED := lz4-l
BOARD_RAMDISK_USE_LZ4 := true
BOARD_RAMDISK_COMPRESSED := lz4-l
BOARD_RAMDISK_NAME += twrp
BOARD_VENDOR_RAMDISK_NAME += twrp
BOARD_RECOVERY_RAMDISK_NAME += twrp

# Recovery
RECOVERY_VARIANT := twrp
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/twrp/twrp.fstab
TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true
TARGET_USERIMAGES_USE_EROFS := true
TARGET_USES_MKE2FS := true
TARGET_USES_EROFS := true

# Security patch level
#VENDOR_SECURITY_PATCH := 2023-06-05

# Verified Boot
BOARD_AVB_ENABLE := true
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3
BOARD_AVB_VENDOR_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
BOARD_AVB_VENDOR_BOOT_ALGORITHM := SHA256_RSA4096
BOARD_AVB_VENDOR_BOOT_ROLLBACK_INDEX := 1
BOARD_AVB_VENDOR_BOOT_ROLLBACK_INDEX_LOCATION := 1

# VINTF
DEVICE_MANIFEST_FILE += $(DEVICE_PATH)/manifest.xml

# XTRAS
#BUILD_BROKEN_MISSING_REQUIRED_MODULES := true
BUILD_BROKEN_DUP_SYSPROP := true
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
#BUILD_BROKEN_PREBUILT_ELF_FILES := true
#BUILD_BROKEN_DUP_RULES := true

# Hack: prevent anti rollback
PLATFORM_SECURITY_PATCH := 2099-12-31
VENDOR_SECURITY_PATCH := 2099-12-31
PLATFORM_VERSION := 20.1.0
TARGET_RECOVERY_SELINUX := permissive


# TWRP Configuration
#TW_OEM_BUILD := true # Uncomment for minimal build / *reduces size greatly*
#TW_THEME := portrait_hdpi # TW_THEME disabled for custom phone screen size
TW_EXTRA_LANGUAGES := false # Set to false to reduce size
TW_INCLUDE_LIBRESETPROP := true
#TW_SCREEN_BLANK_ON_BOOT := true
TW_INPUT_BLACKLIST := "hbtp_vm"
TW_USE_TOOLBOX := true
TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID := true
TW_USE_DRM := true
TW_USE_EXTERNAL_STORAGE := true
TW_USE_FB2PNG := true
TW_INCLUDE_REPACKTOOLS := true
TW_INCLUDE_EXT4 := true
TW_INCLUDE_F2FS := true
TW_INCLUDE_EROFS := true
TW_INCLUDE_VFAT := true
TW_INCLUDE_CRYPTO := true
TW_INCLUDE_CRYPTO_FBE := true
TW_INCLUDE_LPDUMP := true
TW_INCLUDE_LOGCAT := true
TW_INCLUDE_FUSE := true
TW_HAS_SELINUX := true
TW_HAS_EDT_PANEL := true
TW_HAS_MTP := true
#TW_HAS_BOOT_PARTITION := true
TW_SUPPORT_INPUT_AOSP := true
TW_SUPPORT_INPUT_AIDL_HAPTICS := true
TW_DEFAULT_MOUNT_RW := true
TW_OZIP_DECRYPT_KEY := true
TW_ENABLE_ADB_SIDELOAD := true
TW_GRAPHICS_FORCE_USE_LINELENGTH := true
TW_NO_SCREEN_TIMEOUT := true
TW_NO_FASTBOOT_BOOT := true
TW_LOAD_VENDOR_MODULES := $(LIB_MODULES)
TW_CUSTOM_TWRP_FLAGS := device/umidigi/g2315guf_v1_gc_ym_a15c_t/twrp.flags
TW_CUSTOM_CPU_TEMP_PATH := "/sys/class/thermal/thermal_zone9/temp"


Any Help is GREATLY APPRECIATED.. I've been trying to debug this issue for a solid week maybe 2 weeks longer now!!
maxpayne
maxpayne
maxpayne
Intern
4,288
30-03-2025, 08:43 AM
#2
(27-03-2025, 05:35 PM)xXHenneBXx so ive made a device tree using aospdtgen, and changing things as needed, ...

What manual changes did you make to the device tree after it was generated?

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
xXHenneBXx
xXHenneBXx
xXHenneBXx
Junior Member
21
30-03-2025, 02:49 PM
#3
other than some of the additional lines and changing it to build for vendor_boot move the recovery resources over in the above for my board config.. ive changed the fstab made a twrp.flags .. eveything is copied over form device.mk like uevent files, also in the device make also inherit a couple other things needed for my device such as virtual/ab compression, gsi keys ( maybe not needed ) ..

in my twrp_{device}.mk ive inherited the vendor/twrp/config/common.mk and changed product name as twrp_{device}..

ive edited all the prop files adjusted and removed all unnecssary lines keeping only whats needed for recovery

inside my device dir i have the recovery/root folder with other folder files such as ... vendor/firmware lib/modules system/etc/ with ld.config.txt recovery.fstab(device original) ueventd.rc and i have the first_stage_ramdisk/fstab.*(s)

so far thats what i got .. if you need me to post any of them for reference let me know ill post them .. dont see what else im missing.. i did recently change and remove some of the module being loaded, and directly have just spd-drm.ko by kernel and remaining being loaded by.. ive changed my modules.load.recovery for only recovery modules commenting out the rest ..

now i get i a bootloop ?
kelvinchinedu
kelvinchinedu
kelvinchinedu
Contributor
1,588
31-03-2025, 09:51 PM
#4
Drop tree and device here
xXHenneBXx
xXHenneBXx
xXHenneBXx
Junior Member
21
01-04-2025, 08:18 PM
#5



(31-03-2025, 09:51 PM)kelvinchinedu Drop tree and device here

this is my github link to my twrp source tree for my device UMIDIGI A15C (UNISOC chipset T606)

Twrp Dvice Tree UMIDIGI A15C
kelvinchinedu
kelvinchinedu
kelvinchinedu
Contributor
1,588
02-04-2025, 12:11 AM
#6
Dump the full firmware free on tadiphone dump and drop link
Because u can't have a stable twrp with such tree
xXHenneBXx
xXHenneBXx
xXHenneBXx
Junior Member
21
02-04-2025, 12:57 AM
#7
(02-04-2025, 12:11 AM)kelvinchinedu Dump the full firmware free on tadiphone dump and drop link
Because u can't have a stable twrp with such tree

Full Firmware Dump of The device is also on My Github page link here :  Umidigi Full Firmware Dump

Used Dumpyara for firmware dump
xXHenneBXx
xXHenneBXx
xXHenneBXx
Junior Member
21
02-04-2025, 08:38 PM
#8
(02-04-2025, 12:11 AM)kelvinchinedu Dump the full firmware free on tadiphone dump and drop link
Because u can't have a stable twrp with such tree

I had used the firmware dump that i had made with dumpyara stated above in link, and made a device tree from the firmware dump using aospdtgen, and changing anything needed for twrp variation, editing prop files, *.mk files etc.. what is it from the firmware dump that i need ?
kelvinchinedu
kelvinchinedu
kelvinchinedu
Contributor
1,588
02-04-2025, 11:28 PM
#9
Your ramdisk in found inside vendorboot so use vendorboot.img to create a tree
kelvinchinedu
kelvinchinedu
kelvinchinedu
Contributor
1,588
02-04-2025, 11:37 PM
#10
And don't commit those files
Pages (3): 1 2 3 Next
Users browsing this thread:
 1 Guest(s)
Users browsing this thread:
 1 Guest(s)
Join us
WhTlYt