From 2aabb7bf478ee8e75522e96252c4120365a7327d Mon Sep 17 00:00:00 2001 From: Albrecht Lohofener Date: Tue, 3 Dec 2024 11:07:45 +0100 Subject: [PATCH] Add x86_64 qemu development script --- ...-boot-qemu.sh => dev-boot-qemu-aarch64.sh} | 0 dev_tools/dev-boot-qemu-x86_64.sh | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+) rename dev_tools/{dev-boot-qemu.sh => dev-boot-qemu-aarch64.sh} (100%) create mode 100755 dev_tools/dev-boot-qemu-x86_64.sh diff --git a/dev_tools/dev-boot-qemu.sh b/dev_tools/dev-boot-qemu-aarch64.sh similarity index 100% rename from dev_tools/dev-boot-qemu.sh rename to dev_tools/dev-boot-qemu-aarch64.sh diff --git a/dev_tools/dev-boot-qemu-x86_64.sh b/dev_tools/dev-boot-qemu-x86_64.sh new file mode 100755 index 0000000..97247ba --- /dev/null +++ b/dev_tools/dev-boot-qemu-x86_64.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# +# boots an OpenWrt aarch64 image with qemu for development purposes +# +# Copyright Albrecht Lohofener 2024 +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# Assign arguments to variables +IMAGE_FILE="$1" +SSH_PORT=8022 + +qemu-system-x86_64 -M pc -nographic -nodefaults -m 256 --enable-kvm \ +-blockdev driver=raw,node-name=hd0,cache.direct=on,file.driver=file,file.filename=$IMAGE_FILE \ +-device virtio-blk-pci,drive=hd0 \ +-device virtio-net,netdev=qlan0 -netdev user,id=qlan0,net=192.168.1.0/24,hostfwd=tcp::$SSH_PORT-192.168.1.1:22 \ +-device virtio-net,netdev=qwan0 -netdev user,id=qwan0 \ +-serial stdio \ No newline at end of file