mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-10 13:56:48 +00:00
Update the benchmark linux kernel
This commit is contained in:
parent
5402f1fbf7
commit
ab7c4f3740
@ -45,12 +45,6 @@ prepare_system() {
|
|||||||
if [ "$SYSTEM" = "linux" ]; then
|
if [ "$SYSTEM" = "linux" ]; then
|
||||||
# Mount necessary fs
|
# Mount necessary fs
|
||||||
mount -t devtmpfs devtmpfs /dev
|
mount -t devtmpfs devtmpfs /dev
|
||||||
# Add drivers
|
|
||||||
depmod
|
|
||||||
modprobe failover
|
|
||||||
modprobe net_failover
|
|
||||||
modprobe virtio_net
|
|
||||||
modprobe virtio_blk
|
|
||||||
# Enable network
|
# Enable network
|
||||||
ip link set lo up
|
ip link set lo up
|
||||||
ip link set eth0 up
|
ip link set eth0 up
|
||||||
|
@ -10,7 +10,7 @@ BENCHMARK_DIR="${BENCHMARK_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." &>/dev/
|
|||||||
# Dependencies for Linux
|
# Dependencies for Linux
|
||||||
LINUX_DEPENDENCIES_DIR="/opt/linux_binary_cache"
|
LINUX_DEPENDENCIES_DIR="/opt/linux_binary_cache"
|
||||||
LINUX_KERNEL="${LINUX_DEPENDENCIES_DIR}/vmlinuz"
|
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"
|
LINUX_MODULES_DIR="${BENCHMARK_DIR}/../build/initramfs/lib/modules/${LINUX_KERNEL_VERSION}/kernel"
|
||||||
WGET_SCRIPT="${BENCHMARK_DIR}/../../tools/atomic_wget.sh"
|
WGET_SCRIPT="${BENCHMARK_DIR}/../../tools/atomic_wget.sh"
|
||||||
|
|
||||||
@ -21,11 +21,7 @@ prepare_libs() {
|
|||||||
|
|
||||||
# Array of files to download and their URLs
|
# Array of files to download and their URLs
|
||||||
declare -A files=(
|
declare -A files=(
|
||||||
["${LINUX_KERNEL}"]="https://raw.githubusercontent.com/asterinas/linux_binary_cache/8a5b6fd/vmlinuz-${LINUX_KERNEL_VERSION}"
|
["${LINUX_KERNEL}"]="https://raw.githubusercontent.com/asterinas/linux_binary_cache/14598b6/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"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Download files if they don't exist
|
# Download files if they don't exist
|
||||||
@ -38,24 +34,6 @@ prepare_libs() {
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
done
|
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
|
# Prepare fs for Linux
|
||||||
|
@ -30,16 +30,8 @@ RUN apt update && apt-get install -y --no-install-recommends \
|
|||||||
|
|
||||||
WORKDIR /opt/linux_binary_cache
|
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_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
|
-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 =========================================================
|
#= Build benchmark =========================================================
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user