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.

copy-from-target 1014B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. . gconfig
  3. TUSER=${DISTRO:-ubuntu}
  4. QUIET_FLAG=
  5. usage() {
  6. echo "Usage: ${0##*/} [OPTION]... <command>"
  7. echo "Run command on build target."
  8. echo
  9. cat << EOF
  10. --help display this help and exit
  11. --user=U run as U instead of ubuntu
  12. EOF
  13. }
  14. if [ $# != 0 ] ; then
  15. while true ; do
  16. case "$1" in
  17. --help|-h)
  18. usage
  19. exit 0
  20. ;;
  21. --user|-u)
  22. TUSER="$2"
  23. shift 2
  24. ;;
  25. --quiet|-q)
  26. QUIET_FLAG="-q"
  27. shift 1
  28. ;;
  29. --*)
  30. echo "unrecognized option $1"
  31. exit 1
  32. ;;
  33. *)
  34. break
  35. ;;
  36. esac
  37. done
  38. fi
  39. if [ $# = 0 ] ; then
  40. usage
  41. exit 1
  42. fi
  43. if [ -z "$USE_LXC" ]; then
  44. scp $QUIET_FLAG -oConnectTimeout=30 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_rsa -P $VM_SSH_PORT -r $TUSER@localhost:$1 $2
  45. else
  46. config-lxc
  47. sudo $LXC_EXECUTE -n gitian -f var/lxc.config -- sudo -i -u $TUSER tar -C `dirname "$1"` -cf - `basename "$1"` | tar -C "$2" -xf -
  48. fi