Browse Source

Merge branch '2021-04-07-CI-improvements'

- Assorted Azure/GitLab improvements
- Move the Dockerfile used for making containers in CI in to this
  repository.
Tom Rini 3 years ago
parent
commit
e9c99db778
6 changed files with 231 additions and 59 deletions
  1. 8 8
      .azure-pipelines.yml
  2. 4 50
      .gitlab-ci.yml
  3. 14 0
      doc/build/docker.rst
  4. 1 0
      doc/build/index.rst
  5. 1 1
      test/py/requirements.txt
  6. 203 0
      tools/docker/Dockerfile

+ 8 - 8
.azure-pipelines.yml

@@ -304,12 +304,12 @@ jobs:
           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/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
-              export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
+              wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
+              export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
           fi
           if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
-              wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
-              export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
+              wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
+              export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
           fi
           # the below corresponds to .gitlab-ci.yml "script"
           cd ${WORK_DIR}
@@ -401,7 +401,7 @@ jobs:
         sun50i:
           BUILDMAN: "sun50i"
         arm_catch_all:
-          BUILDMAN: "arm -x arm11,arm7,arm9,aarch64,at91,bcm,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,rk,toradex,socfpga,k2,k3,zynq"
+          BUILDMAN: "arm -x arm11,arm7,arm9,aarch64,at91,bcm,freescale,kirkwood,mvebu,renesas,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,rk,toradex,socfpga,k2,k3,zynq"
         sandbox_x86:
           BUILDMAN: "sandbox x86"
         technexion:
@@ -439,11 +439,11 @@ jobs:
         uniphier:
           BUILDMAN: "uniphier"
         aarch64_catch_all:
-          BUILDMAN: "aarch64 -x bcm,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,sunxi,samsung,socfpga,rk,versal,zynq"
+          BUILDMAN: "aarch64 -x bcm,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,renesas,sunxi,samsung,socfpga,rk,versal,zynq"
         rockchip:
           BUILDMAN: "rk"
-        sh:
-          BUILDMAN: "sh -x arm"
+        renesas:
+          BUILDMAN: "renesas"
         zynq:
           BUILDMAN: "zynq&armv7"
         zynqmp_versal:

+ 4 - 50
.gitlab-ci.yml

@@ -11,7 +11,6 @@ stages:
   - world build
 
 .buildman_and_testpy_template: &buildman_and_testpy_dfn
-  tags: [ 'all' ]
   stage: test.py
   before_script:
     # Clone uboot-test-hooks
@@ -21,12 +20,12 @@ stages:
     - 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/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
-        export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
+        wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
+        export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
       fi
     - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
-        wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
-        export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
+        wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
+        export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
       fi
 
   after_script:
@@ -53,7 +52,6 @@ stages:
         --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
 
 build all 32bit ARM platforms:
-  tags: [ 'all' ]
   stage: world build
   script:
     - ret=0;
@@ -64,7 +62,6 @@ build all 32bit ARM platforms:
       fi;
 
 build all 64bit ARM platforms:
-  tags: [ 'all' ]
   stage: world build
   script:
     - virtualenv -p /usr/bin/python3 /tmp/venv
@@ -78,7 +75,6 @@ build all 64bit ARM platforms:
       fi;
 
 build all PowerPC platforms:
-  tags: [ 'all' ]
   stage: world build
   script:
     - ret=0;
@@ -89,7 +85,6 @@ build all PowerPC platforms:
       fi;
 
 build all other platforms:
-  tags: [ 'all' ]
   stage: world build
   script:
     - ret=0;
@@ -102,14 +97,12 @@ build all other platforms:
 # QA jobs for code analytics
 # static code analysis with cppcheck (we can add --enable=all later)
 cppcheck:
-  tags: [ 'all' ]
   stage: testsuites
   script:
     - cppcheck -j$(nproc) --force --quiet --inline-suppr .
 
 # search for TODO within source tree
 grep TODO/FIXME/HACK:
-  tags: [ 'all' ]
   stage: testsuites
   script:
     - grep -r TODO .
@@ -119,7 +112,6 @@ grep TODO/FIXME/HACK:
 
 # build HTML documentation
 htmldocs:
