39 lines
1.3 KiB
Bash
Executable File
39 lines
1.3 KiB
Bash
Executable File
#! /bin/bash
|
|
|
|
SOURCE=${BASH_SOURCE[0]}
|
|
W=$(dirname "$(readlink -f "$SOURCE")")
|
|
|
|
# shellcheck disable=SC1091
|
|
source "/media/work/sdk/diya-emu/environment-setup-core2-64-poky-linux"
|
|
|
|
# runqemu "$W/core-image-base-qemux86-64.rootfs.qemuboot.conf" -d kvm sdl gl-es
|
|
|
|
CMD_IPUP=$(which runqemu-ifup)
|
|
CMD_UPDOWN=$(which runqemu-ifdown)
|
|
|
|
GID=$(id -g)
|
|
|
|
# sudo $CMD_UPDOWN tap0 || true
|
|
tapid=$(sudo $CMD_IPUP $GID)
|
|
|
|
echo "Network interface: $tapid"
|
|
# export LIBGL_ALWAYS_INDIRECT=0
|
|
# printenv
|
|
qemu-system-x86_64 \
|
|
-device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:02 \
|
|
-netdev tap,id=net0,ifname=$tapid,script=no,downscript=no \
|
|
-object rng-random,filename=/dev/urandom,id=rng0 \
|
|
-device virtio-rng-pci,rng=rng0 \
|
|
-drive file=$W/core-image-base-qemux86-64.rootfs.ext4,if=virtio,format=raw \
|
|
-usb -device usb-tablet -usb -device usb-kbd -cpu IvyBridge \
|
|
-machine q35,i8042=off -smp 4 -enable-kvm -m 256 -serial mon:vc -serial null \
|
|
-device virtio-vga-gl -display sdl,gl=es,show-cursor=on \
|
|
-kernel $W/bzImage \
|
|
-cpu host \
|
|
-append 'root=/dev/vda rw ip=192.168.7.2::192.168.7.1:255.255.255.0::eth0:off:8.8.8.8 net.ifnames=0 oprofile.timer=1 tsc=reliable no_timer_check rcupdate.rcu_expedited=1 swiotlb=0 '
|
|
|
|
echo "Cleanup $tapid"
|
|
|
|
sudo $CMD_UPDOWN $tapid
|
|
|