Dasharo / dasharo-issues

The Dasharo issue tracker
https://dasharo.com/
24 stars 0 forks source link

Include Dasharo iPXE menu in OvmfPkg QEMU build #537

Closed macpijan closed 11 months ago

macpijan commented 1 year ago

Dasharo version (if applicable)

v0.1.0

Dasharo variant (if applicable)

Emulation QEMU Q35

Affected component(s) or functionality (if applicable)

edk2/OvmfPkg

Brief summary

Additional context

pietrushnic commented 12 months ago

The problem with network booting is that when it is enabled, we can't prevent PXE autoboot in default OVMF. The key question is how to approach this. @miczyg1 do you know how to approach this?

miczyg1 commented 12 months ago
  1. iPXE would have to be separately built before the OVMF and put into the workspace (maybe included in FDF too
  2. OVMF package DSC would have to mimic UefiPayloadPkg DSC:
  #
  # Network definition
  #
  DEFINE NETWORK_PXE_BOOT               = FALSE
  DEFINE NETWORK_ENABLE                 = FALSE
  DEFINE NETWORK_TLS_ENABLE             = FALSE
  DEFINE NETWORK_IP6_ENABLE             = FALSE
  DEFINE NETWORK_IP4_ENABLE             = TRUE
  DEFINE NETWORK_LAN_ROM                = FALSE

!if $(NETWORK_PXE_BOOT) == TRUE
  DEFINE NETWORK_SNP_ENABLE             = TRUE
  DEFINE NETWORK_HTTP_BOOT_ENABLE       = FALSE
  DEFINE NETWORK_ISCSI_ENABLE           = FALSE
!else
  DEFINE NETWORK_SNP_ENABLE             = FALSE
  DEFINE NETWORK_HTTP_BOOT_ENABLE       = TRUE
  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
  DEFINE NETWORK_ISCSI_ENABLE           = TRUE
!endif

!include NetworkPkg/NetworkDefines.dsc.inc
  #
  # IPXE support
  #
  DEFINE NETWORK_IPXE                   = FALSE
  1. The PlatformBootManagerLib must register a bootable option with iPXE similar to how UefiPayload does it in this own PlatformBootManagerLib https://github.com/Dasharo/edk2/blob/dasharo/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c#L1577
pietrushnic commented 12 months ago

I'm pretty sure we had this problem for another platform, how did we solve it? Are we adding iPXE binary to the EDK II workspace?

pietrushnic commented 12 months ago

Ok, I see how it is done: https://github.com/Dasharo/edk2/blob/dasharo/UefiPayloadPkg/UefiPayloadPkg.fdf#L267

miczyg1 commented 12 months ago

I'm pretty sure we had this problem for another platform, how did we solve it? Are we adding iPXE binary to the EDK II workspace?

Yes, before starting the build process of EDKII we just copy the freshly built ipxe.efi to the EDKII workspace where FDF expects it to be.

pietrushnic commented 12 months ago

@macpijan

Required changes were implemented in:

More detailed descriptions in dedicated issues.

Please let me know how you would like to incorporate those changes.

pietrushnic commented 11 months ago

@macpijan I guess the dependency of this issue was moved to https://github.com/Dasharo/open-source-firmware-validation/pull/70/files, which was merged, so if https://github.com/Dasharo/edk2/pull/101 will be merged we should be able to mark this as complete, correct?

macpijan commented 11 months ago

Precisely @pietrushnic

pietrushnic commented 11 months ago

@macpijan So the key question is who is responsible for approving https://github.com/Dasharo/edk2/pull/101 because the review I received was already addressed. Do we have to wait for @miczyg1 to resolve the discussion and approve that PR?

macpijan commented 11 months ago

because the review I received was already addressed

If I were you here, I would resolve this myself leaving a comment that we can go back to that if necessary.

I would rather not resolve that discussion by myself, as I am not really familiar with the details of this discussion.

pietrushnic commented 11 months ago

@macpijan I merged https://github.com/Dasharo/edk2/pull/101, now remaining piece is verification of #544 to close this item.