Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

How to build for Xioami Redmi Note 10 Pro #6

Open
adamnickster opened this issue May 5, 2022 · 15 comments
Open

How to build for Xioami Redmi Note 10 Pro #6

adamnickster opened this issue May 5, 2022 · 15 comments

Comments

@adamnickster
Copy link

Could you give me some hints how to build/port for Xiaomi Redmi Note 10 Pro (SM7150) ?

@Cl1nkkk
Copy link

Cl1nkkk commented May 7, 2022

send here a file located /sys/firmware/fdt

@Cl1nkkk
Copy link

Cl1nkkk commented May 7, 2022

how much ram does your phone have?

@Cl1nkkk
Copy link

Cl1nkkk commented May 7, 2022

Check this
https://github.com/Cl1nkkk/edk2-note10pro

@adamnickster
Copy link
Author

I tried build myself but getting this error:

bash sweetbuild.sh
Loading previous configuration from /home/adam/git/edk2-sm7150/../edk2/Conf/BuildEnv.sh
Using EDK2 in-source Basetools
WORKSPACE: /home/adam/git/edk2-sm7150/
EDK_TOOLS_PATH: /home/adam/git/edk2-sm7150/../edk2/BaseTools
CONF_PATH: /home/adam/git/edk2-sm7150/../edk2/Conf
Build environment: Linux-5.13.0-40-generic-x86_64-with-Ubuntu-20.04-focal
Build start time: 21:55:41, May.07 2022

WORKSPACE = /home/adam/git/edk2-sm7150
PACKAGES_PATH = /home/adam/git/edk2:/home/adam/git/edk2-platforms:/home/adam/git/edk2-sm7150
EDK_TOOLS_PATH = /home/adam/git/edk2-sm7150/../edk2/BaseTools
CONF_PATH = /home/adam/git/edk2/Conf
PYTHON_COMMAND = python2.7

Processing meta-data
Architecture(s) = AARCH64
.Build target = DEBUG
Toolchain = GCC5

Active Platform = /home/adam/git/edk2-sm7150/F11/sweet.dsc

build.py...
/home/adam/git/edk2-sm7150/F11/sweet.dsc(...): error 4000: Instance of library class [RegisterFilterLib] is not found
in [/home/adam/git/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf] [AARCH64]
consumed by module [/home/adam/git/edk2/ArmPlatformPkg/PrePi/PeiUniCore.inf]

  • Failed -
    Build end time: 21:55:42, May.07 2022
    Build total time: 00:00:01

Here is zip with extractred fdt file and dsc and sh

Redmi_Note_10_Pro.zip

RAM: 6GB

Resolution:
1080x2400x120x183275
1080x2400x60x183275

@adamnickster
Copy link
Author

Check this https://github.com/Cl1nkkk/edk2-note10pro

This looks like fork for Xiaomi Mi Note 10 Pro 2019 (tucana), but I have Xiaomi Redmi Note 10 Pro 2021 (sweet).

@Cl1nkkk
Copy link

Cl1nkkk commented May 8, 2022

Remove edk2 and edk2-platrorms folders, download this https://drive.google.com/file/d/12QZxmXwmjEcv6pBuFAA3n_1ZFmsTyqMM/view?usp=drivesdk to root folder, tar -xvzf edk2.tgz, and check it again https://github.com/Cl1nkkk/edk2-note10pro, for sweet now

@adamnickster
Copy link
Author

Hi @Cl1nkkk
Thank you for your help, but still not able to build.
I'm using your edk2 and edk2-platrorms folders and this repo edk2-sm7150 and also your edk2-note10pro throwing same error:

./build.sh 
Loading previous configuration from /home/adam/git/edk2-note10pro/../edk2/Conf/BuildEnv.sh
WORKSPACE: /home/adam/git/edk2-note10pro/
EDK_TOOLS_PATH: /home/adam/git/edk2-note10pro/../edk2/BaseTools
CONF_PATH: /home/adam/git/edk2-note10pro/../edk2/Conf
Build environment: Linux-5.13.0-40-generic-x86_64-with-Ubuntu-20.04-focal
Build start time: 20:06:42, May.08 2022

WORKSPACE        = /home/adam/git/edk2-note10pro
PACKAGES_PATH    = /home/adam/git/edk2:/home/adam/git/edk2-platforms:/home/adam/git/edk2-note10pro
EDK_TOOLS_PATH   = /home/adam/git/edk2-note10pro/../edk2/BaseTools
CONF_PATH        = /home/adam/git/edk2/Conf
PYTHON_COMMAND   = python2.7


Architecture(s)  = AARCH64
Build target     = DEBUG

Processing meta-data .Toolchain        = GCC5

