scripts: Fix the failure to fetch latest guest kernel code on AArch64

The integration script failed to obtain the new guest kernel commit when
the code folder had been existing on CI machine.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
Michael Zhao 2020-11-04 19:46:39 +08:00 committed by Rob Bradford
parent cc637f12f6
commit 5566992422

View File

@ -106,19 +106,25 @@ update_workloads() {
} }
SRCDIR=$PWD SRCDIR=$PWD
if [ ! -d "$LINUX_CUSTOM_DIR" ]; then LINUX_CUSTOM_BRANCH="virtio-fs-virtio-iommu-5.8-rc4"
pushd $WORKLOADS_DIR
time git clone --depth 1 "https://github.com/cloud-hypervisor/linux.git" -b "virtio-fs-virtio-iommu-5.8-rc4" $LINUX_CUSTOM_DIR # Check whether the local HEAD commit same as the remote HEAD or not. Remove the folder if they are different.
cp $SRCDIR/resources/linux-config-aarch64 $LINUX_CUSTOM_DIR/.config if [ -d "$LINUX_CUSTOM_DIR" ]; then
popd
else
pushd $LINUX_CUSTOM_DIR pushd $LINUX_CUSTOM_DIR
git fetch git fetch
git checkout -f "virtio-fs-virtio-iommu-5.8-rc4" LINUX_CUSTOM_LOCAL_HEAD=$(git rev-parse HEAD)
cp $SRCDIR/resources/linux-config-aarch64 $LINUX_CUSTOM_DIR/.config LINUX_CUSTOM_REMOTE_HEAD=$(git rev-parse remotes/origin/$LINUX_CUSTOM_BRANCH)
popd popd
if [ "$LINUX_CUSTOM_LOCAL_HEAD" != "$LINUX_CUSTOM_REMOTE_HEAD" ]; then
rm -rf "$LINUX_CUSTOM_DIR"
fi
fi fi
if [ ! -d "$LINUX_CUSTOM_DIR" ]; then
time git clone --depth 1 "https://github.com/cloud-hypervisor/linux.git" -b $LINUX_CUSTOM_BRANCH $LINUX_CUSTOM_DIR
fi
cp $SRCDIR/resources/linux-config-aarch64 $LINUX_CUSTOM_DIR/.config
build_custom_linux_kernel build_custom_linux_kernel
VIRTIOFSD="$WORKLOADS_DIR/virtiofsd" VIRTIOFSD="$WORKLOADS_DIR/virtiofsd"