From 0757878b804225bbedb176886e13793866aa0c15 Mon Sep 17 00:00:00 2001 From: Gulshan Singh Date: Wed, 18 Jan 2023 18:33:50 -0800 Subject: [PATCH] Update qemu image download script --- .gitignore | 6 ++---- tests/qemu-tests/download_images.sh | 26 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 532640bc4..36f7f7793 100644 --- a/.gitignore +++ b/.gitignore @@ -76,10 +76,8 @@ tests/**/binaries/div_zero_binary/core tests/**/binaries/div_zero_binary/binary !tests/**/binaries/*.go -# QEMU test files -tests/qemu-tests/Image* -tests/qemu-tests/bzImage* -tests/qemu-tests/rootfs*.img +# QEMU test images +tests/qemu-tests/images # VS Code files .vscode/ diff --git a/tests/qemu-tests/download_images.sh b/tests/qemu-tests/download_images.sh index 5eee00b85..760d2810c 100755 --- a/tests/qemu-tests/download_images.sh +++ b/tests/qemu-tests/download_images.sh @@ -2,12 +2,26 @@ set -o errexit +OUT_DIR=images URL="https://github.com/gsingh93/linux-exploit-dev-env/releases/latest/download" -wget "$URL/rootfs-x86_64.img" -wget "$URL/rootfs-arm64.img" +mkdir -p "${OUT_DIR}" -wget "$URL/bzImage-linux-x86_64" -wget "$URL/bzImage-ack-x86_64" -wget "$URL/Image-linux-arm64" -wget "$URL/Image-ack-arm64" +for arch in x86_64 arm64; do + file="rootfs-${arch}.img" + wget "${URL}/${file}" -O "${OUT_DIR}/${file}" + + file="vmlinux-linux-${arch}" + wget "${URL}/${file}" -O "${OUT_DIR}/${file}" + + file="vmlinux-ack-${arch}" + wget "${URL}/${file}" -O "${OUT_DIR}/${file}" +done + +for kernel_type in ack linux; do + file="bzImage-${kernel_type}-x86_64" + wget "${URL}/${file}" -O "${OUT_DIR}/${file}" + + file="Image-${kernel_type}-arm64" + wget "${URL}/${file}" -O "${OUT_DIR}/${file}" +done