El-Coder-SB
El-Coder-SB

Reputation: 85

How to import/compile uefi module using micropython?

Following the instructions on MicroPythonTestFramework/MicroPythonPkg, I can successfully run micropython.efi (using VS2015x86 instead of VS2017).

However importing the uefi module as given in the example on the above link fails:

FS0:\EFI\Python\> micropython.efi
MicroPython v1.9.4 on 2018-07-30; uefi version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import Lib.Uefi.uefi as uefi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'Lib.Uefi'

MicroPythonDxe.efi is in the same folder as micropython.efi.

How do I do to compile the uefi module into MicroPythonDxe.efi?

Upvotes: 0

Views: 482

Answers (1)

carodog
carodog

Reputation: 26

In order to successfully import the Python UEFI module, you must have the UEFI Python library on your device and accessible.

The modules you are looking for are located in MicroPythonPkg/MicroPythonDxe/Lib/Uefi.

The device file system will end up looking something like below

FS0:\EFI\Python\Lib\Uefi\uefi.py
                        \features.py
                        \msr.py
                        \protocols.py
                        \register.py.... etc

Upvotes: 1

Related Questions