i386-pc: build verifiers API as module
authorMichael Chang <mchang@suse.com>
Thu, 18 Mar 2021 11:30:26 +0000 (19:30 +0800)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
commit64e90326de0743eebd2d865bc7d7ccf27ced54ca
treea4af25ad0b0b79b6760fbc4b6ab5119a4f9ada55
parent23953d230705c30b117aad23c499c59205adb1dc
i386-pc: build verifiers API as module

Given no core functions on i386-pc would require verifiers to work and
the only consumer of the verifier API is the pgp module, it looks good
to me that we can move the verifiers out of the kernel image and let
moddep.lst to auto-load it when pgp is loaded on i386-pc platform.

This helps to reduce the size of core image and thus can relax the
tension of exploding on some i386-pc system with very short MBR gap
size. See also a very comprehensive summary from Colin [1] about the
details.

[1] https://lists.gnu.org/archive/html/grub-devel/2021-03/msg00240.html

V2:
Drop COND_NOT_i386_pc and use !COND_i386_pc.
Add comment in kern/verifiers.c to help understanding what's going on
without digging into the commit history.

Reported-by: Colin Watson <cjwatson@debian.org>
Reviewed-by: Colin Watson <cjwatson@debian.org>
Signed-off-by: Michael Chang <mchang@suse.com>
Origin: other, https://lists.gnu.org/archive/html/grub-devel/2021-03/msg00251.html
Bug-Debian: https://bugs.debian.org/984488
Bug-Debian: https://bugs.debian.org/985374
Last-Update: 2021-09-24

Patch-Name: pc-verifiers-module.patch

Gbp-Pq: Name pc-verifiers-module.patch
grub-core/Makefile.am
grub-core/Makefile.core.def
grub-core/kern/main.c
grub-core/kern/verifiers.c
include/grub/verify.h