Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Andy Smith <github@anarkystic.com>
Anthony Young <sleepsonthefloor@gmail.com>
Brad Hall <brad@nicira.com>
Chmouel Boudjnah <chmouel@chmouel.com>
Darren Birkett <darren.birkett@gmail.com>
Dean Troyer <dtroyer@gmail.com>
Devin Carlen <devin.carlen@gmail.com>
Eddie Hebert <edhebert@gmail.com>
Expand All @@ -16,3 +17,4 @@ Todd Willey <xtoddx@gmail.com>
Tres Henry <tres@treshenry.net>
Vishvananda Ishaya <vishvananda@gmail.com>
Yun Mao <yunmao@gmail.com>

20 changes: 16 additions & 4 deletions stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1219,15 +1219,27 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
fi

# Extract ami and aki files
tar -zxf $FILES/$IMAGE_FNAME -C $FILES/images
mkdir -p $FILES/images/$IMAGE_NAME
tar -zxf $FILES/$IMAGE_FNAME -C $FILES/images/$IMAGE_NAME


# mustn't assume the img and kernel files are named the same as the tar basename
if [ -f $FILES/images/$IMAGE_NAME/*vmlinuz-virtual* ];then
KERNEL_FILE=$(basename $(find $FILES/images/$IMAGE_NAME/*vmlinuz-virtual*))
IMAGE_BASENAME=$(basename $KERNEL_FILE -vmlinuz-virtual)
else
KERNEL_FILE=$(basename $(find $FILES/images/$IMAGE_NAME/*vmlinuz*))
IMAGE_BASENAME=$(basename $KERNEL_FILE -vmlinuz)
fi


# Use glance client to add the kernel the root filesystem.
# We parse the results of the first upload to get the glance ID of the
# kernel for use when uploading the root filesystem.
RVAL=`glance add -A $SERVICE_TOKEN name="$IMAGE_NAME-kernel" is_public=true container_format=aki disk_format=aki < $FILES/images/$IMAGE_NAME-vmlinuz*`
RVAL=$(glance add -A $SERVICE_TOKEN name="$IMAGE_BASENAME-kernel" is_public=true container_format=aki disk_format=aki < $FILES/images/$IMAGE_NAME/$KERNEL_FILE)
KERNEL_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
glance add -A $SERVICE_TOKEN name="$IMAGE_NAME" is_public=true container_format=ami disk_format=ami kernel_id=$KERNEL_ID < $FILES/images/$IMAGE_NAME.img
done
glance add -A $SERVICE_TOKEN name="$IMAGE_BASENAME" is_public=true container_format=ami disk_format=ami kernel_id=$KERNEL_ID < $FILES/images/$IMAGE_NAME/$IMAGE_BASENAME.img

fi

# Fin
Expand Down