Copy devstack into image

main
Dean Troyer 13 years ago
parent 11e5e6fc3d
commit 03412c8cb9

@ -6,10 +6,12 @@ CHROOTCACHE=${CHROOTCACHE:-/root/cache}
# Source params
source ./stackrc
# TODO: make dest not hardcoded
# Store cwd
CWD=`pwd`
NAME=$1
DEST="/nfs/$NAME"
NFSDIR="/nfs/$NAME"
DEST=${DEST:-/opt/stack}
# remove old nfs filesystem if one exists
rm -rf $DEST
@ -92,26 +94,21 @@ git_clone $OPENSTACKX_REPO $DEST/openstackx $OPENSTACKX_BRANCH
chroot $CHROOTCACHE/natty-stack mkdir -p $DEST/files
wget -c http://images.ansolabs.com/tty.tgz -O $CHROOTCACHE/natty-stack$DEST/files/tty.tgz
cp -pr $CHROOTCACHE/natty-stack $DEST
# set hostname
echo $NAME > $DEST/etc/hostname
echo "127.0.0.1 localhost $NAME" > $DEST/etc/hosts
# copy kernel modules
cp -pr /lib/modules/`uname -r` $DEST/lib/modules
# Use this version of devstack?
if [ "$USE_CURRENT_DEVSTACK" = "1" ]; then
rm -rf $$CHROOTCACHE/natty-stack/$DEST/devstack
cp -pr $CWD $CHROOTCACHE/natty-stack/$DEST/devstack
fi
# copy openstack installer and requirement lists to a new directory.
mkdir -p $DEST/opt
cp -pr $CHROOTCACHE/natty-stack $NFSDIR
# inject stack.sh and dependant files
cp -r files $DEST/opt/files
cp stack.sh $DEST/opt/stack.sh
# set hostname
echo $NAME > $NFSDIR/etc/hostname
echo "127.0.0.1 localhost $NAME" > $NFSDIR/etc/hosts
# injecting root's public ssh key if it exists
if [ -f /root/.ssh/id_rsa.pub ]; then
mkdir $DEST/root/.ssh
chmod 700 $DEST/root/.ssh
cp /root/.ssh/id_rsa.pub $DEST/root/.ssh/authorized_keys
mkdir $NFSDIR/root/.ssh
chmod 700 $NFSDIR/root/.ssh
cp /root/.ssh/id_rsa.pub $NFSDIR/root/.ssh/authorized_keys
fi

@ -12,6 +12,9 @@ CHROOTCACHE=${CHROOTCACHE:-/root/cache}
# Source params
source ./stackrc
# Store cwd
CWD=`pwd`
DEST=${DEST:-/opt/stack}
# clean install of natty
@ -89,6 +92,12 @@ git_clone $DASH_REPO $DEST/dash $DASH_BRANCH
git_clone $NOVACLIENT_REPO $DEST/python-novaclient $NOVACLIENT_BRANCH
git_clone $OPENSTACKX_REPO $DEST/openstackx $OPENSTACKX_BRANCH
# Use this version of devstack?
if [ "$USE_CURRENT_DEVSTACK" = "1" ]; then
rm -rf $CACHEDIR/$DEST/devstack
cp -pr $CWD $CACHEDIR/$DEST/devstack
fi
# build a new image
BASE=build.$$
IMG=$BASE.img

Loading…
Cancel
Save