ln -s $rl$r "${rc%/*}/${rc##*/}"
repo="$TOPDIR/SOURCES/repos/${rc%/*}/${rc##*/}/"
fi
- if test "$imagetype" != product ; then
+ if test "$imagetype" != product -a "$DO_INIT" != "false" ; then
echo "creating repodata for $repo"
if chroot $BUILD_ROOT createrepo --simple-md-filenames --help >/dev/null 2>&1 ; then
chroot $BUILD_ROOT createrepo --simple-md-filenames "$repo"
cat > $BUILD_ROOT/kiwi_post.sh << EOF
echo "compressing oem images... "
cd /$TOPDIR/KIWI-oem
+# do not store compressed file _and_ uncompressed one
+[ -e "$imageout.gz" ] && rm -f "$imageout"
if [ -e "$imageout.iso" ]; then
echo "take iso file and create sha256..."
mv "$imageout.iso" "/$TOPDIR/KIWI/$imageout$buildnum.iso"
fi
popd
fi
+if [ -e "$imageout.qcow2" ]; then
+ mv "$imageout.qcow2" "/$TOPDIR/KIWI/$imageout$buildnum.qcow2"
+ pushd /$TOPDIR/KIWI
+ if [ -x /usr/bin/sha256sum ]; then
+ echo "Create sha256 file..."
+ /usr/bin/sha256sum "$imageout$buildnum.qcow2" > "$imageout$buildnum.qcow2.sha256"
+ fi
+ popd
+fi
if [ -e "$imageout.raw" ]; then
compress_tool="bzip2"
compress_suffix="bz2"
fi
tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-raw.tar.bz2" \
- --exclude="$imageout.iso" --exclude="$imageout.raw" *
+ --exclude="$imageout.iso" --exclude="$imageout.raw" --exclude="$imageout.qcow2" *
cd /$TOPDIR/KIWI
if [ -x /usr/bin/sha256sum ]; then
/usr/bin/sha256sum "$imageout$buildnum-raw.tar.bz2" > "$imageout$buildnum-raw.tar.bz2.sha256"
cat > $BUILD_ROOT/kiwi_post.sh << EOF
echo "compressing vmx images... "
cd /$TOPDIR/KIWI-vmx
+for suffix in "ovf" "qcow2"; do
+ if [ -e "$imageout.\$suffix" ]; then
+ mv "$imageout.\$suffix" "/$TOPDIR/KIWI/$imageout$buildnum.\$suffix"
+ pushd /$TOPDIR/KIWI
+ if [ -x /usr/bin/sha256sum ]; then
+ echo "Create sha256 \$suffix file..."
+ /usr/bin/sha256sum "$imageout$buildnum.\$suffix" > "$imageout$buildnum.\$suffix.sha256"
+ fi
+ popd
+ fi
+done
# This option has a number of format parameters
VMXFILES=""
SHAFILES=""
-for i in "$imageout.vmx" "$imageout.vmdk" "$imageout-disk*.vmdk" "$imageout.ovf"; do
- ls \$i >& /dev/null && VMXFILES="\$VMXFILES \$i"
+for i in "$imageout.vmx" "$imageout.vmdk" "$imageout-disk*.vmdk"; do
+ test -e \$i && VMXFILES="\$VMXFILES \$i"
done
# take raw files as fallback
if [ -z "\$VMXFILES" ]; then
- ls "$imageout.raw" >& /dev/null && VMXFILES=""$imageout.raw"
+ test -e "$imageout.raw" && VMXFILES="$imageout.raw"
fi
if [ -n "\$VMXFILES" ]; then
tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-vmx.tar.bz2" \$VMXFILES
SHAFILES="\$SHAFILES $imageout$buildnum-vmx.tar.bz2"
fi
-
if [ -e "$imageout.xenconfig" ]; then
tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-vmx.tar.bz2" $imageout.xenconfig $imageout.raw initrd-*
SHAFILES="\$SHAFILES $imageout$buildnum-vmx.tar.bz2"
cat > $BUILD_ROOT/kiwi_post.sh << EOF
echo "compressing xen images... "
cd /$TOPDIR/KIWI-xen
+# do not store compressed file _and_ uncompressed one
+[ -e "$imageout.gz" ] && rm -f "$imageout"
tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-xen.tar.bz2" \
`grep ^kernel $imageout.xenconfig | cut -d'"' -f2` \
`grep ^ramdisk $imageout.xenconfig | cut -d'"' -f2` \
cat > $BUILD_ROOT/kiwi_post.sh << EOF
echo "compressing pxe images... "
cd /$TOPDIR/KIWI-pxe
+# do not store compressed file _and_ uncompressed one
+[ -e "$imageout.gz" ] && rm -f "$imageout"
tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-pxe.tar.bz2" ${imageout}* initrd-*
if [ -x /usr/bin/sha256sum ]; then
echo "Create sha256 file..."
fi
EOF
;;
+ tbz)
+ cat > $BUILD_ROOT/kiwi_post.sh << EOF
+cd /$TOPDIR/KIWI-tbz
+for i in *.tbz; do
+ file=\$(readlink -f "\$i")
+ [ -z "\$file" ] && echo readlink failed for $i
+ mv "\$file" "/$TOPDIR/KIWI/\${i%.tbz}$buildnum.tbz"
+done
+if [ -x /usr/bin/sha256sum ]; then
+ echo "creating sha256 sum for tar balls... "
+ cd $TOPDIR/KIWI
+ for i in *.tbz; do
+ /usr/bin/sha256sum "\$i" > "\$i.sha256"
+ done
+fi
+EOF
+ ;;
*)
cat > $BUILD_ROOT/kiwi_post.sh << EOF
echo "compressing unkown images... "
cd /$TOPDIR/KIWI-$imgtype
+# do not store compressed file _and_ uncompressed one
+[ -e "$imageout.gz" ] && rm -f "$imageout"
tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-$imgtype.tar.bz2" *
if [ -x /usr/bin/sha256sum ]; then
echo "Create sha256 file..."
done
fi
# Hook for running post kiwi build scripts like QA scripts if installed
- if [ -x /usr/lib/build/kiwi_post_run ]; then
+ if [ -x $BUILD_ROOT/usr/lib/build/kiwi_post_run ]; then
chroot $BUILD_ROOT su -c /usr/lib/build/kiwi_post_run || cleanup_and_exit 1
fi
}