Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2019-11-07,master
>---------------------------------------------------------------
commit 07ec866ada56ce5896bcc6ac9ff804753a0ad8e4
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sat Oct 26 22:06:05 2019 +0000
doc: open-mesh/Kernel_hacking_Debian_image
>---------------------------------------------------------------
07ec866ada56ce5896bcc6ac9ff804753a0ad8e4
open-mesh/Kernel_hacking_Debian_image.textile | 46 ++++++++++++++++-----------
1 file changed, 27 insertions(+), 19 deletions(-)
diff --git a/open-mesh/Kernel_hacking_Debian_image.textile b/open-mesh/Kernel_hacking_Debian_image.textile
index 861d1e3..891e93a 100644
--- a/open-mesh/Kernel_hacking_Debian_image.textile
+++ b/open-mesh/Kernel_hacking_Debian_image.textile
@@ -301,29 +301,37 @@ cat > run.sh << "EOF"
#! /bin/sh
if [ -z "${STY}" ]; then
- echo "must be started inside a screen session" >&2
- exit 1
+ echo "must be started inside a screen session" >&2
+ exit 1
fi
SHARED_PATH=/home/sven/tmp/qemu-batman/
+NUM_SESSIONS=5
+
+for i in $(seq 1 "${NUM_SESSIONS}"); do
+ if [ ! -e "/sys/class/net/tap${i}" ]; then
+ echo "hub script must be started first to create tap$i interface" >&2
+ exit 1
+ fi
+done
-for i in $(seq 1 5); do
- qemu-img create -b debian.img -f qcow2 root.cow$i
- normalized_id="$(echo "$i"|awk '{ printf "%02d\n",$1 }')"
- twodigit_id="$(echo $i|awk '{ printf "%02X", $1 }')"
- screen qemu-system-x86_64 -enable-kvm -name "debian${i}" \
- -kernel linux-next/arch/x86/boot/bzImage -append "root=/dev/vda rw console=ttyS0 nokaslr" \
- -display none -no-user-config -nodefaults \
- -m 512 -device virtio-balloon \
- -cpu host -smp 2 -machine q35,accel=kvm,usb=off,dump-guest-core=off \
- -drive file=root.cow$i,if=virtio,cache=unsafe \
- -nic tap,ifname=tap$i,script=no,model=virtio-net-pci,mac=02:ba:de:af:fe:"${twodigit_id}" \
- -nic user,model=virtio-net-pci,mac=06:ba:de:af:fe:"${twodigit_id}" \
- -virtfs local,path="${SHARED_PATH}",security_model=none,mount_tag=host \
- -gdb tcp:127.0.0.1:$((23000+$i)) \
- -device virtio-rng-pci \
- -serial mon:stdio
- sleep 1
+for i in $(seq 1 "${NUM_SESSIONS}"); do
+ qemu-img create -b debian.img -f qcow2 root.cow$i
+ normalized_id="$(echo "$i"|awk '{ printf "%02d\n",$1 }')"
+ twodigit_id="$(echo $i|awk '{ printf "%02X", $1 }')"
+ screen qemu-system-x86_64 -enable-kvm -name "debian${i}" \
+ -kernel linux-next/arch/x86/boot/bzImage -append "root=/dev/vda rw console=ttyS0 nokaslr" \
+ -display none -no-user-config -nodefaults \
+ -m 512 -device virtio-balloon \
+ -cpu host -smp 2 -machine q35,accel=kvm,usb=off,dump-guest-core=off \
+ -drive file=root.cow$i,if=virtio,cache=unsafe \
+ -nic tap,ifname=tap$i,script=no,model=virtio-net-pci,mac=02:ba:de:af:fe:"${twodigit_id}" \
+ -nic user,model=virtio-net-pci,mac=06:ba:de:af:fe:"${twodigit_id}" \
+ -virtfs local,path="${SHARED_PATH}",security_model=none,mount_tag=host \
+ -gdb tcp:127.0.0.1:$((23000+$i)) \
+ -device virtio-rng-pci \
+ -serial mon:stdio
+ sleep 1
done
EOF