Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2019-11-07,master
commit d3b5af4dc33a422a73cab0eb408836ad6c7b08d0 Author: Sven Eckelmann sven@narfation.org Date: Sat Oct 26 22:30:41 2019 +0000
doc: open-mesh/Kernel_hacking_Debian_image
d3b5af4dc33a422a73cab0eb408836ad6c7b08d0 open-mesh/Kernel_hacking_Debian_image.textile | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/open-mesh/Kernel_hacking_Debian_image.textile b/open-mesh/Kernel_hacking_Debian_image.textile index 891e93a..93ec52a 100644 --- a/open-mesh/Kernel_hacking_Debian_image.textile +++ b/open-mesh/Kernel_hacking_Debian_image.textile @@ -298,15 +298,22 @@ The @SHARED_PATH@ in run.sh has to be changed to a valid path which is used to s
<pre> cat > run.sh << "EOF" -#! /bin/sh +#! /bin/bash
if [ -z "${STY}" ]; then echo "must be started inside a screen session" >&2 exit 1 fi
-SHARED_PATH=/home/sven/tmp/qemu-batman/ +SHARED_PATH="$(pwd)" NUM_SESSIONS=5 +BASE_IMG=debian.img + +BOOTARGS=() +BOOTARGS+=("-kernel") +BOOTARGS+=("linux-next/arch/x86/boot/bzImage") +BOOTARGS+=("-append") +BOOTARGS+=("root=/dev/vda rw console=ttyS0 nokaslr")
for i in $(seq 1 "${NUM_SESSIONS}"); do if [ ! -e "/sys/class/net/tap${i}" ]; then @@ -316,11 +323,12 @@ for i in $(seq 1 "${NUM_SESSIONS}"); do done
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" \ + + qemu-img create -b "${BASE_IMG}" -f qcow2 root.cow$i + screen qemu-system-x86_64 -enable-kvm -name "instance${i}" \ + "${BOOTARGS[@]}" \ -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 \