2020-12-21 01:31:10 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-05-24 11:25:12 -05:00
|
|
|
[[ ! -z "${DBGOPT}" && $0 =~ ${DBGOPT} ]] && set -x
|
2022-12-11 19:20:56 -06:00
|
|
|
|
|
|
|
SCRIPT_SRC_PATH=src/sonic-build-hooks
|
|
|
|
if [ -e ${SCRIPT_SRC_PATH} ]; then
|
2023-05-24 11:25:12 -05:00
|
|
|
. ${SCRIPT_SRC_PATH}/scripts/utils.sh
|
2022-12-11 19:20:56 -06:00
|
|
|
fi
|
|
|
|
|
|
|
|
ARCH=$1
|
|
|
|
DISTRO=$2
|
|
|
|
TARGET=$3
|
|
|
|
FILESYSTEM_ROOT=$4
|
2020-12-21 01:31:10 -06:00
|
|
|
VERSIONS_PATH=$TARGET/versions/host-image
|
2022-12-01 18:28:45 -06:00
|
|
|
IMAGENAME="host-image"
|
2020-12-21 01:31:10 -06:00
|
|
|
|
2021-01-03 03:32:20 -06:00
|
|
|
[ -d $VERSIONS_PATH ] && sudo rm -rf $VERSIONS_PATH
|
2020-12-21 01:31:10 -06:00
|
|
|
mkdir -p $VERSIONS_PATH
|
|
|
|
|
2022-12-01 18:28:45 -06:00
|
|
|
mkdir -p target/vcache/${IMAGENAME}
|
|
|
|
sudo LANG=C chroot $FILESYSTEM_ROOT post_run_buildinfo ${IMAGENAME}
|
2020-12-21 01:31:10 -06:00
|
|
|
|
|
|
|
cp -r $FILESYSTEM_ROOT/usr/local/share/buildinfo/pre-versions $VERSIONS_PATH/
|
|
|
|
cp -r $FILESYSTEM_ROOT/usr/local/share/buildinfo/post-versions $VERSIONS_PATH/
|
2022-12-11 19:20:56 -06:00
|
|
|
|
|
|
|
sudo LANG=C chroot $FILESYSTEM_ROOT post_run_cleanup ${IMAGENAME}
|