Browse code

use for /opt/stack

Dean Troyer authored on 2011/10/03 23:40:32
Showing 2 changed files
... ...
@@ -33,7 +33,9 @@ if [ ! -d $CHROOTCACHE/natty-dev ]; then
33 33
     # Create a stack user that is a member of the libvirtd group so that stack 
34 34
     # is able to interact with libvirt.
35 35
     chroot $CHROOTCACHE/natty-dev groupadd libvirtd
36
-    chroot $CHROOTCACHE/natty-dev useradd stack -s /bin/bash -d /opt -G libvirtd
36
+    chroot $CHROOTCACHE/natty-dev useradd stack -s /bin/bash -d $DEST -G libvirtd
37
+    mkdir -p $CHROOTCACHE/natty-dev/$DEST
38
+    chown stack $CHROOTCACHE/natty-dev/$DEST
37 39
 
38 40
     # a simple password - pass
39 41
     echo stack:pass | chroot $CHROOTCACHE/natty-dev chpasswd
... ...
@@ -79,16 +81,16 @@ function git_clone {
79 79
     chroot $CHROOTCACHE/natty-stack/ chown -R stack $2
80 80
 }
81 81
 
82
-git_clone $NOVA_REPO /opt/stack/nova $NOVA_BRANCH
83
-git_clone $GLANCE_REPO /opt/stack/glance $GLANCE_BRANCH
84
-git_clone $KEYSTONE_REPO /opt/stack/keystone $KEYSTONE_BRANCH
85
-git_clone $NOVNC_REPO /opt/stack/novnc $NOVNC_BRANCH
86
-git_clone $DASH_REPO /opt/stack/dash $DASH_BRANCH $DASH_TAG
87
-git_clone $NOVACLIENT_REPO /opt/stack/python-novaclient $NOVACLIENT_BRANCH
88
-git_clone $OPENSTACKX_REPO /opt/stack/openstackx $OPENSTACKX_BRANCH
82
+git_clone $NOVA_REPO $DEST/nova $NOVA_BRANCH
83
+git_clone $GLANCE_REPO $DEST/glance $GLANCE_BRANCH
84
+git_clone $KEYSTONE_REPO $DEST/keystone $KEYSTONE_BRANCH
85
+git_clone $NOVNC_REPO $DEST/novnc $NOVNC_BRANCH
86
+git_clone $DASH_REPO $DEST/dash $DASH_BRANCH $DASH_TAG
87
+git_clone $NOVACLIENT_REPO $DEST/python-novaclient $NOVACLIENT_BRANCH
88
+git_clone $OPENSTACKX_REPO $DEST/openstackx $OPENSTACKX_BRANCH
89 89
 
90
-chroot $CHROOTCACHE/natty-stack mkdir -p /opt/stack/files
91
-wget -c http://images.ansolabs.com/tty.tgz -O $CHROOTCACHE/natty-stack/opt/stack/files/tty.tgz
90
+chroot $CHROOTCACHE/natty-stack mkdir -p $DEST/files
91
+wget -c http://images.ansolabs.com/tty.tgz -O $CHROOTCACHE/natty-stack$DEST/files/tty.tgz
92 92
 
93 93
 cp -pr $CHROOTCACHE/natty-stack $DEST
94 94
 
... ...
@@ -12,6 +12,8 @@ CHROOTCACHE=${CHROOTCACHE:-/root/cache}
12 12
 # Source params
13 13
 source ./stackrc
14 14
 
15
+DEST=${DEST:-/opt/stack}
16
+
15 17
 # clean install of natty
16 18
 if [ ! -d $CHROOTCACHE/natty-base ]; then
17 19
     $PROGDIR/make_image.sh -C natty $CHROOTCACHE/natty-base
... ...
@@ -31,7 +33,9 @@ if [ ! -d $CHROOTCACHE/natty-dev ]; then
31 31
     # Create a stack user that is a member of the libvirtd group so that stack 
32 32
     # is able to interact with libvirt.
33 33
     chroot $CHROOTCACHE/natty-dev groupadd libvirtd
34
-    chroot $CHROOTCACHE/natty-dev useradd stack -s /bin/bash -d /opt -G libvirtd
34
+    chroot $CHROOTCACHE/natty-dev useradd stack -s /bin/bash -d $DEST -G libvirtd
35
+    mkdir -p $CHROOTCACHE/natty-dev/$DEST
36
+    chown stack $CHROOTCACHE/natty-dev/$DEST
35 37
 
36 38
     # a simple password - pass
37 39
     echo stack:pass | chroot $CHROOTCACHE/natty-dev chpasswd
... ...
@@ -77,13 +81,13 @@ function git_clone {
77 77
     chroot $CHROOTCACHE/natty-stack/ chown -R stack $2
78 78
 }
79 79
 
80
-git_clone $NOVA_REPO /opt/stack/nova $NOVA_BRANCH
81
-git_clone $GLANCE_REPO /opt/stack/glance $GLANCE_BRANCH
82
-git_clone $KEYSTONE_REPO /opt/stack/keystone $KEYSTONE_BRANCH
83
-git_clone $NOVNC_REPO /opt/stack/novnc $NOVNC_BRANCH
84
-git_clone $DASH_REPO /opt/stack/dash $DASH_BRANCH
85
-git_clone $NOVACLIENT_REPO /opt/stack/python-novaclient $NOVACLIENT_BRANCH
86
-git_clone $OPENSTACKX_REPO /opt/stack/openstackx $OPENSTACKX_BRANCH
80
+git_clone $NOVA_REPO $DEST/nova $NOVA_BRANCH
81
+git_clone $GLANCE_REPO $DEST/glance $GLANCE_BRANCH
82
+git_clone $KEYSTONE_REPO $DEST/keystone $KEYSTONE_BRANCH
83
+git_clone $NOVNC_REPO $DEST/novnc $NOVNC_BRANCH
84
+git_clone $DASH_REPO $DEST/dash $DASH_BRANCH
85
+git_clone $NOVACLIENT_REPO $DEST/python-novaclient $NOVACLIENT_BRANCH
86
+git_clone $OPENSTACKX_REPO $DEST/openstackx $OPENSTACKX_BRANCH
87 87
 
88 88
 # build a new image
89 89
 BASE=build.$$