Added port guide (#6)
authorTAOcroatia <34100820+TAOcroatia@users.noreply.github.com>
星期六, 30 Jan 2021 22:01:56 +0000 (23:01 +0100)
committerBigfootACA <bigfoot@classfun.cn>
星期五, 2 Jul 2021 08:30:12 +0000 (16:30 +0800)
Added a port guide and removed sony device from the list of supported devices.

README.md

index 8c8507caa874a65925b296d12441d0d7f088a748..74d1ee126497b7f5cb7cf430a04005f7e7dae824 100644 (file)
--- a/README.md
+++ b/README.md
-# EDK2 UEFI Firmware For Snapdragon 845 (sdm845)\r
-\r
-Attempt to create a normal EDK2 for Snapdragon 845 platform.\r
-\r
-Pull requests for new devices and device tree or ACPI fixes are welcomed!\r
-\r
-![Github](https://img.shields.io/github/downloads/edk2-porting/edk2-sdm845/total)\r
-![Github](https://img.shields.io/github/v/release/edk2-porting/edk2-sdm845?include_prereleases)\r
-\r
-## Resources\r
-\r
-[Telegram group (recommended)](https://t.me/joinchat/MNjTmBqHIokjweeN0SpoyA)\r
-\r
-[Discord group](https://discord.gg/XXBWfag)\r
-\r
-QQ group: 697666196\r
-\r
-## License\r
-This project is released under the [WTFPL LICENSE](http://www.wtfpl.net/ "WTFPL LICENSE").\r
-\r
-## WARNING\r
-\r
-**DO NOT EVER TRY TO PORT IT TO *SONY* DEVICES**\r
-\r
-**YOUR UFS WILL BE WIPED CLEAN!!!**\r
-\r
-\r
-**This repo only supports Snapdragon 845 (sdm845) and does not support others such as Snapdragon 855 (sm8150)**\r
-\r
-**Do not try to run on other non sdm845 devices such as Xiaomi MIX3 5G**\r
-\r
-## Dependencies\r
-\r
-Ubuntu 18.04:\r
-\r
-```bash\r
-sudo apt update\r
-sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git\r
-```\r
-Ubuntu 20.04 is also proved to be fine.\r
-\r
-## Supported devices\r
-\r
-1. Xiaomi MIX 2S       (polaris)\r
-2. Xiaomi MIX 3        (perseus)\r
-3. Xiaomi MI 8         (dipper)\r
-4. Xiaomi PocoPhone F1 (beryllium)\r
-5. OnePlus 6           (enchilada)\r
-6. OnePlus 6T          (fajita)\r
-7. Sony Xperia XZ2     (akari)     (Removed)\r
-\r
-## Building\r
-\r
-1.Clone this project\r
-\r
-```bash\r
-git clone https://github.com/edk2-porting/edk2-sdm845.git --recursive --depth=1\r
-```\r
-\r
-2.Build this project\r
-\r
-```bash\r
-bash build.sh --device DEVICE\r
-```\r
-\r
-3.Boot the image\r
-\r
-```bash\r
-fastboot boot boot_DEVICE.img\r
-```\r
-\r
-(DEVICE is the codename of your phone.)\r
-\r
-## Credits\r
-\r
-Special thanks to [fxsheep](https://github.com/fxsheep)\r
-\r
-MemoryMap thanks to [Lemon1Ice](https://github.com/Lemon1Ice).\r
-\r
-ACPI tables thanks to [sunshuyu](https://github.com/sunshuyu) and many other people related.\r
-\r
-SimpleFbDxe driver is from imbushuo's [Lumia950XLPkg](https://github.com/WOA-Project/Lumia950XLPkg).\r
-\r
-Also thanks to [edk2 website](https://github.com/tianocore/tianocore.github.io/wiki/Using-EDK-II-with-Native-GCC#Install_required_software_from_apt).\r
-\r
-## Simple Porting Guide\r
- WIP\r
+# EDK2 UEFI Firmware For Snapdragon 845 (sdm845)
+
+Attempt to create a normal EDK2 for Snapdragon 845 platform.
+
+Pull requests for new devices and device tree or ACPI fixes are welcomed!
+
+![Github](https://img.shields.io/github/downloads/edk2-porting/edk2-sdm845/total)
+![Github](https://img.shields.io/github/v/release/edk2-porting/edk2-sdm845?include_prereleases)
+
+## Resources
+
+[Telegram group (recommended)](https://t.me/joinchat/MNjTmBqHIokjweeN0SpoyA)
+
+[Discord group](https://discord.gg/XXBWfag)
+
+QQ group: 697666196
+
+## License
+This project is released under the [WTFPL LICENSE](http://www.wtfpl.net/ "WTFPL LICENSE").
+
+## WARNING
+
+**DO NOT EVER TRY TO PORT IT TO *SONY* DEVICES**
+
+**YOUR UFS WILL BE WIPED CLEAN!!!**
+
+
+**This repo only supports Snapdragon 845 (sdm845) and does not support others such as Snapdragon 855 (sm8150)**
+
+**Do not try to run on other non sdm845 devices such as Xiaomi MIX3 5G**
+
+## Dependencies
+
+Ubuntu 18.04:
+
+```bash
+sudo apt update
+sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git
+```
+Ubuntu 20.04 is also proved to be fine.
+
+## Supported devices
+
+1. Xiaomi MIX 2S       (polaris)
+2. Xiaomi MIX 3        (perseus)
+3. Xiaomi MI 8         (dipper)
+4. Xiaomi PocoPhone F1 (beryllium)
+5. OnePlus 6           (enchilada)
+6. OnePlus 6T          (fajita)
+
+## Building
+
+1.Clone this project
+
+```bash
+git clone https://github.com/edk2-porting/edk2-sdm845.git --recursive --depth=1
+```
+
+2.Build this project
+
+```bash
+bash build.sh --device DEVICE
+```
+
+3.Boot the image
+
+```bash
+fastboot boot boot_DEVICE.img
+```
+
+(DEVICE is the codename of your phone.)
+
+## Credits
+
+Special thanks to [fxsheep](https://github.com/fxsheep)
+
+MemoryMap thanks to [Lemon1Ice](https://github.com/Lemon1Ice).
+
+ACPI tables thanks to [sunshuyu](https://github.com/sunshuyu) and many other people related.
+
+SimpleFbDxe driver is from imbushuo's [Lumia950XLPkg](https://github.com/WOA-Project/Lumia950XLPkg).
+
+Also thanks to [edk2 website](https://github.com/tianocore/tianocore.github.io/wiki/Using-EDK-II-with-Native-GCC#Install_required_software_from_apt).
+
+## Porting Guide
+ 1. Install Python protobuf and uefi_firmware-parser by executing `pip install --upgrade google-api-python-client uefi_firmware` in terminal
+ 2. Download [extract_android_ota_payload](https://github.com/cyxx/extract_android_ota_payload/archive/master.zip) and extract the folder inside the archive anywhere
+ 3. Download any OTA update for your phone
+ 4. Extract payload.bin to `extract_android_ota_payload-master` folder
+ 5. Open terminal in the same folder and execute `python3 extract_android_ota_payload.py payload.bin`
+ 6. Execute `uefi-firmware-parser -b -e xbl.img`
+ 7. Change directory to `volume-******/file-9e21fd93-9c72-4c15-8c4b-e77f1db2d792`
+ 8. Execute `7z x -oextracted section0.guid`
+ 9. Open UEFITool and open the file `section0` in folder `extracted`
+ 10. In a file manager, open `edk2-sdm845/sdm845Pkg/Binary`, duplicate `dipper` folder and rename it to your device's codename
+ 11. In UEFITool, expand `UEFI image` and the volume underneath
+ 12. For each file in your device's folder replace it with UEFITool by:
+        - expanding the DXE Driver in UEFITool with the same name as the file you are replacing
+        - in case of file that ends with `.depex` right clicking on DXE dependency
+        - in case of file that ends with `.efi` right clicking on PE32 Image
+        - clicking `Extract body`
+        - deleting the original file
+        - saving the one you are extracting and naming it same as the deleted one
+- In case a part (ex. DXE Dependency) is missing in UEFITool, just delete that file
+ 13. Open `edk2-sdm845/sdm845Pkg` in a file manager
+ 14. Duplicate `dipper.dsc` and `dipper.fdf` and rename both to your device's codename
+ 15. Open the `.dsc` file, replace values 1080 and 2248 with your device's display width and height and save
+ 16. Open the `.fdf` file, replace every word "dipper" with your device's codename and save
+ 17. Open `edk2-sdm845` and edit `build.sh` with a text editor
+ 18. Locate device list at the top, add your device's codename and save
+
+ You can now build as usual.
+ Make sure to message the Discord or Telegram group in case you are stuck somewhere and if your port is successful, send `edk2-sdm845/sdm845Pkg/Binary/devicename` folder and `.dsc` and `.fdf` files.