fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1FROM ubuntu:22.04 2 3ARG DEBIAN_FRONTEND=noninteractive 4RUN apt-get update -y && apt-get install -y --no-install-recommends \ 5 bc \ 6 bzip2 \ 7 ca-certificates \ 8 cmake \ 9 cpio \ 10 curl \ 11 file \ 12 g++ \ 13 g++-arm-linux-gnueabihf \ 14 git \ 15 libc6-dev \ 16 libc6-dev-armhf-cross \ 17 libssl-dev \ 18 make \ 19 ninja-build \ 20 python3 \ 21 qemu-system-arm \ 22 xz-utils 23 24ENV ARCH=arm \ 25 CROSS_COMPILE=arm-linux-gnueabihf- 26 27WORKDIR /build 28 29# Compile the kernel that we're going to run and be emulating with. This is 30# basically just done to be compatible with the QEMU target that we're going 31# to be using when running tests. If any other kernel works or if any 32# other QEMU target works with some other stock kernel, we can use that too! 33# 34# The `vexpress_config` config file was a previously generated config file for 35# the kernel. This file was generated by running `make vexpress_defconfig` 36# followed by `make menuconfig` and then enabling the IPv6 protocol page. 37COPY host-x86_64/armhf-gnu/vexpress_config /build/.config 38RUN curl https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.320.tar.xz | \ 39 tar xJf - && \ 40 cd /build/linux-4.14.320 && \ 41 cp /build/.config . && \ 42 make -j$(nproc) all && \ 43 cp arch/arm/boot/zImage /tmp && \ 44 cd /build && \ 45 rm -rf linux-4.14.320 46 47# Compile an instance of busybox as this provides a lightweight system and init 48# binary which we will boot into. Only trick here is configuring busybox to 49# build static binaries. 50RUN curl https://www.busybox.net/downloads/busybox-1.32.1.tar.bz2 | tar xjf - && \ 51 cd busybox-1.32.1 && \ 52 make defconfig && \ 53 sed -i 's/.*CONFIG_STATIC.*/CONFIG_STATIC=y/' .config && \ 54 make -j$(nproc) && \ 55 make install && \ 56 mv _install /tmp/rootfs && \ 57 cd /build && \ 58 rm -rf busybox-1.32.1 59 60# Download the ubuntu rootfs, which we'll use as a chroot for all our tests. 61WORKDIR /tmp 62RUN mkdir rootfs/ubuntu 63RUN curl https://cdimage.ubuntu.com/ubuntu-base/releases/22.04/release/ubuntu-base-22.04.2-base-armhf.tar.gz | \ 64 tar xzf - -C rootfs/ubuntu && \ 65 cd rootfs && mkdir proc sys dev etc etc/init.d 66 67# Copy over our init script, which starts up our test server and also a few 68# other misc tasks. 69COPY scripts/qemu-bare-bones-rcS rootfs/etc/init.d/rcS 70RUN chmod +x rootfs/etc/init.d/rcS 71 72# Helper to quickly fill the entropy pool in the kernel. 73COPY scripts/qemu-bare-bones-addentropy.c /tmp/addentropy.c 74RUN arm-linux-gnueabihf-gcc addentropy.c -o rootfs/addentropy -static 75 76# TODO: What is this?! 77# Source of the file: https://github.com/vfdev-5/qemu-rpi2-vexpress/raw/master/vexpress-v2p-ca15-tc1.dtb 78RUN curl -O https://ci-mirrors.rust-lang.org/rustc/vexpress-v2p-ca15-tc1.dtb 79 80COPY scripts/sccache.sh /scripts/ 81RUN sh /scripts/sccache.sh 82 83COPY static/gitconfig /etc/gitconfig 84 85ENV RUST_CONFIGURE_ARGS --qemu-armhf-rootfs=/tmp/rootfs 86ENV SCRIPT python3 ../x.py --stage 2 test --host='' --target arm-unknown-linux-gnueabihf 87 88ENV NO_CHANGE_USER=1