DEV Community

nikeasyanzi
nikeasyanzi

Posted on • Edited on

Hosting a HTTP server over UEFI

HTTP-UEFI

This is a Python script to host an HTTP server under UEFI for remote testing purposes.

It is built against Python 3.6.8 provided on EDK II.

It supports operations such as file upload, test utility run, and log read to facilitate the testing process.

How to use

  • Copy the built Python libraries which are folders Tools and StdLib and the http_uefi.py in this repo under your UEFI environment

For Python 3 enablement on UEFI, please refer to https://github.com/tianocore/edk2-libc/releases/tag/v3.6.8.1 provided by Jayaprakash Nevara

If you want to build by yourself, please refer to https://github.com/tianocore/edk2-libc/blob/master/AppPkg/Applications/Python/Python-3.6.8/Py368ReadMe.txt

image

  • Run the HTTP server

image

Operation supported and Usage

Assume we set TARGETURL=http://192.168.100.108:8080. The following commands demonstrate a simple test scenario from a test utility upload to the test result retrieval.

  • Upload where it creates an uploads folder automatically and place the uploaded files

curl -X POST -H "Content-Type: multipart/form-data" -F "file=@my_wake_test.efi" ${TARGETURL}

  • List list dir with the custom path

curl -H "Content-Type: application/json" -X POST --data '{"operation":"listdir","path":"FS0:\uploads"}' ${TARGETURLi}/listdir

curl ${TARGETURL}/getfilelist

  • Run run the efi test utility

curl ${TARGETURL}/run/my_wake_test.efi

  • ReadLog with the customized path Image description

It is built against Python 3.6.8 provided on EDK II.

It supports operations such as file upload, test utility run, and log read to facilitate the testing process.

Check this out!
https://github.com/nikeasyanzi/http_uefi

Top comments (0)