diff --git a/test/benchmark/bench_linux_and_aster.sh b/test/benchmark/bench_linux_and_aster.sh index c1f249d4e..14aadeac7 100755 --- a/test/benchmark/bench_linux_and_aster.sh +++ b/test/benchmark/bench_linux_and_aster.sh @@ -13,15 +13,21 @@ BENCHMARK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" # Kernel image KERNEL_DIR="/root/dependency" LINUX_KERNEL="${KERNEL_DIR}/vmlinuz" +KERNEL_VERSION="5.15.0-105-generic" +MODULES_DIR="${BENCHMARK_DIR}/../build/initramfs/lib/modules/${KERNEL_VERSION}/kernel" # Atomic wget script WGET_SCRIPT="${BENCHMARK_DIR}/../../tools/atomic_wget.sh" # Generate entrypoint script for Linux cases +# TODO: Disable optimize-related features in Linux's ext2 using 'mkfs.ext2 -O ^[feature]' generate_entrypoint_script() { local benchmark="$1" local init_script=$(cat <&1 | tee ${linux_output}" @@ -66,7 +74,12 @@ run_benchmark() { if [ ! -f "${LINUX_KERNEL}" ]; then echo "Downloading the Linux kernel image..." mkdir -p "${KERNEL_DIR}" - ${WGET_SCRIPT} "${LINUX_KERNEL}" "https://raw.githubusercontent.com/asterinas/linux_kernel/9e66d28/vmlinuz-5.15.0-105-generic" + ${WGET_SCRIPT} "${LINUX_KERNEL}" "https://raw.githubusercontent.com/asterinas/linux_kernel/9e66d28/vmlinuz-${KERNEL_VERSION}" + fi + if [ ! -f "${MODULES_DIR}" ]; then + echo "Downloading additional kernel modules..." + mkdir -p "${MODULES_DIR}/drivers/block" + ${WGET_SCRIPT} "${MODULES_DIR}/drivers/block/virtio_blk.ko" "https://raw.githubusercontent.com/asterinas/linux_kernel/f938bde/modules/virtio_blk.ko" fi echo "Running benchmark ${benchmark} on Linux and Asterinas..."