Skip to content

UefiBootManagerLib/BmBoot.c: add iPXE fail handling#309

Closed
filipleple wants to merge 2 commits into
dasharofrom
ipxe_fail_popup
Closed

UefiBootManagerLib/BmBoot.c: add iPXE fail handling#309
filipleple wants to merge 2 commits into
dasharofrom
ipxe_fail_popup

Conversation

@filipleple

@filipleple filipleple commented Jun 5, 2026

Copy link
Copy Markdown
Member

Add a popup for when iPXE fails a boot, e.g. due to lack of plugged in network connection. Addresses Dasharo/dasharo-issues#1834

Dasharo/coreboot#910

ref: NCM-2288

Add a popup for when iPXE fails a boot, e.g. due to lack of plugged in
network connection.

Signed-off-by: Filip Lewinski <filip.lewinski@3mdeb.com>
Comment thread MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c Outdated
Comment thread MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c Outdated
Comment thread MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c Outdated
// contains iPXE, since the boot entry name is platform vendor-specific.
//
if ((DevicePathType (BootOption->FilePath) == HARDWARE_DEVICE_PATH) &&
(DevicePathSubType (BootOption->FilePath) == HW_MEMMAP_DP)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is off. Should be something like this:

    if ((DevicePathType (BootOption->FilePath) == HARDWARE_DEVICE_PATH) &&
        (DevicePathSubType (BootOption->FilePath) == HW_MEMMAP_DP)) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// connection. Catching boots that exit with a warning as well, hence
// not EFI_ERROR ().
//
if (Status != EFI_SUCCESS ) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the same as if (EFI_ERROR (Status)) { above. It should be moved there I think. Also, there is redundant sapce after EFI_SUCCESS)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved upwards in 33bab84

Comment thread MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c Outdated
Improve the message for readability and ensure popup doesn't appear on
intentional exit out of iPXE.

Signed-off-by: Filip Lewinski <filip.lewinski@3mdeb.com>
@filipleple filipleple changed the title MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c: add iPXE fail handling UefiBootManagerLib/BmBoot.c: add iPXE fail handling Jun 8, 2026
@miczyg1

miczyg1 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Now that I think about it, why do we put more popups to EDK2? What if someone does not use EDK2 but uses the Dasharo iPXE script? Then this solution is not generic.

What I think might be best is to simply edit the script https://github.com/Dasharo/dasharo-blobs/blob/main/dasharo/dasharo.ipxe and do something when the commands fail, e.g. use the read to prompt user to press ENTER. E.g.

dhcp || "DHCP command failed. Press Enter to exit to menu" && read empty  && goto MENU
chain https://boot.dasharo.com/dts/dts.ipxe || echo -n "Loading DTS failed. Press Enter to exit to menu" && read empty 
goto MENU

That way, regardless of who uses the script, they will be able to read the error from the screen. If the problem you are trying to solve, is really just quiet failure. @filipleple

Smaller, simpler, more generic.

@filipleple

Copy link
Copy Markdown
Member Author

@miczyg1 o, yeah, that works too, nice:

Dasharo/dasharo-blobs#59

@filipleple filipleple closed this Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants