Update the benchmark linux kernel

This commit is contained in:
Fabing Li 2024-10-08 07:34:22 +00:00 committed by Tate, Hongliang Tian
parent 5402f1fbf7
commit ab7c4f3740
3 changed files with 3 additions and 39 deletions

View File

@ -45,12 +45,6 @@ prepare_system() {
if [ "$SYSTEM" = "linux" ]; then
# Mount necessary fs
mount -t devtmpfs devtmpfs /dev
# Add drivers
depmod
modprobe failover
modprobe net_failover
modprobe virtio_net
modprobe virtio_blk
# Enable network
ip link set lo up
ip link set eth0 up

View File

@ -10,7 +10,7 @@ BENCHMARK_DIR="${BENCHMARK_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." &>/dev/
# Dependencies for Linux
LINUX_DEPENDENCIES_DIR="/opt/linux_binary_cache"
LINUX_KERNEL="${LINUX_DEPENDENCIES_DIR}/vmlinuz"
LINUX_KERNEL_VERSION="5.15.0-105-generic"
LINUX_KERNEL_VERSION="5.15.0-105"
LINUX_MODULES_DIR="${BENCHMARK_DIR}/../build/initramfs/lib/modules/${LINUX_KERNEL_VERSION}/kernel"
WGET_SCRIPT="${BENCHMARK_DIR}/../../tools/atomic_wget.sh"
@ -21,11 +21,7 @@ prepare_libs() {
# Array of files to download and their URLs
declare -A files=(
["${LINUX_KERNEL}"]="https://raw.githubusercontent.com/asterinas/linux_binary_cache/8a5b6fd/vmlinuz-${LINUX_KERNEL_VERSION}"
["${LINUX_DEPENDENCIES_DIR}/virtio_blk.ko"]="https://raw.githubusercontent.com/asterinas/linux_binary_cache/8a5b6fd/kernel/drivers/block/virtio_blk.ko"
["${LINUX_DEPENDENCIES_DIR}/virtio_net.ko"]="https://raw.githubusercontent.com/asterinas/linux_binary_cache/8a5b6fd/kernel/drivers/net/virtio_net.ko"
["${LINUX_DEPENDENCIES_DIR}/net_failover.ko"]="https://raw.githubusercontent.com/asterinas/linux_binary_cache/8a5b6fd/kernel/drivers/net/net_failover.ko"
["${LINUX_DEPENDENCIES_DIR}/failover.ko"]="https://raw.githubusercontent.com/asterinas/linux_binary_cache/8a5b6fd/kernel/net/core/failover.ko"
["${LINUX_KERNEL}"]="https://raw.githubusercontent.com/asterinas/linux_binary_cache/14598b6/vmlinuz-${LINUX_KERNEL_VERSION}"
)
# Download files if they don't exist
@ -38,24 +34,6 @@ prepare_libs() {
}
fi
done
# Copy the kernel modules to the initramfs directory
if [ ! -f "${LINUX_MODULES_DIR}/drivers/block/virtio_blk.ko" ]; then
mkdir -p "${LINUX_MODULES_DIR}/drivers/block"
mkdir -p "${LINUX_MODULES_DIR}/drivers/net"
mkdir -p "${LINUX_MODULES_DIR}/net/core"
declare -A modules=(
["${LINUX_DEPENDENCIES_DIR}/virtio_blk.ko"]="${LINUX_MODULES_DIR}/drivers/block/virtio_blk.ko"
["${LINUX_DEPENDENCIES_DIR}/virtio_net.ko"]="${LINUX_MODULES_DIR}/drivers/net/virtio_net.ko"
["${LINUX_DEPENDENCIES_DIR}/net_failover.ko"]="${LINUX_MODULES_DIR}/drivers/net/net_failover.ko"
["${LINUX_DEPENDENCIES_DIR}/failover.ko"]="${LINUX_MODULES_DIR}/net/core/failover.ko"
)
for src in "${!modules[@]}"; do
sudo cp "$src" "${modules[$src]}"
done
fi
}
# Prepare fs for Linux

View File

@ -30,16 +30,8 @@ RUN apt update && apt-get install -y --no-install-recommends \
WORKDIR /opt/linux_binary_cache
RUN wget https://raw.githubusercontent.com/asterinas/linux_vdso/2a6d2db/vdso64.so -O vdso64.so
RUN wget https://raw.githubusercontent.com/asterinas/linux_binary_cache/8a5b6fd/vmlinuz-5.15.0-105-generic \
RUN wget https://raw.githubusercontent.com/asterinas/linux_binary_cache/14598b6/vmlinuz-5.15.0-105 \
-O vmlinuz
RUN wget https://raw.githubusercontent.com/asterinas/linux_binary_cache/8a5b6fd/kernel/drivers/block/virtio_blk.ko \
-O virtio_blk.ko
RUN wget https://raw.githubusercontent.com/asterinas/linux_binary_cache/8a5b6fd/kernel/drivers/net/net_failover.ko \
-O net_failover.ko
RUN wget https://raw.githubusercontent.com/asterinas/linux_binary_cache/8a5b6fd/kernel/drivers/net/virtio_net.ko \
-O virtio_net.ko
RUN wget https://raw.githubusercontent.com/asterinas/linux_binary_cache/8a5b6fd/kernel/net/core/failover.ko \
-O failover.ko
#= Build benchmark =========================================================