mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
scripts: Use the same linux kernel build function everywhere
This commit unifies the custom linux kernel build in x86, Arm, and performance metrics to the same function. Therefore, when bumping the kernel version, we can make sure we only need to make the change in one place. Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
@@ -42,6 +42,28 @@ checkout_repo() {
|
||||
fi
|
||||
}
|
||||
|
||||
build_custom_linux() {
|
||||
ARCH=$(uname -m)
|
||||
SRCDIR=$PWD
|
||||
LINUX_CUSTOM_DIR="$WORKLOADS_DIR/linux-custom"
|
||||
LINUX_CUSTOM_BRANCH="ch-5.15.12"
|
||||
LINUX_CUSTOM_URL="https://github.com/cloud-hypervisor/linux.git"
|
||||
|
||||
checkout_repo "$LINUX_CUSTOM_DIR" "$LINUX_CUSTOM_URL" "$LINUX_CUSTOM_BRANCH"
|
||||
|
||||
cp $SRCDIR/resources/linux-config-${ARCH} $LINUX_CUSTOM_DIR/.config
|
||||
|
||||
pushd $LINUX_CUSTOM_DIR
|
||||
make -j `nproc`
|
||||
if [ ${ARCH} == "x86_64" ]; then
|
||||
cp vmlinux "$WORKLOADS_DIR/" || exit 1
|
||||
elif [ ${ARCH} == "aarch64" ]; then
|
||||
cp arch/arm64/boot/Image "$WORKLOADS_DIR/" || exit 1
|
||||
cp arch/arm64/boot/Image.gz "$WORKLOADS_DIR/" || exit 1
|
||||
fi
|
||||
popd
|
||||
}
|
||||
|
||||
cmd_help() {
|
||||
echo ""
|
||||
echo "Cloud Hypervisor $(basename $0)"
|
||||
|
||||
Reference in New Issue
Block a user