Skip to content
Browse files

Add glance-upload-ttylinux.sh script

  • Loading branch information...
1 parent 24d5e8e commit 133b6e10e0667ea8745ec82005fd3539680cb8e1 @kiall kiall committed
Showing with 29 additions and 1 deletion.
  1. +2 −1 .gitignore
  2. +27 −0 glance-upload-ttylinux.sh
View
3 .gitignore
@@ -1,8 +1,9 @@
api-paste-keystone.ini
keystone_data.sh
keystone.log
-oneiric-server-cloudimg*
+oneiric*
lucid*
+ttylinux*
settings.local
README.files
glance-api.conf
View
27 glance-upload-ttylinux.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# Import Settings
+. settings
+
+if [ ! -f "ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz" ] ; then
+ echo "Downloading image"
+ wget http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz
+fi
+
+if [ ! -f "ttylinux-uec-amd64-12.1_2.6.35-22_1.img" ] ; then
+ echo "Extracting image"
+ tar xfzv ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz
+fi
+
+TOKEN=`./obtain-token.sh`
+
+echo "Uploading kernel"
+RVAL=`glance -A $TOKEN add name="ttylinux-kernel" is_public=true container_format=aki disk_format=aki < ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz`
+KERNEL_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
+
+echo "Uploading ramdisk"
+RVAL=`glance -A $TOKEN add name="ttylinux-ramdisk" is_public=true container_format=ari disk_format=ari < ttylinux-uec-amd64-12.1_2.6.35-22_1-initrd`
+RAMDISK_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
+
+echo "Uploading image"
+glance -A $TOKEN add name="ttylinux" is_public=true container_format=ami disk_format=ami kernel_id=$KERNEL_ID ramdisk_id=$RAMDISK_ID < ttylinux-uec-amd64-12.1_2.6.35-22_1.img

0 comments on commit 133b6e1

Please sign in to comment.
Something went wrong with that request. Please try again.