-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
146 lines (126 loc) · 3.83 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# SPDX-FileCopyrightText: 2023 Rivos Inc.
#
# SPDX-License-Identifier: Apache-2.0
ARG flavor=mantic
FROM ubuntu:${flavor}
ARG DEBIAN_FRONTEND=noninteractive
SHELL [ "/bin/bash", "--login", "-e", "-o", "pipefail", "-c" ]
WORKDIR /tmp
# Base packages to retrieve the other repositories/packages
RUN apt-get update && apt-get install --yes --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg
# Add additional packages here.
RUN apt-get update && apt-get install --yes --no-install-recommends \
arch-test \
autoconf \
automake \
autotools-dev \
bash-completion \
bc \
binfmt-support \
bison \
bsdmainutils \
build-essential \
ccache \
cmake \
cpio \
diffstat \
flex \
g++-riscv64-linux-gnu \
gawk \
gcc-riscv64-linux-gnu \
gdb \
gettext \
git \
git-lfs \
gperf \
groff \
guestfish \
keyutils \
kmod \
kmod \
less \
less \
libdw-dev \
libelf-dev \
libglib2.0-dev \
libguestfs-tools \
libslirp-dev \
libssl-dev \
liburing-dev \
lsb-release \
lsb-release \
mmdebstrap \
ninja-build \
parallel \
patchutils \
perl \
pkg-config \
psmisc \
python-is-python3 \
python3-docutils \
python3-venv \
qemu-system-misc \
qemu-user-static \
rsync \
ruby \
software-properties-common \
ssh \
strace \
texinfo \
traceroute \
unzip \
vim \
wget \
zlib1g-dev
RUN echo 'deb [arch=amd64] http://apt.llvm.org/mantic/ llvm-toolchain-mantic main' >> /etc/apt/sources.list.d/llvm.list
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
RUN apt update
RUN apt-get install --yes clang llvm lld
# Ick. BPF requires pahole "supernew" to work
RUN cd $(mktemp -d) && git clone https://git.kernel.org/pub/scm/devel/pahole/pahole.git && \
cd pahole && mkdir build && cd build && cmake -D__LIB=lib .. && make install
RUN dpkg --add-architecture riscv64
RUN sed -i 's/^deb/deb [arch=amd64]/' /etc/apt/sources.list
RUN echo -e '\n\
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports mantic main restricted multiverse universe\n\
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports mantic-updates main\n\
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports mantic-security main\n'\
>> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install --yes --no-install-recommends \
libasound2-dev:riscv64 \
libc6-dev:riscv64 \
libcap-dev:riscv64 \
libcap-ng-dev:riscv64 \
libelf-dev:riscv64 \
libfuse-dev:riscv64 \
libhugetlbfs-dev:riscv64 \
libmnl-dev:riscv64 \
libnuma-dev:riscv64 \
libpopt-dev:riscv64 \
libssl-dev:riscv64 \
liburing-dev:riscv64
COPY mkfirmware_rv64_opensbi.sh /usr/local/bin/mkfirmware_rv64_opensbi.sh
COPY mkfirmware_rv64_uboot.sh /usr/local/bin/mkfirmware_rv64_uboot.sh
RUN mkdir -p /firmware
RUN cd /firmware && /usr/local/bin/mkfirmware_rv64_opensbi.sh
RUN cd /firmware && /usr/local/bin/mkfirmware_rv64_uboot.sh
COPY mkrootfs_rv64_ubuntu.sh /usr/local/bin/mkrootfs_rv64_ubuntu.sh
COPY systemd-debian-customize-hook.sh /usr/local/bin/systemd-debian-customize-hook.sh
RUN mkdir -p /rootfs
RUN cd /rootfs && /usr/local/bin/mkrootfs_rv64_ubuntu.sh
RUN echo 'export CCACHE_DIR=/build/ccache' >> /etc/profile
RUN echo 'export CCACHE_MAXSIZE="50G"' >> /etc/profile
RUN echo 'export KBUILD_BUILD_TIMESTAMP=@1621270510' >> /etc/profile
RUN echo 'export KBUILD_BUILD_USER=tuxmake' >> /etc/profile
RUN echo 'export KBUILD_BUILD_HOST=tuxmake' >> /etc/profile
RUN apt-get install --yes --no-install-recommends linux-image-generic
COPY mkqemu.sh /usr/local/bin/mkqemu.sh
RUN cd /rootfs && /usr/local/bin/mkqemu.sh
COPY ci /usr/local/bin/ci
COPY run.sh /usr/local/bin/run.sh
RUN apt-get clean && rm -rf /var/lib/apt/lists/