Python Forum
Trying to install the edk2-rk3399 code but the script fails due some python bug
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to install the edk2-rk3399 code but the script fails due some python bug
#1
Hello.

I would like to install the "Rockchip RK3399 UEFI Firmware" that I found here :

https://github.com/mouseos/edk2-rk3399

on my KHADAS Edge-V (and on my RockPro64 RK3399) because I'm building a FreeBSD modular phone and I've chosen this board as the main board. I can't use u-boot because it does not support the screen that I've bought (a 4 inches 720x720 display),but I've been able to use it using the Jared McNeill UEFI for the Rockchip RK356X.

I think I have good chances to use it also with the RockChip RK3399. But only if someone can help me,I presume,to fix a bug in the code. I want to clarify that I don't want to steal your time. I ask for your help only because I presume that the bug is easy to fix (it seems only a matter of using lowercase or uppercase in the *.c files),but if you find more problems,feel free to don't help...

The script fails to produce the file "SDM845PKG_UEFI.fd".

I will show you what I did on a fresh installation of Ubuntu 20.04 :

Quote:# sudo apt update

# sudo apt install build-essential uuid-dev iasl git nasm python3-distutils gcc-aarch64-linux-gnu

# mkdir workspace-edk2

# cd workspace-edk2

# git clone https://github.com/tianocore/edk2.git -b edk2-stable201911 --recursive --depth=1

# git clone https://github.com/tianocore/edk2-platforms.git -o cfdc7f907d545b14302295b819ea078bc36c6a40 --recursive --depth=1

# git clone https://github.com/edk2-porting/edk2-rk3399.git

# cd edk2-rk3399

# bash build.sh --device polaris

.....
test_build___init__ (CheckPythonSyntax.Tests) ... ok
test_build_build (CheckPythonSyntax.Tests) ... ok
test_sitecustomize (CheckPythonSyntax.Tests) ... ok
test32bitUnicodeCharInUtf8Comment (CheckUnicodeSourceFiles.Tests) ... ok
test32bitUnicodeCharInUtf8File (CheckUnicodeSourceFiles.Tests) ... ok
testSupplementaryPlaneUnicodeCharInUtf16File (CheckUnicodeSourceFiles.Tests) ... ok
testSurrogatePairUnicodeCharInUtf16File (CheckUnicodeSourceFiles.Tests) ... ok
testSurrogatePairUnicodeCharInUtf8File (CheckUnicodeSourceFiles.Tests) ... ok
testSurrogatePairUnicodeCharInUtf8FileWithBom (CheckUnicodeSourceFiles.Tests) ... ok
testUtf16InUniFile (CheckUnicodeSourceFiles.Tests) ... ok
testValidUtf8File (CheckUnicodeSourceFiles.Tests) ... ok
testValidUtf8FileWithBom (CheckUnicodeSourceFiles.Tests) ... ok

----------------------------------------------------------------------
Ran 280 tests in 0.685s

OK
make[1]: uscita dalla directory «/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools/Tests»
make: uscita dalla directory «/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools»
+ rm -f boot_polaris.img uefi_img
+ rm -f workspace/Build/sdm845Pkg/DEBUG_GCC5/FV/SDM845PKG_UEFI.fd
+ GCC5_AARCH64_PREFIX=aarch64-linux-gnu-
+ build -s -n 0 -a AARCH64 -t GCC5 -p sdm845Pkg/polaris.dsc -b DEBUG
Build environment: Linux-5.15.0-139-generic-x86_64-with-glibc2.29
Build start time: 22:43:58, Aug.15 2025

WORKSPACE = /home/marietto/Scaricati/workspace-edk2/edk2-rk3399/workspace
PACKAGES_PATH = /home/marietto/Scaricati/workspace-edk2/edk2:/home/marietto/Scaricati/workspace-edk2/edk2-platforms:/home/marietto/Scaricati/workspace-edk2/edk2-rk3399
EDK_TOOLS_PATH = /home/marietto/Scaricati/workspace-edk2/edk2/BaseTools
CONF_PATH = /home/marietto/Scaricati/workspace-edk2/edk2/Conf
PYTHON_COMMAND = /usr/bin/python3.8


