Index: Build/Kiwi.pm
===================================================================
--- Build/Kiwi.pm	(revision 6333)
+++ Build/Kiwi.pm	(working copy)
@@ -101,6 +101,9 @@
   my $kiwi = parsexml($xml);
   die("not a kiwi config\n") unless $kiwi && $kiwi->{'image'};
   $kiwi = $kiwi->{'image'}->[0];
+  if ($kiwi->{'name'}) {
+    $ret->{'filename'} = $kiwi->{'name'};
+  }
   my $description = (($kiwi->{'description'} || [])->[0]) || {};
   if ($description->{'specification'}) {
     $ret->{'name'} = $description->{'specification'}->[0]->{'_content'};
Index: build
===================================================================
--- build	(revision 6333)
+++ build	(working copy)
@@ -1377,6 +1377,8 @@
 	rm -f $BUILD_ROOT/$TOPDIR/SOURCES/config.xml
 	ln -s $SPECFILE $BUILD_ROOT/$TOPDIR/SOURCES/config.xml
 	imagetype=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$SPECFILE imagetype)
+	imagename=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$SPECFILE filename)
+	imageversion=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$SPECFILE version)
 	chroot $BUILD_ROOT su -c "kiwi --version" -
 	if test "$imagetype" = product ; then
 	    echo "running kiwi --create-instsource..."
@@ -1390,16 +1392,58 @@
 	    done
 	else
 	    BUILD_SUCCEEDED=true
-	    for imagetype in $imagetype ; do
-		echo "running kiwi --prepare for $imagetype..."
-		if chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && kiwi --prepare $TOPDIR/SOURCES --logfile terminal --root $TOPDIR/KIWIROOT-$imagetype" - $BUILD_USER < /dev/null ; then
-		    echo "running kiwi --create for $imagetype..."
-		    chroot $BUILD_ROOT su -c "kiwi --create $TOPDIR/KIWIROOT-$imagetype --logfile terminal --type $imagetype -d $TOPDIR/KIWI" - $BUILD_USER < /dev/null || BUILD_SUCCEEDED=
+	    for imgtype in $imagetype ; do
+		echo "running kiwi --prepare for $imgtype..."
+		if chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && kiwi --prepare $TOPDIR/SOURCES --logfile terminal --root $TOPDIR/KIWIROOT-$imgtype" - $BUILD_USER < /dev/null ; then
+		    echo "running kiwi --create for $imgtype..."
+		    mkdir -p $BUILD_ROOT/$TOPDIR/KIWI-$imgtype
+		    chroot $BUILD_ROOT su -c "kiwi --create $TOPDIR/KIWIROOT-$imgtype --logfile terminal --type $imgtype -d $TOPDIR/KIWI-$imgtype" - $BUILD_USER < /dev/null || BUILD_SUCCEEDED=
 		else
 		    BUILD_SUCCEEDED=
 		fi
-		test -z "$BUILD_SUCCEEDED" && break
+
 	    done
+
+	    # create tar.bz2 of images, in case it makes sense
+            if [ "$BUILD_SUCCEEDED" = "true" ] ; then
+
+		echo "compressing images... "
+		imagearch=`uname -m`
+            	for imgtype in $imagetype ; do
+		    case "$imgtype" in
+		        oem)
+			    pushd $BUILD_ROOT/$TOPDIR/KIWI-oem > /dev/null
+		            tar cvjfS $BUILD_ROOT/$TOPDIR/KIWI/$imagename.$imagearch-$imageversion-raw.tar.bz2 \
+		              $imagename.$imagearch-$imageversion.raw
+		            popd > /dev/null
+		            ;;
+		        vmx)
+		            pushd $BUILD_ROOT/$TOPDIR/KIWI-vmx > /dev/null
+			    tar cvjfS $BUILD_ROOT/$TOPDIR/KIWI/$imagename.$imagearch-$imageversion-vmx.tar.bz2 \
+			      $imagename.$imagearch-$imageversion.vmx \
+			      $imagename.$imagearch-$imageversion.vmdk
+
+			    # don't compress ovf output
+			    if [ -e $imagename.$imagearch-$imageversion.ovf ] ; then
+  			        mv $imagename.$imagearch-$imageversion.ovf $BUILD_ROOT/$TOPDIR/KIWI/
+			        mv $imagename.$imagearch-$imageversion-disk*.vmdk $BUILD_ROOT/$TOPDIR/KIWI/
+			    fi
+			    popd > /dev/null
+		            ;;
+		        xen)
+		            pushd $BUILD_ROOT/$TOPDIR/KIWI-xen > /dev/null
+		            tar cvjfS $BUILD_ROOT/$TOPDIR/KIWI/$imagename.$imagearch-$imageversion-xen.tar.bz2 \
+		              `grep ^kernel $imagename.$imagearch-$imageversion.xenconfig | cut -d'"'  -f2` \
+			      `grep ^ramdisk $imagename.$imagearch-$imageversion.xenconfig | cut -d'"'  -f2` \
+                              $imagename.$imagearch-$imageversion.xenconfig \
+                              $imagename.$imagearch-$imageversion
+			    popd > /dev/null
+		            ;;
+		    esac
+            	done
+            fi
+            
+            test -z "$BUILD_SUCCEEDED" && break
 	fi
     fi
 
