[PATCH next 2/3] CI: use mirror for gnulib dependency of grub

Quentin Schulz quentin.schulz at cherry.de
Fri Nov 21 16:10:55 CET 2025


On 11/21/25 4:00 PM, Quentin Schulz wrote:
> Hi Tom,
> 
> On 11/21/25 3:24 PM, Tom Rini wrote:
>> On Fri, Nov 21, 2025 at 02:22:15PM +0100, Quentin Schulz wrote:
>>
>>> From: Quentin Schulz <quentin.schulz at cherry.de>
>>>
>>> grub bootstrap script downloads gnulib from a non-mirror URL and thus is
>>> unreliable.
>>>
>>> Instead, manually clone the gnulib repo from a mirror URL and pass that
>>> repo to the bootstrap script via --gnulib-srcdir.
>>>
>>> Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
>>> ---
>>>   tools/docker/Dockerfile | 7 ++++---
>>>   1 file changed, 4 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
>>> index 34713c5e8b2..85274c303c8 100644
>>> --- a/tools/docker/Dockerfile
>>> +++ b/tools/docker/Dockerfile
>>> @@ -148,12 +148,13 @@ RUN --mount=type=cache,target=/var/cache/ 
>>> apt,sharing=locked \
>>>       zip
>>>   # Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit
>>> -RUN git clone https://eur02.safelinks.protection.outlook.com/? 
>>> url=https%3A%2F%2Fhttps.git.savannah.gnu.org%2Fgit%2Fgrub.git&data=05%7C02%7Cquentin.schulz%40cherry.de%7C6268e55bdc1c4b33951208de290eb8d7%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C638993340378906741%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=RmWBLYSxmADeqbU71Ayjs7BH%2B%2BhBpxU8SBU7bWJ%2BCDA%3D&reserved=0 /tmp/grub && \
>>> +RUN git clone https://eur02.safelinks.protection.outlook.com/? 
>>> url=https%3A%2F%2Fhttps.git.savannah.gnu.org%2Fgit%2Fgnulib.git&data=05%7C02%7Cquentin.schulz%40cherry.de%7C6268e55bdc1c4b33951208de290eb8d7%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C638993340378938856%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=Dn8RKyWZ%2F5HUQyLZcg08fCK34pPgEXYJ0FckZm%2BId%2B4%3D&reserved=0 /tmp/gnulib && \
>>> +    git clone https://eur02.safelinks.protection.outlook.com/? 
>>> url=https%3A%2F%2Fhttps.git.savannah.gnu.org%2Fgit%2Fgrub.git&data=05%7C02%7Cquentin.schulz%40cherry.de%7C6268e55bdc1c4b33951208de290eb8d7%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C638993340378959547%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=x81uTYbcXZ8xKuPeR87wXKFDjBzFggMxGpmid8uTw1Y%3D&reserved=0 /tmp/grub && \
>>
>> Right now, the next branch is in a funny spot. Post -rc2 I applied to
>> master some changes to make CI more reliable which also meant that right
>> here we do git clone --depth=1 -b TAG. And doing --depth=1 -b TAG is
>> something we should be doing here for gnulib as well. Since -rc3 is this
> 
> No, I'm not sure this is something we can do.
> 
> AFAICT (haven't dug too much), grub will checkout a specific commit of 
> gnulib, and that isn't supported by git clone, c.f. https:// 
> eur02.safelinks.protection.outlook.com/? 
> url=https%3A%2F%2Felixir.bootlin.com%2Fgrub%2Fgrub-2.12%2Fsource%2Fbootstrap.conf%23L19&data=05%7C02%7Cquentin.schulz%40cherry.de%7C6268e55bdc1c4b33951208de290eb8d7%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C638993340378977923%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=jEjaC%2FTri23TTjwrLCDcVfocG%2F6qEtGgftu9vzBt6Dw%3D&reserved=0
> 
> This commit sadly isn't a tagged commit in gnulib (there aren't too many 
> tags in this repo...).
> 
> However, I think I took the hammer approach to this, I believe setting 
> GNULIB_URL variable to the mirror URL might be enough.
> 
> grub bootstrap script does something to avoid downloading the whole 
> thing, c.f. https://eur02.safelinks.protection.outlook.com/? 
> url=https%3A%2F%2Felixir.bootlin.com%2Fgrub%2Fgrub-2.12%2Fsource%2Fbootstrap%23L769&data=05%7C02%7Cquentin.schulz%40cherry.de%7C6268e55bdc1c4b33951208de290eb8d7%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C638993340378993930%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=kikGeVnXtlyPHiSfeula9p7yEMKentnrHCokBvYa7JM%3D&reserved=0
> 
> I'll try something out and send a v2 if that works.
> 

With

"""
diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
index 6c05ff6aa4f..c080af88420 100644
--- a/tools/docker/Dockerfile
+++ b/tools/docker/Dockerfile
@@ -149,13 +149,12 @@ RUN 
--mount=type=cache,target=/var/cache/apt,sharing=locked \
  	zip

  # Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit
-RUN git clone https://https.git.savannah.gnu.org/git/gnulib.git 
/tmp/gnulib && \
-	git clone https://https.git.savannah.gnu.org/git/grub.git /tmp/grub && \
+RUN git clone https://https.git.savannah.gnu.org/git/grub.git /tmp/grub 
&& \
  	cd /tmp/grub && \
  	git checkout grub-2.12 && \
  	git config --global user.name "GitLab CI Runner" && \
  	git config --global user.email trini at konsulko.com && \
-	./bootstrap --gnulib-srcdir=/tmp/gnulib && \
+	GNULIB_URL=https://https.git.savannah.gnu.org/git/gnulib.git 
./bootstrap && \
  	mkdir -p /opt/grub && \
  	./configure --target=aarch64 --with-platform=efi \
  	CC=gcc \
@@ -220,7 +219,7 @@ RUN git clone 
https://https.git.savannah.gnu.org/git/gnulib.git /tmp/gnulib && \
  	make -j$(nproc) && \
  	./grub-mkimage -O x86_64-efi -o /opt/grub/grub_x64.efi --prefix= -d \
  	grub-core normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd 
&& \
-	rm -rf /tmp/grub /tmp/gnulib
+	rm -rf /tmp/grub

  RUN git clone https://gitlab.com/qemu-project/qemu.git /tmp/qemu && \
  	cd /tmp/qemu && \
"""


I get

"""
./bootstrap: getting gnulib files...
hint: Using 'master' as the name for the initial branch. This default 
branch name
hint: is subject to change. To configure the initial branch name to use 
in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this 
command:
hint:
hint: 	git branch -m <name>
Initialized empty Git repository in /tmp/grub/gnulib/.git/
 From https://https.git.savannah.gnu.org/git/gnulib
  * branch                9f48fb992a3d7e96610c4ce8be969cff2d61a01b -> 
FETCH_HEAD
HEAD is now at 9f48fb992 filevercmp: fix several unexpected results
Note: switching to '9f48fb992a3d7e96610c4ce8be969cff2d61a01b'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

   git switch -c <new-branch-name>

Or undo this operation with:

   git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 9f48fb992 filevercmp: fix several unexpected results
"""

It was slow but it worked. Will go with that for the v2 to send Monday. 
Ping me if I forget :)

Thanks!
Quentin


More information about the U-Boot mailing list