Architecture(s) = AARCH64
Build target = DEBUG
Toolchain = GCC5

Active Platform = /home/marietto/Scaricati/workspace-edk2/edk2-rk3399/sdm845Pkg/polaris.dsc

Processing meta-data ..build: : warning: Module MetaFile [Sources] is missing local header!
Local Header: /home/marietto/scaricati/workspace-edk2/edk2-rk3399/sdm845pkg/library/platformbootmanagerlib/platformbm.h not found in /home/marietto/Scaricati/workspace-edk2/edk2-rk3399/sdm845Pkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
build: : warning: Module MetaFile [Sources] is missing local header!
Local Header: /home/marietto/scaricati/workspace-edk2/edk2/embeddedpkg/application/androidfastboot/androidfastbootapp.h not found in /home/marietto/Scaricati/workspace-edk2/edk2/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf

build.py...
/home/marietto/Scaricati/workspace-edk2/edk2-rk3399/sdm845Pkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf(-1): error 4000: Value of Protocol [gEmbeddedMmcHostProtocolGuid] is not found under [Protocols] section in
/home/marietto/Scaricati/workspace-edk2/edk2/EmbeddedPkg/EmbeddedPkg.dec
/home/marietto/Scaricati/workspace-edk2/edk2/MdePkg/MdePkg.dec
/home/marietto/Scaricati/workspace-edk2/edk2-rk3399/sdm845Pkg/Drivers/DwEmmcDxe/DwEmmcDxe.dec
/home/marietto/Scaricati/workspace-edk2/edk2-rk3399/sdm845Pkg/sdm845Pkg.dec
Traceback (most recent call last):
File "/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools/Source/Python/AutoGen/AutoGenWorker.py", line 244, in run
Ma.CreateCodeFile(False)
File "/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py", line 1867, in CreateCodeFile
for File in self.AutoGenFileList:
File "/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools/Source/Python/Common/caching.py", line 28, in get
Value = obj.dict[self._function.name] = self._function(obj)
File "/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py", line 980, in AutoGenFileList
GenC.CreateCode(self, AutoGenC, AutoGenH, StringH, AutoGenUniIdf, UniStringBinBuffer, StringIdf, AutoGenUniIdf, IdfGenBinBuffer)
File "/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools/Source/Python/AutoGen/GenC.py", line 2032, in CreateCode
CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH)
File "/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools/Source/Python/AutoGen/GenC.py", line 1582, in CreateProtocolDefinitionCode
if Info.ProtocolList:
File "/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools/Source/Python/Common/caching.py", line 28, in get
Value = obj.dict[self._function.name] = self._function(obj)
File "/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py", line 1091, in ProtocolList
RetVal = OrderedDict(self.Module.Protocols)
File "/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools/Source/Python/Common/caching.py", line 28, in get
Value = obj.dict[self._function.name] = self._function(obj)
File "/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools/Source/Python/Workspace/InfBuildData.py", line 604, in Protocols
EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
File "/home/marietto/Scaricati/workspace-edk2/edk2/BaseTools/Source/Python/Common/EdkLogger.py", line 284, in error
raise FatalError(ErrorCode)
Common.BuildToolError.FatalError: 16384
.build: : warning: Module MetaFile [Sources] is missing local header!
Local Header: /home/marietto/scaricati/workspace-edk2/edk2-rk3399/sdm845pkg/sdm845dxe/sdm845dxe.h not found in /home/marietto/Scaricati/workspace-edk2/edk2-rk3399/sdm845Pkg/sdm845Dxe/sdm845Dxe.inf


- Done -
Build end time: 22:44:01, Aug.15 2025
Build total time: 00:00:02

+ echo 'Build done. check workspace/Build/sdm845Pkg/DEBUG_GCC5/FV/SDM845PKG_UEFI.fd Use it as a Linux kernel'
Build done. check workspace/Build/sdm845Pkg/DEBUG_GCC5/FV/SDM845PKG_UEFI.fd Use it as a Linux kernel

the file SDM845PKG_UEFI.fd IS NOT produced because of this error ?

