3 RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
12 g++-arm-linux-gnueabihf \
15 libc6-dev-armhf-cross \
23 CROSS_COMPILE=arm-linux-gnueabihf-
27 # Compile the kernel that we're going to run and be emulating with. This is
28 # basically just done to be compatible with the QEMU target that we're going
29 # to be using when running tests. If any other kernel works or if any
30 # other QEMU target works with some other stock kernel, we can use that too!
32 # The `vexpress_config` config file was a previously generated config file for
33 # the kernel. This file was generated by running `make vexpress_defconfig`
34 # followed by `make menuconfig` and then enabling the IPv6 protocol page.
35 COPY host-x86_64/armhf-gnu/vexpress_config /build/.config
36 RUN curl https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.253.tar.xz | \
38 cd /build/linux-4.4.253 && \
39 cp /build/.config . && \
40 make -j$(nproc) all && \
41 cp arch/arm/boot/zImage /tmp && \
45 # Compile an instance of busybox as this provides a lightweight system and init
46 # binary which we will boot into. Only trick here is configuring busybox to
47 # build static binaries.
48 RUN curl https://www.busybox.net/downloads/busybox-1.32.1.tar.bz2 | tar xjf - && \
49 cd busybox-1.32.1 && \
51 sed -i 's/.*CONFIG_STATIC.*/CONFIG_STATIC=y/' .config && \
54 mv _install /tmp/rootfs && \
58 # Download the ubuntu rootfs, which we'll use as a chroot for all our tests.
60 RUN mkdir rootfs/ubuntu
61 RUN curl https://cdimage.ubuntu.com/ubuntu-base/releases/20.04/release/ubuntu-base-20.04.1-base-armhf.tar.gz | \
62 tar xzf - -C rootfs/ubuntu && \
63 cd rootfs && mkdir proc sys dev etc etc/init.d
65 # Copy over our init script, which starts up our test server and also a few
67 COPY scripts/qemu-bare-bones-rcS rootfs/etc/init.d/rcS
68 RUN chmod +x rootfs/etc/init.d/rcS
70 # Helper to quickly fill the entropy pool in the kernel.
71 COPY scripts/qemu-bare-bones-addentropy.c /tmp/addentropy.c
72 RUN arm-linux-gnueabihf-gcc addentropy.c -o rootfs/addentropy -static
74 # TODO: What is this?!
75 # Source of the file: https://github.com/vfdev-5/qemu-rpi2-vexpress/raw/master/vexpress-v2p-ca15-tc1.dtb
76 RUN curl -O https://ci-mirrors.rust-lang.org/rustc/vexpress-v2p-ca15-tc1.dtb
78 COPY scripts/sccache.sh /scripts/
79 RUN sh /scripts/sccache.sh
81 COPY static/gitconfig /etc/gitconfig
83 ENV RUST_CONFIGURE_ARGS --qemu-armhf-rootfs=/tmp/rootfs
84 ENV SCRIPT python3 ../x.py --stage 2 test --host='' --target arm-unknown-linux-gnueabihf