Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 49 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save lopestom/a5e6b690028cedd47d7e648a1035b358 to your computer and use it in GitHub Desktop.
Save lopestom/a5e6b690028cedd47d7e648a1035b358 to your computer and use it in GitHub Desktop.

How To Make A Working TWRP Device Tree For Your MediaTek Device & Start Building Them, Online

This Guide is tested on 64-bit mt6735/53 chipset device. It will also work on any 64-bit and 32-bit devices.

You will need something from your Stock ROM first. Get them all and Try to modify it using the procedure.

Table of contents

1. Get Your Official Stock Recovery and Stock ROM's build.prop

  • You have to get your device's Stock "recovery.img" from the Official Firmware which you can (or maybe can't) get from the device manufacturer's website.
  • You have to get the build.prop file (from ROM's /system/build.prop) because there are a few key things that we need.
    • Use ADB to Pull the file by the command adb pull /system/build.prop

2. Extract the ramdisk and kernel zImage

3. Create A GitHub Repository

  • Go to https://github.com/ and SignUp there.
  • You have to Create an online GitHub Repository with the name of the device.
    • For Example: something like android_device_Walton_PrimoRX5 or twrp_device_Walton_PrimoRX5 or whatever you want to call it.
  • Go to https://github.com/settings/tokens/new/
    • It will take you to a page to create a New personal access token.
    • Name your Token as anything you like, for example: "GitHubToken" and save the Token Value in Notepad. We will need it later.

4. Make Note Of These Things From build.prop

  • Write down the keys and their values in Notepad or something of the followings:
  • For ease, I am showing from my device. As in "Keys" = "Values"
    ro.build.product=gionee6735_65u_m0                        # Company Given Codename for the Device.
    ro.product.board=Primo_RX5                                # The Board Name for Build.
    ro.product.brand=WALTON                                   # The Brand and The Manufacturer
    ro.product.manufacturer=WALTON                              # can be of the Same Name.
    ro.product.name=Primo_RX5                                 # The Device Name and/or The Codename
    ro.product.device=Primo_RX5                                 # we will be using.
    ro.product.model=Primo RX5                                # A Nickname, we will ignore it.
    ro.mediatek.platform=MT6735                               # The Chipset Platform of the Project.
    ro.mediatek.project.path=device/gionee/gionee6735_65u_m0  # The Original Build Location from Company.
    ro.product.cpu.abi=arm64-v8a                              # Shows if the device is 6-bit or 32-bit.
    

5. Put Some Stock Files In The Folder

  • Create a Folder named prebuilt and put the unpacked recovery.img-kernel inside it. Rename that file to zImage
  • Create another Folder named recovery. Go in there and create a folder named root
  • In the root folder, Put your factory_init.*.rc files, meta_init.*.rc files, ueventd.mt****.rc, init.recovery.mt****.rc files
  • Make a new folder named etc inside root. Make a file named recovery.fstab
    • Use THIS FILE as a reference point and edit it.
    • You Have to edit the Mount Addresses (Like /dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system), Alternate Short Mount Addresses (Like /dev/block/mmcblk0p20).

      You can get Some of the Mount Addresses by ADB Commands from PC, using adb shell cat /proc/self/mountstats or adb shell cat /proc/self/mounts or adb shell cat /proc/self/mountinfo. Also check whether the Basic FSType (emmc or ext4) of the partitions match with your devices. If you fail to know the Alternate Short Mount Addresses, Just erase them.

  • Make a new folder named sbin inside root. Make a file named permissive.sh with File Permission set to "644" by using chmod a+x permissive.sh shell command
    • The file must contain the below content:
      #!/sbin/sh
      
      setenforce 0
      
      # Get your device's block path where "system", "recovery", etc. lives.
      # That can be "/dev/block/bootdevice/by-name" or something like that.
      mkdir -p /dev/block/platform/mtk-msdc.0/by-name/
      busybox mount -o bind /dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/ /dev/block/platform/mtk-msdc.0/by-name/
    The above script is for adding Old-Style Mount Points as-well-as New-Style Mount Points to avoid ROM Conflicts.

6. Create A New File Called "Android.mk"

  • Make a new File, name it Android.mk, with the below content
    # Replace $$DEVICE$$ with your Device Name's Value. Mine is Primo_RX5.
    # Replace $$BRAND$$ with your Brand's / Manufacturer's Value, Mine is WALTON 
    
    ifneq ($(filter $$DEVICE$$,$(TARGET_DEVICE)),)
    
    LOCAL_PATH := device/$$BRAND$$/$$DEVICE$$
    
    include $(call all-makefiles-under,$(LOCAL_PATH))
    
    endif

7. Create A New File Called "AndroidProducts.mk"

  • Make a new File, name it AndroidProducts.mk, with the below content
    # Replace $$DEVICE$$ with your Device Name's Value.
    # Replace $$BRAND$$ with your Brand's / Manufacturer's Value.
    # The part of last line in mine looks like "omni_Primo_RX5.mk"
    
    LOCAL_PATH := device/$$BRAND$$/$$DEVICE$$
    
    PRODUCT_MAKEFILES := $(LOCAL_PATH)/omni_$$DEVICE$$.mk

8. Create The Base File Called "BoardConfig.mk"

  • Make a new File, name it BoardConfig.mk, with the below content
    LOCAL_PATH := device/$$BRAND$$/$$DEVICE$$
    
    TARGET_BOARD_PLATFORM := mt6735               # From ro.mediatek.platform, but lowercase value
    TARGET_NO_BOOTLOADER := true
    TARGET_BOOTLOADER_BOARD_NAME := Primo_RX5     # From ro.product.board
    
    # These two are for MTK Chipsets only
    BOARD_USES_MTK_HARDWARE := true
    BOARD_HAS_MTK_HARDWARE := true
    
    # Recovery
    TARGET_USERIMAGES_USE_EXT4 := true
    TARGET_USERIMAGES_USE_F2FS := true            # To add info about F2FS Filesystem Data Block
    # Put The Size of your Recovery Partition below, get it from your "MT****_Android_scatter.txt"
    BOARD_RECOVERYIMAGE_PARTITION_SIZE := 16777216
    # BOARD_USES_FULL_RECOVERY_IMAGE := true      # Uncomment this line if you want to remove size restriction
    BOARD_FLASH_BLOCK_SIZE := 0                   # Might be different for your chip
    BOARD_HAS_NO_REAL_SDCARD := true              # Depricated
    # BOARD_HAS_NO_SELECT_BUTTON := true          # Depricated
    BOARD_SUPPRESS_SECURE_ERASE := true
    BOARD_HAS_NO_MISC_PARTITION := true           # Delete if your partition table has /misc
    BOARD_RECOVERY_SWIPE := true
    BOARD_USES_MMCUTILS := true
    BOARD_SUPPRESS_EMMC_WIPE := true
    BOARD_CHARGER_SHOW_PERCENTAGE := true
    RECOVERY_SDCARD_ON_DATA := true               # Optional: If /sdcard partition is emulated on /data partition 
    
    # TWRP stuff
    TW_EXCLUDE_SUPERSU := true                    # true/false: Add SuperSU or not
    TW_INCLUDE_CRYPTO := true                     # true/false: Add Data Encryption Support or not
    TW_INPUT_BLACKLIST := "hbtp_vm"               # Optional: Disables virtual mouse
    TW_SCREEN_BLANK_ON_BOOT := true
    TW_THEME := portrait_hdpi                     # Set the exact theme you wanna use. If resulation doesn't match, define the height/width
    DEVICE_RESOLUTION := 720x1280                 # The Resolution of your Device
    TARGET_SCREEN_HEIGHT := 1280                    # The height
    TARGET_SCREEN_WIDTH := 720                      # The width
    TARGET_RECOVERY_PIXEL_FORMAT := "RGBA_8888"
    # Set the Brightness Control File Path below (as per your chip/device)
    TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness
    TW_SECONDARY_BRIGHTNESS_PATH := /sys/devices/platform/leds-mt65xx/leds/lcd-backlight/brightness
    # Set the Path of Logical Units (LUNs) for Storage below (as per your chip/device)
    TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/devices/platform/mt_usb/musb-hdrc.0.auto/gadget/lun%d/file
    TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/class/android_usb/android0/f_mass_storage/lun/file
    TW_MAX_BRIGHTNESS := 255
    TW_DEFAULT_BRIGHTNESS := 80                   # Set custom brightness, low is better
    
    TW_INCLUDE_NTFS_3G := true                    # Include NTFS Filesystem Support
    TW_INCLUDE_FUSE_EXFAT := true                 # Include Fuse-ExFAT Filesystem Support
    TWRP_INCLUDE_LOGCAT := true                   # Include LogCat Binary
    TW_INCLUDE_FB2PNG := true                     # Include Screenshot Support
    TW_DEFAULT_LANGUAGE := en                     # Set Default Language 
    TW_EXTRA_LANGUAGES := false
    
    # Kernel
    TARGET_IS_64_BIT := true                      # true/false: Determine if the device is 64-bit or not
    TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/prebuilt/zImage
    TARGET_PREBUILT_RECOVERY_KERNEL := $(LOCAL_PATH)/prebuilt/zImage
    # Get the CMDLine, Base, Pagesize and offsets from Unpacked recovery image and put below
    BOARD_KERNEL_CMDLINE := bootopt=64S3,32N2,64N2 androidboot.selinux=permissive
    BOARD_KERNEL_BASE := 0x40078000
    BOARD_KERNEL_PAGESIZE := 2048
    BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x03f88000 --tags_offset 0x0df88000
    
    # Set FSTAB
    TARGET_RECOVERY_FSTAB := $(LOCAL_PATH)/recovery/root/etc/recovery.fstab
    
    TARGET_BOARD_SUFFIX := _64                    # Remove if the device is 32-bit
    TARGET_USES_64_BIT_BINDER := true             # Remove if the device is 32-bit
    
    # Architecture
    # According to the device's architecture (64-bit or 32-bit)
    ifeq ($(TARGET_IS_64_BIT),true)
    TARGET_ARCH := arm64
    TARGET_ARCH_VARIANT := armv8-a
    TARGET_CPU_ABI := arm64-v8a
    TARGET_CPU_ABI2 :=
    TARGET_CPU_VARIANT := cortex-a53
    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 := cortex-a53
    TARGET_CPU_ABI_LIST_64_BIT := $(TARGET_CPU_ABI)
    TARGET_CPU_ABI_LIST_32_BIT := $(TARGET_2ND_CPU_ABI),$(TARGET_2ND_CPU_ABI2)
    TARGET_CPU_ABI_LIST := $(TARGET_CPU_ABI_LIST_64_BIT),$(TARGET_CPU_ABI_LIST_32_BIT)
    else
    TARGET_ARCH := arm
    TARGET_ARCH_VARIANT := armv7-a-neon
    TARGET_CPU_ABI := armeabi-v7a
    TARGET_CPU_ABI2 := armeabi
    TARGET_CPU_VARIANT := cortex-a7
    TARGET_CPU_ABI_LIST := $(TARGET_CPU_ABI),$(TARGET_CPU_ABI2)
    endif
    

9. Create A New File Called "omni_$$DEVICE$$.mk" as in "omni_Primo_RX5.mk"

  • Make a new File, name it omni_$$DEVICE$$.mk, with the below content
    $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
    
    # Add this line if your device is 64-bit
    $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
    # Otherwise, If you have 32-bit device, add the below line instead of above line
    $(call inherit-product, $(SRC_TARGET_DIR)/product/core_minimal.mk
    
    # Another common config inclusion
    $(call inherit-product, $(SRC_TARGET_DIR)/product/embedded.mk)
    
    # If you are building from OmniROM's minimal source, Inherit some common Omni stuff.
    $(call inherit-product, vendor/omni/config/common.mk)
    
    # Replace $$DEVICE$$ with your Device Name's Value.
    # Replace $$BRAND$$ with your Brand's / Manufacturer's Value.
    PRODUCT_COPY_FILES += device/$$BRAND$$/$$DEVICE$$/prebuilt/zImage:kernel
    # Fles under $(LOCAL_PATH)/recovery/root/ gets automatically copied into recovery
    # PRODUCT_COPY_FILES += $(LOCAL_PATH)/recovery/root/*:root/*
    
    PRODUCT_DEVICE := $$DEVICE$$
    PRODUCT_NAME := omni_$$DEVICE$$
    PRODUCT_BRAND := $$BRAND$$
    PRODUCT_MODEL := $$DEVICE$$
    PRODUCT_MANUFACTURER := $$BRAND$$
    
    # Forcefully add mtp support (adb is already there)
    PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
        persist.sys.usb.config=mtp
    
    # Add fingerprint from Stock ROM build.prop
    PRODUCT_BUILD_PROP_OVERRIDES += \
        # These lines are from my device. You MUST Replace yours.
        BUILD_FINGERPRINT="WALTON/Primo_RX5/Primo_RX5:6.0/MRA58K/1465782828:user/release-keys" \
        PRIVATE_BUILD_DESC="full_gionee6735_65u_m0-user 6.0 MRA58K 1465782828 release-keys"

10. Publish the GitHub Repository

  • If you have done the above process entirely online inside github.com, then it is okay.
  • But, if you have done the above things Locally on your PC, Just upload the entire Folder or git push to server.

    No detail or tutorial will be provided here. This is A-B-C of Git, Man!

11. Create An Account in Travis CI for Building the Recovery

  • Go to https://travis-ci.org/ and SignUp there using GitHub.
  • Go to https://travis-ci.org/profile/ and Add the Repository there by tapping on the Radio Button switch at the right side of the Repository name.
  • Now, On its further right corner, you will find an individual repository Settings button. Click it. You will be on the Repository's Settings Page Now.
    • Go below where "Environment Variables" is written.
    • Add "GitOAUTHToken" as New Environment Variables' Name and put your GitHub Token's value as it's Value here.

12. Create A File Named .travis.yml in GitHub Repo

  • To Start the Build Process, go to your created TWRP Device Tree in GitHub.
  • Make a file named .travis.yml with below content
    os: linux
    dist: bionic
    language: generic
    sudo: required
    git:
      depth: 1
    addons:
      apt:
        update:
          - true
    services:
      - docker
    before_install:
      - docker pull fr3akyphantom/droid-builder:latest
    before_script:
      - cd $HOME && mkdir twrp
      # download the TWRP Compressed Source Files from PhantomZone54's Release
      # Uncomment & Use below line If Building for Lollipop-based Devices
      # - TWRP_SOURCE="https://github.com/PhantomZone54/twrp_sources_norepo/releases/download/v3.3.1-20200222/MinimalOmniRecovery-twrp-5.1-norepo-20200222.tar.xz"
      # Use below line If Building for Marshmallow-based Devices
      - TWRP_SOURCE="https://github.com/PhantomZone54/twrp_sources_norepo/releases/download/v3.3.1-20200222/MinimalOmniRecovery-twrp-6.0-norepo-20200222.tar.xz"
      # Uncomment & Use below line If Building for Nougat-based Devices
      # - TWRP_SOURCE="https://github.com/PhantomZone54/twrp_sources_norepo/releases/download/v3.3.1-20200222/MinimalOmniRecovery-twrp-7.1-norepo-20200222.tar.xz"
      - wget -q ${TWRP_SOURCE} -O $HOME/twrp.tar.xz
      - tar -xJf twrp.tar.xz --directory $HOME/twrp/ && rm twrp.tar.xz
    script:
      # Replace your $$USERNAME$$, $$REPO_URL$$, $$BRAND$$, $$DEVICE$$
      - cd $HOME/twrp/ && git clone https://github.com/$$USERNAME$$/$$REPO_URL$$.git device/$$BRAND$$/$$DEVICE$$
      - rm -rf bootable/recovery && git clone https://github.com/omnirom/android_bootable_recovery -b android-9.0 --depth 1 bootable/recovery
      - |
        docker run --rm -i -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -v "$(pwd):/home/builder/twrp/:rw,z" -v "${HOME}/.ccache:/srv/ccache:rw,z" fr3akyphantom/droid-builder bash << EOF
        cd /home/builder/twrp/
        source build/envsetup.sh
        # Choose build flavor as "eng" or "userdebug"
        BUILD_FLAVOR="eng"
        lunch omni_$$DEVICE$$-${BUILD_FLAVOR}
        make -j$(nproc --all) recoveryimage
        exit
        EOF
    after_success:
      - export version=$(cat bootable/recovery/variables.h | grep "define TW_MAIN_VERSION_STR" | cut -d '"' -f2)
      - cp $HOME/twrp/out/target/product/$$DEVICE$$/recovery.img $HOME/twrp/TWRP-$version-$$DEVICE$$-$(date +"%Y%m%d")-Unofficial.img
      - cd $HOME/twrp/
      # Optional: You might need to switch from https://transfer.sh to https://file.io
      # - curl -s --upload-file TWRP-$version-$$DEVICE$$-$(date +"%Y%m%d")-Unofficial.img https://transfer.sh/ && echo ""
    deploy:
      skip_cleanup: true
      provider: releases
      # The secret api_key will be loaded from the environment variables
      api_key: $GitOAUTHToken
      file_glob: true
      file: $HOME/twrp/*.img
      on:
        tags: false
        repo: $$USERNAME$$/$$REPO_URL$$ # Optional: If you want to deploy on different repository
        branch: master # Optional: Needs to be exact as the config branch
    branches:
      only:
        - master # Set travis builder branch(es) names
      except:
        - /^(?i:untagged)-.*$/
        - /^v\d+\.\d+(\.\d+)?(-\S*)?$/

13. Fire-Up The Build

14. Flash and Enjoy

  • Flash the newly-build Recovery. It is better Not to Use with Stock ROM.

15. Troubleshooting Recovery Boot

  • If The Recovery does not Boot,
    • Unpack the Stock Recovery Image again, and double-check properties used in TWRP Tree
    • Double-check files that are included in the Tree
  • If the Recovery starts Upside-Down,
    • Edit BoardConfig.mk and insert the below line before the include part (last line)
      BOARD_HAS_FLIPPED_SCREEN := true
@King12689
Copy link

device/OPPO/CPH1717
( https://www.mediafire.com/file/qv1kesxr26i3fae/CPH1717.zip/file )
i syill got some error sir here my local device tree folder

Not same https://github.com/King12689/Android_Device_Oppo_CPH1717 ?? It's better if you update your DT even through your file and leave both parts the same. You should improve how your DT shows like this: https://github.com/lopestom/device_TWRP_BLU_G0130WW So don't put everything in one folder!
Are you carlodeeCrypton? Ah! That's from here https://github.com/Darkweber0009/custom_recovery_tree_oppo_CPH1717
So who are you? Why do you have a DT with King12689 and give me a DT file of Darkweber0009??

shoot sorry i think i miss place it and send you the wrong folder sorry i downloaded both of it one from the one you send and mine that i created so i can compare it , it has a same name folder sorry i try to fix this again and send this to you

You not need send me file. Only put the link for your DT repository in the github.

hello sir good evening uhmm here the device tree that i freshly created DT -------> https://github.com/King12689/Android_Oppo_CPH1717/tree/main then when i tried to build it i got this error

osboxes@osboxes:~/TWRP$ lunch

You're building on Linux

Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
7. omni_CPH1717-user
8. omni_CPH1717-userdebug
9. omni_CPH1717-eng

Which would you like? [aosp_arm-eng] 7
build/core/node_fns.mk:185: *** unterminated call to function 'call': missing ')'. Stop.
File "/home/osboxes/TWRP/build/tools/roomservice.py", line 109
except IOError, ES.ParseError:
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized
build/core/node_fns.mk:185: *** unterminated call to function 'call': missing ')'. Stop.

** Don't have a product spec for: 'omni_CPH1717'
** Do you have the right repo manifest?

osboxes@osboxes:~/TWRP$

@lopestom
Copy link
Author

lopestom commented Apr 20, 2023

SyntaxError: multiple exception types must be parenthesized
build/core/node_fns.mk:185: *** unterminated call to function 'call': missing ')'. Stop.

Your DT has many errors. Probably because you didn't read all the instructions, maybe because you're in a hurry and didn't understand that many parts must come from the device and ROM.

I tried to fix some basic things. Unfortunately you didn't make the folder correction I wrote earlier. But for me it would be more interesting to make a new DT than to correct a lot of things that I don't even know if I has on the device. I think you should read this too: https://gist.github.com/lopestom/3c1f3eaa66248c56e61acf19ddd4b96c

On the other hand, try to do this too:
https://gist.github.com/rokibhasansagar/247ddd4ef00dcc9d3340397322051e6a
https://gist.github.com/rokibhasansagar/247ddd4ef00dcc9d3340397322051e6a#file-roomservice_71-py

Why are you making random choices all the time?
Always choose omni_CPH1717-eng!!!

@King12689
Copy link

King12689 commented Apr 21, 2023

SyntaxError: multiple exception types must be parenthesized
build/core/node_fns.mk:185: *** unterminated call to function 'call': missing ')'. Stop.

Your DT has many errors. Probably because you didn't read all the instructions, maybe because you're in a hurry and didn't understand that many parts must come from the device and ROM.

I tried to fix some basic things. Unfortunately you didn't make the folder correction I wrote earlier. But for me it would be more interesting to make a new DT than to correct a lot of things that I don't even know if I has on the device. I think you should read this too: https://gist.github.com/lopestom/3c1f3eaa66248c56e61acf19ddd4b96c

On the other hand, try to do this too: https://gist.github.com/rokibhasansagar/247ddd4ef00dcc9d3340397322051e6a https://gist.github.com/rokibhasansagar/247ddd4ef00dcc9d3340397322051e6a#file-roomservice_71-py

Why are you making random choices all the time? Always choose omni_CPH1717-eng!!!

i always got the same error thas why i tried the others if they work and im aware about that omni_CPH1717-eng its just happend thats what i typed when i send the logs but its has the same error but thanks for answering ill read itt again and ill edit my DT again and the roomserveice.py

@King12689
Copy link

King12689 commented Apr 21, 2023

SyntaxError: multiple exception types must be parenthesized
build/core/node_fns.mk:185: *** unterminated call to function 'call': missing ')'. Stop.

Your DT has many errors. Probably because you didn't read all the instructions, maybe because you're in a hurry and didn't understand that many parts must come from the device and ROM.

I tried to fix some basic things. Unfortunately you didn't make the folder correction I wrote earlier. But for me it would be more interesting to make a new DT than to correct a lot of things that I don't even know if I has on the device. I think you should read this too: https://gist.github.com/lopestom/3c1f3eaa66248c56e61acf19ddd4b96c

On the other hand, try to do this too: https://gist.github.com/rokibhasansagar/247ddd4ef00dcc9d3340397322051e6a https://gist.github.com/rokibhasansagar/247ddd4ef00dcc9d3340397322051e6a#file-roomservice_71-py

Why are you making random choices all the time? Always choose omni_CPH1717-eng!!!

but to exact sir what really are the errors on my DT? because im really confused uis there any missing things? im really interested in this stuff and i want to learn more

@lopestom
Copy link
Author

SyntaxError: multiple exception types must be parenthesized
build/core/node_fns.mk:185: *** unterminated call to function 'call': missing ')'. Stop.

Your DT has many errors. Probably because you didn't read all the instructions, maybe because you're in a hurry and didn't understand that many parts must come from the device and ROM.
I tried to fix some basic things. Unfortunately you didn't make the folder correction I wrote earlier. But for me it would be more interesting to make a new DT than to correct a lot of things that I don't even know if I has on the device. I think you should read this too: https://gist.github.com/lopestom/3c1f3eaa66248c56e61acf19ddd4b96c
On the other hand, try to do this too: https://gist.github.com/rokibhasansagar/247ddd4ef00dcc9d3340397322051e6a https://gist.github.com/rokibhasansagar/247ddd4ef00dcc9d3340397322051e6a#file-roomservice_71-py
Why are you making random choices all the time? Always choose omni_CPH1717-eng!!!

but to exact sir what really are the errors on my DT? because im really confused uis there any missing things? im really interested in this stuff and i want to learn more

send stock recovery.img

DT really need more organization; correct flags and more correct informations from device.

If you find more DT of the mt6750 in the github so you can knew.

@King12689
Copy link

SyntaxError: multiple exception types must be parenthesized
build/core/node_fns.mk:185: *** unterminated call to function 'call': missing ')'. Stop.

Your DT has many errors. Probably because you didn't read all the instructions, maybe because you're in a hurry and didn't understand that many parts must come from the device and ROM.
I tried to fix some basic things. Unfortunately you didn't make the folder correction I wrote earlier. But for me it would be more interesting to make a new DT than to correct a lot of things that I don't even know if I has on the device. I think you should read this too: https://gist.github.com/lopestom/3c1f3eaa66248c56e61acf19ddd4b96c
On the other hand, try to do this too: https://gist.github.com/rokibhasansagar/247ddd4ef00dcc9d3340397322051e6a https://gist.github.com/rokibhasansagar/247ddd4ef00dcc9d3340397322051e6a#file-roomservice_71-py
Why are you making random choices all the time? Always choose omni_CPH1717-eng!!!

but to exact sir what really are the errors on my DT? because im really confused uis there any missing things? im really interested in this stuff and i want to learn more

send stock recovery.img

DT really need more organization; correct flags and more correct informations from device.

If you find more DT of the mt6750 in the github so you can knew.

@lopestom
Copy link
Author

lopestom commented Apr 22, 2023

but to exact sir what really are the errors on my DT? because im really confused uis there any missing things? im really interested in this stuff and i want to learn more

send stock recovery.img
DT really need more organization; correct flags and more correct informations from device.
If you find more DT of the mt6750 in the github so you can knew.

I had actually already seen your DT before writing the message above. I didn't like it because you're not reading the instructions, you're just copying based on the information in the guide. But it is not inclined to read, process and have information based/pulled from your device.

If it was bad before, now it's terrible! Don't get me wrong but do you really want to learn or just want TWRP ready?!
Things as omni_CPH1717.mk and twrp_CPH1717.mk and https://github.com/King12689/Android_Oppo_CPH1717/blob/5b264424f60d66bfd2d339f70c7a5eee26007042/device.mk#L14

# A/B
ENABLE_VIRTUAL_AB := true

AB_OTA_POSTINSTALL_CONFIG += \

are showing that you didn't read or want to understand how to do a DT. All this has no nothing connection with what you want.

I'll check your stock recovery.img.

--
look this: https://github.com/lopestom/Action-Recovery-Builder-CT/releases

build - Click to open

source build/envsetup.sh
  export ALLOW_MISSING_DEPENDENCIES=true
  lunch omni_CPH1717-eng && make clean && make recoveryimage -j$(nproc --all)
  shell: /usr/bin/bash -e {0}
  env:
    JAVA_HOME: /opt/hostedtoolcache/Java_Zulu_jdk/8.0.[3](https://github.com/lopestom/Action-Recovery-Builder-CT/actions/runs/4770985130/jobs/8482628170#step:16:3)72-7/x6[4](https://github.com/lopestom/Action-Recovery-Builder-CT/actions/runs/4770985130/jobs/8482628170#step:16:4)
    JAVA_HOME_8_X64: /opt/hostedtoolcache/Java_Zulu_jdk/8.0.372-7/x64
including device/oppo/CPH1717/vendorsetup.sh
Traceback (most recent call last):
WARNING: Trying to fetch a device that's already there
  File "build/tools/roomservice.py", line 3[5](https://github.com/lopestom/Action-Recovery-Builder-CT/actions/runs/4770985130/jobs/8482628170#step:16:5)4, in <module>
    fetch_dependencies(device)
  File "build/tools/roomservice.py", line 309, in fetch_dependencies
    fetch_device(device)
  File "build/tools/roomservice.py", line 321, in fetch_device
    git_data = search_gerrit_for_device(device)
  File "build/tools/roomservice.py", line 81, in search_gerrit_for_device
    device_data = check_repo_exists(git_data, device)
  File "build/tools/roomservice.py", line 58, in check_repo_exists
    "exiting roomservice".format(device=device))
Exception: CPH1717 not found,exiting roomservice

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
TARGET_PRODUCT=omni_CPH1717
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm[6](https://github.com/lopestom/Action-Recovery-Builder-CT/actions/runs/4770985130/jobs/8482628170#step:16:6)4
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv[7](https://github.com/lopestom/Action-Recovery-Builder-CT/actions/runs/4770985130/jobs/8482628170#step:16:7)-a-neon
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x[8](https://github.com/lopestom/Action-Recovery-Builder-CT/actions/runs/4770985130/jobs/8482628170#step:16:8)6_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.15.0-[10](https://github.com/lopestom/Action-Recovery-Builder-CT/actions/runs/4770985130/jobs/8482628170#step:16:11)35-azure-x86_64-with-Ubuntu-20.04-focal
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47F
OUT_DIR=/home/runner/work/Action-Recovery-Builder-CT/Action-Recovery-Builder-CT/workspace/out
============================================
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
TARGET_PRODUCT=omni_CPH1717
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.[15](https://github.com/lopestom/Action-Recovery-Builder-CT/actions/runs/4770985130/jobs/8482628170#step:16:16).0-1035-azure-x86_64-with-Ubuntu-[20](https://github.com/lopestom/Action-Recovery-Builder-CT/actions/runs/4770985130/jobs/8482628170#step:16:21).04-focal
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47F
OUT_DIR=/home/runner/work/Action-Recovery-Builder-CT/Action-Recovery-Builder-CT/workspace/out

[ 99% 7395/7399] DumpPublicKey: /home/runner/work/Action-Recovery-Builder-CT/Action-Recovery-Builder-CT/workspace/out/target/product/CPH1717/obj/PACKAGING/ota_keys_intermediates/keys <= build/target/product/security/testkey.x509.pem 
[ 99% 7396/7399] ----- Making recovery ramdisk ------
Copying baseline ramdisk...
Modifying ramdisk contents...
----- Making uncompressed recovery ramdisk ------
[ 99% 7397/7399] -e ----- Making compressed recovery ramdisk ------
[ 99% 7398/7399] -e ----- Making recovery image ------
[100% 7399/7399] build /home/runner/work/Action-Recovery-Builder-CT/Action-Recovery-Builder-CT/workspace/out/target/product/CPH1717/system/etc/recovery-resource.dat

#### make completed successfully (08:53 (mm:ss)) ####

Obviously I didn't put all the information because I didn't have your stock recovery.img. And I didn't even know that one of the special information is BOARD_HEADER_VERSION : 0

But the file was compiled. Just don't believe it will launch on your device because of correct information.

@King12689
Copy link

but to exact sir what really are the errors on my DT? because im really confused uis there any missing things? im really interested in this stuff and i want to learn more

send stock recovery.img
DT really need more organization; correct flags and more correct informations from device.
If you find more DT of the mt6750 in the github so you can knew.

I had actually already seen your DT before writing the message above. I didn't like it because you're not reading the instructions, you're just copying based on the information in the guide. But it is not inclined to read, process and have information based/pulled from your device.

If it was bad before, now it's terrible! Don't get me wrong but do you really want to learn or just want TWRP ready?! Things as omni_CPH1717.mk and twrp_CPH1717.mk and https://github.com/King12689/Android_Oppo_CPH1717/blob/5b264424f60d66bfd2d339f70c7a5eee26007042/device.mk#L14

# A/B
ENABLE_VIRTUAL_AB := true

AB_OTA_POSTINSTALL_CONFIG += \

are showing that you didn't read or want to understand how to do a DT. All this has no nothing connection with what you want.

I'll check your stock recovery.img.

-- look this: https://github.com/lopestom/Action-Recovery-Builder-CT/releases

build - Click to open
Obviously I didn't put all the information because I didn't have your stock recovery.img. And I didn't even know that one of the special information is BOARD_HEADER_VERSION : 0

But the file was compiled. Just don't believe it will launch on your device because of correct information.

uhh im sorry about that sir ill read it again and redo it again

@King12689
Copy link

King12689 commented Apr 22, 2023

but to exact sir what really are the errors on my DT? because im really confused uis there any missing things? im really interested in this stuff and i want to learn more

send stock recovery.img
DT really need more organization; correct flags and more correct informations from device.
If you find more DT of the mt6750 in the github so you can knew.

I had actually already seen your DT before writing the message above. I didn't like it because you're not reading the instructions, you're just copying based on the information in the guide. But it is not inclined to read, process and have information based/pulled from your device.

If it was bad before, now it's terrible! Don't get me wrong but do you really want to learn or just want TWRP ready?! Things as omni_CPH1717.mk and twrp_CPH1717.mk and https://github.com/King12689/Android_Oppo_CPH1717/blob/5b264424f60d66bfd2d339f70c7a5eee26007042/device.mk#L14

# A/B
ENABLE_VIRTUAL_AB := true

AB_OTA_POSTINSTALL_CONFIG += \

are showing that you didn't read or want to understand how to do a DT. All this has no nothing connection with what you want.

I'll check your stock recovery.img.

-- look this: https://github.com/lopestom/Action-Recovery-Builder-CT/releases

build - Click to open
Obviously I didn't put all the information because I didn't have your stock recovery.img. And I didn't even know that one of the special information is BOARD_HEADER_VERSION : 0

But the file was compiled. Just don't believe it will launch on your device because of correct information.

hello sir good evening uhmm the twrp that you send to me is woking properly
336637393_617249576928935_7444962859448762388_n what DT did you use building that? is it the one i created or you made your own i want to know. and also there is a bit issue in the recovery the screen doesnt fit it missis some inches its like 5 inches and also i cant see my internal storage its says 0mb only sdcard is accessable for storage is there any fixes for this? i want to know because im planning to compile one for another phone and if its really my DT i want to know where should i look out next because i already read the links that you give me and its true i have so many error and i want to know how to fix it

@lopestom
Copy link
Author

lopestom commented Apr 22, 2023

but to exact sir what really are the errors on my DT? because im really confused uis there any missing things? im really interested in this stuff and i want to learn more

send stock recovery.img
DT really need more organization; correct flags and more correct informations from device.
If you find more DT of the mt6750 in the github so you can knew.

I had actually already seen your DT before writing the message above. I didn't like it because you're not reading the instructions, you're just copying based on the information in the guide. But it is not inclined to read, process and have information based/pulled from your device.
If it was bad before, now it's terrible! Don't get me wrong but do you really want to learn or just want TWRP ready?! Things as omni_CPH1717.mk and twrp_CPH1717.mk and https://github.com/King12689/Android_Oppo_CPH1717/blob/5b264424f60d66bfd2d339f70c7a5eee26007042/device.mk#L14

# A/B
ENABLE_VIRTUAL_AB := true

AB_OTA_POSTINSTALL_CONFIG += \

are showing that you didn't read or want to understand how to do a DT. All this has no nothing connection with what you want.
I'll check your stock recovery.img.
-- look this: https://github.com/lopestom/Action-Recovery-Builder-CT/releases
build - Click to open
Obviously I didn't put all the information because I didn't have your stock recovery.img. And I didn't even know that one of the special information is BOARD_HEADER_VERSION : 0
But the file was compiled. Just don't believe it will launch on your device because of correct information.

hello sir good evening uhmm the twrp that you send to me is woking properly 336637393_617249576928935_7444962859448762388_n what DT did you use building that? is it the one i created or you made your own i want to know. and also there is a bit issue in the recovery the screen doesnt fit it missis some inches its like 5 inches and also i cant see my internal storage its says 0mb only sdcard is accessable for storage is there any fixes for this? i want to know because im planning to compile one for another phone and if its really my DT i want to know where should i look out next because i already read the links that you give me and its true i have so many error and i want to know how to fix it

https://github.com/lopestom/twrp_device_oppo_CPH1717/tree/twrp-7.1

About 0MB

  • Wipe -- FORMAT DATA - yes
  • Reboot -- Recovery

After reboot system and your device start so not setting password. Reboot in TWRP again and if you see \Data not mounted & 0MB so you need apply disable_encryption patch (search in the internet foruns) or you should solve the encryption/decryption process to your device (Not ask me about!!! You need learning & have knowledege!

Cheers
💀

@King12689
Copy link

King12689 commented Apr 23, 2023

but to exact sir what really are the errors on my DT? because im really confused uis there any missing things? im really interested in this stuff and i want to learn more

send stock recovery.img
DT really need more organization; correct flags and more correct informations from device.
If you find more DT of the mt6750 in the github so you can knew.

I had actually already seen your DT before writing the message above. I didn't like it because you're not reading the instructions, you're just copying based on the information in the guide. But it is not inclined to read, process and have information based/pulled from your device.
If it was bad before, now it's terrible! Don't get me wrong but do you really want to learn or just want TWRP ready?! Things as omni_CPH1717.mk and twrp_CPH1717.mk and https://github.com/King12689/Android_Oppo_CPH1717/blob/5b264424f60d66bfd2d339f70c7a5eee26007042/device.mk#L14

# A/B
ENABLE_VIRTUAL_AB := true

AB_OTA_POSTINSTALL_CONFIG += \

are showing that you didn't read or want to understand how to do a DT. All this has no nothing connection with what you want.
I'll check your stock recovery.img.
-- look this: https://github.com/lopestom/Action-Recovery-Builder-CT/releases
build - Click to open
Obviously I didn't put all the information because I didn't have your stock recovery.img. And I didn't even know that one of the special information is BOARD_HEADER_VERSION : 0
But the file was compiled. Just don't believe it will launch on your device because of correct information.

hello sir good evening uhmm the twrp that you send to me is woking properly 336637393_617249576928935_7444962859448762388_n what DT did you use building that? is it the one i created or you made your own i want to know. and also there is a bit issue in the recovery the screen doesnt fit it missis some inches its like 5 inches and also i cant see my internal storage its says 0mb only sdcard is accessable for storage is there any fixes for this? i want to know because im planning to compile one for another phone and if its really my DT i want to know where should i look out next because i already read the links that you give me and its true i have so many error and i want to know how to fix it

https://github.com/lopestom/twrp_device_oppo_CPH1717/tree/twrp-7.1

About 0MB

  • Wipe -- FORMAT DATA - yes
  • Reboot -- Recovery

After reboot system and your device start so not setting password. Reboot in TWRP again and if you see \Data not mounted & 0MB so you need apply disable_encryption patch (search in the internet foruns) or you should solve the encryption/decryption process to your device (Not ask me about!!! You need learning & have knowledege!

Cheers 💀

thanks about the device tree sir and some patch about it, what about the incorrect screen size sir i already know how to fix the 0mb my only problem now is the screen resulotion as i'v rememeber in a thread you need to unpack it and modify something which is i forgot what it is.

@lopestom
Copy link
Author

thanks about the device tree sir and some patch about it, what about the incorrect screen size sir i already know how to fix the 0mb my only problem now is the screen resulotion as i'v rememeber in a thread you need to unpack it and modify something which is i forgot what it is.

If you can see https://github.com/King12689/twrp_device_oppo_CPH1717/blob/b6897e4b84fd51607ef078314a714e39db1d2df0/BoardConfig.mk#L101
I put # to extend to the maximum height.

#TW_Y_OFFSET := 80
#TW_H_OFFSET := -80

According some sites the resolution for Oppo A71 is 720 x 1280

DEVICE_RESOLUTION := 720x1280
TARGET_SCREEN_HEIGHT := 1280
TARGET_SCREEN_WIDTH := 720

so here all good.
For you see resolution fixed so compile your new TWRP.

@King12689
Copy link

thanks about the device tree sir and some patch about it, what about the incorrect screen size sir i already know how to fix the 0mb my only problem now is the screen resulotion as i'v rememeber in a thread you need to unpack it and modify something which is i forgot what it is.

If you can see https://github.com/King12689/twrp_device_oppo_CPH1717/blob/b6897e4b84fd51607ef078314a714e39db1d2df0/BoardConfig.mk#L101 I put # to extend to the maximum height.

#TW_Y_OFFSET := 80
#TW_H_OFFSET := -80

According some sites the resolution for Oppo A71 is 720 x 1280

DEVICE_RESOLUTION := 720x1280
TARGET_SCREEN_HEIGHT := 1280
TARGET_SCREEN_WIDTH := 720

so here all good. For you see resolution fixed so compile your new TWRP.

Thank you very much sir

@King12689
Copy link

King12689 commented Apr 25, 2023

thanks about the device tree sir and some patch about it, what about the incorrect screen size sir i already know how to fix the 0mb my only problem now is the screen resulotion as i'v rememeber in a thread you need to unpack it and modify something which is i forgot what it is.

If you can see https://github.com/King12689/twrp_device_oppo_CPH1717/blob/b6897e4b84fd51607ef078314a714e39db1d2df0/BoardConfig.mk#L101 I put # to extend to the maximum height.

#TW_Y_OFFSET := 80
#TW_H_OFFSET := -80

According some sites the resolution for Oppo A71 is 720 x 1280

DEVICE_RESOLUTION := 720x1280
TARGET_SCREEN_HEIGHT := 1280
TARGET_SCREEN_WIDTH := 720

so here all good. For you see resolution fixed so compile your new TWRP.

hello its me again sir i kinda have an error while building the recovery image i dont know whats the problem heres the log

Click to open

osboxes@osboxes:~/TWRP$ mka recoveryimage

PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
TARGET_PRODUCT=omni_CPH1717
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.19.0-31-generic-x86_64-with-glibc2.36
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47F
OUT_DIR=/home/osboxes/TWRP/out

Using 'prebuilts/ninja/linux-x86/ninja' binary on 'linux-x86'
Running kati to generate build-omni_CPH1717.ninja...
$(shell cd libcore && ls -d */src/test/{java,resources} 2> /dev/null) was changed, regenerating...

PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
TARGET_PRODUCT=omni_CPH1717
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.19.0-31-generic-x86_64-with-glibc2.36
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47F
OUT_DIR=/home/osboxes/TWRP/out

including ./bionic/Android.mk ...
including ./bootable/recovery/Android.mk ...
including ./build/libs/host/Android.mk ...
including ./build/target/board/Android.mk ...
including ./build/target/product/security/Android.mk ...
including ./build/tools/Android.mk ...
including ./device/oppo/CPH1717/Android.mk ...
including ./external/bash/Android.mk ...
including ./external/bison/Android.mk ...
including ./external/boringssl/Android.mk ...
including ./external/bouncycastle/Android.mk ...
including ./external/busybox/Android.mk ...
including ./external/bzip2/Android.mk ...
including ./external/clang/Android.mk ...
including ./external/compiler-rt/Android.mk ...
including ./external/conscrypt/Android.mk ...
including ./external/e2fsprogs/Android.mk ...
including ./external/exfat/Android.mk ...
including ./external/f2fs-tools/Android.mk ...
including ./external/fec/Android.mk ...
including ./external/freetype/Android.mk ...
including ./external/fuse/Android.mk ...
including ./external/gptfdisk/Android.mk ...
including ./external/icu/Android.mk ...
including ./external/jemalloc/Android.mk ...
including ./external/junit/Android.mk ...
including ./external/libcap/Android.mk ...
including ./external/libcxx/Android.mk ...
including ./external/libcxxabi/Android.mk ...
including ./external/libdrm/Android.mk ...
including ./external/liblzf/Android.mk ...
including ./external/libncurses/Android.mk ...
including ./external/libnl/Android.mk ...
including ./external/libpng/Android.mk ...
including ./external/libselinux/Android.mk ...
including ./external/libunwind/Android.mk ...
including ./external/libunwind_llvm/Android.mk ...
including ./external/llvm/Android.mk ...
including ./external/ltrace/Android.mk ...
including ./external/lz4/Android.mk ...
including ./external/lzma/C/Android.mk ...
including ./external/lzma/Java/Tukaani/Android.mk ...
including ./external/lzma/xz-embedded/Android.mk ...
including ./external/magisk-prebuilt/Android.mk ...
including ./external/minijail/Android.mk ...
including ./external/mksh/Android.mk ...
including ./external/nano/Android.mk ...
including ./external/ntfs-3g/Android.mk ...
including ./external/openssh/Android.mk ...
including ./external/pcre/Android.mk ...
including ./external/protobuf/Android.mk ...
including ./external/python3/Android.mk ...
including ./external/safe-iop/Android.mk ...
including ./external/scrypt/Android.mk ...
including ./external/selinux/Android.mk ...
including ./external/squashfs-tools/Android.mk ...
including ./external/strace/Android.mk ...
including ./external/toybox/Android.mk ...
awk: line 1: syntax error at or near ,
including ./external/unzip/Android.mk ...
including ./external/zip/Android.mk ...
including ./external/zlib/Android.mk ...
including ./frameworks/native/cmds/atrace/Android.mk ...
including ./frameworks/native/cmds/bugreport/Android.mk ...
including ./frameworks/native/cmds/bugreportz/Android.mk ...
including ./frameworks/native/cmds/cmd/Android.mk ...
including ./frameworks/native/cmds/dumpstate/Android.mk ...
including ./frameworks/native/cmds/dumpsys/Android.mk ...
including ./frameworks/native/cmds/flatland/Android.mk ...
including ./frameworks/native/cmds/installd/Android.mk ...
including ./frameworks/native/cmds/ip-up-vpn/Android.mk ...
including ./frameworks/native/cmds/rawbu/Android.mk ...
including ./frameworks/native/cmds/service/Android.mk ...
including ./frameworks/native/cmds/servicemanager/Android.mk ...
including ./frameworks/native/libs/binder/Android.mk ...
including ./frameworks/native/libs/diskusage/Android.mk ...
including ./frameworks/native/libs/gui/Android.mk ...
including ./frameworks/native/libs/input/Android.mk ...
including ./frameworks/native/libs/ui/Android.mk ...
including ./frameworks/native/opengl/libagl/Android.mk ...
including ./frameworks/native/opengl/libs/Android.mk ...
including ./frameworks/native/opengl/tests/Android.mk ...
including ./frameworks/native/services/batteryservice/Android.mk ...
including ./frameworks/native/services/inputflinger/Android.mk ...
including ./frameworks/native/services/powermanager/Android.mk ...
including ./frameworks/native/services/sensorservice/Android.mk ...
including ./frameworks/native/services/surfaceflinger/Android.mk ...
including ./frameworks/native/vulkan/Android.mk ...
including ./hardware/intel/bootstub/Android.mk ...
including ./hardware/libhardware/Android.mk ...
including ./hardware/qcom/keymaster/Android.mk ...
including ./libcore/Android.mk ...
including ./libnativehelper/Android.mk ...
including ./prebuilts/clang/host/linux-x86/Android.mk ...
including ./prebuilts/misc/Android.mk ...
including ./prebuilts/ndk/Android.mk ...
including ./prebuilts/sdk/Android.mk ...
including ./system/core/Android.mk ...
including ./system/extras/Android.mk ...
including ./system/gatekeeper/Android.mk ...
including ./system/keymaster/Android.mk ...
including ./system/netd/Android.mk ...
including ./system/security/keystore-engine/Android.mk ...
including ./system/security/keystore/Android.mk ...
including ./system/security/softkeymaster/Android.mk ...
including ./system/sepolicy/Android.mk ...
including ./vendor/omni/Android.mk ...
File "/home/osboxes/TWRP/build/tools/diff_package_overlays.py", line 88
print r
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
No private recovery resources for TARGET_DEVICE CPH1717
build/core/tasks/kernel.mk:109: ***************************************************************
build/core/tasks/kernel.mk:110: * Using prebuilt kernel binary instead of source *
build/core/tasks/kernel.mk:111: * THIS IS DEPRECATED, AND WILL BE DISCONTINUED *
build/core/tasks/kernel.mk:112: * Please configure your device to download the kernel *
build/core/tasks/kernel.mk:113: * source repository to kernel/oppo/CPH1717
build/core/tasks/kernel.mk:114: * See http://forum.xda-developers.com/wiki/ROM/Integrated_Kernel_Build
build/core/tasks/kernel.mk:115: * for more information *
build/core/tasks/kernel.mk:116: ***************************************************************
build/core/base_rules.mk:407: warning: overriding commands for target /recovery_unit_test' build/core/base_rules.mk:407: warning: ignoring old commands for target /recovery_unit_test'
build/core/base_rules.mk:407: warning: overriding commands for target /recovery_component_test' build/core/base_rules.mk:407: warning: ignoring old commands for target /recovery_component_test'
build/core/base_rules.mk:407: warning: overriding commands for target /minadbd_test' build/core/base_rules.mk:407: warning: ignoring old commands for target /minadbd_test'
bootable/recovery/toolbox/Android.mk:302: warning: overriding commands for target /home/osboxes/TWRP/out/target/product/CPH1717/recovery/root/sbin/start' bootable/recovery/toolbox/Android.mk:302: warning: ignoring old commands for target /home/osboxes/TWRP/out/target/product/CPH1717/recovery/root/sbin/start'
bootable/recovery/toolbox/Android.mk:302: warning: overriding commands for target /home/osboxes/TWRP/out/target/product/CPH1717/recovery/root/sbin/stop' bootable/recovery/toolbox/Android.mk:302: warning: ignoring old commands for target /home/osboxes/TWRP/out/target/product/CPH1717/recovery/root/sbin/stop'
build/core/base_rules.mk:319: warning: overriding commands for target /home/osboxes/TWRP/out/target/product/CPH1717/system/xbin/unzip' ./external/busybox/Android.mk:172: warning: ignoring old commands for target /home/osboxes/TWRP/out/target/product/CPH1717/system/xbin/unzip'
build/core/base_rules.mk:319: warning: overriding commands for target /home/osboxes/TWRP/out/target/product/CPH1717/root/res/images/charger/battery_fail.png' build/core/base_rules.mk:319: warning: ignoring old commands for target /home/osboxes/TWRP/out/target/product/CPH1717/root/res/images/charger/battery_fail.png'
build/core/base_rules.mk:319: warning: overriding commands for target /home/osboxes/TWRP/out/target/product/CPH1717/root/res/images/charger/battery_scale.png' build/core/base_rules.mk:319: warning: ignoring old commands for target /home/osboxes/TWRP/out/target/product/CPH1717/root/res/images/charger/battery_scale.png'
build/core/Makefile:1114: warning: overriding commands for target /home/osboxes/TWRP/out/target/product/CPH1717/ramdisk-recovery.cpio' build/core/Makefile:1070: warning: ignoring old commands for target /home/osboxes/TWRP/out/target/product/CPH1717/ramdisk-recovery.cpio'
build/core/Makefile:1120: warning: overriding commands for target /home/osboxes/TWRP/out/target/product/CPH1717/ramdisk-recovery.img' build/core/Makefile:1076: warning: ignoring old commands for target /home/osboxes/TWRP/out/target/product/CPH1717/ramdisk-recovery.img'
build/core/Makefile:1126: warning: overriding commands for target /home/osboxes/TWRP/out/target/product/CPH1717/recovery.img' build/core/Makefile:1081: warning: ignoring old commands for target /home/osboxes/TWRP/out/target/product/CPH1717/recovery.img'
Starting build with ninja
ninja: Entering directory `.'
[ 1% 8/435] build /home/osboxes/TWRP/out/target/product/CPH1717/obj/ETC/file_contexts.bin_intermediates/file_contexts.local.tmp
FAILED: /bin/bash -c "m4 -s system/sepolicy/file_contexts /home/osboxes/TWRP/out/target/product/CPH1717/obj/ETC/sectxfile_nl_intermediates/sectxfile_nl > /home/osboxes/TWRP/out/target/product/CPH1717/obj/ETC/file_contexts.bin_intermediates/file_contexts.local.tmp"
/bin/bash: line 1: m4: command not found
[ 1% 8/435] build /home/osboxes/TWRP/out/target/product/CPH1717/obj_arm/SHARED_LIBRARIES/libbmlutils_intermediates/teamwin
ninja: build stopped: subcommand failed.
make: *** [build/core/ninja.mk:158: ninja_wrapper] Error 1
osboxes@osboxes:~/TWRP$

@King12689
Copy link

King12689 commented Jul 19, 2023

hello sir i want to ask about this Device tree in github can this device tree be use in custom rom building i've been really curious about it i hope you can answer me sir

@lopestom
Copy link
Author

hello sir i want to ask about this Device tree in github can this device tree be use in custom rom building i've been really curious about it i hope you can answer me sir

As that have some flags and settings same by DT for Custom ROMs so you can use some. But some others like TW_ is by TWRP code.
For have DT for Custom ROM you search if have in the github same Soc (or similar) & kernel. You need great PC hardware to build that - need time - need know how solve some sensors or errors or anything that not work.
As here is not for Custom ROM development or guide so you need search in other gist/github/internet.

@King12689
Copy link

hello sir i want to ask about this Device tree in github can this device tree be use in custom rom building i've been really curious about it i hope you can answer me sir

As that have some flags and settings same by DT for Custom ROMs so you can use some. But some others like TW_ is by TWRP code. For have DT for Custom ROM you search if have in the github same Soc (or similar) & kernel. You need great PC hardware to build that - need time - need know how solve some sensors or errors or anything that not work. As here is not for Custom ROM development or guide so you need search in other gist/github/internet.

thanks you sir

@King12689
Copy link

King12689 commented Aug 23, 2023

hello sir i want to ask about this Device tree in github can this device tree be use in custom rom building i've been really curious about it i hope you can answer me sir

As that have some flags and settings same by DT for Custom ROMs so you can use some. But some others like TW_ is by TWRP code. For have DT for Custom ROM you search if have in the github same Soc (or similar) & kernel. You need great PC hardware to build that - need time - need know how solve some sensors or errors or anything that not work. As here is not for Custom ROM development or guide so you need search in other gist/github/internet.

hello sir i want to ask you again today i tried to build my twrp using the DT and i successully build it my question is what image should i pick?

Click to open

Screenshot (49)

Click to open

@lopestom
Copy link
Author

lopestom commented Aug 23, 2023

hello sir i want to ask you again today i tried to build my twrp using the DT and i successully build it my question is what image should i pick?

It's a very simple answer that comes from your action. When you had the img file built, what partition/option name were you given?
mka recoveryimage ??

Obviously some parts confirm the choice:
https://github.com/lopestom/twrp_device_oppo_CPH1717/blob/d7512fa874098cb146069c0151bcccae5c272122/recovery.fstab#L5
https://github.com/lopestom/twrp_device_oppo_CPH1717/blob/d7512fa874098cb146069c0151bcccae5c272122/BoardConfig.mk#L36
https://github.com/lopestom/twrp_device_oppo_CPH1717/blob/d7512fa874098cb146069c0151bcccae5c272122/recovery.fstab#L5

So obviously the file can only stand out: recovery.img

@King12689
Copy link

hello sir i want to ask you again today i tried to build my twrp using the DT and i successully build it my question is what image should i pick?

It's a very simple answer that comes from your action. When you had the img file built, what partition/option name were you given? mka recoveryimage ??

Obviously some parts confirm the choice: https://github.com/lopestom/twrp_device_oppo_CPH1717/blob/d7512fa874098cb146069c0151bcccae5c272122/recovery.fstab#L5 https://github.com/lopestom/twrp_device_oppo_CPH1717/blob/d7512fa874098cb146069c0151bcccae5c272122/BoardConfig.mk#L36 https://github.com/lopestom/twrp_device_oppo_CPH1717/blob/d7512fa874098cb146069c0151bcccae5c272122/recovery.fstab#L5

So obviously the file can only stand out: recovery.img

thank you sir

@kinguser981
Copy link

kinguser981 commented Nov 7, 2023

Here's the log file

Click to open

gitpod /workspace/empty/twrp (main) $ mka recoveryimage
build/make/core/soong_config.mk:196: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
build/make/core/soong_config.mk:197: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=16.1.0
TARGET_PRODUCT=omni_CAP_sprout
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.1.54-060154-generic-x86_64-Ubuntu-22.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/hmd/CAP_sprout
============================================
[ 29% 27/93] including bootable/recovery/Android.mk ...
bootable/recovery/prebuilt/Android.mk:441: warning: vendor_hw: bootable/recovery/prebuilt/relink.sh out/target/product/CAP_sprout/recovery/root/vendor/bin/hw
[ 86% 80/93] including system/sepolicy/Android.mk ...
system/sepolicy/Android.mk:57: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
system/sepolicy/Android.mk:62: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.

ninja: no work to do.

the source: https://github.com/kinguser981/Nokia-5.3-twrp/tree/android-12.0

what is the problem??? ninja: no work to do.

@lopestom
Copy link
Author

lopestom commented Nov 7, 2023

Here's the log file
PLATFORM_VERSION=16.1.0
TARGET_PRODUCT=omni_CAP_sprout

ninja: no work to do.
the source: https://github.com/kinguser981/Nokia-5.3-twrp/tree/android-12.0

what is the problem??? ninja: no work to do.

android-12.0 => update your knowledge
https://gist.github.com/lopestom/3c1f3eaa66248c56e61acf19ddd4b96c#build-levels

@lopestom
Copy link
Author

lopestom commented Dec 24, 2023

hlo sir i am building twrp for my device realme 9 pro plus ,i got twrp size error how to solve this here is my dt : https://github.com/DG-HEART/test_ossi_twrp can you help me out max size of recovery partition is 40mb

BOARD_BOOTIMAGE_PARTITION_SIZE := 41943040
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 41943040

That's a normal Max size of the partition? 40MB?
So, very attempts but not know if encrypt/decrypt works. Using some flags like TW_EXCLUDE_ can help or not.

TW_EXCLUDE_PYTHON := true
TW_EXCLUDE_NANO := true
TW_EXCLUDE_TWRPAPP := true
TW_EXCLUDE_MTP := true
TW_EXCLUDE_TZDATA := true
TW_EXCLUDE_BASH := true
TW_EXCLUDE_LPTOOLS := true
TW_EXCLUDE_LPDUMP := true`

But looking your DT so has only one file in the \recovery\root
https://github.com/DG-HEART/test_ossi_twrp/tree/main/recovery/root

In that condiction the size of img file compiled maybe have 33~36MB.
But if you putting more files in the \vendor\*.* to try encrypt/decrypt process so need minimal specific/special files.

You can try compiling with flags mentioned and put files - one by one - to know how size have in the final.
That's not easy and maybe have Large size file in the final. But that was the company's choice.

@lopestom
Copy link
Author

lopestom commented Dec 25, 2023

Bro go to this Telegram gc and ask ur questions plz 👍 .

If you not write here to help so
Can you send PM to him......

Build completed without size error but not 33~36 its 40mb what to do sir

Bro,
If you write:

BOARD_BOOTIMAGE_PARTITION_SIZE := 41943040
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 41943040

The img file compiled already have 40MB. This is the max size of partition and you can use img file for flash.
if put nothing or more like 67108864 so the compiled img file have 64MB. But you cannot flash that file in the device.

Lopestom sir i think you have released twrp for rmx3393 can you help out how to build without size error I am facing size error I am also building for the same device, is there any way to compress ramdisk into smaller size

I really not understand what you need:
1- Have a compiled file with 40MB --> Okay
2- TWRP compiled img file start in the device?
3- step -2 Okay. Want encrypt/decrypt mode?
3.1- step -2 not work?

What I undertand:

Click to open

You need functional TWRP with encrypt/decrypt mode.
But I wrote to three people about this issue that to have a fully functional TWRP on the RMX3393, the encryption/decryption files could not be placed in the device tree. This is all because the encryption/decryption files add up to a size much larger than 40MB. Even if you manage to have a TWRP with a size of 64MB, then unpack and repack it to know its real size.
Example: after the img file was repackaged, the actual size was 46MB. Well, so did you make the img file with all the TW_EXCLUDE_ flags?
Yes: So choose to have TWRP without encryption/decryption or you should study/learn how to increase the size of the boot.img partition;
No: Then try.

I can't help with this because I myself have a device with A12 and a maximum partition of 32MB. Whenever I compiled the img file with all the encryption/decryption files (with a minimum part of specific/correct files, so there are very few files in quantity and size), the final size of the img file is 33/35MB and I cannot flash it it on the device. I tried removing more files. But encryption/decryption always failed. There are encryption/decryption files that have a minimum size of 1~1.2MB and even if you try to remove this file, the final size of the img file will still not be the same as that of the device partition. So you try to remove more files and in the end you have a good sized img file. But it remains the same, encryption/decryption always failed.
I have the same direction/option that I wrote for you above.

@AblertARock
Copy link

Quick question: How do I compile this without Travis CI? I have admin access to a flavour of Arch Linux, if Arch would work.

@lopestom
Copy link
Author

Quick question: How do I compile this without Travis CI? I have admin access to a flavour of Arch Linux, if Arch would work.

What Android & Kernel version?

@AblertARock
Copy link

I have the tree built, I just need to make the boot image. (I have a A/B partitioned system, and I used twrpdtgen.)

I am using Android 12, with a MTK Helio G37. The phone's codename is (Motorola) Maui.

@lopestom
Copy link
Author

I have the tree built, I just need to make the boot image. (I have a A/B partitioned system, and I used twrpdtgen.)

I am using Android 12, with a MTK Helio G37. The phone's codename is (Motorola) Maui.

This gist How To Make A Working TWRP Device Tree For Your MediaTek Device is for <A9 and maybe you need read more.
Update mind and development: Device Tree for A10+

Quick question: How do I compile this without Travis CI? I have admin access to a flavour of Arch Linux, if Arch would work.

Read Tutorial Using online resource to build custom recovery

@AblertARock
Copy link

I have the tree built, I just need to make the boot image. (I have a A/B partitioned system, and I used twrpdtgen.)
I am using Android 12, with a MTK Helio G37. The phone's codename is (Motorola) Maui.

This gist How To Make A Working TWRP Device Tree For Your MediaTek Device is for <A9 and maybe you need read more. Update mind and development: Device Tree for A10+

Quick question: How do I compile this without Travis CI? I have admin access to a flavour of Arch Linux, if Arch would work.

Read Tutorial Using online resource to build custom recovery

Thank you for the info. I'm currently just a dumb teenager, so any help is greatly appreciated.

@kinguser981
Copy link

kinguser981 commented Feb 24, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment