diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-02-17 00:30:13 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-02-17 00:30:13 +0000 |
| commit | 451f54ae7075abef76705b5b916d97feccca3b78 (patch) | |
| tree | 94ab2cb649f968ec88313115f229df06d67cef66 | |
| parent | ddc12789bc0536a2a5dec419124817de9152d292 (diff) | |
| parent | fd6d4376b95cc3a8465aa0079253a6af3056a92c (diff) | |
| download | kolla-451f54ae7075abef76705b5b916d97feccca3b78.tar.gz kolla-451f54ae7075abef76705b5b916d97feccca3b78.zip | |
Merge "Implements: Blueprint update-image-build-script"
| -rw-r--r-- | .gitignore | 3 | ||||
| -rwxr-xr-x | devenv/get-image.sh | 38 |
2 files changed, 41 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore index d2c5f5fba..8dcc4f5b7 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 000000000..e6c43b97b --- /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 <<EOF +DEVICE=eth1 +BOOTPROTO=none +ONBOOT=yes +DEFROUTE=no +EOF" \ + +# SELinux relabeling requires virt-customize to have networking disabled +# https://bugzilla.redhat.com/show_bug.cgi?id=1122907 +virt-customize --add $TARGET_DIR/$TARGET --selinux-relabel --no-network + +echo "Finished building image:" +ls -l $TARGET_DIR/$TARGET |