Quote:—-> Local Header: /home/marietto/scaricati/workspace-edk2/edk2-rk3399/sdm845pkg/sdm845dxe/sdm845dxe.h not found in /home/marietto/Scaricati/workspace-edk2/edk2-rk3399/sdm845Pkg/sdm845Dxe/sdm845Dxe.inf

The missing file is on the right place,but is called differently : "sdm845dxe.inf"

https://ibb.co/jPKJnBGN

I tried to rename it,but I entered a loop of other files that are named incorrectly. I changed their names too,but probably I did it in the wrong way because I still see errors.

I think real error is in :

Quote:Common.BuildToolError.FatalError: 16384 is for code /home/marietto/Scaricati/workspace-edk2/edk2-rk3399/sdm845Pkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf(-1): error 4000: Value of Protocol [gEmbeddedMmcHostProtocolGuid] is not found under [Protocols] section in which raises error in Python raise FatalError(ErrorCode)
Reply
#2
(Aug-17-2025, 07:11 PM)mariozio Wrote: The missing file is on the right place,but is called differently : "sdm845dxe.inf"
I tried to rename it,
I don't know anything about your problem but it seems very unlikely that the missing header file sdm845dxe.h is the same file as the .inf file sdm845dxe.inf. I guess the .inf file is not a C header file but rather a file containing perhaps build descriptions or directives or meta information. You can open the .inf file to confirm that it is not a C header file.

This means that the step that you made by renaming sdm845dxe.inf into sdm845dxe.h cannot solve the issue. What you must do is try to understand why the header file sdm845dxe.h was missing.
« We can solve any problem by introducing an extra level of indirection »
Reply
#3
(Aug-17-2025, 08:00 PM)Gribouillis Wrote:
(Aug-17-2025, 07:11 PM)mariozio Wrote: The missing file is on the right place,but is called differently : "sdm845dxe.inf"
I tried to rename it,
I don't know anything about your problem but it seems very unlikely that the missing header file sdm845dxe.h is the same file as the .inf file sdm845dxe.inf. I guess the .inf file is not a C header file but rather a file containing perhaps build descriptions or directives or meta information. You can open the .inf file to confirm that it is not a C header file.

This means that the step that you made by renaming sdm845dxe.inf into sdm845dxe.h cannot solve the issue. What you must do is try to understand why the header file sdm845dxe.h was missing.

I started a post here :

https://edk2.groups.io/g/devel/topic/114...#msg121541

I made some progress,but it still does not work...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pip fails to install PyGObject voidtrance 2 4,427 Sep-11-2025, 10:50 AM
Last Post: Larz60+
  Python Code Help - pip install PyMuPDF python-docx pillow Splishsplash92 3 4,666 Jun-05-2024, 06:49 AM
Last Post: Pedroski55
  Anaconda 2.4.2: The JupyterLab 3.5.3 fails to run the python code of the Geographical jamalnuman 0 1,238 Aug-23-2023, 07:48 AM
Last Post: jamalnuman
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 10,048 Jun-29-2023, 11:57 AM
Last Post: gologica
  Anaconda pip install mpyc Error pip-script.py is not present Anldra12 2 10,260 Dec-13-2021, 06:59 PM
Last Post: Anldra12
  Embedded python fails to compile on Raspberry Pi tryfon 2 5,524 Dec-22-2020, 02:06 PM
Last Post: tryfon
  Raspi Commands via Python (VS Code) Script AS4188 5 5,168 Oct-21-2020, 03:49 PM
Last Post: AS4188
  pip3 install opencv-python fails on 'skbuild' Pedroski55 2 10,070 Sep-15-2020, 11:33 AM
Last Post: snippsat
  Runs perfect in Python but fails to print last statement when converted to .exe. Help sunil422 3 4,641 Aug-13-2020, 01:22 PM
Last Post: deanhystad
  Python 3.6.10 fails when running a localized script. Mikee 2 3,619 Jul-09-2020, 10:25 PM
Last Post: Mikee

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020
This forum uses Lukasz Tkacz MyBB addons.
Forum use Krzysztof "Supryk" Supryczynski addons.