1
1
# based on armhf-gnu/Dockerfile
2
- FROM ubuntu:20 .04
2
+ FROM ubuntu:22 .04
3
3
4
- RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
4
+ ARG DEBIAN_FRONTEND=noninteractive
5
5
RUN apt-get update -y && apt-get install -y --no-install-recommends \
6
- bc \
7
- bison \
8
- ca-certificates \
9
- cmake \
10
- cpio \
11
- curl \
12
- debian-ports-archive-keyring \
13
- debootstrap \
14
- flex \
15
- gcc \
16
- gcc-riscv64-linux-gnu \
17
- git \
18
- g++-riscv64-linux-gnu \
19
- g++ \
20
- libc6-dev \
21
- libc6-dev-riscv64-cross \
22
- libssl-dev \
23
- make \
24
- ninja-build \
25
- patch \
26
- python3 \
27
- qemu-system-misc \
28
- xz-utils
6
+ bc \
7
+ bzip2 \
8
+ ca-certificates \
9
+ cmake \
10
+ cpio \
11
+ curl \
12
+ file \
13
+ flex \
14
+ bison \
15
+ g++ \
16
+ g++-riscv64-linux-gnu \
17
+ git \
18
+ libc6-dev \
19
+ libc6-dev-riscv64-cross \
20
+ libssl-dev \
21
+ make \
22
+ ninja-build \
23
+ python3 \
24
+ qemu-system-riscv64 \
25
+ xz-utils
29
26
30
- ENV ARCH=riscv
31
- ENV CROSS_COMPILE=riscv64-linux-gnu-
27
+ ENV ARCH=riscv \
28
+ CROSS_COMPILE=riscv64-linux-gnu-
32
29
33
30
WORKDIR /build
34
31
35
32
# From https://github.com/michaeljclark/busybear-linux/blob/master/conf/linux.config
36
- COPY host-x86_64/riscv64gc-linux /linux.config /build
33
+ COPY host-x86_64/riscv64gc-gnu /linux.config /build
37
34
38
35
# Compile the kernel that we're going to be emulating with. This is
39
36
# basically just done to be compatible with the QEMU target that we're going
@@ -49,29 +46,22 @@ RUN curl https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.16.tar.xz | tar
49
46
# Compile an instance of busybox as this provides a lightweight system and init
50
47
# binary which we will boot into. Only trick here is configuring busybox to
51
48
# build static binaries.
52
- RUN curl https://busybox.net/downloads/busybox-1.31.1.tar.bz2 | tar xjf -
53
- COPY host-x86_64/riscv64gc-linux/0001-Remove-stime-function-calls.patch /build/busybox-1.31.1/
54
- RUN cd /build/busybox-1.31.1 && \
55
- patch -p1 -i 0001-Remove-stime-function-calls.patch && \
56
- make defconfig && \
57
- sed -i 's/.*CONFIG_STATIC.*/CONFIG_STATIC=y/' .config && \
58
- make -j$(nproc) && \
59
- make install && \
60
- mv _install /tmp/rootfs && \
61
- cd /build && \
62
- rm -rf busybox-1.31.1
49
+ RUN curl https://www.busybox.net/downloads/busybox-1.32.1.tar.bz2 | tar xjf - && \
50
+ cd busybox-1.32.1 && \
51
+ make defconfig && \
52
+ sed -i 's/.*CONFIG_STATIC.*/CONFIG_STATIC=y/' .config && \
53
+ make -j$(nproc) && \
54
+ make install && \
55
+ mv _install /tmp/rootfs && \
56
+ cd /build && \
57
+ rm -rf busybox-1.32.1
63
58
64
- # Download the ubuntu rootfs, which we'll use as a chroot for all our tests
65
- # This is only needed to provide /lib/* and /usr/lib/*
59
+ # Download the ubuntu rootfs, which we'll use as a chroot for all our tests.
66
60
WORKDIR /tmp
67
- RUN debootstrap --variant=minbase --arch=riscv64 --foreign focal /tmp/rootfs/ubuntu
68
- RUN cd rootfs && mkdir proc sys dev etc etc/init.d
69
- # rootfs/ubuntu/proc is in a weird state (access fails with ELOOP) until
70
- # rootfs/ubuntu/debootstrap/debootstrap --second-stage is run (under emulation),
71
- # but this takes ages. Instead hack it into a good enough state.
72
- # /proc is used by std::env::current_exe() (which is roughly
73
- # `readlink /proc/self/exe`)
74
- RUN cd rootfs/ubuntu && rm -rf proc && mkdir proc
61
+ RUN mkdir rootfs/ubuntu
62
+ RUN curl https://cdimage.ubuntu.com/ubuntu-base/releases/22.04/release/ubuntu-base-22.04.2-base-riscv64.tar.gz | \
63
+ tar xzf - -C rootfs/ubuntu && \
64
+ cd rootfs && mkdir proc sys dev etc etc/init.d
75
65
76
66
# Copy over our init script, which starts up our test server and also a few other
77
67
# misc tasks
@@ -95,9 +85,6 @@ RUN mkdir build && cd build && \
95
85
WORKDIR /tmp
96
86
RUN rm -rf /tmp/riscv-pk
97
87
98
- COPY scripts/cmake.sh /scripts/
99
- RUN /scripts/cmake.sh
100
-
101
88
COPY scripts/sccache.sh /scripts/
102
89
RUN sh /scripts/sccache.sh
103
90
0 commit comments