Skip to content

UefiPayloadPkg: Make RtkUndiDxe inclusion conditional on RTKUNDI_ENABLE#37

Open
jackadam1981 wants to merge 2 commits intoMrChromebox:uefipayload_2511from
jackadam1981:fix/pxe-rtl8168-acer-cxi4
Open

UefiPayloadPkg: Make RtkUndiDxe inclusion conditional on RTKUNDI_ENABLE#37
jackadam1981 wants to merge 2 commits intoMrChromebox:uefipayload_2511from
jackadam1981:fix/pxe-rtl8168-acer-cxi4

Conversation

@jackadam1981
Copy link

## Summary

Wrap the RtkUndiDxe (Realtek UNDI for RTL8168/8111) block in `UefiPayloadPkg.fdf` with `!if $(RTKUNDI_ENABLE) == TRUE` so that the driver is only included when the build is invoked with `-D RTKUNDI_ENABLE=TRUE`. This allows coreboot (or other build systems) to control whether RtkUndiDxe is packed into the payload via a single define, without removing the block from the FDF.

Use case: **Acer CXI4** (Google Kaisa) and similar boards with RTL8168 that need PXE from the EDK2 payload; other boards can leave `RTKUNDI_ENABLE` unset and avoid including the driver.

## Changes

- **UefiPayloadPkg/UefiPayloadPkg.fdf**: Around the existing `FILE DRIVER = 10EC8168-...` block for `RtkUndiDxe.efi`, add:
  - `!if $(RTKUNDI_ENABLE) == TRUE` before the block
  - `!endif` after the block

The block remains inside the existing `!if $(NETWORK_DRIVER_ENABLE) == TRUE` section, so RtkUndi is only considered when network drivers are enabled.

## Testing

- Build with `-D RTKUNDI_ENABLE=TRUE`: RtkUndiDxe.efi is included in the payload (requires the file at `UefiPayloadPkg/NetworkDrivers/RtkUndiDxe.efi`).
- Build without `RTKUNDI_ENABLE` or with `FALSE`: RtkUndiDxe block is skipped; payload builds successfully without the driver.

jackadam1981 and others added 2 commits February 1, 2026 15:29
- Add Realtek UNDI driver as FILE DRIVER for automatic loading
- Supports RTL8168 and compatible NICs for PXE boot

Co-authored-by: Cursor <cursoragent@cursor.com>
@jackadam1981
Copy link
Author

https://www.realtek.com/Download/List?cate_id=584
Download UEFI support for:

Realtek PCIe FE / GbE / 2.5GbE / 5G / 10G Family Controller Software

Network Interface Controllers > 10G Gigabit Ethernet > PCI Express

RTL8127 / RTL8127AT / RTL8127ATF

Network Interface Controllers > 5G Gigabit Ethernet > PCI Express

RTL8126

Network Interface Controllers > 2.5G Gigabit Ethernet > PCI Express

RTL8125 / RTL8125B(G) / RTL8125D / RTL8125K

RTL8125BP / RTL8125CP

Network Interface Controllers > 10/100/1000M Gigabit Ethernet > PCI Express

RTL8111B/RTL8111C/RTL8111D/RTL8111E/RTL8111F/RTL8111G/RTL8111H(S)/RTL8118A/RTL8119i/RTL8111L/RTL8111K/RTL8116AF

RTL8168B/RTL8168E/RTL8168G/RTL8168H

RTL8111DP/RTL8111EP(P)(V)/RTL8111FP

Network Interface Controllers > 10/100M Fast Ethernet > PCI Express

RTL8101E/RTL8102E/RTL8103E/RTL8105E/RTL8106E/RTL8107E

Network Interface Controllers > 10G Gigabit Ethernet > PCI Express

RTL8127 / RTL8127AT / RTL8127ATF

Network Interface Controllers > 5G Gigabit Ethernet > PCI Express

RTL8126

Network Interface Controllers > 2.5G Gigabit Ethernet > PCI Express

RTL8125 / RTL8125B(G) / RTL8125D / RTL8125K

RTL8125BP / RTL8125CP

Network Interface Controllers > 10/100/1000M Gigabit Ethernet > PCI Express

RTL8111B/RTL8111C/RTL8111D/RTL8111E/RTL8111F/RTL8111G/RTL8111H(S)/RTL8118A/RTL8119i/RTL8111L/RTL8111K/RTL8116AF

RTL8168B/RTL8168E/RTL8168G/RTL8168H

RTL8111DP/RTL8111EP(P)(V)/RTL8111FP

Network Interface Controllers > 10/100M Fast Ethernet > PCI Express

RTL8101E/RTL8102E/RTL8103E/RTL8105E/RTL8106E/RTL8107E

@MrChromebox
Copy link
Owner

I'm not a huge fan of including opaque EFI drivers in the build when not completely necessary.

What functionality does this enable that using iPXE doesn't offer?

Also, I'd included this previously and it didn't work properly, the LAN MAC showed up as all 00.

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.

2 participants