1
0

GO9PRUN 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. trap : 2
  2. $HARVEY/util/ufs -root=$HARVEY &
  3. ufspid=$!
  4. export machineflag=pc
  5. if [ "$(uname)" = "Linux" ] && [ -e /dev/kvm ]; then
  6. export kvmflag='-enable-kvm'
  7. export machineflag='pc,accel=kvm'
  8. if [ ! -w /dev/kvm ]; then
  9. # we don't have access as a regular user
  10. export kvmdo=sudo
  11. fi
  12. fi
  13. read -r cmd <<EOF
  14. $kvmdo qemu-system-x86_64 -s -cpu Opteron_G1 -smp 1 -m 2048 $kvmflag \
  15. -serial stdio \
  16. --machine pc,accel=kvm \
  17. -net nic,model=rtl8139 \
  18. -net user,hostfwd=tcp::5555-:1522 \
  19. -net dump,file=/tmp/vm0.pcap \
  20. -redir tcp:9999::9 \
  21. -redir tcp:17010::17010 \
  22. -redir tcp:17013::17013 \
  23. -append "service=cpu nobootprompt=tcp maxcores=1024 fs=10.0.2.2 auth=10.0.2.2 nvram=/boot/nvram nvrlen=512 nvroff=0" \
  24. -kernel harvey.32bit $*
  25. EOF
  26. echo $cmd
  27. eval $cmd
  28. kill $ufspid
  29. wait
  30. # -nographic \
  31. #-S -gdb tcp::1234 \
  32. # -nographic \
  33. #-kernel mnt/hdd/kernel $*
  34. # if you need the dump.
  35. #-net dump,file=/tmp/vm0.pcap \
  36. #sudo qemu-system-x86_64 -s -cpu phenom -smp 8 -m 4096 -nographic \
  37. #-net nic,model=rtl8139 mnt/hdd268mb.img \
  38. #-net user,hostfwd=tcp::5555-:23 \
  39. #-net dump,file=/tmp/vm0.pcap \
  40. #-kernel mnt/hdd/kernel $*
  41. #
  42. #sudo qemu-system-x86_64 -s -cpu phenom -smp 8 -m 6024 -nographic -net nic,model=rtl8139 mnt/hdd268mb.img -netdev user,id=mynet0 -kernel mnt/hdd/kernel $*
  43. #sudo qemu-system-x86_64 -s -cpu phenom -smp 8 -m 6024 -nographic -net nic,model=rtl8139 mnt/hdd268mb.img -netdev user,id=mynet0,net=192.168.76.0/24,dhcpstart=192.168.76.9 -kernel mnt/hdd/kernel $*
  44. #