blob: a0fd174ff602d407b4dfe8b15d8009782cdc10f0 [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 \
93 iputils-ping \
Bin Mengf551a532021-08-26 23:33:33 +080094 libconfuse-dev \
Tom Rinic8982d22021-06-10 10:57:36 -040095 libgit2-dev \
Heinrich Schuchardt4e202672021-11-09 19:51:20 +010096 libjson-glib-dev \
AKASHI Takahiro3edc3472022-02-01 10:32:36 +090097 libgnutls28-dev \
98 libgnutls30 \
Tom Rini04549e92021-03-15 13:19:01 -040099 liblz4-tool \
100 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 \
110 lzma-alone \
111 lzop \
112 mount \
113 mtd-utils \
114 mtools \
Heinrich Schuchardt4e202672021-11-09 19:51:20 +0100115 net-tools \
Bin Meng00afccd2021-08-26 23:33:32 +0800116 ninja-build \
Tom Rini04549e92021-03-15 13:19:01 -0400117 openssl \
118 picocom \
119 parted \
120 pkg-config \
Tom Rinic8982d22021-06-10 10:57:36 -0400121 python-is-python3 \
122 python2.7 \
123 python3 \
124 python3-dev \
Tom Rini04549e92021-03-15 13:19:01 -0400125 python3-pip \
126 python3-sphinx \
Tom Rinic8982d22021-06-10 10:57:36 -0400127 python3-virtualenv \
Tom Rini04549e92021-03-15 13:19:01 -0400128 rpm2cpio \
129 sbsigntool \
Heinrich Schuchardt4e202672021-11-09 19:51:20 +0100130 socat \
131 softhsm2 \
Tom Rini04549e92021-03-15 13:19:01 -0400132 sparse \
133 srecord \
134 sudo \
135 swig \
Heinrich Schuchardtc2c98ea2022-12-30 05:41:01 +0100136 texinfo \
Tom Rini04549e92021-03-15 13:19:01 -0400137 util-linux \
138 uuid-dev \
139 virtualenv \
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 && \
Heinrich Schuchardt2b4a6562024-02-28 08:43:11 +0100236 cd tools/fiptool && \
Tom Rini4bac0392024-11-27 11:17:22 -0600237 make -j$(nproc) && \
Heinrich Schuchardt2b4a6562024-02-28 08:43:11 +0100238 mkdir -p /usr/local/bin && \
239 cp fiptool /usr/local/bin && \
240 rm -rf /tmp/tf-a
241
Tom Rini2182c482025-04-08 14:21:41 -0600242# Download the Arm Architecture FVP platform. This file is double compressed.
243RUN 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
244
Bin Mengf551a532021-08-26 23:33:33 +0800245# Build genimage (required by some targets to generate disk images)
246RUN wget -O - https://github.com/pengutronix/genimage/releases/download/v14/genimage-14.tar.xz | tar -C /tmp -xJ && \
247 cd /tmp/genimage-14 && \
248 ./configure && \
249 make -j$(nproc) && \
250 make install && \
251 rm -rf /tmp/genimage-14
252
Heinrich Schuchardt4e202672021-11-09 19:51:20 +0100253# Build libtpms
254RUN git clone https://github.com/stefanberger/libtpms /tmp/libtpms && \
255 cd /tmp/libtpms && \
256 ./autogen.sh && \
257 ./configure && \
258 make -j$(nproc) && \
259 make install && \
260 ldconfig && \
261 rm -rf /tmp/libtpms
262
263# Build swtpm
264RUN git clone https://github.com/stefanberger/swtpm /tmp/swtpm && \
265 cd /tmp/swtpm && \
266 ./autogen.sh && \
267 ./configure && \
268 make -j$(nproc) && \
269 make install && \
270 rm -rf /tmp/swtpm
271
Simon Glass523cb6d2023-01-15 14:15:59 -0700272# Build trace-cmd
273RUN mkdir /tmp/trace && \
274 git clone https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git /tmp/trace/libtraceevent && \
275 cd /tmp/trace/libtraceevent && \
276 make -j$(nproc) && \
277 sudo make install && \
278 git clone https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git /tmp/trace/libtracefs && \
279 cd /tmp/trace/libtracefs && \
280 make -j$(nproc) && \
281 sudo make install && \
282 git clone https://github.com/rostedt/trace-cmd.git /tmp/trace/trace-cmd && \
283 cd /tmp/trace/trace-cmd && \
284 make -j$(nproc) && \
285 sudo make install && \
286 rm -rf /tmp/trace
287
Tom Rini9e2b09e2024-02-13 09:39:26 -0500288# Build coreboot
Simon Glass78b9c8a2024-10-14 16:32:05 -0600289RUN wget -O - https://coreboot.org/releases/coreboot-24.08.tar.xz | tar -C /tmp -xJ && \
290 cd /tmp/coreboot-24.08 && \
Tom Rini9e2b09e2024-02-13 09:39:26 -0500291 make crossgcc-i386 CPUS=$(nproc) && \
292 make -C payloads/coreinfo olddefconfig && \
293 make -C payloads/coreinfo && \
294 make olddefconfig && \
Simon Glass78b9c8a2024-10-14 16:32:05 -0600295 echo CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y | tee -a .config && \
296 echo CONFIG_USE_OPTION_TABLE=y | tee -a .config && \
297 make olddefconfig && \
Tom Rini9e2b09e2024-02-13 09:39:26 -0500298 make -j $(nproc) && \
299 sudo mkdir /opt/coreboot && \
Tom Rini1994e542025-02-12 16:24:15 -0600300 sudo cp build/coreboot.rom build/cbfstool /opt/coreboot/ && \
301 rm -rf /tmp/coreboot-24.08
Tom Rini9e2b09e2024-02-13 09:39:26 -0500302
Tom Rini04549e92021-03-15 13:19:01 -0400303# Create our user/group
304RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot
305RUN useradd -m -U uboot
306USER uboot:uboot
307
Tom Rini54573e02023-03-23 14:57:58 -0400308# Populate the cache for pip to use. Get these via wget as the
309# COPY / ADD directives don't work as we need them to.
310RUN wget -O /tmp/pytest-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/test/py/requirements.txt
311RUN 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 -0600312RUN 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 -0500313RUN 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 -0600314RUN wget -O /tmp/patman-requirements.txt https://source.denx.de/u-boot/u-boot/-/raw/master/tools/patman/requirements.txt
315RUN 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 Rini54573e02023-03-23 14:57:58 -0400316RUN virtualenv -p /usr/bin/python3 /tmp/venv && \
317 . /tmp/venv/bin/activate && \
318 pip install -r /tmp/pytest-requirements.txt \
Tom Rini763160f2024-01-18 12:10:07 -0500319 -r /tmp/sphinx-requirements.txt \
Tom Rini9a4b1112025-02-04 17:12:09 -0600320 -r /tmp/binman-requirements.txt \
321 -r /tmp/buildman-requirements.txt \
322 -r /tmp/patman-requirements.txt \
323 -r /tmp/u_boot_pylib-requirements.txt && \
Tom Rini54573e02023-03-23 14:57:58 -0400324 deactivate && \
Tom Rini763160f2024-01-18 12:10:07 -0500325 rm -rf /tmp/venv /tmp/*-requirements.txt
Tom Rini54573e02023-03-23 14:57:58 -0400326
Tom Rini04549e92021-03-15 13:19:01 -0400327# Create the buildman config file
Tom Rinif1b9e2a2024-12-08 11:07:30 -0600328RUN /bin/echo -e "[toolchain]\nkernelorg = /opt/gcc-${TCVER}-nolibc/*" > ~/.buildman
329RUN /bin/echo -e "root = /usr" >> ~/.buildman
Tom Rini5d18a672024-12-08 11:07:24 -0600330RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
331 /bin/echo -e "\n[toolchain-prefix]\nxtensa = /opt/2020.07/xtensa-dc233c-elf/bin/xtensa-dc233c-elf-" >> ~/.buildman; \
332 fi
Tom Rini64d32672024-12-08 11:07:29 -0600333RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
334 /bin/echo -e "\n[toolchain-prefix]\naarch64 = /opt/gcc-${TCVER}-nolibc/aarch64-linux/bin/aarch64-linux-" >> ~/.buildman; \
335 fi
Tom Rini04549e92021-03-15 13:19:01 -0400336RUN /bin/echo -e "\n[toolchain-alias]\nsh = sh2" >> ~/.buildman
Tom Rini04549e92021-03-15 13:19:01 -0400337RUN /bin/echo -e "\nx86 = i386" >> ~/.buildman;
Safae Ouajihaaa366f2023-02-06 00:50:21 +0100338
339# Add mkbootimg tool
340RUN git clone https://android.googlesource.com/platform/system/tools/mkbootimg /home/uboot/mkbootimg
Simon Glassf8e20122024-11-27 11:17:28 -0600341ENV PYTHONPATH="${PYTHONPATH}:/home/uboot/mkbootimg"