You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

start-target 982B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. . gconfig
  3. ARCH=qemu$1
  4. SUFFIX=$2
  5. VMSW=KVM
  6. if [ -n "$USE_LXC" ]; then
  7. VMSW=LXC
  8. elif [ -n "$USE_VBOX" ]; then
  9. VMSW=VBOX
  10. elif [ -n "$USE_DOCKER" ]; then
  11. VMSW=DOCKER
  12. fi
  13. case $VMSW in
  14. KVM)
  15. case $ARCH in
  16. qemu32)
  17. [ -n "$KVM" ] || KVM=qemu-system-i386
  18. ;;
  19. qemu64)
  20. [ -n "$KVM" ] || KVM=qemu-system-x86_64
  21. ;;
  22. esac
  23. $KVM -enable-kvm -m ${VMEM:-2000} -smp ${NPROCS:-2} -drive file=target-$SUFFIX.qcow2,cache=writeback,if=virtio -net nic,model=virtio -net user,hostfwd=tcp:127.0.0.1:$VM_SSH_PORT-:22 -vnc 127.0.0.1:16 > var/target.log 2>&1 &
  24. echo $! > var/target.pid
  25. wait
  26. rm var/target.pid
  27. ;;
  28. LXC)
  29. true #sudo lxc-start -n gitian -c var/target.log -f lxc.config
  30. ;;
  31. VBOX)
  32. VBoxManage startvm "Gitian-${2}" --type headless
  33. echo "Gitian-${2}" > var/target.vmname
  34. ;;
  35. DOCKER)
  36. docker run -d --name gitian-target base-$SUFFIX:latest > /dev/null
  37. ;;
  38. esac