Active Platform          = /home/adam/git/edk2-note10pro/F11/F11.dsc
.. done!
Building ... /home/adam/git/edk2/MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf [AARCH64]
Building ... /home/adam/git/edk2-note10pro/F11/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf [AARCH64]
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mstrict-align’; did you mean ‘-Wstrict-aliasing’?
make: *** [GNUmakefile:308: /home/adam/git/edk2-note10pro/Build/F11/DEBUG_GCC5/AARCH64/MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib/OUTPUT/BaseStackCheckGcc.obj] Error 1


build.py...
 : error 7000: Failed to execute command
	make -s tbuild [/home/adam/git/edk2-note10pro/Build/F11/DEBUG_GCC5/AARCH64/MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib]


build.py...
 : error 7000: Failed to execute command
	make -s tbuild [/home/adam/git/edk2-note10pro/Build/F11/DEBUG_GCC5/AARCH64/F11/Library/PlatformBootManagerLib/PlatformBootManagerLib]


build.py...
 : error F002: Failed to build module
	/home/adam/git/edk2/MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf [AARCH64, GCC5, DEBUG]

- Failed -
Build end time: 20:06:45, May.08 2022
Build total time: 00:00:02

any idea what is wrong ? Should I try run build directly on smartphone ?

@Cl1nkkk
Copy link

Cl1nkkk commented May 8, 2022

try
sudo apt install build-essential uuid-dev iasl git nasm python3-distutils gcc-aarch64-linux-gnu abootimg && cd /home/adam/git/edk2-note10pro && git pull && bash build.sh

@Cl1nkkk
Copy link

Cl1nkkk commented May 8, 2022

if that doesn't work build via linux deploy container on your phone

@Cl1nkkk
Copy link

Cl1nkkk commented May 8, 2022

@adamnickster
Copy link
Author

Test result: after booting your uefi_sweet.img I get only black screen (tried also press/hold buttons) but I don't have WinPE partition yet because of encryption of Android 12. Should I get some response/screen/message without boot partition with stock Android partition layout ?

Build result: moving forward but another error. looks like different architecture of the binary? I will try linux deploy tomorrow.
here is end of the build log:

Building ... /home/adam/git/edk2/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf [AARCH64]
Building ... /home/adam/git/edk2/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf [AARCH64]
Building ... /home/adam/git/edk2/MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf [AARCH64]
/home/adam/git/edk2-note10pro/../edk2/BaseTools/BinWrappers/PosixLike/VfrCompile: line 18: /home/adam/git/edk2-note10pro/../edk2/BaseTools/Source/C/bin/VfrCompile: cannot execute binary file: Exec format error
/home/adam/git/edk2-note10pro/../edk2/BaseTools/BinWrappers/PosixLike/VfrCompile: line 18: /home/adam/git/edk2-note10pro/../edk2/BaseTools/Source/C/bin/VfrCompile: Success
make: *** [GNUmakefile:310: /home/adam/git/edk2-note10pro/Build/F11/DEBUG_GCC5/AARCH64/MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib/DEBUG/BootManagerVfr.c] Error 126


build.py...
 : error 7000: Failed to execute command
	make -s tbuild [/home/adam/git/edk2-note10pro/Build/F11/DEBUG_GCC5/AARCH64/MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib]


build.py...
 : error 7000: Failed to execute command
	make -s tbuild [/home/adam/git/edk2-note10pro/Build/F11/DEBUG_GCC5/AARCH64/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib]


build.py...
 : error 7000: Failed to execute command
	make -s tbuild [/home/adam/git/edk2-note10pro/Build/F11/DEBUG_GCC5/AARCH64/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib]


build.py...
 : error F002: Failed to build module
	/home/adam/git/edk2/MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf [AARCH64, GCC5, DEBUG]

- Failed -
Build end time: 21:59:44, May.08 2022
Build total time: 00:00:07

@adamnickster
Copy link
Author

Update:
I'm able to build UEFI image via Linux deploy container on my phone ✅ (Ubuntu 18.04)
Created esp, pe, win partitions, flag as boot and copy WinPE files (by this guide: https://forum.renegade-project.org/t/faq/95)
boot UEFI image and get only black screen like a dead phone. (same behaviour with the image provided by @Cl1nkkk )

@adamnickster
Copy link
Author

Update 2:
fixed the black screen by reducing RAM to 3664MB.
gArmTokenSpaceGuid.PcdSystemMemorySize|0xE5000000
I saw this value in commit history and it's working but stuck on windows logo screen without dots loading :( looks like same issue as @Cl1nkkk created

With 6GB value 0x180000000 = black screen
With 5,75GB, 5GB, 4GB = screen is working and stuck with 3 lines of logs at Loading DxeCore at 0x017E28C000 etc... (with change RAM size hex value in log is different)

@adamnickster
Copy link
Author

Progress: I reverted this commit Expanded ram size to 6g (b8c0f56) and windows start loading, but after a few seconds BSOD: IRQL NOT LESS OR EQUAL

Screenshot

Any idea how to fix memory mapping/settings?

@Idonotkno
Copy link

@adamnickster acpi or map,
And which pe are you using?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants