-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.env
75 lines (52 loc) · 2.41 KB
/
setup.env
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
############################################################
#
# The settings in this script are required
# and should be sourced into your local build shell.
#
############################################################
# The root of the X1 build tree is here
export X1=$( cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)
export X1_TEMPLATES=$X1/packages/base/any/templates
# The root of the ONL tree is here
export ONL=$X1/sm/ONL
export SONIC=$X1/sm/sonic-buildimage
export DOCKER_BUILDER_MOUNT=$X1:$X1
export DOCKER_BUILDER_WORKDIR=$SONIC
export PYTHONPATH=$ONL/tools
# Checkout ONL if necessary
if [ ! -f $ONL/LICENSE ]; then
git submodule update --init sm/ONL
fi
# Versions and setup.
(cd sm/ONL && . setup.env)
# All package directories.
ONLPM_OPTION_PACKAGEDIRS="$ONL/packages:$ONL/builds:$X1/packages:$X1/builds"${ONLPM_OPTION_PACKAGEDIRS:+":"}$ONLPM_OPTION_PACKAGEDIRS
export ONLPM_OPTION_PACKAGEDIRS
# Repo directory.
export ONLPM_OPTION_REPO="$X1/REPO"
# RELEASE directory.
export ONLPM_OPTION_RELEASE_DIR="$X1/RELEASE"
# The ONL build tools should be included in the local path:
export PATH="$ONL/tools/scripts:$ONL/tools:$PATH"
# Export the current debian suite
export ONL_DEBIAN_SUITE=$(lsb_release -c -s)
export ONL_MAKE_PARALLEL=-j$(nproc)
export BUILDER_MODULE_DATABASE_ROOT=$X1
export INIT=systemd
# Version files
$ONL/tools/make-versions.py --force --import-file=$X1/tools/x1vi --class-name=OnlVersionImplementation --output-dir $X1/make/versions
( . $X1/make/versions/version-goldstone.sh && echo BuildID is $FNAME_BUILD_ID )
$ONL/tools/make-versions.py --force --import-file=$ONL/tools/onlvi --class-name=OnlVersionImplementation --output-dir $ONL/make/versions
# Enable local post-merge githook
gitroot=$($ONL/docker/tools/gitroot $X1)
if [ ! -f $gitroot/.git/hooks/post-merge ]; then
cp $ONL/tools/scripts/post-merge.hook $gitroot/.git/hooks/post-merge
fi
export ONL_SUBMODULE_UPDATED_SCRIPTS="$X1/tools/scripts/submodule-updated.sh:$ONL/tools/scripts/submodule-updated.sh"
# Update X1 REPO from ONL build-artifacts
cp -R $ONL/sm/build-artifacts/REPO/* $X1/REPO
export ONLPM_OPTION_PLATFORMS_AMD64='x86-64-accton-as7946-30xb-r0 x86-64-accton-as7316-26xb-r0 x86-64-wistron-wtp-01-02-00-r0 x86-64-accton-as7716-24sc-r0 x86-64-accton-as7716-24xc-r0 x86-64-accton-as7716-32x-r0'
export ONLPM_OPTION_PLATFORMS_ARM64='arm64-wistron-wtp-01-c1-00-r0'
# This incur security risk
sudo chmod 666 /var/run/docker.sock