-  tags: [ 'all' ]
   stage: testsuites
   script:
     - virtualenv -p /usr/bin/python3 /tmp/venvhtml
@@ -129,34 +121,29 @@ htmldocs:
 
 # some statistics about the code base
 sloccount:
-  tags: [ 'all' ]
   stage: testsuites
   script:
     - sloccount .
 
 # ensure all configs have MAINTAINERS entries
 Check for configs without MAINTAINERS entry:
-  tags: [ 'all' ]
   stage: testsuites
   script:
     - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
 
 # Ensure host tools build
 Build tools-only:
-  tags: [ 'all' ]
   stage: testsuites
   script:
     - make tools-only_config tools-only -j$(nproc)
 
 # Ensure env tools build
 Build envtools:
-  tags: [ 'all' ]
   stage: testsuites
   script:
     - make tools-only_config envtools -j$(nproc)
 
 Run binman, buildman, dtoc, Kconfig and patman testsuites:
-  tags: [ 'all' ]
   stage: testsuites
   script:
     - git config --global user.name "GitLab CI Runner";
@@ -177,7 +164,6 @@ Run binman, buildman, dtoc, Kconfig and patman testsuites:
       make testconfig
 
 Run tests for Nokia RX-51 (aka N900):
-  tags: [ 'all' ]
   stage: testsuites
   script:
     - ./tools/buildman/buildman --fetch-arch arm;
@@ -186,20 +172,17 @@ Run tests for Nokia RX-51 (aka N900):
 
 # Test sandbox with test.py
 sandbox test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "sandbox"
   <<: *buildman_and_testpy_dfn
 
 sandbox with clang test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "sandbox"
     OVERRIDE: "-O clang-10"
   <<: *buildman_and_testpy_dfn
 
 sandbox_spl test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "sandbox_spl"
     TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
@@ -213,34 +196,29 @@ sandbox_noinst_test.py:
   <<: *buildman_and_testpy_dfn
 
 evb-ast2500 test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "evb-ast2500"
     TEST_PY_ID: "--id qemu"
   <<: *buildman_and_testpy_dfn
 
 sandbox_flattree test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "sandbox_flattree"
   <<: *buildman_and_testpy_dfn
 
 vexpress_ca15_tc2 test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "vexpress_ca15_tc2"
     TEST_PY_ID: "--id qemu"
   <<: *buildman_and_testpy_dfn
 
 vexpress_ca9x4 test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "vexpress_ca9x4"
     TEST_PY_ID: "--id qemu"
   <<: *buildman_and_testpy_dfn
 
 integratorcp_cm926ejs test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "integratorcp_cm926ejs"
     TEST_PY_TEST_SPEC: "not sleep"
@@ -248,49 +226,42 @@ integratorcp_cm926ejs test.py:
   <<: *buildman_and_testpy_dfn
 
 qemu_arm test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu_arm"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 qemu_arm64 test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu_arm64"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 qemu_mips test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu_mips"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 qemu_mipsel test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu_mipsel"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 qemu_mips64 test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu_mips64"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 qemu_mips64el test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu_mips64el"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 qemu_malta test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "malta"
     TEST_PY_TEST_SPEC: "not sleep and not efi"
@@ -298,7 +269,6 @@ qemu_malta test.py:
   <<: *buildman_and_testpy_dfn
 
 qemu_maltael test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "maltael"
     TEST_PY_TEST_SPEC: "not sleep and not efi"
@@ -306,7 +276,6 @@ qemu_maltael test.py:
   <<: *buildman_and_testpy_dfn
 
 qemu_malta64 test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "malta64"
     TEST_PY_TEST_SPEC: "not sleep and not efi"
@@ -314,7 +283,6 @@ qemu_malta64 test.py:
   <<: *buildman_and_testpy_dfn
 
 qemu_malta64el test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "malta64el"
     TEST_PY_TEST_SPEC: "not sleep and not efi"
