| ... | ... |
@@ -11,7 +11,7 @@ rm -rf $DEST |
| 11 | 11 |
# build a proto image - natty + packages that will install (optimization) |
| 12 | 12 |
if [ ! -d proto ]; then |
| 13 | 13 |
debootstrap natty proto |
| 14 |
- cp sources.list proto/etc/apt/sources.list |
|
| 14 |
+ cp files/sources.list proto/etc/apt/sources.list |
|
| 15 | 15 |
chroot proto apt-get update |
| 16 | 16 |
chroot proto apt-get install -y `cat apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin)"` |
| 17 | 17 |
chroot proto pip install `cat pips/*` |
| ... | ... |
@@ -33,17 +33,21 @@ echo "127.0.0.1 localhost $NAME" > $DEST/etc/hosts |
| 33 | 33 |
# copy kernel modules |
| 34 | 34 |
cp -pr /lib/modules/`uname -r` $DEST/lib/modules |
| 35 | 35 |
|
| 36 |
+# helpful screenrc |
|
| 37 |
+cp files/screenrc $DEST/root/.screenrc |
|
| 38 |
+ |
|
| 36 | 39 |
# copy openstack installer and requirement lists to a new directory. |
| 37 | 40 |
mkdir -p $DEST/opt |
| 38 | 41 |
cp stack.sh $DEST/opt/stack.sh |
| 39 | 42 |
cp -r pips $DEST/opt |
| 40 | 43 |
cp -r apts $DEST/opt |
| 41 | 44 |
|
| 42 |
-# injecting root's ssh key |
|
| 43 |
-# FIXME: only do this if id_rsa.pub exists |
|
| 44 |
-mkdir $DEST/root/.ssh |
|
| 45 |
-chmod 700 $DEST/root/.ssh |
|
| 46 |
-cp /root/.ssh/id_rsa.pub $DEST/root/.ssh/authorized_keys |
|
| 45 |
+# injecting root's public ssh key if it exists |
|
| 46 |
+if [ -f /root/.ssh/id_rsa.pub ]; then |
|
| 47 |
+ mkdir $DEST/root/.ssh |
|
| 48 |
+ chmod 700 $DEST/root/.ssh |
|
| 49 |
+ cp /root/.ssh/id_rsa.pub $DEST/root/.ssh/authorized_keys |
|
| 50 |
+fi |
|
| 47 | 51 |
|
| 48 | 52 |
# set root password to password |
| 49 | 53 |
echo root:password | chroot $DEST chpasswd |
| 0 | 9 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,9 @@ |
| 0 |
+deb http://us.archive.ubuntu.com/ubuntu/ natty main restricted |
|
| 1 |
+deb http://us.archive.ubuntu.com/ubuntu/ natty-updates main restricted |
|
| 2 |
+deb http://us.archive.ubuntu.com/ubuntu/ natty universe |
|
| 3 |
+deb http://us.archive.ubuntu.com/ubuntu/ natty-updates universe |
|
| 4 |
+deb http://us.archive.ubuntu.com/ubuntu/ natty multiverse |
|
| 5 |
+deb http://us.archive.ubuntu.com/ubuntu/ natty-updates multiverse |
|
| 6 |
+deb http://security.ubuntu.com/ubuntu natty-security main restricted |
|
| 7 |
+deb http://security.ubuntu.com/ubuntu natty-security universe |
|
| 8 |
+deb http://security.ubuntu.com/ubuntu natty-security multiverse |
| 0 | 9 |
deleted file mode 100644 |
| ... | ... |
@@ -1,9 +0,0 @@ |
| 1 |
-deb http://us.archive.ubuntu.com/ubuntu/ natty main restricted |
|
| 2 |
-deb http://us.archive.ubuntu.com/ubuntu/ natty-updates main restricted |
|
| 3 |
-deb http://us.archive.ubuntu.com/ubuntu/ natty universe |
|
| 4 |
-deb http://us.archive.ubuntu.com/ubuntu/ natty-updates universe |
|
| 5 |
-deb http://us.archive.ubuntu.com/ubuntu/ natty multiverse |
|
| 6 |
-deb http://us.archive.ubuntu.com/ubuntu/ natty-updates multiverse |
|
| 7 |
-deb http://security.ubuntu.com/ubuntu natty-security main restricted |
|
| 8 |
-deb http://security.ubuntu.com/ubuntu natty-security universe |
|
| 9 |
-deb http://security.ubuntu.com/ubuntu natty-security multiverse |
| ... | ... |
@@ -133,18 +133,6 @@ EOF |
| 133 | 133 |
exit |
| 134 | 134 |
fi |
| 135 | 135 |
|
| 136 |
-# Configure screen |
|
| 137 |
-cat >~/.screenrc <<EOF |
|
| 138 |
-hardstatus on |
|
| 139 |
-hardstatus alwayslastline |
|
| 140 |
-hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G}%H %{..Y}%d/%m %c"
|
|
| 141 |
- |
|
| 142 |
-defscrollback 1024 |
|
| 143 |
- |
|
| 144 |
-vbell off |
|
| 145 |
-startup_message off |
|
| 146 |
-EOF |
|
| 147 |
- |
|
| 148 | 136 |
NL=`echo -ne '\015'` |
| 149 | 137 |
|
| 150 | 138 |
function screen_it {
|