]> git.lizzy.rs Git - rust.git/blob - src/ci/docker/host-x86_64/armhf-gnu/Dockerfile
Merge 'rust-clippy/master' into clippyup
[rust.git] / src / ci / docker / host-x86_64 / armhf-gnu / Dockerfile
1 FROM ubuntu:20.04
2
3 RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
4       bc \
5       bzip2 \
6       ca-certificates \
7       cmake \
8       cpio \
9       curl \
10       file \
11       g++ \
12       gcc-arm-linux-gnueabihf \
13       git \
14       libc6-dev \
15       libc6-dev-armhf-cross \
16       make \
17       ninja-build \
18       python3 \
19       qemu-system-arm \
20       xz-utils
21
22 ENV ARCH=arm \
23     CROSS_COMPILE=arm-linux-gnueabihf-
24
25 WORKDIR /build
26
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!
31 #
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 | \
37       tar xJf - && \
38       cd /build/linux-4.4.253 && \
39       cp /build/.config . && \
40       make -j$(nproc) all && \
41       cp arch/arm/boot/zImage /tmp && \
42       cd /build &&  \
43       rm -rf linux-4.4.253
44
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 && \
50       make defconfig && \
51       sed -i 's/.*CONFIG_STATIC.*/CONFIG_STATIC=y/' .config && \
52       make -j$(nproc) && \
53       make install && \
54       mv _install /tmp/rootfs && \
55       cd /build && \
56       rm -rf busybox-1.32.1
57
58 # Download the ubuntu rootfs, which we'll use as a chroot for all our tests.
59 WORKDIR /tmp
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
64
65 # Copy over our init script, which starts up our test server and also a few
66 # other misc tasks.
67 COPY scripts/qemu-bare-bones-rcS rootfs/etc/init.d/rcS
68 RUN chmod +x rootfs/etc/init.d/rcS
69
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
73
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
77
78 COPY scripts/sccache.sh /scripts/
79 RUN sh /scripts/sccache.sh
80
81 ENV RUST_CONFIGURE_ARGS --qemu-armhf-rootfs=/tmp/rootfs
82 ENV SCRIPT python3 ../x.py --stage 2 test --host='' --target arm-unknown-linux-gnueabihf
83
84 ENV NO_CHANGE_USER=1