Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0+ |
| 2 | # This Dockerfile is used to build an image containing basic stuff to be used |
| 3 | # to build U-Boot and run our test suites. |
| 4 | |
Tom Rini | e0c84c8 | 2024-08-21 09:41:20 -0600 | [diff] [blame] | 5 | FROM ubuntu:jammy-20240808 |
Tom Rini | 92160da | 2024-08-19 15:07:19 -0600 | [diff] [blame] | 6 | LABEL org.opencontainers.image.authors="Tom Rini <trini@konsulko.com>" |
| 7 | LABEL org.opencontainers.image.description=" This image is for building U-Boot inside a container" |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 8 | |
Simon Glass | 7aafac0 | 2024-11-27 11:17:26 -0600 | [diff] [blame] | 9 | # Used by docker to set the target platform: valid values are linux/arm64/v8 |
| 10 | # and linux/amd64 |
| 11 | ARG TARGETPLATFORM |
| 12 | |
| 13 | # Used by docker to set the build platform: the only valid value is linux/amd64 |
| 14 | ARG BUILDPLATFORM |
| 15 | |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 16 | # Make sure apt is happy |
| 17 | ENV DEBIAN_FRONTEND=noninteractive |
| 18 | |
Simon Glass | 7aafac0 | 2024-11-27 11:17:26 -0600 | [diff] [blame] | 19 | RUN echo "Building on $BUILDPLATFORM, for target $TARGETPLATFORM" |
| 20 | |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 21 | # Add LLVM repository |
Tom Rini | 3f88c79 | 2024-11-27 11:17:25 -0600 | [diff] [blame] | 22 | RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ |
| 23 | --mount=type=cache,target=/var/lib/apt,sharing=locked \ |
| 24 | apt-get update && apt-get install -y gnupg2 wget xz-utils |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 25 | RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - |
Tom Rini | e752a3a | 2024-03-10 15:59:28 -0400 | [diff] [blame] | 26 | RUN echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main | tee /etc/apt/sources.list.d/llvm.list |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 27 | |
Tom Rini | 3bd5ed7 | 2023-08-25 13:21:26 -0400 | [diff] [blame] | 28 | # Manually install the kernel.org "Crosstool" based toolchains for gcc-13.2.0 |
| 29 | 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-aarch64-linux.tar.xz | tar -C /opt -xJ |
| 30 | 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 |
| 31 | 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 |
| 32 | 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 |
| 33 | 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 |
| 34 | 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 |
| 35 | 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 |
| 36 | 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-nios2-linux.tar.xz | tar -C /opt -xJ |
| 37 | 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-powerpc-linux.tar.xz | tar -C /opt -xJ |
| 38 | 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-riscv64-linux.tar.xz | tar -C /opt -xJ |
| 39 | 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-riscv32-linux.tar.xz | tar -C /opt -xJ |
| 40 | 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-sh2-linux.tar.xz | tar -C /opt -xJ |
Tom Rini | f3fb9cd | 2024-11-27 11:17:21 -0600 | [diff] [blame] | 41 | 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-x86_64-linux.tar.xz | tar -C /opt -xJ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 42 | |
| 43 | # Manually install other toolchains |
Tom Rini | 0a78bc3 | 2021-07-02 10:41:58 -0400 | [diff] [blame] | 44 | RUN wget -O - https://github.com/foss-xtensa/toolchain/releases/download/2020.07/x86_64-2020.07-xtensa-dc233c-elf.tar.gz | tar -C /opt -xz |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 45 | |
| 46 | # Update and install things from apt now |
Tom Rini | 3f88c79 | 2024-11-27 11:17:25 -0600 | [diff] [blame] | 47 | RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ |
| 48 | --mount=type=cache,target=/var/lib/apt,sharing=locked \ |
| 49 | apt-get update && apt-get install -y \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 50 | automake \ |
| 51 | autopoint \ |
| 52 | bc \ |
| 53 | binutils-dev \ |
| 54 | bison \ |
| 55 | build-essential \ |
Simon Glass | be17cb3 | 2023-08-24 13:55:46 -0600 | [diff] [blame] | 56 | cgpt \ |
Tom Rini | e752a3a | 2024-03-10 15:59:28 -0400 | [diff] [blame] | 57 | clang-17 \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 58 | coreutils \ |
| 59 | cpio \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 60 | curl \ |
| 61 | device-tree-compiler \ |
| 62 | dosfstools \ |
| 63 | e2fsprogs \ |
| 64 | efitools \ |
Huang Jianan | 11e0443 | 2022-02-26 15:05:51 +0800 | [diff] [blame] | 65 | erofs-utils \ |
Heinrich Schuchardt | 4e20267 | 2021-11-09 19:51:20 +0100 | [diff] [blame] | 66 | expect \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 67 | fakeroot \ |
| 68 | flex \ |
Heinrich Schuchardt | 4e20267 | 2021-11-09 19:51:20 +0100 | [diff] [blame] | 69 | gawk \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 70 | gdisk \ |
Tom Rini | 12248ed | 2024-11-27 11:17:23 -0600 | [diff] [blame] | 71 | gettext \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 72 | git \ |
| 73 | gnu-efi \ |
Heinrich Schuchardt | 4e20267 | 2021-11-09 19:51:20 +0100 | [diff] [blame] | 74 | gnutls-dev \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 75 | graphviz \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 76 | help2man \ |
| 77 | iasl \ |
| 78 | imagemagick \ |
| 79 | iputils-ping \ |
Bin Meng | f551a53 | 2021-08-26 23:33:33 +0800 | [diff] [blame] | 80 | libconfuse-dev \ |
Tom Rini | c8982d2 | 2021-06-10 10:57:36 -0400 | [diff] [blame] | 81 | libgit2-dev \ |
Heinrich Schuchardt | 4e20267 | 2021-11-09 19:51:20 +0100 | [diff] [blame] | 82 | libjson-glib-dev \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 83 | libguestfs-tools \ |
AKASHI Takahiro | 3edc347 | 2022-02-01 10:32:36 +0900 | [diff] [blame] | 84 | libgnutls28-dev \ |
| 85 | libgnutls30 \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 86 | liblz4-tool \ |
| 87 | libpixman-1-dev \ |
Tom Rini | c8982d2 | 2021-06-10 10:57:36 -0400 | [diff] [blame] | 88 | libpython3-dev \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 89 | libsdl1.2-dev \ |
| 90 | libsdl2-dev \ |
Heinrich Schuchardt | 4e20267 | 2021-11-09 19:51:20 +0100 | [diff] [blame] | 91 | libseccomp-dev \ |
Tom Rini | 83da232 | 2023-07-13 10:16:28 -0400 | [diff] [blame] | 92 | libslirp-dev \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 93 | libssl-dev \ |
Heinrich Schuchardt | 4e20267 | 2021-11-09 19:51:20 +0100 | [diff] [blame] | 94 | libtool \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 95 | libudev-dev \ |
| 96 | libusb-1.0-0-dev \ |
Simon Glass | 86baff1 | 2024-11-27 11:17:27 -0600 | [diff] [blame] | 97 | linux-image-generic \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 98 | lzma-alone \ |
| 99 | lzop \ |
| 100 | mount \ |
| 101 | mtd-utils \ |
| 102 | mtools \ |
Heinrich Schuchardt | 4e20267 | 2021-11-09 19:51:20 +0100 | [diff] [blame] | 103 | net-tools \ |
Bin Meng | 00afccd | 2021-08-26 23:33:32 +0800 | [diff] [blame] | 104 | ninja-build \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 105 | openssl \ |
| 106 | picocom \ |
| 107 | parted \ |
| 108 | pkg-config \ |
Tom Rini | c8982d2 | 2021-06-10 10:57:36 -0400 | [diff] [blame] | 109 | python-is-python3 \ |
| 110 | python2.7 \ |
| 111 | python3 \ |
| 112 | python3-dev \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 113 | python3-pip \ |
Simon Glass | b955cd2 | 2022-10-13 06:25:57 -0600 | [diff] [blame] | 114 | python3-pyelftools \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 115 | python3-sphinx \ |
Tom Rini | c8982d2 | 2021-06-10 10:57:36 -0400 | [diff] [blame] | 116 | python3-virtualenv \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 117 | rpm2cpio \ |
| 118 | sbsigntool \ |
Heinrich Schuchardt | 4e20267 | 2021-11-09 19:51:20 +0100 | [diff] [blame] | 119 | socat \ |
| 120 | softhsm2 \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 121 | sparse \ |
| 122 | srecord \ |
| 123 | sudo \ |
| 124 | swig \ |
Heinrich Schuchardt | c2c98ea | 2022-12-30 05:41:01 +0100 | [diff] [blame] | 125 | texinfo \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 126 | util-linux \ |
| 127 | uuid-dev \ |
| 128 | virtualenv \ |
Simon Glass | be17cb3 | 2023-08-24 13:55:46 -0600 | [diff] [blame] | 129 | vboot-kernel-utils \ |
| 130 | vboot-utils \ |
Heinrich Schuchardt | 905d075 | 2024-02-28 08:23:09 +0100 | [diff] [blame] | 131 | xilinx-bootgen \ |
Tom Rini | 0a78bc3 | 2021-07-02 10:41:58 -0400 | [diff] [blame] | 132 | xxd \ |
Tom Rini | 3f88c79 | 2024-11-27 11:17:25 -0600 | [diff] [blame] | 133 | zip |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 134 | |
Alper Nebi Yasak | 5d249e9 | 2021-06-21 21:51:54 +0300 | [diff] [blame] | 135 | # Make kernels readable for libguestfs tools to work correctly |
| 136 | RUN chmod +r /boot/vmlinu* |
| 137 | |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 138 | # Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit |
| 139 | RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub && \ |
| 140 | cd /tmp/grub && \ |
Tom Rini | 12248ed | 2024-11-27 11:17:23 -0600 | [diff] [blame] | 141 | git checkout grub-2.12 && \ |
Tom Rini | 77d48f1 | 2022-11-22 12:31:58 -0500 | [diff] [blame] | 142 | git config --global user.name "GitLab CI Runner" && \ |
| 143 | git config --global user.email trini@konsulko.com && \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 144 | ./bootstrap && \ |
| 145 | mkdir -p /opt/grub && \ |
| 146 | ./configure --target=aarch64 --with-platform=efi \ |
| 147 | CC=gcc \ |
Tom Rini | 3bd5ed7 | 2023-08-25 13:21:26 -0400 | [diff] [blame] | 148 | TARGET_CC=/opt/gcc-13.2.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc \ |
| 149 | TARGET_OBJCOPY=/opt/gcc-13.2.0-nolibc/aarch64-linux/bin/aarch64-linux-objcopy \ |
| 150 | TARGET_STRIP=/opt/gcc-13.2.0-nolibc/aarch64-linux/bin/aarch64-linux-strip \ |
| 151 | TARGET_NM=/opt/gcc-13.2.0-nolibc/aarch64-linux/bin/aarch64-linux-nm \ |
| 152 | TARGET_RANLIB=/opt/gcc-13.2.0-nolibc/aarch64-linux/bin/aarch64-linux-ranlib && \ |
Tom Rini | 4bac039 | 2024-11-27 11:17:22 -0600 | [diff] [blame] | 153 | make -j$(nproc) && \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 154 | ./grub-mkimage -O arm64-efi -o /opt/grub/grubaa64.efi --prefix= -d \ |
| 155 | grub-core cat chain configfile echo efinet ext2 fat halt help linux \ |
| 156 | lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \ |
| 157 | search search_fs_file search_fs_uuid search_label serial sleep test \ |
| 158 | true && \ |
| 159 | make clean && \ |
| 160 | ./configure --target=arm --with-platform=efi \ |
| 161 | CC=gcc \ |
Tom Rini | 3bd5ed7 | 2023-08-25 13:21:26 -0400 | [diff] [blame] | 162 | TARGET_CC=/opt/gcc-13.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc \ |
| 163 | TARGET_OBJCOPY=/opt/gcc-13.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-objcopy \ |
| 164 | TARGET_STRIP=/opt/gcc-13.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-strip \ |
| 165 | TARGET_NM=/opt/gcc-13.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-nm \ |
| 166 | TARGET_RANLIB=/opt/gcc-13.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ranlib && \ |
Tom Rini | 4bac039 | 2024-11-27 11:17:22 -0600 | [diff] [blame] | 167 | make -j$(nproc) && \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 168 | ./grub-mkimage -O arm-efi -o /opt/grub/grubarm.efi --prefix= -d \ |
| 169 | grub-core cat chain configfile echo efinet ext2 fat halt help linux \ |
| 170 | lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \ |
| 171 | search search_fs_file search_fs_uuid search_label serial sleep test \ |
| 172 | true && \ |
| 173 | make clean && \ |
| 174 | ./configure --target=riscv64 --with-platform=efi \ |
| 175 | CC=gcc \ |
Tom Rini | 3bd5ed7 | 2023-08-25 13:21:26 -0400 | [diff] [blame] | 176 | TARGET_CC=/opt/gcc-13.2.0-nolibc/riscv64-linux/bin/riscv64-linux-gcc \ |
| 177 | TARGET_OBJCOPY=/opt/gcc-13.2.0-nolibc/riscv64-linux/bin/riscv64-linux-objcopy \ |
| 178 | TARGET_STRIP=/opt/gcc-13.2.0-nolibc/riscv64-linux/bin/riscv64-linux-strip \ |
| 179 | TARGET_NM=/opt/gcc-13.2.0-nolibc/riscv64-linux/bin/riscv64-linux-nm \ |
| 180 | TARGET_RANLIB=/opt/gcc-13.2.0-nolibc/riscv64-linux/bin/riscv64-linux-ranlib && \ |
Tom Rini | 4bac039 | 2024-11-27 11:17:22 -0600 | [diff] [blame] | 181 | make -j$(nproc) && \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 182 | ./grub-mkimage -O riscv64-efi -o /opt/grub/grubriscv64.efi --prefix= -d \ |
| 183 | grub-core cat chain configfile echo efinet ext2 fat halt help linux \ |
| 184 | lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \ |
| 185 | search search_fs_file search_fs_uuid search_label serial sleep test \ |
| 186 | true && \ |
Tom Rini | e8403a9 | 2024-11-27 11:17:24 -0600 | [diff] [blame] | 187 | make clean && \ |
| 188 | ./configure --target=i386 --with-platform=efi \ |
| 189 | CC=gcc \ |
| 190 | TARGET_CC=/opt/gcc-13.2.0-nolibc/i386-linux/bin/i386-linux-gcc \ |
| 191 | TARGET_OBJCOPY=/opt/gcc-13.2.0-nolibc/i386-linux/bin/i386-linux-objcopy \ |
| 192 | TARGET_STRIP=/opt/gcc-13.2.0-nolibc/i386-linux/bin/i386-linux-strip \ |
| 193 | TARGET_NM=/opt/gcc-13.2.0-nolibc/i386-linux/bin/i386-linux-nm \ |
| 194 | TARGET_RANLIB=/opt/gcc-13.2.0-nolibc/i386-linux/bin/i386-linux-ranlib && \ |
| 195 | make -j$(nproc) && \ |
| 196 | ./grub-mkimage -O i386-efi -o /opt/grub/grub_x86.efi --prefix= -d \ |
| 197 | grub-core normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd && \ |
| 198 | make clean && \ |
| 199 | ./configure --target=x86_64 --with-platform=efi \ |
| 200 | CC=gcc \ |
| 201 | TARGET_CC=/opt/gcc-13.2.0-nolibc/x86_64-linux/bin/x86_64-linux-gcc \ |
| 202 | TARGET_OBJCOPY=/opt/gcc-13.2.0-nolibc/x86_64-linux/bin/x86_64-linux-objcopy \ |
| 203 | TARGET_STRIP=/opt/gcc-13.2.0-nolibc/x86_64-linux/bin/x86_64-linux-strip \ |
| 204 | TARGET_NM=/opt/gcc-13.2.0-nolibc/x86_64-linux/bin/x86_64-linux-nm \ |
| 205 | TARGET_RANLIB=/opt/gcc-13.2.0-nolibc/x86_64-linux/bin/x86_64-linux-ranlib && \ |
| 206 | make -j$(nproc) && \ |
| 207 | ./grub-mkimage -O x86_64-efi -o /opt/grub/grub_x64.efi --prefix= -d \ |
| 208 | grub-core normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd && \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 209 | rm -rf /tmp/grub |
| 210 | |
Tom Rini | b60c1d7 | 2023-02-07 12:50:13 -0500 | [diff] [blame] | 211 | RUN git clone https://gitlab.com/qemu-project/qemu.git /tmp/qemu && \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 212 | cd /tmp/qemu && \ |
Heinrich Schuchardt | 24069c2 | 2024-01-12 03:17:57 +0100 | [diff] [blame] | 213 | git checkout v8.2.0 && \ |
Bin Meng | 00afccd | 2021-08-26 23:33:32 +0800 | [diff] [blame] | 214 | # config user.name and user.email to make 'git am' happy |
| 215 | git config user.name u-boot && \ |
| 216 | git config user.email u-boot@denx.de && \ |
Heinrich Schuchardt | 24069c2 | 2024-01-12 03:17:57 +0100 | [diff] [blame] | 217 | git format-patch 0c7ffc977195~..0c7ffc977195 && \ |
| 218 | git am 0001-hw-net-cadence_gem-Fix-MDIO_OP_xxx-values.patch && \ |
Tom Rini | 139e995 | 2024-03-11 10:02:43 -0400 | [diff] [blame] | 219 | git cherry-pick d3c79c3974 && \ |
Tom Rini | 26a4183 | 2023-03-21 15:28:00 -0400 | [diff] [blame] | 220 | ./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" && \ |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 221 | make -j$(nproc) all install && \ |
| 222 | rm -rf /tmp/qemu |
| 223 | |
Heinrich Schuchardt | 2b4a656 | 2024-02-28 08:43:11 +0100 | [diff] [blame] | 224 | # Build fiptool |
| 225 | RUN git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git /tmp/tf-a && \ |
| 226 | cd /tmp/tf-a/ && \ |
| 227 | git checkout v2.10.0 && \ |
| 228 | cd tools/fiptool && \ |
Tom Rini | 4bac039 | 2024-11-27 11:17:22 -0600 | [diff] [blame] | 229 | make -j$(nproc) && \ |
Heinrich Schuchardt | 2b4a656 | 2024-02-28 08:43:11 +0100 | [diff] [blame] | 230 | mkdir -p /usr/local/bin && \ |
| 231 | cp fiptool /usr/local/bin && \ |
| 232 | rm -rf /tmp/tf-a |
| 233 | |
Bin Meng | f551a53 | 2021-08-26 23:33:33 +0800 | [diff] [blame] | 234 | # Build genimage (required by some targets to generate disk images) |
| 235 | RUN wget -O - https://github.com/pengutronix/genimage/releases/download/v14/genimage-14.tar.xz | tar -C /tmp -xJ && \ |
| 236 | cd /tmp/genimage-14 && \ |
| 237 | ./configure && \ |
| 238 | make -j$(nproc) && \ |
| 239 | make install && \ |
| 240 | rm -rf /tmp/genimage-14 |
| 241 | |
Heinrich Schuchardt | 4e20267 | 2021-11-09 19:51:20 +0100 | [diff] [blame] | 242 | # Build libtpms |
| 243 | RUN git clone https://github.com/stefanberger/libtpms /tmp/libtpms && \ |
| 244 | cd /tmp/libtpms && \ |
| 245 | ./autogen.sh && \ |
| 246 | ./configure && \ |
| 247 | make -j$(nproc) && \ |
| 248 | make install && \ |
| 249 | ldconfig && \ |
| 250 | rm -rf /tmp/libtpms |
| 251 | |
| 252 | # Build swtpm |
| 253 | RUN git clone https://github.com/stefanberger/swtpm /tmp/swtpm && \ |
| 254 | cd /tmp/swtpm && \ |
| 255 | ./autogen.sh && \ |
| 256 | ./configure && \ |
| 257 | make -j$(nproc) && \ |
| 258 | make install && \ |
| 259 | rm -rf /tmp/swtpm |
| 260 | |
Simon Glass | 523cb6d | 2023-01-15 14:15:59 -0700 | [diff] [blame] | 261 | # Build trace-cmd |
| 262 | RUN mkdir /tmp/trace && \ |
| 263 | git clone https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git /tmp/trace/libtraceevent && \ |
| 264 | cd /tmp/trace/libtraceevent && \ |
| 265 | make -j$(nproc) && \ |
| 266 | sudo make install && \ |
| 267 | git clone https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git /tmp/trace/libtracefs && \ |
| 268 | cd /tmp/trace/libtracefs && \ |
| 269 | make -j$(nproc) && \ |
| 270 | sudo make install && \ |
| 271 | git clone https://github.com/rostedt/trace-cmd.git /tmp/trace/trace-cmd && \ |
| 272 | cd /tmp/trace/trace-cmd && \ |
| 273 | make -j$(nproc) && \ |
| 274 | sudo make install && \ |
| 275 | rm -rf /tmp/trace |
| 276 | |
Tom Rini | 9e2b09e | 2024-02-13 09:39:26 -0500 | [diff] [blame] | 277 | # Build coreboot |
Simon Glass | 78b9c8a | 2024-10-14 16:32:05 -0600 | [diff] [blame] | 278 | RUN wget -O - https://coreboot.org/releases/coreboot-24.08.tar.xz | tar -C /tmp -xJ && \ |
| 279 | cd /tmp/coreboot-24.08 && \ |
Tom Rini | 9e2b09e | 2024-02-13 09:39:26 -0500 | [diff] [blame] | 280 | make crossgcc-i386 CPUS=$(nproc) && \ |
| 281 | make -C payloads/coreinfo olddefconfig && \ |
| 282 | make -C payloads/coreinfo && \ |
| 283 | make olddefconfig && \ |
Simon Glass | 78b9c8a | 2024-10-14 16:32:05 -0600 | [diff] [blame] | 284 | echo CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y | tee -a .config && \ |
| 285 | echo CONFIG_USE_OPTION_TABLE=y | tee -a .config && \ |
| 286 | make olddefconfig && \ |
Tom Rini | 9e2b09e | 2024-02-13 09:39:26 -0500 | [diff] [blame] | 287 | make -j $(nproc) && \ |
| 288 | sudo mkdir /opt/coreboot && \ |
| 289 | sudo cp build/coreboot.rom build/cbfstool /opt/coreboot/ |
| 290 | |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 291 | # Create our user/group |
| 292 | RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot |
| 293 | RUN useradd -m -U uboot |
| 294 | USER uboot:uboot |
| 295 | |
Tom Rini | 54573e0 | 2023-03-23 14:57:58 -0400 | [diff] [blame] | 296 | # Populate the cache for pip to use. Get these via wget as the |
| 297 | # COPY / ADD directives don't work as we need them to. |
| 298 | RUN wget -O /tmp/pytest-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/test/py/requirements.txt |
| 299 | RUN wget -O /tmp/sphinx-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/doc/sphinx/requirements.txt |
Tom Rini | 763160f | 2024-01-18 12:10:07 -0500 | [diff] [blame] | 300 | RUN wget -O /tmp/buildman-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/tools/buildman/requirements.txt |
Tom Rini | 54573e0 | 2023-03-23 14:57:58 -0400 | [diff] [blame] | 301 | RUN virtualenv -p /usr/bin/python3 /tmp/venv && \ |
| 302 | . /tmp/venv/bin/activate && \ |
| 303 | pip install -r /tmp/pytest-requirements.txt \ |
Tom Rini | 763160f | 2024-01-18 12:10:07 -0500 | [diff] [blame] | 304 | -r /tmp/sphinx-requirements.txt \ |
| 305 | -r /tmp/buildman-requirements.txt && \ |
Tom Rini | 54573e0 | 2023-03-23 14:57:58 -0400 | [diff] [blame] | 306 | deactivate && \ |
Tom Rini | 763160f | 2024-01-18 12:10:07 -0500 | [diff] [blame] | 307 | rm -rf /tmp/venv /tmp/*-requirements.txt |
Tom Rini | 54573e0 | 2023-03-23 14:57:58 -0400 | [diff] [blame] | 308 | |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 309 | # Create the buildman config file |
| 310 | RUN /bin/echo -e "[toolchain]\nroot = /usr" > ~/.buildman |
Tom Rini | 3bd5ed7 | 2023-08-25 13:21:26 -0400 | [diff] [blame] | 311 | RUN /bin/echo -e "kernelorg = /opt/gcc-13.2.0-nolibc/*" >> ~/.buildman |
Tom Rini | 0a78bc3 | 2021-07-02 10:41:58 -0400 | [diff] [blame] | 312 | RUN /bin/echo -e "\n[toolchain-prefix]\nxtensa = /opt/2020.07/xtensa-dc233c-elf/bin/xtensa-dc233c-elf-" >> ~/.buildman; |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 313 | RUN /bin/echo -e "\n[toolchain-alias]\nsh = sh2" >> ~/.buildman |
Tom Rini | 04549e9 | 2021-03-15 13:19:01 -0400 | [diff] [blame] | 314 | RUN /bin/echo -e "\nx86 = i386" >> ~/.buildman; |
Safae Ouajih | aaa366f | 2023-02-06 00:50:21 +0100 | [diff] [blame] | 315 | |
| 316 | # Add mkbootimg tool |
| 317 | RUN git clone https://android.googlesource.com/platform/system/tools/mkbootimg /home/uboot/mkbootimg |
Simon Glass | f8e2012 | 2024-11-27 11:17:28 -0600 | [diff] [blame^] | 318 | ENV PYTHONPATH="${PYTHONPATH}:/home/uboot/mkbootimg" |