Skip to content
Open
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
27 changes: 25 additions & 2 deletions create
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,30 @@ debug set -x

case "$IMAGE_TYPE" in
tarball)
IMG_EXT=".tar.gz"
case $TARBALL_COMPRESS in
none)
IMG_EXT=".tar"
;;
gzip|pigz)
IMG_EXT=".tar.gz"
;;
bzip2|pbzip2|lbzip2)
IMG_EXT=".tar.bz2"
;;
lzop)
IMG_EXT=".tar.lzo"
;;
xz)
IMG_EXT=".tar.xz"
;;
p7zip)
IMG_EXT=".tar.7z"
;;
*)
log_error "$TARBALL_COMPRESS as tarball compressor is not supported"
exit 1
;;
esac
;;
qemu)
IMG_EXT=".img"
Expand Down Expand Up @@ -134,7 +157,7 @@ if [ "$CDINSTALL" = "no" ] ; then

if [ "${IMAGE_TYPE}" = "tarball" ] ; then
# unpack image
tar pzxf $IMAGE_FILE -C $TARGET
tar -I"$TARBALL_COMPRESS" -pxf $IMAGE_FILE -C $TARGET
elif [ "${IMAGE_TYPE}" = "dump" ] ; then
root_dump="${IMAGE_FILE}"
( cd ${TARGET}; restore -r -y -f ${root_dump} > /dev/null )
Expand Down
7 changes: 7 additions & 0 deletions defaults
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
# ( default is @localstatedir@/cache/ganeti-instance-image )
# IMAGE_DIR=""

# TARBALL_COMPRESS: compress program use to compress tar file.
# It must accept the -d option, for decompression.
# The argument can contain command line options.
# Use either none, gzip, pigz, bzip2, pzip2, lbzip2, lzop, xz, p7zip
# (default is gzip)
# TARBALL_COMPRESS="gzip"

# NOMOUNT: Do not try to mount volume (if it is not a linux partition). Accepts
# either 'yes' or 'no'. This option is useful for installing Windows images for
# example. ( default is no )
Expand Down