Install LoongArch64 toolchains, build LoongArch64 QEMU,
build LoongArch64 GRUB.

Signed-off-by: Jiaxun Yang <jiaxun.y...@flygoat.com>
---
 tools/docker/Dockerfile | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
index e3b2c2d57555..26b0e36fec05 100644
--- a/tools/docker/Dockerfile
+++ b/tools/docker/Dockerfile
@@ -19,6 +19,7 @@ RUN wget -O - 
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_
 RUN wget -O - 
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/x86_64-gcc-13.2.0-nolibc-arc-linux.tar.xz
 | tar -C /opt -xJ
 RUN wget -O - 
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/x86_64-gcc-13.2.0-nolibc-arm-linux-gnueabi.tar.xz
 | tar -C /opt -xJ
 RUN wget -O - 
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/x86_64-gcc-13.2.0-nolibc-i386-linux.tar.xz
 | tar -C /opt -xJ
+RUN wget -O - 
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/x86_64-gcc-13.2.0-nolibc-loongarch64-linux.tar.xz
 | tar -C /opt -xJ
 RUN wget -O - 
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/x86_64-gcc-13.2.0-nolibc-m68k-linux.tar.xz
 | tar -C /opt -xJ
 RUN wget -O - 
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/x86_64-gcc-13.2.0-nolibc-mips-linux.tar.xz
 | tar -C /opt -xJ
 RUN wget -O - 
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.2.0/x86_64-gcc-13.2.0-nolibc-microblaze-linux.tar.xz
 | tar -C /opt -xJ
@@ -131,7 +132,7 @@ RUN git config --global user.name "U-Boot CI" && \
 # Make kernels readable for libguestfs tools to work correctly
 RUN chmod +r /boot/vmlinu*
 
-# Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit
+# Build GRUB UEFI targets for ARM & LoongArch64 & RISC-V, 32-bit and 64-bit
 RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub && \
        cd /tmp/grub && \
        git checkout grub-2.12 && \
@@ -165,6 +166,20 @@ RUN git clone git://git.savannah.gnu.org/grub.git 
/tmp/grub && \
        search search_fs_file search_fs_uuid search_label serial sleep test \
        true && \
        make clean && \
+       ./configure --target=loongarch64 --with-platform=efi \
+       CC=gcc \
+       
TARGET_CC=/opt/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-gcc \
+       
TARGET_OBJCOPY=/opt/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-objcopy
 \
+       
TARGET_STRIP=/opt/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-strip
 \
+       
TARGET_NM=/opt/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-nm \
+       
TARGET_RANLIB=/opt/gcc-13.2.0-nolibc/loongarch64-linux/bin/loongarch64-linux-ranlib
 && \
+       make && \
+       ./grub-mkimage -O loongarch64-efi -o /opt/grub/grubloongarch64.efi 
--prefix= -d \
+       grub-core cat chain configfile echo efinet ext2 fat halt help linux \
+       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=riscv64 --with-platform=efi \
        CC=gcc \
        TARGET_CC=/opt/gcc-13.2.0-nolibc/riscv64-linux/bin/riscv64-linux-gcc \
@@ -183,7 +198,9 @@ RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub 
&& \
 RUN git clone https://gitlab.com/qemu-project/qemu.git /tmp/qemu && \
        cd /tmp/qemu && \
        git checkout v9.0.0 && \
-       ./configure --prefix=/opt/qemu 
--target-list="aarch64-softmmu,arm-softmmu,i386-softmmu,m68k-softmmu,mips-softmmu,mips64-softmmu,mips64el-softmmu,mipsel-softmmu,ppc-softmmu,riscv32-softmmu,riscv64-softmmu,sh4-softmmu,x86_64-softmmu,xtensa-softmmu"
 && \
+       git cherry-pick 16b1ecee52effa3346fb34dcc351e4645e4ab53e && \
+       git cherry-pick 085446905000d6b80978815594a7cd34d54ff46b && \
+       ./configure --prefix=/opt/qemu 
--target-list="aarch64-softmmu,arm-softmmu,i386-softmmu,loongarch64-softmmu,m68k-softmmu,mips-softmmu,mips64-softmmu,mips64el-softmmu,mipsel-softmmu,ppc-softmmu,riscv32-softmmu,riscv64-softmmu,sh4-softmmu,x86_64-softmmu,xtensa-softmmu"
 && \
        make -j$(nproc) all install && \
        rm -rf /tmp/qemu
 

-- 
2.43.0

Reply via email to