-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·68 lines (50 loc) · 1.66 KB
/
build.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
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
#!/bin/bash
# Filename: build.sh
# Author: "Sai Sree Kartheek Adivi <[email protected]>"
# Description: Script to build a Debian SD card image for TI Platforms
###############################################################################
# set -x
export topdir=$(git rev-parse --show-toplevel)
source ${topdir}/scripts/setup.sh
source ${topdir}/scripts/common.sh
source ${topdir}/scripts/build_bsp.sh
source ${topdir}/scripts/build_distro.sh
if [ "$EUID" -ne 0 ] ; then
echo "Failed to run: requires root privileges"
echo "Exiting"
exit 1
fi
# exit if no arguments are passed
if [ "$#" -ne 0 ]; then
builds="$@"
else
echo "build.sh: missing operand"
echo "Specify one or more builds from the \"builds.toml\" file."
exit 1
fi
mkdir -p ${topdir}/build
for build in ${builds}
do
echo "${build}"
validate_section "Build" ${build} "${topdir}/builds.toml"
machine=($(read_build_config ${build} machine))
bsp_version=($(read_build_config ${build} bsp_version))
distro_variant=($(read_build_config ${build} distro_variant))
export host_arch=`uname -m`
export native_build=false
export cross_compile=aarch64-none-linux-gnu-
if [ "$host_arch" == "aarch64" ]; then
native_build=true
cross_compile=
fi
echo "machine: ${machine}"
echo "bsp_version: ${bsp_version}"
echo "distro_variant: ${distro_variant}"
echo "host_arch: ${host_arch}"
setup_build_tools
setup_log_file "${build}"
validate_build ${machine} ${bsp_version} ${distro_variant}
generate_rootfs ${build} ${machine} ${distro_variant}
build_bsp ${build} ${machine} ${bsp_version}
package_and_clean ${build}
done