@@ -130,6 +130,8 @@ parts:
130
130
DEB_URL="http://launchpadlibrarian.net/548325871/linux-libc-dev_5.8.0-63.71_armhf.deb"
131
131
elif [ $ARCH = s390x ]; then
132
132
DEB_URL="http://launchpadlibrarian.net/548279675/linux-libc-dev_5.8.0-63.71_s390x.deb"
133
+ elif [ $ARCH = riscv64 ]; then
134
+ DEB_URL="http://launchpadlibrarian.net/548280908/linux-libc-dev_5.8.0-63.71_riscv64.deb"
133
135
fi
134
136
wget --quiet ${DEB_URL} -O ${SNAPCRAFT_STAGE}/linux-libc-dev.deb
135
137
echo -n "Unpacking kernel headers..."
@@ -194,27 +196,33 @@ parts:
194
196
override-pull : |
195
197
KERNEL_VER="4.18.0"
196
198
ARCH=$(dpkg-architecture -q DEB_BUILD_ARCH)
197
- if [ $ARCH = amd64 ] || [ $ARCH = ppc64el ] || [ $ARCH = arm64 ]; then
199
+ if [ $ARCH = amd64 ] || [ $ARCH = ppc64el ] || [ $ARCH = arm64 ]; then
198
200
DEB_URL="http://launchpadlibrarian.net/431512728/linux-libc-dev_4.18.0-26.27_amd64.deb"
199
201
elif [ $ARCH = armhf ]; then
200
202
DEB_URL="http://launchpadlibrarian.net/431525966/linux-libc-dev_4.18.0-26.27_armhf.deb"
201
203
elif [ $ARCH = s390x ]; then
202
204
DEB_URL="http://launchpadlibrarian.net/431485536/linux-libc-dev_4.18.0-26.27_s390x.deb"
203
205
fi
204
- wget --quiet ${DEB_URL} -O ${SNAPCRAFT_STAGE}/linux-libc-dev.deb
205
- echo -n "Unpacking kernel headers..."
206
- dpkg -x ${SNAPCRAFT_STAGE}/linux-libc-dev.deb ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev
207
- printf " %d.%d.%d\n" $(printf "%6.6x" $(grep LINUX_VERSION_CODE ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/linux/version.h | sed -e "s/.*CODE //") | sed -e "s/\(..\)\(..\)/0x\1 0x\2 0x/")
208
- rm -f ${SNAPCRAFT_STAGE}/linux-libc-dev.deb
206
+ # Ubuntu 18.10 Cosmic Cuttle had no riscv64 support
207
+ if [ $ARCH != riscv64 ]; then
208
+ wget --quiet ${DEB_URL} -O ${SNAPCRAFT_STAGE}/linux-libc-dev.deb
209
+ echo -n "Unpacking kernel headers..."
210
+ dpkg -x ${SNAPCRAFT_STAGE}/linux-libc-dev.deb ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev
211
+ printf " %d.%d.%d\n" $(printf "%6.6x" $(grep LINUX_VERSION_CODE ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/linux/version.h | sed -e "s/.*CODE //") | sed -e "s/\(..\)\(..\)/0x\1 0x\2 0x/")
212
+ rm -f ${SNAPCRAFT_STAGE}/linux-libc-dev.deb
213
+ fi
209
214
override-build : |
210
215
snapcraftctl build
211
- # Move header from the part to the host
212
- ARCH_DIR=$(ls -d ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/*/asm | sed -e "s:/asm$::" -e "s:.*/::")
213
- for d in linux asm-generic $ARCH_DIR/asm; do
214
- dest=/usr/include/$d
215
- rm -rf $dest
216
- mv ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/$d ${dest%/*}
217
- done
216
+ ARCH=$(dpkg-architecture -q DEB_BUILD_ARCH)
217
+ if [ $ARCH != riscv64 ]; then
218
+ # Move header from the part to the host
219
+ ARCH_DIR=$(ls -d ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/*/asm | sed -e "s:/asm$::" -e "s:.*/::")
220
+ for d in linux asm-generic $ARCH_DIR/asm; do
221
+ dest=/usr/include/$d
222
+ rm -rf $dest
223
+ mv ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/$d ${dest%/*}
224
+ done
225
+ fi
218
226
rm -rf ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev
219
227
echo -n "Build kernel:"
220
228
printf " %d.%d.%d\n" $(printf "%6.6x" $(grep LINUX_VERSION_CODE /usr/include/linux/version.h | sed -e "s/.*CODE //") | sed -e "s/\(..\)\(..\)/0x\1 0x\2 0x/")
@@ -259,24 +267,30 @@ parts:
259
267
ARCH=$(dpkg-architecture -q DEB_BUILD_ARCH)
260
268
if [ $ARCH = amd64 ]; then
261
269
ARCHIVE_URL="http://security.ubuntu.com/ubuntu/pool/main/l/linux/"
262
- else
270
+ elif [ $ARCH != riscv64 ]; then
263
271
ARCHIVE_URL="http://ports.ubuntu.com/pool/main/l/linux/"
264
272
fi
265
- DEB_SUFFIX=$(wget ${ARCHIVE_URL} -O - | grep linux-libc-dev | cut -d'_' -f2-3 | cut -d'"' -f1 | grep ${ARCH} | grep ${KERNEL_VER} | tail -n1)
266
- wget --quiet ${ARCHIVE_URL}/linux-libc-dev_${DEB_SUFFIX} -O ${SNAPCRAFT_STAGE}/linux-libc-dev.deb
267
- echo -n "Unpacking kernel headers..."
268
- dpkg -x ${SNAPCRAFT_STAGE}/linux-libc-dev.deb ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev
269
- printf " %d.%d.%d\n" $(printf "%6.6x" $(grep LINUX_VERSION_CODE ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/linux/version.h | sed -e "s/.*CODE //") | sed -e "s/\(..\)\(..\)/0x\1 0x\2 0x/")
270
- rm -f ${SNAPCRAFT_STAGE}/linux-libc-dev.deb
273
+ # Ubuntu 18.40 (Bionic Beaver) had no riscv64 support
274
+ if [ $ARCH != riscv64 ]; then
275
+ DEB_SUFFIX=$(wget ${ARCHIVE_URL} -O - | grep linux-libc-dev | cut -d'_' -f2-3 | cut -d'"' -f1 | grep ${ARCH} | grep ${KERNEL_VER} | tail -n1)
276
+ wget --quiet ${ARCHIVE_URL}/linux-libc-dev_${DEB_SUFFIX} -O ${SNAPCRAFT_STAGE}/linux-libc-dev.deb
277
+ echo -n "Unpacking kernel headers..."
278
+ dpkg -x ${SNAPCRAFT_STAGE}/linux-libc-dev.deb ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev
279
+ printf " %d.%d.%d\n" $(printf "%6.6x" $(grep LINUX_VERSION_CODE ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/linux/version.h | sed -e "s/.*CODE //") | sed -e "s/\(..\)\(..\)/0x\1 0x\2 0x/")
280
+ rm -f ${SNAPCRAFT_STAGE}/linux-libc-dev.deb
281
+ fi
271
282
override-build : |
272
283
snapcraftctl build
273
284
# Move header from the part to the host
274
- ARCH_DIR=$(ls -d ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/*/asm | sed -e "s:/asm$::" -e "s:.*/::")
275
- for d in linux asm-generic $ARCH_DIR/asm; do
276
- dest=/usr/include/$d
277
- rm -rf $dest
278
- mv ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/$d ${dest%/*}
279
- done
285
+ ARCH=$(dpkg-architecture -q DEB_BUILD_ARCH)
286
+ if [ $ARCH != riscv64]; then
287
+ ARCH_DIR=$(ls -d ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/*/asm | sed -e "s:/asm$::" -e "s:.*/::")
288
+ for d in linux asm-generic $ARCH_DIR/asm; do
289
+ dest=/usr/include/$d
290
+ rm -rf $dest
291
+ mv ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/$d ${dest%/*}
292
+ done
293
+ fi
280
294
rm -rf ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev
281
295
echo -n "Build kernel:"
282
296
printf " %d.%d.%d\n" $(printf "%6.6x" $(grep LINUX_VERSION_CODE /usr/include/linux/version.h | sed -e "s/.*CODE //") | sed -e "s/\(..\)\(..\)/0x\1 0x\2 0x/")
@@ -323,9 +337,9 @@ parts:
323
337
elif [ $ARCH = armhf ]; then
324
338
DEB_URL="http://launchpadlibrarian.net/422971427/linux-libc-dev_3.13.0-170.220_i386.deb"
325
339
fi
326
- if [ $ARCH != s390x ]; then
327
- # s390x was not supported on Trusty, so there are no kernel headers for it .
328
- # Just let it build with the previous headers.
340
+ if [ $ARCH != s390x ] && [ $ARCH != riscv64 ] ; then
341
+ # riscv64 and s390x were not supported on Trusty, so there are no kernel headers for them .
342
+ # Just let them build with the previous headers.
329
343
wget --quiet ${DEB_URL} -O ${SNAPCRAFT_STAGE}/linux-libc-dev.deb
330
344
echo -n "Unpacking kernel headers..."
331
345
dpkg -x ${SNAPCRAFT_STAGE}/linux-libc-dev.deb ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev
@@ -335,7 +349,7 @@ parts:
335
349
override-build : |
336
350
snapcraftctl build
337
351
ARCH=$(dpkg-architecture -q DEB_BUILD_ARCH)
338
- if [ $ARCH != s390x ]; then
352
+ if [ $ARCH != s390x ] && [ $ARCH != riscv64] ; then
339
353
# Move header from the part to the host
340
354
ARCH_DIR=$(ls -d ${SNAPCRAFT_STAGE}/keepalived-linux-libc-dev/usr/include/*/asm | sed -e "s:/asm$::" -e "s:.*/::")
341
355
for d in linux asm-generic $ARCH_DIR/asm; do
0 commit comments