[Android Software Development] SanHelios:
hey, devs.

I'm a little new to compiling twrp and i tried to create one for my Xiaomi Mi Mix 4 (Odin)...

i used this script to get a device tree, running it on the boot.img of the latest weekly EU-Rom

Home

A Python library/script to automatically generate TWRP-compatible device tree from a boot/recovery image - twrpdtgen/twrpdtgen

github-wiki-see.page

For the Repo i used this one

GitHub - minimal-manifest-twrp/platform_manifest_twrp_omni: Minimal manifest for building TWRP for devices shipped with Android 5.1 through Android 9.0

Minimal manifest for building TWRP for devices shipped with Android 5.1 through Android 9.0 - minimal-manifest-twrp/platform_manifest_twrp_omni

github.com

here's what i did and what the system gave me back

. build/envsetup.sh (ENTER)

including device/xiaomi/odin/vendorsetup.sh

device/xiaomi/odin/vendorsetup.sh:19: add_lunch_combo is obsolete. Use COMMON_LUNCH_CHOICES in your AndroidProducts.mk instead.

device/xiaomi/odin/vendorsetup.sh:20: add_lunch_combo is obsolete. Use COMMON_LUNCH_CHOICES in your AndroidProducts.mk instead.

ccache found and CCACHE_EXEC has been set to : /usr/bin/ccache

export ALLOW_MISSING_DEPENDENCIES=true (ENTER)

lunch omni_odin-eng (ENTER)

WARNING: device/xiaomi/odin/omni.dependencies file not found

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=16.1.0

TARGET_PRODUCT=omni_odin

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-5.11.0-31-generic-x86_64-Ubuntu-21.04

HOST_CROSS_OS=windows

HOST_CROSS_ARCH=x86

HOST_CROSS_2ND_ARCH=x86_64

HOST_BUILD_TYPE=release

BUILD_ID=QQ3A.200805.001

OUT_DIR=/home/dave/twrp/out

ROM_BUILDTYPE=HOMEMADE

mka bootimage (ENTER)

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=16.1.0

TARGET_PRODUCT=omni_odin

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-5.11.0-31-generic-x86_64-Ubuntu-21.04

HOST_CROSS_OS=windows

HOST_CROSS_ARCH=x86

HOST_CROSS_2ND_ARCH=x86_64

HOST_BUILD_TYPE=release

BUILD_ID=QQ3A.200805.001

OUT_DIR=/home/dave/twrp/out

ROM_BUILDTYPE=HOMEMADE

============================================

wildcard(/home/dave/twrp/out/target/product/odin/clean_steps.mk) was changed, regenerating...

[100% 9582/9582] Target boot image: /home/dave/twrp/out/target/product/odin/boot.img

FAILED: /home/dave/twrp/out/target/product/odin/boot.img

/bin/bash -c "(/home/dave/twrp/out/host/linux-x86/bin/mkbootimg --kernel /home/dave/twrp/out/target/product/odin/kernel --ramdisk /home/dave/twrp/out/target/product/odin/ramdisk.img --cmdline \"buildvariant=eng\" --os_version 16.1.0 --os_patch_level 2099-12-31 --header_version 3 --output /home/dave/twrp/out/target/product/odin/boot.img ) && (true )"

Traceback (most recent call last):

File "/home/dave/twrp/out/host/linux-x86/bin/mkbootimg/internal/stdlib/runpy.py", line 174, in _run_module_as_main

File "/home/dave/twrp/out/host/linux-x86/bin/mkbootimg/internal/stdlib/runpy.py", line 72, in _run_code

File "/home/dave/twrp/out/host/linux-x86/bin/mkbootimg/__main__.py", line 12, in <module>

File "/home/dave/twrp/out/host/linux-x86/bin/mkbootimg/internal/stdlib/runpy.py", line 174, in _run_module_as_main

File "/home/dave/twrp/out/host/linux-x86/bin/mkbootimg/internal/stdlib/runpy.py", line 72, in _run_code

File "/home/dave/twrp/out/host/linux-x86/bin/mkbootimg/mkbootimg.py", line 238, in <module>

File "/home/dave/twrp/out/host/linux-x86/bin/mkbootimg/mkbootimg.py", line 229, in main

File "/home/dave/twrp/out/host/linux-x86/bin/mkbootimg/mkbootimg.py", line 70, in write_header

ValueError: Boot header version 3 not supported

15:48:30 ninja failed with: exit status 1

#### failed to build some targets (36 seconds) ####

---

If anyone can explain to me, what i messed up and what i could do to fix it? I don't mind, if it's a deep and complicated answer. Will be an opportunity to learn. :) :) :)

Thx in advance.