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

@ -12,6 +12,9 @@ CHROOTCACHE=${CHROOTCACHE:-/root/cache}
# Source params # Source params
source ./stackrc source ./stackrc
# Store cwd
CWD=`pwd`
DEST=${DEST:-/opt/stack} DEST=${DEST:-/opt/stack}
# clean install of natty # 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 $NOVACLIENT_REPO $DEST/python-novaclient $NOVACLIENT_BRANCH
git_clone $OPENSTACKX_REPO $DEST/openstackx $OPENSTACKX_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 # build a new image
BASE=build.$$ BASE=build.$$
IMG=$BASE.img IMG=$BASE.img

Loading…
Cancel
Save