]>
Commit | Line | Data |
---|---|---|
5869c6ff | 1 | FROM ubuntu:20.04 |
8bb4bdeb | 2 | |
5869c6ff | 3 | RUN 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 | ||
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. | |
f035d41b | 35 | COPY host-x86_64/armhf-gnu/vexpress_config /build/.config |
5869c6ff | 36 | RUN 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 |
48 | RUN 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. | |
59 | WORKDIR /tmp | |
60 | RUN mkdir rootfs/ubuntu | |
136023e0 | 61 | RUN 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 | 67 | COPY scripts/qemu-bare-bones-rcS rootfs/etc/init.d/rcS |
8bb4bdeb XL |
68 | RUN chmod +x rootfs/etc/init.d/rcS |
69 | ||
70 | # Helper to quickly fill the entropy pool in the kernel. | |
3b2f2976 | 71 | COPY scripts/qemu-bare-bones-addentropy.c /tmp/addentropy.c |
8bb4bdeb XL |
72 | RUN 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 | 76 | RUN curl -O https://ci-mirrors.rust-lang.org/rustc/vexpress-v2p-ca15-tc1.dtb |
8bb4bdeb | 77 | |
041b39d2 XL |
78 | COPY scripts/sccache.sh /scripts/ |
79 | RUN sh /scripts/sccache.sh | |
8bb4bdeb | 80 | |
f2b60f7d FG |
81 | COPY static/gitconfig /etc/gitconfig |
82 | ||
0531ce1d | 83 | ENV RUST_CONFIGURE_ARGS --qemu-armhf-rootfs=/tmp/rootfs |
1b1a35ee | 84 | ENV SCRIPT python3 ../x.py --stage 2 test --host='' --target arm-unknown-linux-gnueabihf |
8bb4bdeb XL |
85 | |
86 | ENV NO_CHANGE_USER=1 |