add support for local mirrors by:
- making sure the preseed file points to a local mirror.
- the apt sources mounted in the DevStack VM will point automatically to the same mirrror
Change-Id: I33052ac5c10387db7206ce2210ee2cbe9096df47
| ... | ... |
@@ -174,13 +174,16 @@ fi |
| 174 | 174 |
templateuuid=$(xe template-list name-label="$TNAME") |
| 175 | 175 |
if [ -n "$templateuuid" ] |
| 176 | 176 |
then |
| 177 |
- vm_uuid=$(xe vm-install template="$TNAME" new-name-label="$GUEST_NAME") |
|
| 177 |
+ vm_uuid=$(xe vm-install template="$TNAME" new-name-label="$GUEST_NAME") |
|
| 178 | 178 |
else |
| 179 | 179 |
template=$(xe_min template-list name-label="Ubuntu 11.10 (64-bit)") |
| 180 | 180 |
if [ -z "$template" ] |
| 181 | 181 |
then |
| 182 | 182 |
cp $TOP_DIR/devstackubuntupreseed.cfg /opt/xensource/www/ |
| 183 | 183 |
$TOP_DIR/scripts/xenoneirictemplate.sh "${HOST_IP}/devstackubuntupreseed.cfg"
|
| 184 |
+ MIRROR=${MIRROR:-archive.ubuntu.com}
|
|
| 185 |
+ sed -e "s,d-i mirror/http/hostname string .*,d-i mirror/http/hostname string $MIRROR," \ |
|
| 186 |
+ -i /opt/xensource/www/devstackubuntupreseed.cfg |
|
| 184 | 187 |
fi |
| 185 | 188 |
$TOP_DIR/scripts/install-os-vpx.sh -t "Ubuntu 11.10 (64-bit)" -v $VM_BR -m $MGT_BR -p $PUB_BR -l $GUEST_NAME -r $OSDOMU_MEM_MB -k "flat_network_bridge=${VM_BR}"
|
| 186 | 189 |
|
| 187 | 190 |
deleted file mode 100755 |
| ... | ... |
@@ -1,41 +0,0 @@ |
| 1 |
-#i!/bin/sh |
|
| 2 |
-set -o xtrace |
|
| 3 |
-set -o errexit |
|
| 4 |
- |
|
| 5 |
-# Install basics for vi and git |
|
| 6 |
-yum -y --enablerepo=base install gcc make vim-enhanced zlib-devel openssl-devel curl-devel.i386 |
|
| 7 |
- |
|
| 8 |
-# Simple but usable vimrc |
|
| 9 |
-if [ ! -e /root/.vimrc ]; then |
|
| 10 |
- cat > /root/.vimrc <<EOF |
|
| 11 |
-syntax on |
|
| 12 |
-se ts=4 |
|
| 13 |
-se expandtab |
|
| 14 |
-se shiftwidth=4 |
|
| 15 |
-EOF |
|
| 16 |
-fi |
|
| 17 |
- |
|
| 18 |
-# Use the pretty vim |
|
| 19 |
-if [ -e /usr/bin/vim ]; then |
|
| 20 |
- rm /bin/vi |
|
| 21 |
- ln -s /usr/bin/vim /bin/vi |
|
| 22 |
-fi |
|
| 23 |
- |
|
| 24 |
-# Install git |
|
| 25 |
-if ! which git; then |
|
| 26 |
- DEST=/tmp/ |
|
| 27 |
- GITDIR=$DEST/git-1.7.7 |
|
| 28 |
- cd $DEST |
|
| 29 |
- rm -rf $GITDIR* |
|
| 30 |
- wget http://git-core.googlecode.com/files/git-1.7.7.tar.gz |
|
| 31 |
- tar xfv git-1.7.7.tar.gz |
|
| 32 |
- cd $GITDIR |
|
| 33 |
- ./configure --with-curl --with-expat |
|
| 34 |
- make install |
|
| 35 |
-fi |
|
| 36 |
- |
|
| 37 |
-# Clone devstack |
|
| 38 |
-DEVSTACK=${DEVSTACKROOT:-"/root/devstack"}
|
|
| 39 |
-if [ ! -d $DEVSTACK ]; then |
|
| 40 |
- git clone git://github.com/openstack-dev/devstack.git $DEVSTACK |
|
| 41 |
-fi |
| ... | ... |
@@ -7,18 +7,6 @@ GUEST_PASSWORD=${GUEST_PASSWORD:-secrete}
|
| 7 | 7 |
STAGING_DIR=${STAGING_DIR:-stage}
|
| 8 | 8 |
DO_TGZ=${DO_TGZ:-1}
|
| 9 | 9 |
|
| 10 |
-# Sources.list |
|
| 11 |
-cat <<EOF >$STAGING_DIR/etc/apt/sources.list |
|
| 12 |
-deb http://us.archive.ubuntu.com/ubuntu/ oneiric main restricted |
|
| 13 |
-deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric main restricted |
|
| 14 |
-deb http://us.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted |
|
| 15 |
-deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted |
|
| 16 |
-deb http://us.archive.ubuntu.com/ubuntu/ oneiric universe |
|
| 17 |
-deb http://us.archive.ubuntu.com/ubuntu/ oneiric-updates universe |
|
| 18 |
-deb http://us.archive.ubuntu.com/ubuntu/ oneiric multiverse |
|
| 19 |
-deb http://us.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse |
|
| 20 |
-EOF |
|
| 21 |
- |
|
| 22 | 10 |
# Install basics |
| 23 | 11 |
chroot $STAGING_DIR apt-get update |
| 24 | 12 |
chroot $STAGING_DIR apt-get install -y cracklib-runtime curl wget ssh openssh-server tcpdump ethtool |