blob: ceb7a25ad4d7cc0c8d04b1d29edd190fbeac4871 [file] [log] [blame]
Tom Rini04549e92021-03-15 13:19:01 -04001# 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 Rinieed9e692025-04-10 09:15:05 -06005FROM ubuntu:jammy-20250404
Tom Rini92160da2024-08-19 15:07:19 -06006LABEL org.opencontainers.image.authors="Tom Rini <trini@konsulko.com>"
7LABEL org.opencontainers.image.description=" This image is for building U-Boot inside a container"
Tom Rini04549e92021-03-15 13:19:01 -04008
Simon Glass7aafac02024-11-27 11:17:26 -06009# Used by docker to set the target platform: valid values are linux/arm64/v8
10# and linux/amd64
11ARG TARGETPLATFORM
12
13# Used by docker to set the build platform: the only valid value is linux/amd64
14ARG BUILDPLATFORM
15
Tom Rini04549e92021-03-15 13:19:01 -040016# Make sure apt is happy
17ENV DEBIAN_FRONTEND=noninteractive
18
Simon Glassef4ca582024-11-27 11:17:29 -060019# Set architectures to build for (leaving out ARM which is an exception)
20ENV ARCHS="aarch64 arc i386 m68k mips microblaze nios2 powerpc riscv64 riscv32 sh2 x86_64"
21
22# Mirror containing the toolchains
23ENV MIRROR=https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin
24
25# Toolchain version
Tom Rinib76fa132025-01-28 17:02:05 -060026ENV TCVER=14.2.0
Simon Glassef4ca582024-11-27 11:17:29 -060027
Simon Glass7aafac02024-11-27 11:17:26 -060028RUN echo "Building on $BUILDPLATFORM, for target $TARGETPLATFORM"
29
Tom Rini04549e92021-03-15 13:19:01 -040030# Add LLVM repository
Tom Rini3f88c792024-11-27 11:17:25 -060031RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
32 --mount=type=cache,target=/var/lib/apt,sharing=locked \
33 apt-get update && apt-get install -y gnupg2 wget xz-utils
Tom Rini04549e92021-03-15 13:19:01 -040034RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
Tom Rinib76fa132025-01-28 17:02:05 -060035RUN echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main | tee /etc/apt/sources.list.d/llvm.list
Tom Rini04549e92021-03-15 13:19:01 -040036
Simon Glassef4ca582024-11-27 11:17:29 -060037# Create a list of URLs to process, then pass them into a 'while read' loop
38RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then HOSTARCH=x86_64; else HOSTARCH=arm64; fi; ( \
39 # Manually install the kernel.org "Crosstool"-based toolchains
40 for arch in $ARCHS; do \
41 echo $MIRROR/$HOSTARCH/$TCVER/${HOSTARCH}-gcc-$TCVER-nolibc-${arch}-linux.tar.xz; \
42 done; \
43 \
44 # Deal with ARM, which has a 'gnueabi' suffix
45 echo $MIRROR/${HOSTARCH}/$TCVER/${HOSTARCH}-gcc-$TCVER-nolibc-arm-linux-gnueabi.tar.xz; \
46 \
47 ) | while read url; do \
48 # Read the URL and unpack it into /opt
49 wget -O - $url | tar -C /opt -xJ; \
50 done
Tom Rini04549e92021-03-15 13:19:01 -040051
52# Manually install other toolchains
Simon Glassef4ca582024-11-27 11:17:29 -060053RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
54 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; \
55 fi
Tom Rini04549e92021-03-15 13:19:01 -040056
57# Update and install things from apt now
Tom Rini3f88c792024-11-27 11:17:25 -060058RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
59 --mount=type=cache,target=/var/lib/apt,sharing=locked \
60 apt-get update && apt-get install -y \
Tom Rini04549e92021-03-15 13:19:01 -040061 automake \
62 autopoint \
63 bc \
64 binutils-dev \
65 bison \
66 build-essential \
Leonard Anderweit8957b2e2025-04-01 10:46:41 +020067 byacc \
Simon Glassbe17cb32023-08-24 13:55:46 -060068 cgpt \
Tom Rinib76fa132025-01-28 17:02:05 -060069 clang-18 \
Tom Rini04549e92021-03-15 13:19:01 -040070 coreutils \
71 cpio \
Tom Rini04549e92021-03-15 13:19:01 -040072 curl \
73 device-tree-compiler \
74 dosfstools \
75 e2fsprogs \
76 efitools \
Huang Jianan11e04432022-02-26 15:05:51 +080077 erofs-utils \
Marek Vasut60b83672025-03-17 04:12:50 +010078 exfatprogs \
Heinrich Schuchardt4e202672021-11-09 19:51:20 +010079 expect \
Tom Rini04549e92021-03-15 13:19:01 -040080 fakeroot \
Tom Rini4da79d42025-04-10 10:54:03 -060081 fdisk \
Tom Rini04549e92021-03-15 13:19:01 -040082 flex \
Heinrich Schuchardt4e202672021-11-09 19:51:20 +010083 gawk \
Tom Rini04549e92021-03-15 13:19:01 -040084 gdisk \
Tom Rini12248ed2024-11-27 11:17:23 -060085 gettext \
Tom Rini04549e92021-03-15 13:19:01 -040086 git \
87 gnu-efi \
Heinrich Schuchardt4e202672021-11-09 19:51:20 +010088 gnutls-dev \
Tom Rini04549e92021-03-15 13:19:01 -040089 graphviz \
Tom Rini04549e92021-03-15 13:19:01 -040090 help2man \
91 iasl \
92 imagemagick \
Tom Rini343d3b82025-04-22 13:36:56 -060093 inetutils-telnet \
Tom Rini04549e92021-03-15 13:19:01 -040094 iputils-ping \
Bin Mengf551a532021-08-26 23:33:33 +080095 libconfuse-dev \
Tom Rinic8982d22021-06-10 10:57:36 -040096 libgit2-dev \
Heinrich Schuchardt4e202672021-11-09 19:51:20 +010097 libjson-glib-dev \
AKASHI Takahiro3edc3472022-02-01 10:32:36 +090098 libgnutls28-dev \
99 libgnutls30 \
Tom Rini04549e92021-03-15 13:19:01 -0400100 libpixman-1-dev \
Tom Rinic8982d22021-06-10 10:57:36 -0400101 libpython3-dev \
Tom Rini04549e92021-03-15 13:19:01 -0400102 libsdl1.2-dev \
103 libsdl2-dev \
Heinrich Schuchardt4e202672021-11-09 19:51:20 +0100104 libseccomp-dev \
Tom Rini83da2322023-07-13 10:16:28 -0400105 libslirp-dev \
Tom Rini04549e92021-03-15 13:19:01 -0400106 libssl-dev \
Heinrich Schuchardt4e202672021-11-09 19:51:20 +0100107 libtool \
Tom Rini04549e92021-03-15 13:19:01 -0400108 libudev-dev \
109 libusb-1.0-0-dev \
Heinrich Schuchardtd00948c2025-05-05 16:43:14 +0200110 lz4 \
Tom Rini04549e92021-03-15 13:19:01 -0400111 lzma-alone \
112 lzop \
113 mount \
114 mtd-utils \
115 mtools \
Heinrich Schuchardt4e202672021-11-09 19:51:20 +0100116 net-tools \
Bin Meng00afccd2021-08-26 23:33:32 +0800117 ninja-build \
Tom Rini04549e92021-03-15 13:19:01 -0400118 openssl \
119 picocom \
120 parted \
121 pkg-config \
Tom Rinic8982d22021-06-10 10:57:36 -0400122 python-is-python3 \
123 python2.7 \
124 python3 \
125 python3-dev \
Tom Rini04549e92021-03-15 13:19:01 -0400126 python3-pip \
127 python3-sphinx \
Tom Rinic02ec5a2025-04-15 12:10:26 -0600128 python3-venv \
Tom Rini04549e92021-03-15 13:19:01 -0400129 rpm2cpio \
130 sbsigntool \
Heinrich Schuchardt4e202672021-11-09 19:51:20 +0100131 socat \
132 softhsm2 \
Tom Rini04549e92021-03-15 13:19:01 -0400133 sparse \
134 srecord \
135 sudo \
136 swig \
Heinrich Schuchardtc2c98ea2022-12-30 05:41:01 +0100137 texinfo \
Tom Rini04549e92021-03-15 13:19:01 -0400138 util-linux \
139 uuid-dev \
Simon Glassbe17cb32023-08-24 13:55:46 -0600140 vboot-kernel-utils \
141 vboot-utils \
Heinrich Schuchardt905d0752024-02-28 08:23:09 +0100142 xilinx-bootgen \
Tom Rini0a78bc32021-07-02 10:41:58 -0400143 xxd \
Tom Rini3f88c792024-11-27 11:17:25 -0600144 zip
Tom Rini04549e92021-03-15 13:19:01 -0400145
Tom Rini04549e92021-03-15 13:19:01 -0400146# Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit
147RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub && \
148 cd /tmp/grub && \
Tom Rini12248ed2024-11-27 11:17:23 -0600149 git checkout grub-2.12 && \
Tom Rini77d48f12022-11-22 12:31:58 -0500150 git config --global user.name "GitLab CI Runner" && \
151 git config --global user.email trini@konsulko.com && \
Tom Rini04549e92021-03-15 13:19:01 -0400152 ./bootstrap && \
153 mkdir -p /opt/grub && \
154 ./configure --target=aarch64 --with-platform=efi \
155 CC=gcc \
Tom Rini69349882024-12-08 11:07:25 -0600156 TARGET_CC=/opt/gcc-${TCVER}-nolibc/aarch64-linux/bin/aarch64-linux-gcc \
157 TARGET_OBJCOPY=/opt/gcc-${TCVER}-nolibc/aarch64-linux/bin/aarch64-linux-objcopy \
158 TARGET_STRIP=/opt/gcc-${TCVER}-nolibc/aarch64-linux/bin/aarch64-linux-strip \
159 TARGET_NM=/opt/gcc-${TCVER}-nolibc/aarch64-linux/bin/aarch64-linux-nm \
160 TARGET_RANLIB=/opt/gcc-${TCVER}-nolibc/aarch64-linux/bin/aarch64-linux-ranlib && \
Tom Rini4bac0392024-11-27 11:17:22 -0600161 make -j$(nproc) && \
Tom Rini04549e92021-03-15 13:19:01 -0400162 ./grub-mkimage -O arm64-efi -o /opt/grub/grubaa64.efi --prefix= -d \
163 grub-core cat chain configfile echo efinet ext2 fat halt help linux \
164 lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \
165 search search_fs_file search_fs_uuid search_label serial sleep test \
166 true && \
167 make clean && \
168 ./configure --target=arm --with-platform=efi \
169 CC=gcc \
Tom Rini69349882024-12-08 11:07:25 -0600170 TARGET_CC=/opt/gcc-${TCVER}-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc \
171 TARGET_OBJCOPY=/opt/gcc-${TCVER}-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-objcopy \
172 TARGET_STRIP=/opt/gcc-${TCVER}-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-strip \
173 TARGET_NM=/opt/gcc-${TCVER}-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-nm \
174 TARGET_RANLIB=/opt/gcc-${TCVER}-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ranlib && \
Tom Rini4bac0392024-11-27 11:17:22 -0600175 make -j$(nproc) && \
Tom Rini04549e92021-03-15 13:19:01 -0400176 ./grub-mkimage -O arm-efi -o /opt/grub/grubarm.efi --prefix= -d \
177 grub-core cat chain configfile echo efinet ext2 fat halt help linux \
178 lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \
179 search search_fs_file search_fs_uuid search_label serial sleep test \
180 true && \
181 make clean && \
Tom Rinib76fa132025-01-28 17:02:05 -0600182 grub_cv_cc_mcmodel=no ./configure --target=riscv64 --with-platform=efi \
Tom Rini04549e92021-03-15 13:19:01 -0400183 CC=gcc \
Tom Rini69349882024-12-08 11:07:25 -0600184 TARGET_CC=/opt/gcc-${TCVER}-nolibc/riscv64-linux/bin/riscv64-linux-gcc \
185 TARGET_OBJCOPY=/opt/gcc-${TCVER}-nolibc/riscv64-linux/bin/riscv64-linux-objcopy \
186 TARGET_STRIP=/opt/gcc-${TCVER}-nolibc/riscv64-linux/bin/riscv64-linux-strip \
187 TARGET_NM=/opt/gcc-${TCVER}-nolibc/riscv64-linux/bin/riscv64-linux-nm \
188 TARGET_RANLIB=/opt/gcc-${TCVER}-nolibc/riscv64-linux/bin/riscv64-linux-ranlib && \
Tom Rini4bac0392024-11-27 11:17:22 -0600189 make -j$(nproc) && \
Tom Rini04549e92021-03-15 13:19:01 -0400190 ./grub-mkimage -O riscv64-efi -o /opt/grub/grubriscv64.efi --prefix= -d \
191 grub-core cat chain configfile echo efinet ext2 fat halt help linux \
192 lsefisystab loadenv lvm minicmd normal part_msdos part_gpt reboot \
193 search search_fs_file search_fs_uuid search_label serial sleep test \
194 true && \
Tom Rinie8403a92024-11-27 11:17:24 -0600195 make clean && \
196 ./configure --target=i386 --with-platform=efi \
197 CC=gcc \
Tom Rini69349882024-12-08 11:07:25 -0600198 TARGET_CC=/opt/gcc-${TCVER}-nolibc/i386-linux/bin/i386-linux-gcc \
199 TARGET_OBJCOPY=/opt/gcc-${TCVER}-nolibc/i386-linux/bin/i386-linux-objcopy \
200 TARGET_STRIP=/opt/gcc-${TCVER}-nolibc/i386-linux/bin/i386-linux-strip \
201 TARGET_NM=/opt/gcc-${TCVER}-nolibc/i386-linux/bin/i386-linux-nm \
202 TARGET_RANLIB=/opt/gcc-${TCVER}-nolibc/i386-linux/bin/i386-linux-ranlib && \
Tom Rinie8403a92024-11-27 11:17:24 -0600203 make -j$(nproc) && \
204 ./grub-mkimage -O i386-efi -o /opt/grub/grub_x86.efi --prefix= -d \
205 grub-core normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd && \
206 make clean && \
207 ./configure --target=x86_64 --with-platform=efi \
208 CC=gcc \
Tom Rini69349882024-12-08 11:07:25 -0600209 TARGET_CC=/opt/gcc-${TCVER}-nolibc/x86_64-linux/bin/x86_64-linux-gcc \
210 TARGET_OBJCOPY=/opt/gcc-${TCVER}-nolibc/x86_64-linux/bin/x86_64-linux-objcopy \
211 TARGET_STRIP=/opt/gcc-${TCVER}-nolibc/x86_64-linux/bin/x86_64-linux-strip \
212 TARGET_NM=/opt/gcc-${TCVER}-nolibc/x86_64-linux/bin/x86_64-linux-nm \
213 TARGET_RANLIB=/opt/gcc-${TCVER}-nolibc/x86_64-linux/bin/x86_64-linux-ranlib && \
Tom Rinie8403a92024-11-27 11:17:24 -0600214 make -j$(nproc) && \
215 ./grub-mkimage -O x86_64-efi -o /opt/grub/grub_x64.efi --prefix= -d \
216 grub-core normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd && \
Tom Rini04549e92021-03-15 13:19:01 -0400217 rm -rf /tmp/grub
218
Tom Rinib60c1d72023-02-07 12:50:13 -0500219RUN git clone https://gitlab.com/qemu-project/qemu.git /tmp/qemu && \
Tom Rini04549e92021-03-15 13:19:01 -0400220 cd /tmp/qemu && \
Heinrich Schuchardt24069c22024-01-12 03:17:57 +0100221 git checkout v8.2.0 && \
Bin Meng00afccd2021-08-26 23:33:32 +0800222 # config user.name and user.email to make 'git am' happy
223 git config user.name u-boot && \
224 git config user.email u-boot@denx.de && \
Heinrich Schuchardt24069c22024-01-12 03:17:57 +0100225 git format-patch 0c7ffc977195~..0c7ffc977195 && \
226 git am 0001-hw-net-cadence_gem-Fix-MDIO_OP_xxx-values.patch && \
Tom Rini139e9952024-03-11 10:02:43 -0400227 git cherry-pick d3c79c3974 && \
Tom Rini26a41832023-03-21 15:28:00 -0400228 ./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 Rini04549e92021-03-15 13:19:01 -0400229 make -j$(nproc) all install && \
230 rm -rf /tmp/qemu
231
Heinrich Schuchardt2b4a6562024-02-28 08:43:11 +0100232# Build fiptool
233RUN git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git /tmp/tf-a && \
234 cd /tmp/tf-a/ && \
Tom Rinif1210b12025-04-08 14:21:40 -0600235 git checkout v2.12.0 && \
Tom Rini343d3b82025-04-22 13:36:56 -0600236 make CROSS_COMPILE=/opt/gcc-${TCVER}-nolibc/aarch64-linux/bin/aarch64-linux- \
237 PLAT=fvp BL33=/dev/null -j$(nproc) all fip && \
238 mkdir -p /usr/local/bin /opt/tf-a/vexpress_fvp && \
239 cp tools/fiptool/fiptool /usr/local/bin && \
240 cp build/fvp/release/fip.bin build/fvp/release/bl1.bin \
241 /opt/tf-a/vexpress_fvp/ && \
242 rm -rf build/fvp && \
243 make CROSS_COMPILE=/opt/gcc-${TCVER}-nolibc/aarch64-linux/bin/aarch64-linux- \
244 PLAT=fvp BL33=/dev/null TRANSFER_LIST=1 -j$(nproc) all fip && \
245 mkdir -p /opt/tf-a/vexpress_fvp_bloblist && \
246 cp build/fvp/release/fip.bin build/fvp/release/bl1.bin \
247 /opt/tf-a/vexpress_fvp_bloblist/ && \
Heinrich Schuchardt2b4a6562024-02-28 08:43:11 +0100248 rm -rf /tmp/tf-a
249
Tom Rini2182c482025-04-08 14:21:41 -0600250# Download the Arm Architecture FVP platform. This file is double compressed.
251RUN wget -O - https://developer.arm.com/-/cdn-downloads/permalink/FVPs-Architecture/FM-11.28/FVP_Base_RevC-2xAEMvA_11.28_23_Linux64.tgz | gunzip -dc | tar -C /opt -x
252
Bin Mengf551a532021-08-26 23:33:33 +0800253# Build genimage (required by some targets to generate disk images)
254RUN wget -O - https://github.com/pengutronix/genimage/releases/download/v14/genimage-14.tar.xz | tar -C /tmp -xJ && \
255 cd /tmp/genimage-14 && \
256 ./configure && \
257 make -j$(nproc) && \
258 make install && \
259 rm -rf /tmp/genimage-14
260
Heinrich Schuchardt4e202672021-11-09 19:51:20 +0100261# Build libtpms
262RUN git clone https://github.com/stefanberger/libtpms /tmp/libtpms && \
263 cd /tmp/libtpms && \
264 ./autogen.sh && \
265 ./configure && \
266 make -j$(nproc) && \
267 make install && \
268 ldconfig && \
269 rm -rf /tmp/libtpms
270
271# Build swtpm
272RUN git clone https://github.com/stefanberger/swtpm /tmp/swtpm && \
273 cd /tmp/swtpm && \
274 ./autogen.sh && \
275 ./configure && \
276 make -j$(nproc) && \
277 make install && \
278 rm -rf /tmp/swtpm
279
Simon Glass523cb6d2023-01-15 14:15:59 -0700280# Build trace-cmd
281RUN mkdir /tmp/trace && \
282 git clone https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git /tmp/trace/libtraceevent && \
283 cd /tmp/trace/libtraceevent && \
284 make -j$(nproc) && \
285 sudo make install && \
286 git clone https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git /tmp/trace/libtracefs && \
287 cd /tmp/trace/libtracefs && \
288 make -j$(nproc) && \
289 sudo make install && \
290 git clone https://github.com/rostedt/trace-cmd.git /tmp/trace/trace-cmd && \
291 cd /tmp/trace/trace-cmd && \
292 make -j$(nproc) && \
293 sudo make install && \
294 rm -rf /tmp/trace
295
Tom Rini9e2b09e2024-02-13 09:39:26 -0500296# Build coreboot
Simon Glass78b9c8a2024-10-14 16:32:05 -0600297RUN wget -O - https://coreboot.org/releases/coreboot-24.08.tar.xz | tar -C /tmp -xJ && \
298 cd /tmp/coreboot-24.08 && \
Tom Rini9e2b09e2024-02-13 09:39:26 -0500299 make crossgcc-i386 CPUS=$(nproc) && \
300 make -C payloads/coreinfo olddefconfig && \
301 make -C payloads/coreinfo && \
302 make olddefconfig && \
Simon Glass78b9c8a2024-10-14 16:32:05 -0600303 echo CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y | tee -a .config && \
304 echo CONFIG_USE_OPTION_TABLE=y | tee -a .config && \
305 make olddefconfig && \
Tom Rini9e2b09e2024-02-13 09:39:26 -0500306 make -j $(nproc) && \
307 sudo mkdir /opt/coreboot && \
Tom Rini1994e542025-02-12 16:24:15 -0600308 sudo cp build/coreboot.rom build/cbfstool /opt/coreboot/ && \
309 rm -rf /tmp/coreboot-24.08
Tom Rini9e2b09e2024-02-13 09:39:26 -0500310
Tom Rini04549e92021-03-15 13:19:01 -0400311# Create our user/group
312RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot
313RUN useradd -m -U uboot
314USER uboot:uboot
315
Tom Rini54573e02023-03-23 14:57:58 -0400316# Populate the cache for pip to use. Get these via wget as the
317# COPY / ADD directives don't work as we need them to.
318RUN wget -O /tmp/pytest-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/test/py/requirements.txt
319RUN wget -O /tmp/sphinx-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/doc/sphinx/requirements.txt
Tom Rini9a4b1112025-02-04 17:12:09 -0600320RUN wget -O /tmp/binman-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/tools/binman/requirements.txt
Tom Rini763160f2024-01-18 12:10:07 -0500321RUN wget -O /tmp/buildman-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/tools/buildman/requirements.txt
Tom Rini9a4b1112025-02-04 17:12:09 -0600322RUN wget -O /tmp/patman-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/tools/patman/requirements.txt
323RUN wget -O /tmp/u_boot_pylib-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/tools/u_boot_pylib/requirements.txt
Tom Rinic02ec5a2025-04-15 12:10:26 -0600324RUN python3 -m venv /tmp/venv && \
Tom Rini54573e02023-03-23 14:57:58 -0400325 . /tmp/venv/bin/activate && \
326 pip install -r /tmp/pytest-requirements.txt \
Tom Rini763160f2024-01-18 12:10:07 -0500327 -r /tmp/sphinx-requirements.txt \
Tom Rini9a4b1112025-02-04 17:12:09 -0600328 -r /tmp/binman-requirements.txt \
329 -r /tmp/buildman-requirements.txt \
330 -r /tmp/patman-requirements.txt \
331 -r /tmp/u_boot_pylib-requirements.txt && \
Tom Rini54573e02023-03-23 14:57:58 -0400332 deactivate && \
Tom Rini763160f2024-01-18 12:10:07 -0500333 rm -rf /tmp/venv /tmp/*-requirements.txt
Tom Rini54573e02023-03-23 14:57:58 -0400334
Tom Rini04549e92021-03-15 13:19:01 -0400335# Create the buildman config file
Tom Rinif1b9e2a2024-12-08 11:07:30 -0600336RUN /bin/echo -e "[toolchain]\nkernelorg = /opt/gcc-${TCVER}-nolibc/*" > ~/.buildman
337RUN /bin/echo -e "root = /usr" >> ~/.buildman
Tom Rini5d18a672024-12-08 11:07:24 -0600338RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
339 /bin/echo -e "\n[toolchain-prefix]\nxtensa = /opt/2020.07/xtensa-dc233c-elf/bin/xtensa-dc233c-elf-" >> ~/.buildman; \
340 fi
Tom Rini64d32672024-12-08 11:07:29 -0600341RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
342 /bin/echo -e "\n[toolchain-prefix]\naarch64 = /opt/gcc-${TCVER}-nolibc/aarch64-linux/bin/aarch64-linux-" >> ~/.buildman; \
343 fi
Tom Rini04549e92021-03-15 13:19:01 -0400344RUN /bin/echo -e "\n[toolchain-alias]\nsh = sh2" >> ~/.buildman
Tom Rini04549e92021-03-15 13:19:01 -0400345RUN /bin/echo -e "\nx86 = i386" >> ~/.buildman;
Safae Ouajihaaa366f2023-02-06 00:50:21 +0100346
347# Add mkbootimg tool
348RUN git clone https://android.googlesource.com/platform/system/tools/mkbootimg /home/uboot/mkbootimg
Simon Glassf8e20122024-11-27 11:17:28 -0600349ENV PYTHONPATH="${PYTHONPATH}:/home/uboot/mkbootimg"