From b7407899f49a2c6922853bf81e8909ffe3cf0717 Mon Sep 17 00:00:00 2001 From: Darren Birkett Date: Thu, 8 Dec 2011 15:03:01 +0000 Subject: [PATCH 1/3] when processing the IMAGE_URLS for additional images to download and push into glance, don't assume the extracted kernel and image files will have the same basename as the tar.gz. --- stack.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/stack.sh b/stack.sh index 7d66e319..5c51e516 100755 --- a/stack.sh +++ b/stack.sh @@ -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 From 9a0b545b0c012793f14ddd3b67c9c4dddbcf5fd4 Mon Sep 17 00:00:00 2001 From: Darren Birkett Date: Thu, 8 Dec 2011 15:17:01 +0000 Subject: [PATCH 2/3] Update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 9d8366ba..642d568a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,3 +16,4 @@ Todd Willey Tres Henry Vishvananda Ishaya Yun Mao +Darren Birkett From 7e39fe356f951abd6fbadb4b7c5acba4848b15a0 Mon Sep 17 00:00:00 2001 From: Darren Birkett Date: Thu, 8 Dec 2011 15:17:50 +0000 Subject: [PATCH 3/3] Update AUTHORS --- AUTHORS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 642d568a..767c653d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,6 +2,7 @@ Andy Smith Anthony Young Brad Hall Chmouel Boudjnah +Darren Birkett Dean Troyer Devin Carlen Eddie Hebert @@ -16,4 +17,4 @@ Todd Willey Tres Henry Vishvananda Ishaya Yun Mao -Darren Birkett +