diff --git a/.gitignore b/.gitignore index d2c5f5fba7..8dcc4f5b79 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,8 @@ *~ [._]*.s[a-w][a-z] +# Any qcow images created from get-image script +*.qcow2 + .tox/ .buildconf diff --git a/devenv/get-image.sh b/devenv/get-image.sh new file mode 100755 index 0000000000..e6c43b97bd --- /dev/null +++ b/devenv/get-image.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# This script expects the following to be installed: +# curl, libguestfs-tools-c + +IMAGE=Fedora-Cloud-Base-20141203-21.x86_64.qcow2 +TARGET_DIR=/var/lib/libvirt/images +TARGET=fedora-21-x86_64 + +if ! [ -f "$IMAGE" ]; then + echo "Downloading $IMAGE" + curl -O http://archive.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64/$IMAGE +fi + +echo "Copying $IMAGE to $TARGET" +cp "$IMAGE" $TARGET_DIR/$TARGET + +PACKAGES="git,tcpdump" + +virt-customize \ + --add $TARGET_DIR/$TARGET \ + --install $PACKAGES \ + --update \ + --install $PACKAGES \ + --run-command "yum clean all" \ + --run-command "cat > /etc/sysconfig/network-scripts/ifcfg-eth1 <