-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·76 lines (56 loc) · 1.9 KB
/
build.sh
File metadata and controls
executable file
·76 lines (56 loc) · 1.9 KB
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
#!/bin/bash
# Filename: build.sh
# Author: "Sai Sree Kartheek Adivi <s-adivi@ti.com>"
# 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))
distro_codename=($(read_build_config ${build} distro_codename))
rt_linux=($(read_build_config ${build} rt_linux))
if [ ${rt_linux} == "true" ]; then
distro=${distro_codename}-rt-${machine}
else
distro=${distro_codename}-${machine}
fi
bsp_version=($(read_bsp_config ${distro_codename} bsp_version))
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: ${distro}"
echo "host_arch: ${host_arch}"
setup_build_tools
setup_log_file "${build}"
validate_build ${machine} ${bsp_version} ${distro_codename}/${distro}.yaml
generate_rootfs ${distro} ${distro_codename} ${machine} ${bsp_version}
build_bsp ${distro} ${machine} ${bsp_version}
package_and_clean ${distro} ${bsp_version}
done