mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
ci: AArch64: Refactor custom linux kernel building strategy
As the current AArch64 integration test builds kernel every time, which would take unnecessary time in CI and therefore not ideal. This commit refactors the AArch64 kernel building strategy to: 1. Keep the Linux kernel source code directory instead of deleting it everytime after the kernel is built. 2. In integration test script, check if the Linux kernel source code directory exists. If so use `git fetch && git checkout -f` to keep the source code always updated, else run `git clone` to get the source code. 3. Copy config file in and then compile the kernel. Fixes: https://github.com/cloud-hypervisor/cloud-hypervisor/issues/1444 Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
parent
dc55e45977
commit
e81402e76e
@ -104,30 +104,27 @@ PE_IMAGE="$WORKLOADS_DIR/Image"
|
||||
LINUX_CUSTOM_DIR="$WORKLOADS_DIR/linux-custom"
|
||||
|
||||
build_custom_linux_kernel() {
|
||||
SRCDIR=$PWD
|
||||
pushd $WORKLOADS_DIR
|
||||
time git clone --depth 1 "https://github.com/cloud-hypervisor/linux.git" -b "virtio-fs-virtio-iommu-virtio-mem-5.6-rc4" $LINUX_CUSTOM_DIR
|
||||
cp $SRCDIR/resources/linux-config-aarch64 $LINUX_CUSTOM_DIR/.config
|
||||
popd
|
||||
|
||||
pushd $LINUX_CUSTOM_DIR
|
||||
time make -j `nproc`
|
||||
cp arch/arm64/boot/Image $WORKLOADS_DIR/Image || exit 1
|
||||
popd
|
||||
}
|
||||
|
||||
if [ ! -f "$PE_IMAGE" ]; then
|
||||
build_custom_linux_kernel
|
||||
if [ ! -d "$LINUX_CUSTOM_DIR" ]; then
|
||||
pushd $WORKLOADS_DIR
|
||||
time git clone --depth 1 "https://github.com/cloud-hypervisor/linux.git" -b "virtio-fs-virtio-iommu-virtio-mem-5.6-rc4" $LINUX_CUSTOM_DIR
|
||||
popd
|
||||
|
||||
else
|
||||
SRCDIR=$PWD
|
||||
if [ "$PE_IMAGE" -ot "$SRCDIR/resources/linux-config-aarch64" ]; then
|
||||
build_custom_linux_kernel
|
||||
fi
|
||||
pushd $LINUX_CUSTOM_DIR
|
||||
git fetch
|
||||
git checkout -f
|
||||
popd
|
||||
fi
|
||||
|
||||
if [ -d "$LINUX_CUSTOM_DIR" ]; then
|
||||
rm -rf $LINUX_CUSTOM_DIR
|
||||
fi
|
||||
SRCDIR=$PWD
|
||||
cp $SRCDIR/resources/linux-config-aarch64 $LINUX_CUSTOM_DIR/.config
|
||||
build_custom_linux_kernel
|
||||
|
||||
VIRTIOFSD="$WORKLOADS_DIR/virtiofsd"
|
||||
QEMU_DIR="qemu_build"
|
||||
|
Loading…
Reference in New Issue
Block a user