Allow configurable gzip binary name

Add a new environment variable $DIB_GZIP_BIN allowing builders to
specify a different gzip (such as pigz) to be used when compressing
tgz images.

Change-Id: Ifb617568140a149e2fda241e07ff8a59429e6697
This commit is contained in:
Logan V 2019-07-04 16:54:45 -05:00
parent 472be2a144
commit d9e85efd7c
4 changed files with 10 additions and 1 deletions

View File

@ -123,6 +123,7 @@ DIB_DEBUG_TRACE=${DIB_DEBUG_TRACE:-0}
INSTALL_PACKAGES=""
IMAGE_TYPES=("qcow2")
COMPRESS_IMAGE="true"
DIB_GZIP_BIN=${DIB_GZIP_BIN:-"gzip"}
ROOT_LABEL=""
DIB_DEFAULT_INSTALLTYPE=${DIB_DEFAULT_INSTALLTYPE:-"source"}
MKFS_OPTS=""

View File

@ -144,7 +144,7 @@ function compress_and_save_image () {
if [ "$IMAGE_TYPE" = "raw" ]; then
mv $TMP_IMAGE_PATH $1-new
elif [ "$IMAGE_TYPE" == "tgz" ]; then
gzip -9 < $IMAGE_NAME.tar > $1-new
$DIB_GZIP_BIN -9 < $IMAGE_NAME.tar > $1-new
rm $IMAGE_NAME.tar
elif [ "$IMAGE_TYPE" == "vhd" ]; then
cp $TMP_IMAGE_PATH $1-intermediate

View File

@ -57,6 +57,9 @@ formats are:
* docker
* raw
When building a tgz image, note that the `DIB_GZIP_BIN` environment variable
can be used to set the path of the gzip executable.
Disk Image Layout
-----------------

View File

@ -0,0 +1,5 @@
---
features:
- |
The `DIB_GZIP_BIN` environment variable enables builders to change the
path to `gzip`, such as when an alternate gzip is to be used (ie. pigz).