Maybe, but I still think the Omni source is a dead end. Notice that the About on the github page says:My question is, do the makefiles from the devicetree need to be adjusted or completely rebuild to android 11 parameters? I.e. rhe command "add_lunch_combo" is obsolete and "COMMAND_LUNCH_CHOICES" took its place..
Sorry in advance for this nooby questions...
Funny, now that you mention it, i realize it now too... Looks like a bit of a challenge...Maybe, but I still think the Omni source is a dead end. Notice that the About on the github page says:
Minimal manifest for building TWRP for devices shipped with Android 5.1 through Android 10
Already tried it with the AOSP-repository... here's what the system gave me backDon't we need this https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp as that one is stated to support android 11
GitHub - MiCode/Xiaomi_Kernel_OpenSource at odin-r-oss
Xiaomi Mobile Phone Kernel OpenSource. Contribute to MiCode/Xiaomi_Kernel_OpenSource development by creating an account on GitHub.github.com
I was able to getAlready tried it with the AOSP-repository... here's what the system gave me back
maybe i need to use the odin-kernel, since the prebuilt-kernels are not recommended
repo init --depth=1 -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-11
repo sync
python3 -m twrpdtgen -o ~/twrp11/device ~/boot.img
$(LOCAL_DIR)/omni_odin.mk
$(LOCAL_DIR)/twrp_odin.mk
COMMON_LUNCH_CHOICES := \
twrp_odin-userdebug \
twrp_odin-eng
$(call inherit-product, vendor/omni/config/gsm.mk)
#$(call inherit-product, vendor/omni/config/gsm.mk)
$(call inherit-product, vendor/omni/config/common.mk)
$(call inherit-product, vendor/twrp/config/common.mk)
PRODUCT_NAME := omni_odin
PRODUCT_NAME := twrp_odin
add_lunch_combo omni_odin-userdebug
add_lunch_combo omni_odin-eng
#add_lunch_combo omni_odin-userdebug
#add_lunch_combo omni_odin-eng
PRODUCT_STATIC_BOOT_CONTROL_HAL := \
bootctrl.lahaina \
libgptutils \
libz \
libcutils
export ALLOW_MISSING_DEPENDENCIES=true
. build/envsetup.sh
lunch twrp_odin-eng
mka bootimage
i'm doing it right now... keep you posted.I was able to get
#### build completed successfully (29 seconds) ####
with the AOSP repo and some modifications in the device tree files. However I can't find boot.img (or I don't know where to look at).
Here's what I did:
Code:repo init --depth=1 -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-11 repo sync python3 -m twrpdtgen -o ~/twrp11/device ~/boot.img
The problem here is that, as you correctly guessed, twrpdtgen is meant to work with omni 10 manifest and the device trees it creates have values that are per-configured for Omni. So I made the following edits:
AndroidProducts.mk
change from:
$(LOCAL_DIR)/omni_odin.mk
to:
$(LOCAL_DIR)/twrp_odin.mk
Add at the end:
COMMON_LUNCH_CHOICES := \ twrp_odin-userdebug \ twrp_odin-eng
omni_odin.mk
Rename the file to twrp_odin.mk
change from:
$(call inherit-product, vendor/omni/config/gsm.mk)
to:
#$(call inherit-product, vendor/omni/config/gsm.mk)
change from:
$(call inherit-product, vendor/omni/config/common.mk)
to:
$(call inherit-product, vendor/twrp/config/common.mk)
change from:
PRODUCT_NAME := omni_odin
to:
PRODUCT_NAME := twrp_odin
vendorsetup.sh
change from:
add_lunch_combo omni_odin-userdebug add_lunch_combo omni_odin-eng
to:
#add_lunch_combo omni_odin-userdebug #add_lunch_combo omni_odin-eng
device.mk
delete this part:
PRODUCT_STATIC_BOOT_CONTROL_HAL := \ bootctrl.lahaina \ libgptutils \ libz \ libcutils
Then I continued following the instructions:
Code:export ALLOW_MISSING_DEPENDENCIES=true . build/envsetup.sh lunch twrp_odin-eng mka bootimage
At the end I get a message saying that the build has completed successfully and a bunch of files in /out, but I'm not sure what to do next.
Oh, this looks great... can you tell us, what you used as repositories and commands?
Hi, I found another workaround that seem to give results: use the omni manifest and the original tree, but in BoardConfig.mk replace:Oh, this looks great... can you tell us, what you used as repositories and commands?
Seems like soong is running correctly, but when ninja is about to continue the build process, it stops.
As far as i learned is, that Bootloader Header Version 2 is native to Android 10/Omni anyways, so it should workHi, I found another workaround that seem to give results: use the omni manifest and the original tree, but in BoardConfig.mk replace:
BOARD_BOOTIMG_HEADER_VERSION := 3
with
BOARD_BOOTIMG_HEADER_VERSION := 2
Compiling like this creates a boot.img file. I don't have the device yet, but even if I did I don't know if I would flash it. I have a feeling that changing this value may not be safe (also I'm a total noob in this so I wouldn't trust a recovery created by myself )
so mate, one suggestion is, dont flash the twrp image, go to fastboot, and use fastboot boot twrp.img, so even if the build isnt correct, it just tries to boot the image flash rather than replacing the boot partitionAs far as i learned is, that Bootloader Header Version 2 is native to Android 10/Omni anyways, so it should work
I think i'm going to try it... it wanted to setup my device anyways. And if anything goes wrong, the fastboot-weeklys always fixed any problem for me..
Btw, i found a video tutorial for building twrp from source. I'm not sure, if i can apply this week (maybe friday) to see how this turns out. I'll keep you posted.
did you make these changes along with the once u mentioned here? and then did it make the twrp image?Hi, I found another workaround that seem to give results: use the omni manifest and the original tree, but in BoardConfig.mk replace:
BOARD_BOOTIMG_HEADER_VERSION := 3
with
BOARD_BOOTIMG_HEADER_VERSION := 2
Compiling like this creates a boot.img file. I don't have the device yet, but even if I did I don't know if I would flash it. I have a feeling that changing this value may not be safe (also I'm a total noob in this so I wouldn't trust a recovery created by myself )
That's awesome! Thanks, and care to explain what we do wrong. Hopefully you come far so we can use it with the Xiaomi eu ROM
No, when I compiled with the Omni 10 repo I changed only BOARD_BOOTIMG_HEADER_VERSION and a boot image was created.did you make these changes along with the once u mentioned here? and then did it make the twrp image?
AndroidProducts.mk
change from:
$(LOCAL_DIR)/omni_odin.mk
to:
$(LOCAL_DIR)/twrp_odin.mk
Add at the end:
COMMON_LUNCH_CHOICES := \ twrp_odin-userdebug \ twrp_odin-eng
omni_odin.mk
Rename the file to twrp_odin.mk
change from:
$(call inherit-product, vendor/omni/config/gsm.mk)
to:
#$(call inherit-product, vendor/omni/config/gsm.mk)
change from:
$(call inherit-product, vendor/omni/config/common.mk)
to:
$(call inherit-product, vendor/twrp/config/common.mk)
change from:
PRODUCT_NAME := omni_odin
to:
PRODUCT_NAME := twrp_odin
vendorsetup.sh
change from:
add_lunch_combo omni_odin-userdebug add_lunch_combo omni_odin-eng
to:
#add_lunch_combo omni_odin-userdebug #add_lunch_combo omni_odin-eng
device.mk
delete this part:
PRODUCT_STATIC_BOOT_CONTROL_HAL := \ bootctrl.lahaina \ libgptutils \ libz \ libcutils
Then I continued following the instructions:
Code:
export ALLOW_MISSING_DEPENDENCIES=true
. build/envsetup.sh
lunch twrp_odin-eng
mka bootimage
At the end I get a message saying that the build has completed successfully and a bunch of files in /out, but I'm not sure what to do next.
Oh, this looks great... can you tell us, what you used as repositories and commands?
Seems like soong is running correctly, but when ninja is about to continue the build process, it stops.
Hey, i was able to create a boot.img file by using the twrp10 repository and the bootheader-workaround. I used fastboot to boot the image, but my phone just went black and i had to restart it. Sooooo, back to the drawing board for us.so mate, one suggestion is, dont flash the twrp image, go to fastboot, and use fastboot boot twrp.img, so even if the build isnt correct, it just tries to boot the image flash rather than replacing the boot partition
try taking the log, connect your mix 4 to computer, use commandHey, i was able to create a boot.img file by using the twrp10 repository and the bootheader-workaround. I used fastboot to boot the image, but my phone just went black and i had to restart it. Sooooo, back to the drawing board for us.
adb logcat > logcat.txt
what all are not working mate?
I was able to getAlready tried it with the AOSP-repository... here's what the system gave me back
maybe i need to use the odin-kernel, since the prebuilt-kernels are not recommended
repo init --depth=1 -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-11
repo sync
python3 -m twrpdtgen -o ~/twrp11/device ~/boot.img
$(LOCAL_DIR)/omni_odin.mk
$(LOCAL_DIR)/twrp_odin.mk
COMMON_LUNCH_CHOICES := \
twrp_odin-userdebug \
twrp_odin-eng
$(call inherit-product, vendor/omni/config/gsm.mk)
#$(call inherit-product, vendor/omni/config/gsm.mk)
$(call inherit-product, vendor/omni/config/common.mk)
$(call inherit-product, vendor/twrp/config/common.mk)
PRODUCT_NAME := omni_odin
PRODUCT_NAME := twrp_odin
add_lunch_combo omni_odin-userdebug
add_lunch_combo omni_odin-eng
#add_lunch_combo omni_odin-userdebug
#add_lunch_combo omni_odin-eng
PRODUCT_STATIC_BOOT_CONTROL_HAL := \
bootctrl.lahaina \
libgptutils \
libz \
libcutils
export ALLOW_MISSING_DEPENDENCIES=true
. build/envsetup.sh
lunch twrp_odin-eng
mka bootimage
Oh, this looks great... can you tell us, what you used as repositories and commands?
Seems like soong is running correctly, but when ninja is about to continue the build process, it stops.