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.

make-clean-vm 911B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/sh
  2. set -e
  3. SUITE=lucid
  4. ARCH=amd64
  5. usage() {
  6. echo "Usage: ${0##*/} [OPTION]..."
  7. echo "Make a clean copy of the base client."
  8. echo
  9. cat << EOF
  10. --help display this help and exit
  11. --suite U build suite U instead of lucid
  12. --arch A build architecture A (e.g. i386) instead of amd64
  13. EOF
  14. }
  15. if [ $# != 0 ] ; then
  16. while true ; do
  17. case "$1" in
  18. --help|-h)
  19. usage
  20. exit 0
  21. ;;
  22. --suite|-s)
  23. SUITE="$2"
  24. shift 2
  25. ;;
  26. --arch|-a)
  27. ARCH="$2"
  28. shift 2
  29. ;;
  30. --*)
  31. echo "unrecognized option $1"
  32. exit 1
  33. ;;
  34. *)
  35. break
  36. ;;
  37. esac
  38. done
  39. fi
  40. BASE=base-$SUITE-$ARCH
  41. OUT=target-$SUITE-$ARCH
  42. if [ -z "$USE_LXC" ]; then
  43. qemu-img create -f qcow2 -o backing_file="$BASE.qcow2" "$OUT.qcow2"
  44. else
  45. cp -a $BASE $OUT
  46. on-target -u root bash < target-bin/bootstrap-fixup
  47. fi