-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathbuild
More file actions
executable file
·40 lines (29 loc) · 984 Bytes
/
build
File metadata and controls
executable file
·40 lines (29 loc) · 984 Bytes
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
#!/usr/bin/env bash
set -e
set -x
[ -n "$LOG" ] || LOG="build.log"
define(){ IFS='\n' read -r -d '' ${1} || true; }
# Source in dist config to seed generate_board_config.py
# but will then be overwritten ${CUSTOM_PI_OS_PATH}/config for
# 'final' configuration
source ${DIST_PATH}/config
define SCRIPT <<'EOF'
BUILD_SCRIPT_PATH=$(dirname $(realpath -s $BASH_SOURCE))
export EXTRA_BOARD_CONFIG=$(mktemp)
${BUILD_SCRIPT_PATH}/custompios_core/generate_board_config.py "${EXTRA_BOARD_CONFIG}"
echo "Temp source file: ${EXTRA_BOARD_CONFIG}"
source ${BUILD_SCRIPT_PATH}/common.sh
install_cleanup_trap
CUSTOM_OS_PATH=$(dirname $(realpath -s $0))
source ${CUSTOM_PI_OS_PATH}/config "${1}" "${EXTRA_BOARD_CONFIG}" ${@}
${CUSTOM_PI_OS_PATH}/config_sanity
[ "$CONFIG_ONLY" == "yes" ] || source ${CUSTOM_OS_PATH}/custompios ${@}
EOF
if [ "$LOG" != "no" ]; then
touch "$LOG"
chmod 666 "$LOG"
eval "$SCRIPT" 2>&1 | tee "$LOG"
exit ${PIPESTATUS}
else
eval "$SCRIPT"
fi