-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-all
executable file
·85 lines (65 loc) · 2.56 KB
/
build-all
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
#!/bin/sh
clear
if [ ! -f "/.build-host" ]; then
echo "Must be launched on build host :)"
exit 1
fi
. build.env
test -f "${SOFIN_DATA_DIR}/loader" && \
. "${SOFIN_DATA_DIR}/loader" && \
echo "Loaded ${SOFIN_DATA_DIR}/loader"
LANG=en_US.UTF-8
export LANG
if [ "H" = "${SYSTEM_RELEASE_TYPE}" ]; then
# default is hardened
sysctl hardening.pax.mprotect.status=1
sysctl hardening.pax.pageexec.status=1
sysctl hardening.pax.disallow_map32bit.status=1
sysctl hardening.pax.aslr.status=1
fi
echo "Enabling Dtrace"
kldload dtraceall >/dev/null
# echo "Setting up ntp.conf"
# grep -e 'rlimit memlock 0' /etc/ntp.conf >/dev/null 2>&1 || \
# echo "rlimit memlock 0" >> /etc/ntp.conf
# grep -e 'tinker panic 0' /etc/ntp.conf >/dev/null 2>&1 || \
# echo "tinker panic 0" >> /etc/ntp.conf
# service ntpd restart
# test -f "${BUILD_NUMBER_FILE}" || echo "1" > "${BUILD_NUMBER_FILE}"
BUILD_NUMBER="$(echo "$(cat "${BUILD_NUMBER_FILE}" 2>/dev/null)+1" | bc 2>/dev/null)"
export BUILD_NUMBER
VERSION="${VERSION_MAJOR}-${SYSTEM_VERSION_MAJOR}-b${BUILD_NUMBER}"
export VERSION
test -z "${BUILD_NUMBER_FILE}" && exit 122
test -z "${BUILD_NUMBER}" && exit 123
test -z "${VERSION}" && exit 124
echo "BUILD no: ${BUILD_NUMBER}"
echo "${BUILD_NUMBER}" > "${BUILD_NUMBER_FILE}"
# echo "Updating current build number on workstation host…"
# ${SCP_BIN} "${BUILD_NUMBER_FILE}" "${WORKSTATION_USER}@${HOSTADDR_GW}:/Users/${WORKSTATION_USER}/${BUILD_NUM_NAME}"
case ${ARCH} in
arm)
sed -i '' -e 's/^COPTFLAGS.*$/COPTFLAGS=-O2 -pipe -ffast-math -fno-strict-aliasing -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard/' etc/make.conf
sed -i '' -e 's/^CPUTYPE.*$/CPUTYPE?=armv6/' etc/make.conf
sed -i '' -e 's/^CFLAGS.*$/CFLAGS=-O2 -pipe -fno-omit-frame-pointer -fno-strict-aliasing -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard/' etc/make.conf
;;
arm64)
sed -i '' -e 's/^COPTFLAGS.*$/COPTFLAGS=-O2 -pipe -fno-strict-aliasing -mcpu=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard/' etc/make.conf
sed -i '' -e 's/^CPUTYPE.*$/CPUTYPE?=cortex-a53/' etc/make.conf
sed -i '' -e 's/^CFLAGS.*$/CFLAGS=-O2 -pipe -fno-omit-frame-pointer -fno-strict-aliasing -mcpu=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard/' etc/make.conf
;;
amd64|x86_64)
;;
*)
echo "Error: Architecture not supported: ${ARCH}"
exit 1
;;
esac
set -e
echo "Pedantic mode enabled!"
zfs set readonly=off zroot/ROOT/default
. build.env
. build-base
echo "Build #${BUILD_NUMBER} started at: ${TIMESTAMP}"
build_base
set +e