@@ -322,84 +290,72 @@ qemu_malta64el test.py:
   <<: *buildman_and_testpy_dfn
 
 qemu-ppce500 test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu-ppce500"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 qemu-riscv32 test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu-riscv32"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 qemu-riscv64 test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu-riscv64"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 qemu-riscv32_spl test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu-riscv32_spl"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 qemu-riscv64_spl test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu-riscv64_spl"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 qemu-x86 test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu-x86"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 qemu-x86_64 test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "qemu-x86_64"
     TEST_PY_TEST_SPEC: "not sleep"
   <<: *buildman_and_testpy_dfn
 
 r2dplus_i82557c test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "r2dplus"
     TEST_PY_ID: "--id i82557c_qemu"
   <<: *buildman_and_testpy_dfn
 
 r2dplus_pcnet test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "r2dplus"
     TEST_PY_ID: "--id pcnet_qemu"
   <<: *buildman_and_testpy_dfn
 
 r2dplus_rtl8139 test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "r2dplus"
     TEST_PY_ID: "--id rtl8139_qemu"
   <<: *buildman_and_testpy_dfn
 
 r2dplus_tulip test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "r2dplus"
     TEST_PY_ID: "--id tulip_qemu"
   <<: *buildman_and_testpy_dfn
 
 xilinx_zynq_virt test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "xilinx_zynq_virt"
     TEST_PY_TEST_SPEC: "not sleep"
@@ -407,7 +363,6 @@ xilinx_zynq_virt test.py:
   <<: *buildman_and_testpy_dfn
 
 xilinx_versal_virt test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "xilinx_versal_virt"
     TEST_PY_TEST_SPEC: "not sleep"
@@ -415,7 +370,6 @@ xilinx_versal_virt test.py:
   <<: *buildman_and_testpy_dfn
 
 xtfpga test.py:
-  tags: [ 'all' ]
   variables:
     TEST_PY_BD: "xtfpga"
     TEST_PY_TEST_SPEC: "not sleep"

+ 14 - 0
doc/build/docker.rst

@@ -0,0 +1,14 @@
+GitLab CI / U-Boot runner container
+===================================
+
+In order to have a reproducible and portable build environment for CI we use a container for building in.  This means that developers can also reproduce the CI environment, to a large degree at least, locally.  This file is located in the tools/docker directory.  To build the image yourself
+
+.. code-block:: bash
+
+    sudo docker build -t your-namespace:your-tag .
+
+Or to use an existing container
+
+.. code-block:: bash
+
+    sudo docker pull trini/u-boot-gitlab-ci-runner:bionic-20200807-02Sep2020

+ 1 - 0
doc/build/index.rst

@@ -9,4 +9,5 @@ Build U-Boot
    source
    gcc
    clang
+   docker
    tools

+ 1 - 1
test/py/requirements.txt

@@ -11,7 +11,7 @@ pbr==5.4.3
 pluggy==0.13.0
 py==1.8.0
 pyelftools==0.27
-pygit2==1.4.0
+pygit2==0.28.2
 pyparsing==2.4.2
 pytest==5.2.1
 python-mimeparse==1.6.0

+ 203 - 0
tools/docker/Dockerfile

