U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Cc: Simon Glass <sjg@chromium.org>
Subject: [v6 06/12] docker: Build grub for all architectures
Date: Wed, 27 Nov 2024 11:17:24 -0600	[thread overview]
Message-ID: <20241127172247.1488685-7-trini@konsulko.com> (raw)
In-Reply-To: <20241127172247.1488685-1-trini@konsulko.com>

For consistency now, and future ease of testing with non-amd64 hosts,
build grub for all architectures rather than relying on host binaries
for i386/x86_64.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
Changes in v6:
- New patch
---
 .azure-pipelines.yml    |  6 ++----
 .gitlab-ci.yml          |  6 ++----
 tools/docker/Dockerfile | 24 ++++++++++++++++++++++--
 3 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml
index 4ecf76eaa0b5..cc335e5f720c 100644
--- a/.azure-pipelines.yml
+++ b/.azure-pipelines.yml
@@ -245,8 +245,6 @@ stages:
           ln -s u_boot_boardenv_qemu_arm64_na.py /tmp/uboot-test-hooks/py/travis-ci/u_boot_boardenv_qemu_arm64_lwip_na.py
           ln -s travis-ci /tmp/uboot-test-hooks/bin/\`hostname\`
           ln -s travis-ci /tmp/uboot-test-hooks/py/\`hostname\`
-          grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
-          grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
           if [[ "\${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
               wget -O - https://github.com/riscv-software-src/opensbi/releases/download/v1.3.1/opensbi-1.3.1-rv-bin.tar.xz | tar -C /tmp -xJ;
               export OPENSBI=/tmp/opensbi-1.3.1-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
@@ -268,8 +266,8 @@ stages:
           fi
           pip install -r tools/buildman/requirements.txt
           tools/buildman/buildman -o \${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board \${TEST_PY_BD} \${OVERRIDE}
-          cp ~/grub_x86.efi \${UBOOT_TRAVIS_BUILD_DIR}/
-          cp ~/grub_x64.efi \${UBOOT_TRAVIS_BUILD_DIR}/
+          cp /opt/grub/grub_x86.efi \${UBOOT_TRAVIS_BUILD_DIR}/
+          cp /opt/grub/grub_x64.efi \${UBOOT_TRAVIS_BUILD_DIR}/
           cp /opt/grub/grubriscv64.efi \${UBOOT_TRAVIS_BUILD_DIR}/grub_riscv64.efi
           cp /opt/grub/grubaa64.efi \${UBOOT_TRAVIS_BUILD_DIR}/grub_arm64.efi
           cp /opt/grub/grubarm.efi \${UBOOT_TRAVIS_BUILD_DIR}/grub_arm.efi
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2164ad79a72b..23bbe2c24b8d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -34,8 +34,6 @@ stages:
     - ln -s conf.qemu_arm64_na /tmp/uboot-test-hooks/bin/travis-ci/conf.qemu_arm64_lwip_na
     - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
     - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
-    - grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal  echo lsefimmap lsefi lsefisystab efinet tftp minicmd
-    - grub-mkimage --prefix="" -o ~/grub_x64.efi -O x86_64-efi normal  echo lsefimmap lsefi lsefisystab efinet tftp minicmd
     - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
         wget -O - https://github.com/riscv-software-src/opensbi/releases/download/v1.3.1/opensbi-1.3.1-rv-bin.tar.xz | tar -C /tmp -xJ;
         export OPENSBI=/tmp/opensbi-1.3.1-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
@@ -62,8 +60,8 @@ stages:
       fi
     - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
         --board ${TEST_PY_BD} ${OVERRIDE}
-    - cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/
-    - cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/
+    - cp /opt/grub/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/
+    - cp /opt/grub/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/
     - cp /opt/grub/grubriscv64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv64.efi
     - cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi
     - cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi
diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
index 11beaedf9b30..90c90bd05f0b 100644
--- a/tools/docker/Dockerfile
+++ b/tools/docker/Dockerfile
@@ -60,8 +60,6 @@ RUN apt-get update && apt-get install -y \
 	gnu-efi \
 	gnutls-dev \
 	graphviz \
-	grub-efi-amd64-bin \
-	grub-efi-ia32-bin \
 	help2man \
 	iasl \
 	imagemagick \
@@ -175,6 +173,28 @@ RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub && \
 	lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \
 	search search_fs_file search_fs_uuid search_label serial sleep test \
 	true && \
+	make clean && \
+	./configure --target=i386 --with-platform=efi \
+	CC=gcc \
+	TARGET_CC=/opt/gcc-13.2.0-nolibc/i386-linux/bin/i386-linux-gcc \
+	TARGET_OBJCOPY=/opt/gcc-13.2.0-nolibc/i386-linux/bin/i386-linux-objcopy \
+	TARGET_STRIP=/opt/gcc-13.2.0-nolibc/i386-linux/bin/i386-linux-strip \
+	TARGET_NM=/opt/gcc-13.2.0-nolibc/i386-linux/bin/i386-linux-nm \
+	TARGET_RANLIB=/opt/gcc-13.2.0-nolibc/i386-linux/bin/i386-linux-ranlib && \
+	make -j$(nproc) && \
+	./grub-mkimage -O i386-efi -o /opt/grub/grub_x86.efi --prefix= -d \
+	grub-core normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd && \
+	make clean && \
+	./configure --target=x86_64 --with-platform=efi \
+	CC=gcc \
+	TARGET_CC=/opt/gcc-13.2.0-nolibc/x86_64-linux/bin/x86_64-linux-gcc \
+	TARGET_OBJCOPY=/opt/gcc-13.2.0-nolibc/x86_64-linux/bin/x86_64-linux-objcopy \
+	TARGET_STRIP=/opt/gcc-13.2.0-nolibc/x86_64-linux/bin/x86_64-linux-strip \
+	TARGET_NM=/opt/gcc-13.2.0-nolibc/x86_64-linux/bin/x86_64-linux-nm \
+	TARGET_RANLIB=/opt/gcc-13.2.0-nolibc/x86_64-linux/bin/x86_64-linux-ranlib && \
+	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
 
 RUN git clone https://gitlab.com/qemu-project/qemu.git /tmp/qemu && \
-- 
2.43.0


  parent reply	other threads:[~2024-11-27 17:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-27 17:17 [v6 0/12] CI: Set up for an arm64 runner Tom Rini
2024-11-27 17:17 ` [v6 01/12] sandbox: efi_loader: Correct use of addresses as pointers Tom Rini
2024-11-27 18:40   ` Heinrich Schuchardt
2024-11-27 18:51     ` Tom Rini
2024-11-27 19:13       ` Heinrich Schuchardt
2024-11-27 19:38     ` Heinrich Schuchardt
2024-11-27 21:09     ` Simon Glass
2024-11-27 21:14       ` Tom Rini
2024-11-30 20:24         ` Simon Glass
2024-11-27 17:17 ` [v6 02/12] test: Adjust print_ut test to use unsigned char Tom Rini
2024-11-27 17:17 ` [v6 03/12] docker: Add kernel.org x86_64 toolchain Tom Rini
2024-11-28 15:45   ` Simon Glass
2024-11-27 17:17 ` [v6 04/12] docker: Use "make -j$(nproc)" when invoking make Tom Rini
2024-11-28 15:45   ` Simon Glass
2024-11-27 17:17 ` [v6 05/12] docker: Update to grub-2.12 Tom Rini
2024-11-28 15:45   ` Simon Glass
2024-11-27 17:17 ` Tom Rini [this message]
2024-11-28 15:45   ` [v6 06/12] docker: Build grub for all architectures Simon Glass
2024-11-27 17:17 ` [v6 07/12] docker: Use cache mounts for apt Tom Rini
2024-11-28 15:45   ` Simon Glass
2024-11-27 17:17 ` [v6 08/12] docker: Support building for multiple architectures Tom Rini
2024-11-27 17:17 ` [v6 09/12] docker: Adjust installed packages slightly Tom Rini
2024-11-27 17:17 ` [v6 10/12] docker: Fix LegacyKeyValueFormat warning with PYTHONPATH Tom Rini
2024-11-27 17:17 ` [v6 11/12] docker: Install toolchains on arm64 host Tom Rini
2024-11-27 17:17 ` [v6 12/12] CI: Add platform variable Tom Rini
2024-12-03 19:57 ` [v6 0/12] CI: Set up for an arm64 runner Tom Rini
2024-12-17 19:45   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241127172247.1488685-7-trini@konsulko.com \
    --to=trini@konsulko.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox