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