@@ -0,0 +1,203 @@
+# SPDX-License-Identifier: GPL-2.0+
+# This Dockerfile is used to build an image containing basic stuff to be used
+# to build U-Boot and run our test suites.
+
+FROM ubuntu:bionic-20200807
+MAINTAINER Tom Rini <trini@konsulko.com>
+LABEL Description=" This image is for building U-Boot inside a container"
+
+# Make sure apt is happy
+ENV DEBIAN_FRONTEND=noninteractive
+
+# Add LLVM repository
+RUN apt-get update && apt-get install -y gnupg2 wget xz-utils && rm -rf /var/lib/apt/lists/*
+RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
+RUN echo deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main | tee /etc/apt/sources.list.d/llvm.list
+
+# Manually install the kernel.org "Crosstool" based toolchains for gcc-7.3
+RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/x86_64-gcc-9.2.0-nolibc-aarch64-linux.tar.xz | tar -C /opt -xJ
+RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/x86_64-gcc-9.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/9.2.0/x86_64-gcc-9.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/9.2.0/x86_64-gcc-9.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/9.2.0/x86_64-gcc-9.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/9.2.0/x86_64-gcc-9.2.0-nolibc-microblaze-linux.tar.xz | tar -C /opt -xJ
+RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/x86_64-gcc-9.2.0-nolibc-nios2-linux.tar.xz | tar -C /opt -xJ
+RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/x86_64-gcc-9.2.0-nolibc-powerpc-linux.tar.xz | tar -C /opt -xJ
+RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/x86_64-gcc-9.2.0-nolibc-riscv32-linux.tar.xz | tar -C /opt -xJ
+RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/x86_64-gcc-9.2.0-nolibc-riscv64-linux.tar.xz | tar -C /opt -xJ
+RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/9.2.0/x86_64-gcc-9.2.0-nolibc-sh2-linux.tar.xz | tar -C /opt -xJ
+
+# Manually install other toolchains
+RUN wget -O - https://github.com/foss-xtensa/toolchain/releases/download/2018.02/x86_64-2018.02-xtensa-dc233c-elf.tar.gz | tar -C /opt -xz
+RUN wget -O - https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2019.09-release/arc_gnu_2019.09_prebuilt_uclibc_le_archs_linux_install.tar.gz | tar --no-same-owner -C /opt -xz
+RUN wget -O - https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz | tar -C /opt -xz
+
+# Update and install things from apt now
+RUN apt-get update && apt-get install -y \
+	automake \
+	autopoint \
+	bc \
+	binutils-dev \
+	bison \
+	build-essential \
+	clang-10 \
+	coreutils \
+	cpio \
+	cppcheck \
+	curl \
+	device-tree-compiler \
+	dosfstools \
+	e2fsprogs \
+	efitools \
+	fakeroot \
+	flex \
+	gdisk \
+	git \
+	gnu-efi \
+	graphviz \
+	grub-efi-amd64-bin \
+	grub-efi-ia32-bin \
+	help2man \
+	iasl \
+	imagemagick \
+	iputils-ping \
+	libguestfs-tools \
+	libisl15 \
+	liblz4-tool \
+	libpixman-1-dev \
+	libpython-dev \
+	libsdl1.2-dev \
+	libsdl2-dev \
+	libssl-dev \
+	libudev-dev \
+	libusb-1.0-0-dev \
+	lzma-alone \
+	lzop \
+	mount \
+	mtd-utils \
+	mtools \
+	openssl \
+	picocom \
+	parted \
+	pkg-config \
+	python \
+	python-dev \
+	python-pip \
+	python-virtualenv \
+	python3-pip \
+	python3-sphinx \
+	rpm2cpio \
+	sbsigntool \
+	sloccount \
+	sparse \
+	srecord \
+	sudo \
+	swig \
+	util-linux \
+	uuid-dev \
+	virtualenv \
+	zip \
+	&& rm -rf /var/lib/apt/lists/*
+
+# Manually install libmpfr4 for the toolchains
+RUN wget http://mirrors.kernel.org/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.4-1_amd64.deb && dpkg -i libmpfr4_3.1.4-1_amd64.deb && rm libmpfr4_3.1.4-1_amd64.deb
+
+# Manually install a new enough version of efitools (must be v1.5.2 or later)
+RUN wget http://mirrors.kernel.org/ubuntu/pool/universe/e/efitools/efitools_1.8.1-0ubuntu2_amd64.deb && sudo dpkg -i efitools_1.8.1-0ubuntu2_amd64.deb && rm efitools_1.8.1-0ubuntu2_amd64.deb
+
+# Manually install a new enough version of sbsigntools (must be v0.9.4 or later)
+RUN git clone https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git /tmp/sbsigntools && \
+	cd /tmp/sbsigntools && \
+	git checkout -b latest v0.9.4 && \
+	./autogen.sh && \
+	./configure && \
+	make && \
+	make install && \
+	rm -rf /tmp/sbsigntools
+
+# Build GRUB UEFI targets for ARM & 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.04 && \
+	./bootstrap && \
+	mkdir -p /opt/grub && \
+	./configure --target=aarch64 --with-platform=efi \
+	CC=gcc \
+	TARGET_CC=/opt/gcc-9.2.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc \
+	TARGET_OBJCOPY=/opt/gcc-9.2.0-nolibc/aarch64-linux/bin/aarch64-linux-objcopy \
+	TARGET_STRIP=/opt/gcc-9.2.0-nolibc/aarch64-linux/bin/aarch64-linux-strip \
+	TARGET_NM=/opt/gcc-9.2.0-nolibc/aarch64-linux/bin/aarch64-linux-nm \
+	TARGET_RANLIB=/opt/gcc-9.2.0-nolibc/aarch64-linux/bin/aarch64-linux-ranlib && \
+	make && \
+	./grub-mkimage -O arm64-efi -o /opt/grub/grubaa64.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=arm --with-platform=efi \
+	CC=gcc \
+	TARGET_CC=/opt/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc \
+	TARGET_OBJCOPY=/opt/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-objcopy \
+	TARGET_STRIP=/opt/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-strip \
+	TARGET_NM=/opt/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-nm \
+	TARGET_RANLIB=/opt/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ranlib && \
+	make && \
+	./grub-mkimage -O arm-efi -o /opt/grub/grubarm.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-9.2.0-nolibc/riscv64-linux/bin/riscv64-linux-gcc \
+	TARGET_OBJCOPY=/opt/gcc-9.2.0-nolibc/riscv64-linux/bin/riscv64-linux-objcopy \
+	TARGET_STRIP=/opt/gcc-9.2.0-nolibc/riscv64-linux/bin/riscv64-linux-strip \
+	TARGET_NM=/opt/gcc-9.2.0-nolibc/riscv64-linux/bin/riscv64-linux-nm \
+	TARGET_RANLIB=/opt/gcc-9.2.0-nolibc/riscv64-linux/bin/riscv64-linux-ranlib && \
+	make && \
+	./grub-mkimage -O riscv64-efi -o /opt/grub/grubriscv64.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=riscv32 --with-platform=efi \
+	CC=gcc \
+	TARGET_CC=/opt/gcc-9.2.0-nolibc/riscv32-linux/bin/riscv32-linux-gcc \
+	TARGET_OBJCOPY=/opt/gcc-9.2.0-nolibc/riscv32-linux/bin/riscv32-linux-objcopy \
+	TARGET_STRIP=/opt/gcc-9.2.0-nolibc/riscv32-linux/bin/riscv32-linux-strip \
+	TARGET_NM=/opt/gcc-9.2.0-nolibc/riscv32-linux/bin/riscv32-linux-nm \
+	TARGET_RANLIB=/opt/gcc-9.2.0-nolibc/riscv32-linux/bin/riscv32-linux-ranlib && \
+	make && \
+	./grub-mkimage -O riscv32-efi -o /opt/grub/grubriscv32.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 && \
+	rm -rf /tmp/grub
+
+RUN git clone git://git.qemu.org/qemu.git /tmp/qemu && \
+	cd /tmp/qemu && \
+	git submodule update --init dtc && \
+	git checkout v4.2.0 && \
+	./configure --prefix=/opt/qemu --target-list="aarch64-softmmu,arm-softmmu,i386-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
+
+# Create our user/group
+RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot
+RUN useradd -m -U uboot
+USER uboot:uboot
+
+# Create the buildman config file
+RUN /bin/echo -e "[toolchain]\nroot = /usr" > ~/.buildman
+RUN /bin/echo -e "kernelorg = /opt/gcc-9.2.0-nolibc/*" >> ~/.buildman
+RUN /bin/echo -e "arc = /opt/arc_gnu_2019.09_prebuilt_uclibc_le_archs_linux_install" >> ~/.buildman
+RUN /bin/echo -e "\n[toolchain-prefix]\nxtensa = /opt/2018.02/xtensa-dc233c-elf/bin/xtensa-dc233c-elf-" >> ~/.buildman;
+RUN /bin/echo -e "\nnds32 = /opt/nds32le-linux-glibc-v3-upstream/bin/nds32le-linux-" >> ~/.buildman;
+RUN /bin/echo -e "\n[toolchain-alias]\nsh = sh2" >> ~/.buildman
+RUN /bin/echo -e "\nriscv = riscv64" >> ~/.buildman
+RUN /bin/echo -e "\nsandbox = x86_64" >> ~/.buildman
+RUN /bin/echo -e "\nx86 = i386" >> ~/.buildman;