55a707586b
* Support SONiC reproduceable build for deb/py2/py3/web * Remove j2 files * Fix bug * Fix some issues 1. Change some code format issues 2. Fix curl calling wget command, pip2 calling pip3 issue 3. Fix wget/curl downloading multiple urls issue * Fix some code format issue * Fix bug * Fix bug * Fix command path hard code in build info scripts issue * Add debian package sonic-build-tools * Fix auto debian package removed issue * Change build debian package name, and change the folder * Collect the pre-versions and post-versions * Change to use debian:buster * Remove apt-mark and improve code * Remove set_build_hooks * Change docker trusted gpg files * Fix docker build COPY directory name issue * Move the trusted gpg files into the sonic-build-hooks package
30 lines
1.0 KiB
Bash
Executable File
30 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
|
|
ARCH=$1
|
|
DISTRO=$2
|
|
FILESYSTEM_ROOT=$3
|
|
|
|
. /usr/local/share/buildinfo/scripts/buildinfo_base.sh
|
|
VERSION_DEB_PREFERENCE="01-versions-deb"
|
|
BUILDINFO_PATH=${FILESYSTEM_ROOT}/usr/local/share/buildinfo
|
|
BUILDINFO_VERSION_PATH=${FILESYSTEM_ROOT}/usr/local/share/buildinfo/versions
|
|
BUILDINFO_VERSION_DEB=${BUILDINFO_VERSION_PATH}/${VERSION_DEB_PREFERENCE}
|
|
OVERRIDE_VERSION_PATH=files/build/versions/host-image
|
|
DIFF_VERSIONS_PATH=$BUILDINFO_PATH/diff-versions
|
|
|
|
mkdir -p $BUILDINFO_PATH
|
|
|
|
# Copy the build info config
|
|
cp -rf src/sonic-build-hooks/buildinfo/* $BUILDINFO_PATH/
|
|
|
|
# Generate version lock files
|
|
scripts/versions_manager.py generate -t "$BUILDINFO_VERSION_PATH" -m "$OVERRIDE_VERSION_PATH" -d "$DISTRO" -a "$ARCH"
|
|
|
|
if [ "$ENABLE_VERSION_CONTROL_DEB" == "y" ]; then
|
|
cp -f $BUILDINFO_VERSION_DEB ${FILESYSTEM_ROOT}/etc/apt/preferences.d/
|
|
fi
|
|
|
|
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "dpkg -i /usr/local/share/buildinfo/sonic-build-hooks_1.0_all.deb"
|
|
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "pre_run_buildinfo"
|