-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDockerfile
More file actions
251 lines (243 loc) · 7.98 KB
/
Dockerfile
File metadata and controls
251 lines (243 loc) · 7.98 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# Pre-installed reMarkable libraries
ARG FROM
FROM $FROM
# Build libcap 2.32 targeting armhf
RUN export DEBIAN_FRONTEND=noninteractive \
# Install build dependencies
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
git \
# Build libcap
&& cd /root \
&& git clone git://git.kernel.org/pub/scm/libs/libcap/libcap.git \
&& cd libcap \
&& git checkout 13227f9b2f2b2f222e8022e19bd46db6f6f898c6 \
&& sed -i "s/^BUILD_GPERF/#\0/" Make.Rules \
# Compile binaries that run on the build machine using normal GCC
&& sed -i "s/^\(BUILD_CC\) := \$(CC)/\1 := gcc/" Make.Rules \
&& make \
AR="${CROSS_COMPILE}ar" \
CC="${CROSS_COMPILE}gcc" \
RANLIB="${CROSS_COMPILE}ranlib" \
lib=lib \
&& make install \
RAISE_SETFCAP=no \
lib=lib \
DESTDIR="$SYSROOT" \
&& cd .. \
# Clean up
&& rm -rf libcap \
&& apt-get autoremove -y \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/log/dpkg.log /var/log/apt
# Build util-linux 2.36.1 targeting armhf
RUN export DEBIAN_FRONTEND=noninteractive \
# Install build dependencies
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
automake \
autopoint \
bison \
gettext \
git \
libtool \
# Build util-linux
&& cd /root \
&& git clone https://github.com/karelzak/util-linux.git \
&& cd util-linux \
&& git checkout 35c07c82be1ddc3b1c40f061b59008cac6405499 \
&& ./autogen.sh \
&& ./configure --host="$CHOST" \
&& make LDFLAGS="-Wl,-rpath-link,.libs" \
&& make install DESTDIR="$SYSROOT" \
&& cd .. \
# Clean up
&& rm -rf util-linux \
&& find "$SYSROOT" -type l,f -name "*.la" | xargs --no-run-if-empty rm \
&& apt-get autoremove -y \
automake \
autopoint \
bison \
gettext \
git \
libtool \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/log/dpkg.log /var/log/apt
# Build systemd 244 targeting armhf
COPY patch/*.patch /
RUN export DEBIAN_FRONTEND=noninteractive \
# Install build dependencies
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
gettext \
git \
gperf \
m4 \
rsync \
# Build systemd
&& cd /root \
&& git clone https://github.com/systemd/systemd.git \
&& cd systemd \
&& git checkout db9c5ae73e23d816e2df2a3e10a9a2a60b5b3ed7 \
# Fix build errors with GCC 10 and -O3
# (see <https://github.com/systemd/systemd/pull/15762>)
&& git apply /systemd-244-15762.patch \
# Fix Meson syntax and semantic changes in recent versions
# (see <https://github.com/systemd/systemd/pull/20633>)
&& git apply /systemd-244-20633.patch \
&& rm /systemd-244-*.patch \
&& ./configure \
--buildtype=release \
--cross-file="$CHOST" \
--prefix=/ \
-Drootprefix=/ \
--datadir=usr/share \
--includedir=usr/include \
--libdir=lib \
&& ninja -C build \
&& DESTDIR="$SYSROOT" ninja -C build install \
&& cd .. \
# Clean up
&& rm -rf systemd \
&& apt-get autoremove -y \
gettext \
git \
gperf \
m4 \
rsync \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/log/dpkg.log /var/log/apt
# Build zlib 1.2.11 and libpng 1.6.37 targeting armhf
RUN export DEBIAN_FRONTEND=noninteractive \
# Install build dependencies
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
automake \
git \
libtool \
# Build static zlib
&& cd /root \
&& git clone https://github.com/madler/zlib \
&& cd zlib \
&& git checkout cacf7f1d4e3d44d871b605da3b647f07d718623f \
&& CC="${CROSS_COMPILE}gcc" CFLAGS=-fPIC ./configure \
--static \
--prefix=/usr \
&& make \
&& DESTDIR="$SYSROOT" make install \
&& cd .. \
# Build dynamic libpng
&& git clone git://git.code.sf.net/p/libpng/code libpng \
&& cd libpng \
&& git checkout a40189cf881e9f0db80511c382292a5604c3c3d1 \
&& ./configure --prefix=/usr --host="$CHOST" \
&& make \
&& DESTDIR="$SYSROOT" make install \
&& cd .. \
# Clean up
&& rm -rf zlib libpng \
&& find "$SYSROOT" -type l,f -name "*.la" | xargs --no-run-if-empty rm \
&& apt-get autoremove -y \
automake \
git \
libtool \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/log/dpkg.log /var/log/apt
# Build libevdev 1.9.1 targeting armhf
RUN export DEBIAN_FRONTEND=noninteractive \
# Build libevdev
&& cd /root \
&& mkdir libevdev \
&& cd libevdev \
&& curl https://www.freedesktop.org/software/libevdev/libevdev-1.9.1.tar.xz -o libevdev.tar.xz \
&& echo "f5603c48c5afd76b14df7a5124e0a94a102f8da0d45826192325069d1bbc7acb libevdev.tar.xz" > sha256sums \
&& sha256sum -c sha256sums \
&& tar --strip-components=1 -xf libevdev.tar.xz \
&& rm libevdev.tar.xz sha256sums \
&& ./configure --prefix=/usr --host="$CHOST" \
&& make \
&& DESTDIR="$SYSROOT" make install \
&& cd .. \
# Clean up
&& rm -rf libevdev \
&& find "$SYSROOT" -type l,f -name "*.la" | xargs --no-run-if-empty rm
# Build OpenSSL 1.1.1g targeting armhf
RUN export DEBIAN_FRONTEND=noninteractive \
# Build OpenSSL
&& cd /root \
&& mkdir openssl \
&& cd openssl \
&& curl https://www.openssl.org/source/openssl-1.1.1g.tar.gz -Lo openssl.tar.gz \
&& echo "ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46 openssl.tar.gz" > sha256sums \
&& sha256sum -c sha256sums \
&& tar --strip-components=1 -xf openssl.tar.gz \
&& rm openssl.tar.gz sha256sums \
&& ./Configure --prefix=/usr --cross-compile-prefix="$CROSS_COMPILE" linux-armv4 \
&& make \
&& make DESTDIR="$SYSROOT" install_sw \
&& cd .. \
# Clean up
&& rm -rf openssl
# Build libcurl 7.69.1 targeting armhf
RUN export DEBIAN_FRONTEND=noninteractive \
# Build libcurl
&& cd /root \
&& mkdir libcurl \
&& cd libcurl \
&& curl https://curl.se/download/curl-7.69.1.tar.xz -o curl.tar.xz \
&& echo "03c7d5e6697f7b7e40ada1b2256e565a555657398e6c1fcfa4cb251ccd819d4f curl.tar.xz" > sha256sums \
&& sha256sum -c sha256sums \
&& tar --strip-components=1 -xf curl.tar.xz \
&& rm curl.tar.xz sha256sums \
&& ./configure --prefix=/usr --host="$CHOST" --with-openssl \
&& make \
&& DESTDIR="$SYSROOT" make install \
&& cd .. \
# Clean up
&& rm -rf libcurl \
&& find "$SYSROOT" -type l,f -name "*.la" | xargs --no-run-if-empty rm
# Build breakpad 0.1 (db1cda2653) targeting armhf
RUN export DEBIAN_FRONTEND=noninteractive \
# Install build dependencies
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
git \
zlib1g-dev \
libssl-dev \
# breakpad's build tools require python2 to be available as python on the path
&& git clone https://github.com/pyenv/pyenv.git .pyenv \
&& export PYENV_ROOT="$(pwd)/.pyenv" \
&& export PATH="$PYENV_ROOT/bin:$PATH" \
&& eval "$(pyenv init --path)" \
&& pyenv install 2.7 \
&& pyenv global 2.7 \
# Fetch and activate depot_tools
&& cd /root \
&& git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git \
&& export PATH=$PATH:/root/depot_tools \
# Build static breakpad
&& cd /root \
&& mkdir breakpad \
&& cd breakpad \
&& fetch breakpad \
&& cd src \
&& git checkout -f db1cda26539c711c3da7ed4d410dfe8190e89b8f \
&& ./configure --prefix=/usr --host="$CHOST" \
&& make \
&& DESTDIR="$SYSROOT" make install \
&& cd ../.. \
# Clean up
&& rm -rf \
.vpython-root \
.vpython_cipd_cache \
/tmp/* \
breakpad \
depot_tools \
.pyenv \
&& apt-get autoremove -y \
git \
zlib1g-dev \
libssl-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/log/dpkg.log /var/log/apt