Skip to contentSkip to conversation

configs: socfpga: stratix10: Disable mkeficapsule tool build

PATCH In review Boon Khai Ng 2 participants 2 messages May 29

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 configs: socfpga: stratix10: Disable mkeficapsule tool build

mkeficapsule tool is automatically enabled when EFI_LOADER is selected, which introduces a host dependency on libgnutls.

This causes build failures in minimal toolchain environments where gnutls headers are not installed.

Stratix10 SoCFPGA platforms do not use UEFI capsule update workflows and therefore do not require mkeficapsule.

Disable CONFIG_TOOLS_MKEFICAPSULE in Stratix10 defconfigs to:
(1) avoid unintended host dependency on gnutls,
(2) reflect actual platform capability, and
(3) prevent tool build failures in minimal environments.

This is intended as an interim fix; a proper Kconfig refinement to only enable mkeficapsule when capsule update support is actually used is being discussed with EFI maintainers.

---
Changelog:
v2:
- Update commit message to clarify root cause of build failure (missing gnutls/gnutls.h when mkeficapsule is enabled by EFI_LOADER).
- Clarify that Stratix10 SoCFPGA platforms do not use UEFI capsule update workflows, so mkeficapsule is not required for these boards.
- Explicitly state this change is intended as an interim workaround to avoid unintended host dependency on libgnutls in minimal builds.
- Note that a longer-term fix should refine Kconfig logic to enable mkeficapsule only for platforms that actually support capsule updates.

v1:
https://patchwork.ozlabs.org/project/uboot/patch/
[email protected]/

 configs/socfpga_stratix10_atf_defconfig | 1 +
 configs/socfpga_stratix10_defconfig     | 1 +
 2 files changed, 2 insertions(+)
configs/socfpga_stratix10_atf_defconfig +1 -0
index 2eea9a2a731..e7ae16fc278 100644
@@ -88,3 +88,4 @@ CONFIG_WDT=y
 # CONFIG_SPL_USE_TINY_PRINTF is not set
 CONFIG_PANIC_HANG=y
 CONFIG_SPL_CRC32=y
+# CONFIG_TOOLS_MKEFICAPSULE is not set
configs/socfpga_stratix10_defconfig +1 -0
index 7b04859dec7..3071864d88e 100644
@@ -90,3 +90,4 @@ CONFIG_WDT=y
 # CONFIG_SPL_USE_TINY_PRINTF is not set
 CONFIG_PANIC_HANG=y
 CONFIG_SPL_CRC32=y
+# CONFIG_TOOLS_MKEFICAPSULE is not set
Signature · 1 line
2.43.7
Reviewed-by on v2 1/1
#1 lore raw

Hi Boon Khai Ng, Tom,

Quoted 6 lines · Boon Khai Ng

mkeficapsule tool is automatically enabled when EFI_LOADER is selected, which introduces a host dependency on libgnutls.

This causes build failures in minimal toolchain environments where gnutls headers are not installed.

Having had a cursory look at tools/mkeficapsule.c, I think it should be pretty straightforward (famous last words) to remove the dependency on gnutls. See changes made in 16abff246b40 ("tools: mkeficapsule: add firmware image signing") (lots of noise in the patch though, I'm thinking we only need to ifdef the privkey_file && cert_file if block in create_fwbin() (and the functions called in that block). The only issue is to decide when to drop this dependency.

We use pkg-config to detect if the lib is available (I'm hoping that's enough to assume the header will be available too), but if pkg-config fails then we still default to -lgnutls, see 31a7688cbe0e ("tools: mkeficapsule: use pkg-config to get -luuid and -lgnutls"). I'm not sure if/why we need to keep this fallback but otherwise we could do the same trick as for pk11 support in gnutls here https://lore.kernel.org/u-boot/[email protected]/ and set a flag to ifdef the appropriate sections in the code.

Quoted 3 lines

Stratix10 SoCFPGA platforms do not use UEFI capsule update workflows and therefore do not require mkeficapsule.

If you say so :)

Cheers,
Quentin