gitian-builder/libexec/make-clean-vm

54 lines
889 B
Plaintext
Raw Normal View History

2012-04-22 05:44:00 +00:00
#!/bin/sh
set -e
SUITE=lucid
ARCH=amd64
usage() {
echo "Usage: ${0##*/} [OPTION]..."
echo "Make a clean copy of the base client."
echo
cat << EOF
--help display this help and exit
--suite U build suite U instead of lucid
--arch A build architecture A (e.g. i386) instead of amd64
EOF
}
if [ $# != 0 ] ; then
while true ; do
case "$1" in
--help|-h)
usage
exit 0
;;
--suite|-s)
SUITE="$2"
shift 2
;;
--arch|-a)
ARCH="$2"
shift 2
;;
--*)
echo "unrecognized option $1"
exit 1
;;
*)
break
;;
esac
done
fi
BASE=base-$SUITE-$ARCH-root
OUT=target-$SUITE-$ARCH-root
if [ -z "$USE_LXC" ]; then
cp $BASE.qcow2 $OUT.qcow2
else
sudo rm -rf $OUT
sudo cp -a $BASE $OUT
on-target -u root useradd -m ubuntu
fi