Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenNetworkBoot: Add PXE and HTTP(S) Boot support #562

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mikebeaton
Copy link
Contributor

@mikebeaton mikebeaton commented Oct 8, 2024

This replaces #554, now that the previous two changes #552 #553 are merged.

I was surprised how much of network boot is done in the OVMF UI package. Hence needing to take (sometimes with small mods) several bits of that, in the files imported from EDK 2; and then needing to reimplement the rest of it, in the rest of this driver. Doing it that way means it works with existing network boot drivers, up to the top level of the network boot stack; and means it works, full stop, i.e. no need to try to work out from scratch the correct usage patterns for the lower level network libraries, which are very low level (e.g. you can't 'just' issue a GET or a POST in http, very far from it).

The three commits here are: 1. import three edk 2 files; 2. clean them down to just what I kept and modified; 3. everything else, so if you review just the third commit, it is much easier to see what I changed from the originals in BmBoot.c, BmBootDescription.c and TlsAuthConfigImpl.c.

As before, the biggest change for the rest of the project is switching to use the CryptoPkg intrinsics lib. Maybe that change per se could be discussed independent of reviewing the rest of this? (REFS: #555; acidanthera/audk#67; tianocore/edk2#6169 - based on these refs, I say a) we should use it, and b) we should leave it where it is (not move to MdePkg) for now.) EDIT: Now rebased and updated to use new MdePkg IntrinsicLib location.

@mikebeaton mikebeaton changed the title Network boot (replaces #554) OpenNetworkBoot: Add PXE and HTTP(S) Boot support Oct 8, 2024
@mikebeaton mikebeaton mentioned this pull request Oct 8, 2024
@mikebeaton
Copy link
Contributor Author

Rebased and updated to use new MdePkg IntrinsicLib location.

Is there any progress reviewing or testing this?

@mikebeaton mikebeaton force-pushed the network-boot branch 2 times, most recently from a25fbbb to 0ea9019 Compare November 9, 2024 21:54
@mikebeaton
Copy link
Contributor Author

mikebeaton commented Nov 9, 2024

Full https boot to recovery: https://www.youtube.com/watch?v=xo_Pb-3thS4

Screenshot 2024-11-09 at 22 17 10 Screenshot 2024-11-09 at 22 24 42

@mikebeaton
Copy link
Contributor Author

mikebeaton commented Nov 17, 2024

@vit9696 @MikhailKrichanov - I have updated the PR so that OpenCore ships the three network stack drivers which are required only for PXE Boot (in addition to already shipping all the drivers required for HTTP(S) Boot). This includes the driver UefiPxeBcDxe which I missed out before in the PXE Boot drivers section of the README. Apologies for omitting that, before today I never tested PXE Boot with only our network stack, since up to now we only shipped the drivers required for HTTP(S) Boot (and since almost everything already includes the PXE Boot network stack!).

@MikhailKrichanov
Copy link
Contributor

MikhailKrichanov commented Nov 18, 2024

To date I tested only PXE Boot (works fine in QEMU), which needs not only UefiPxeBcDxe but also VirtioNetDxe or some other network card driver. VirtioNetDxe is worth mentioning in README and providing links to OEM sites, where network card drivers can be downloaded, also seems to be a good idea.

@MikhailKrichanov
Copy link
Contributor

@vit9696 would also like you to add to OpenCore CI tests for PXE and HTTP(S) Boot as a separate pull request.

@mikebeaton
Copy link
Contributor Author

mikebeaton commented Nov 18, 2024

To date I tested only PXE Boot (works fine in QEMU), which needs not only UefiPxeBcDxe but also VirtioNetDxe or some other network card driver. VirtioNetDxe is worth mentioning in README and providing links to OEM sites, where network card drivers can be downloaded also seems to be a good idea.

I missed UefiPxeBcDxe because the original network stack commit didn't include drivers for PXE boot at all, only HTTP boot - so up to the recent update to this PR above, I assumed we were only aiming at HTTP boot. Now added.

Rather similarly, the standard EDK II and audk builds of OvmfPkg include VirtioNetDxe even if NETWORK_ENABLE compilation flag is 0, but I believe you are using a different, more cut down build. It is probably a mistake on their part to include it in this case, I might look at doing a PR, but it explains why I missed it. SNP seems to be what this installs, and presumably is what the hardware device drivers would install.

On the hardware side, a similar issue is that almost all real hardware already includes at least PXE boot ... unless it's using special, cut-down, firmware... - so again I never encountered this, as the relevant hardware drivers are almost always present on most normal machines. But ofc I agree it should be mentioned. Do you have any links to relevant h/ware device drivers?

EDIT: Btw it's been successfully tested by a few other users - but I'm not sure anyone except me so far has tested HTTP(S) boot support!

@mikebeaton
Copy link
Contributor Author

@mikebeaton mikebeaton force-pushed the network-boot branch 3 times, most recently from 9ffbf8f to 6ad77fa Compare November 18, 2024 16:59
@MikhailKrichanov
Copy link
Contributor

On the hardware side, a similar issue is that almost all real hardware already includes at least PXE boot ... unless it's using special, cut-down, firmware... - so again I never encountered this, as the relevant hardware drivers are almost always present on most normal machines. But ofc I agree it should be mentioned. Do you have any links to relevant h/ware device drivers?

  1. https://winraid.level1techs.com/t/efi-lan-bios-intel-gopdriver-modules/33948
  2. https://www.intel.com/content/www/us/en/download/15755/intel-ethernet-connections-boot-utility-preboot-images-and-efi-drivers.html

@mikebeaton
Copy link
Contributor Author

On the hardware side, a similar issue is that almost all real hardware already includes at least PXE boot ... unless it's using special, cut-down, firmware... - so again I never encountered this, as the relevant hardware drivers are almost always present on most normal machines. But ofc I agree it should be mentioned. Do you have any links to relevant h/ware device drivers?

  1. https://winraid.level1techs.com/t/efi-lan-bios-intel-gopdriver-modules/33948
  2. https://www.intel.com/content/www/us/en/download/15755/intel-ethernet-connections-boot-utility-preboot-images-and-efi-drivers.html

I have added those links to the README:
https://github.com/acidanthera/OpenCorePkg/tree/network-boot/Platform/OpenNetworkBoot#firmware-and-option-roms

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

Successfully merging this pull request may close these issues.

2 participants