Advertisement
marietto2020

Untitled

Mar 10th, 2021
503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. x86_64:/ # root@ziomario-Z390-AORUS-PRO:/usr/bin# nano qemu-android
  2.  
  3. run_qemu_on_port()
  4. {
  5. $QEMU -enable-kvm \
  6. -kernel kernel \
  7. -append "root=/dev/ram0 androidboot.selinux=permissive buildvariant=userdebug console=ttyS0 RAMDISK=vdb $DATADEV" \
  8. -initrd initrd.img \
  9. -m 2048 -smp 2 -cpu host \
  10. -usb -device usb-tablet,bus=usb-bus.0 \
  11. -machine vmport=off \
  12. -soundhw ac97 \
  13. -serial mon:stdio \
  14. -boot menu=on \
  15. -drive index=0,if=virtio,id=system,file=$SYSTEMIMG,format=raw,readonly \
  16. -drive index=1,if=virtio,id=ramdisk,file=ramdisk.img,format=raw,readonly \
  17. -netdev user,id=mynet,hostfwd=tcp::$port-:5555 -device virtio-net-pci,netdev=mynet \
  18. $DATA $@
  19. }
  20.  
  21. run_qemu()
  22. {
  23. port=5555
  24. while [ $port -lt 5600 ]; do
  25. run_qemu_on_port $@ && break
  26. let port++
  27. done
  28. }
  29.  
  30. # Try to run QEMU in several VGA modes
  31. run_qemu -vga virtio -display gtk,gl=off $@ || \
  32. run_qemu -vga qxl -display gtk $@ || \
  33. run_qemu -vga std -display gtk $@ || \
  34. run_qemu $@
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement