forked from msm8916-mainline/lk2nd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.sh
executable file
·33 lines (28 loc) · 918 Bytes
/
.drone.sh
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
#!/bin/sh
# SPDX-License-Identifier: MIT
set -eux
nproc && grep Mem /proc/meminfo && df -hT .
apk add build-base git
git clean -dxf
# Workaround problem with faccessat2() on Drone CI
wget https://gist.githubusercontent.com/TravMurav/36c83efbc188115aa9b0fc7f4afba63e/raw/faccessat.c -P /opt
gcc -O2 -shared -o /opt/faccessat.so /opt/faccessat.c
export LD_PRELOAD=/opt/faccessat.so
case "$1" in
lk2nd-*)
apk add dtc python3
;;
esac
case "$DRONE_STEP_NAME" in
*gcc4*)
wget https://gitlab.com/postmarketOS/pmbootstrap/raw/master/pmb/data/keys/build.postmarketos.org.rsa.pub -P /etc/apk/keys
echo https://mirror.postmarketos.org/postmarketos/v22.12 >> /etc/apk/repositories
apk add gcc4-armv7
TOOLCHAIN_PREFIX=gcc4-armv7-alpine-linux-musleabihf-
;;
*)
apk add gcc-arm-none-eabi
TOOLCHAIN_PREFIX=arm-none-eabi-
esac
"$TOOLCHAIN_PREFIX"gcc --version
exec make -j$(nproc) TOOLCHAIN_PREFIX=$TOOLCHAIN_PREFIX "$@"