mirror of
https://github.com/Telecominfraproject/oopt-goldstone.git
synced 2026-01-27 02:21:48 +00:00
* Goldstone support for as7946-30xb platform * sm/ONL: updated to include AS7946-30XB support
76 lines
2.4 KiB
Bash
76 lines
2.4 KiB
Bash
#!/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
|