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