From 19f9e2688f82e8c50d220cf5a221ce68d3d5c5ba Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Mon, 10 Aug 2026 23:29:17 +0200 Subject: [PATCH] boot/grub2: properly handle autoreconf for target package In commit e427f85e29f7027319a5cd1ce1024d80ef4a29ea ("boot/grub2: fix build issue since 2.14 version bump") we added some patches that require regenerating the configure script. Consequently, we added GRUB2_AUTORECONF = YES and HOST_GRUB2_AUTORECONF = YES. Except that grub2 is special. While the host package is indeed using host-autotols-package, the target package is using generic-package, making GRUB2_AUTORECONF = YES basically a no-op. Except that since we're patching configure.ac, the build realize at build time that configure is older than configure.ac, regenerates it at that time, and re-runs the configure script without the right environment variables causing build failures. We fix that by doing the autoreconf step "manually" for the target grub2 package. Fixes: https://autobuild.buildroot.org/results/11802ca1762e046328df324d33a1ad813fcd92e8/ Signed-off-by: Thomas Petazzoni Signed-off-by: Julien Olivain --- boot/grub2/grub2.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk index 85b3925c1e..de9f913e93 100644 --- a/boot/grub2/grub2.mk +++ b/boot/grub2/grub2.mk @@ -17,8 +17,8 @@ GRUB2_INSTALL_IMAGES = YES # 0001-Revert-configure-Check-linker-for-image-base-support.patch # 0002-Revert-configure-Print-a-more-helpful-error-if-autoc.patch -GRUB2_AUTORECONF = YES -GRUB2_DEPENDENCIES += host-pkgconf +# Target grub2 package doesn't use autotools-package +GRUB2_DEPENDENCIES += host-automake host-autoconf host-libtool host-pkgconf HOST_GRUB2_AUTORECONF = YES HOST_GRUB2_DEPENDENCIES += host-pkgconf @@ -139,6 +139,7 @@ HOST_GRUB2_CONF_OPTS = \ --disable-werror define GRUB2_CONFIGURE_CMDS + cd $(@D); $(AUTORECONF) $(foreach tuple, $(GRUB2_TUPLES-y), \ @$(call MESSAGE,Configuring $(tuple)) mkdir -p $(@D)/build-$(tuple)