# SPDX-License-Identifier: GPL-2.0+ # This Containerfile is used to build an image containing basic stuff to be used # to build barebox and run our test suites. FROM debian:bullseye MAINTAINER Sascha Hauer LABEL Description="This image is for building and testing barebox inside a container" # Make sure apt is happy ENV DEBIAN_FRONTEND=noninteractive # Update and install things from apt now RUN apt-get update && apt-get install -y \ bison \ build-essential \ coreutils \ flex \ gawk \ git \ imagemagick \ libc6-i386 \ libgit2-dev \ libguestfs-tools \ liblz4-tool \ libseccomp-dev \ libssl-dev \ libtool \ libudev-dev \ libusb-1.0-0-dev \ lzma-alone \ lzop \ mount \ openssl \ pkg-config \ util-linux \ wget \ qemu-system-arm \ qemu-system-misc \ qemu-system-mips \ qemu-system-x86 \ qemu-system-common \ ovmf \ python3 \ python3-pip \ python3-virtualenv \ python3-setuptools \ virtualenv \ sudo \ u-boot-tools \ && rm -rf /var/lib/apt/lists/* ENV GCC_VERSION=13.1.0 # Manually install the kernel.org Crosstool based toolchains RUN korg_crosstool_dl() { wget -nv -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/${1}/${2}/${1}-gcc-${2}-nolibc-${3}.tar.xz | tar -C /opt -xJ ; } && \ korg_crosstool_dl x86_64 ${GCC_VERSION} arm-linux-gnueabi && \ korg_crosstool_dl x86_64 ${GCC_VERSION} aarch64-linux && \ korg_crosstool_dl x86_64 ${GCC_VERSION} mips-linux && \ korg_crosstool_dl x86_64 ${GCC_VERSION} or1k-linux && \ korg_crosstool_dl x86_64 ${GCC_VERSION} powerpc-linux && \ korg_crosstool_dl x86_64 ${GCC_VERSION} riscv64-linux RUN wget "https://github.com/qemu/qemu/blob/v5.2.0/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin?raw=true" -O /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin # Create our user/group RUN useradd -m -U barebox RUN echo barebox ALL=NOPASSWD: ALL > /etc/sudoers.d/barebox # install labgrid RUN cd /tmp && \ git clone --depth 1 -b v23.0 https://github.com/labgrid-project/labgrid && \ cd labgrid && \ pip3 install . && \ ln -s $(which pytest) /usr/local/bin/labgrid-pytest; ENV CROSS_COMPILE_arm=/opt/gcc-${GCC_VERSION}-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- ENV CROSS_COMPILE_arm64=/opt/gcc-${GCC_VERSION}-nolibc/aarch64-linux/bin/aarch64-linux- ENV CROSS_COMPILE_mips=/opt/gcc-${GCC_VERSION}-nolibc/mips-linux/bin/mips-linux- ENV CROSS_COMPILE_openrisc=/opt/gcc-${GCC_VERSION}-nolibc/or1k-linux/bin/or1k-linux- ENV CROSS_COMPILE_powerpc=/opt/gcc-${GCC_VERSION}-nolibc/powerpc-linux/bin/powerpc-linux- ENV CROSS_COMPILE_riscv=/opt/gcc-${GCC_VERSION}-nolibc/riscv64-linux/bin/riscv64-linux- USER barebox:barebox