]> git.proxmox.com Git - rustc.git/blame - src/ci/docker/host-x86_64/armhf-gnu/Dockerfile
New upstream version 1.65.0+dfsg1
[rustc.git] / src / ci / docker / host-x86_64 / armhf-gnu / Dockerfile
CommitLineData
5869c6ff 1FROM ubuntu:20.04
8bb4bdeb 2
5869c6ff 3RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
8bb4bdeb
XL
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 \
1b1a35ee 17 ninja-build \
ba9703b0 18 python3 \
8bb4bdeb
XL
19 qemu-system-arm \
20 xz-utils
21
22ENV ARCH=arm \
23 CROSS_COMPILE=arm-linux-gnueabihf-
24
25WORKDIR /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.
f035d41b 35COPY host-x86_64/armhf-gnu/vexpress_config /build/.config
5869c6ff 36RUN curl https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.253.tar.xz | \
8bb4bdeb 37 tar xJf - && \
5869c6ff 38 cd /build/linux-4.4.253 && \
8bb4bdeb
XL
39 cp /build/.config . && \
40 make -j$(nproc) all && \
41 cp arch/arm/boot/zImage /tmp && \
42 cd /build && \
5869c6ff 43 rm -rf linux-4.4.253
8bb4bdeb
XL
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.
5869c6ff
XL
48RUN curl https://www.busybox.net/downloads/busybox-1.32.1.tar.bz2 | tar xjf - && \
49 cd busybox-1.32.1 && \
8bb4bdeb
XL
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 && \
5869c6ff 56 rm -rf busybox-1.32.1
8bb4bdeb
XL
57
58# Download the ubuntu rootfs, which we'll use as a chroot for all our tests.
59WORKDIR /tmp
60RUN mkdir rootfs/ubuntu
136023e0 61RUN curl https://cdimage.ubuntu.com/ubuntu-base/releases/20.04/release/ubuntu-base-20.04.1-base-armhf.tar.gz | \
8bb4bdeb
XL
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.
3b2f2976 67COPY scripts/qemu-bare-bones-rcS rootfs/etc/init.d/rcS
8bb4bdeb
XL
68RUN chmod +x rootfs/etc/init.d/rcS
69
70# Helper to quickly fill the entropy pool in the kernel.
3b2f2976 71COPY scripts/qemu-bare-bones-addentropy.c /tmp/addentropy.c
8bb4bdeb
XL
72RUN arm-linux-gnueabihf-gcc addentropy.c -o rootfs/addentropy -static
73
74# TODO: What is this?!
9fa01778 75# Source of the file: https://github.com/vfdev-5/qemu-rpi2-vexpress/raw/master/vexpress-v2p-ca15-tc1.dtb
60c5eb7d 76RUN curl -O https://ci-mirrors.rust-lang.org/rustc/vexpress-v2p-ca15-tc1.dtb
8bb4bdeb 77
041b39d2
XL
78COPY scripts/sccache.sh /scripts/
79RUN sh /scripts/sccache.sh
8bb4bdeb 80
f2b60f7d
FG
81COPY static/gitconfig /etc/gitconfig
82
0531ce1d 83ENV RUST_CONFIGURE_ARGS --qemu-armhf-rootfs=/tmp/rootfs
1b1a35ee 84ENV SCRIPT python3 ../x.py --stage 2 test --host='' --target arm-unknown-linux-gnueabihf
8bb4bdeb
XL
85
86ENV NO_CHANGE_USER=1