2020-12-21 01:31:10 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-12-11 19:20:56 -06:00
|
|
|
[[ ! -z "${DBGOPT}" && $0 =~ ${DBGOPT} ]] && set -x
|
|
|
|
|
2020-12-21 01:31:10 -06:00
|
|
|
SLAVE_DIR=$1
|
|
|
|
ARCH=$2
|
|
|
|
DISTRO=$3
|
|
|
|
|
2021-01-05 05:05:13 -06:00
|
|
|
# Install the latest debian package sonic-build-hooks in the slave container
|
2022-12-11 19:20:56 -06:00
|
|
|
sudo dpkg -i --force-overwrite $SLAVE_DIR/buildinfo/sonic-build-hooks_*.deb &> /dev/null
|
2021-01-05 05:05:13 -06:00
|
|
|
|
2020-12-21 01:31:10 -06:00
|
|
|
# Enable the build hooks
|
2022-12-11 19:20:56 -06:00
|
|
|
sudo symlink_build_hooks
|
|
|
|
|
|
|
|
# set the global permissions
|
|
|
|
sudo chmod -f 777 /usr/local/share/buildinfo/ -R
|
2020-12-21 01:31:10 -06:00
|
|
|
|
|
|
|
# Build the slave running config
|
|
|
|
cp -rf $SLAVE_DIR/buildinfo/* /usr/local/share/buildinfo/
|
|
|
|
. /usr/local/share/buildinfo/scripts/buildinfo_base.sh
|
|
|
|
|
2022-03-30 23:37:53 -05:00
|
|
|
# Enable reproducible mirrors
|
|
|
|
set_reproducible_mirrors
|
|
|
|
apt-get update > /dev/null 2>&1
|
|
|
|
|
2020-12-21 01:31:10 -06:00
|
|
|
# Build the slave version config
|
|
|
|
[ -d /usr/local/share/buildinfo/versions ] && rm -rf /usr/local/share/buildinfo/versions
|
|
|
|
scripts/versions_manager.py generate -t "/usr/local/share/buildinfo/versions" -n "build-${SLAVE_DIR}" -d "$DISTRO" -a "$ARCH"
|
2022-12-11 19:20:56 -06:00
|
|
|
touch ${BUILDINFO_PATH}/versions/versions-deb ${BUILDINFO_PATH}/versions/versions-web
|
2020-12-21 01:31:10 -06:00
|
|
|
|
2022-12-11 19:20:56 -06:00
|
|
|
sudo rm -f /etc/apt/preferences.d/01-versions-deb
|
|
|
|
([ "$ENABLE_VERSION_CONTROL_DEB" == "y" ] && [ -f $VERSION_DEB_PREFERENCE ]) && sudo cp -f $VERSION_DEB_PREFERENCE /etc/apt/preferences.d/
|
2020-12-21 01:31:10 -06:00
|
|
|
exit 0
|