Browse Source

Merge "Allow configurable gzip binary name"

tags/2.27.0
Zuul 2 weeks ago
parent
commit
48edd472e7

+ 1
- 0
diskimage_builder/lib/disk-image-create View File

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

+ 1
- 1
diskimage_builder/lib/img-functions View File

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

+ 3
- 0
doc/source/user_guide/building_an_image.rst View File

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

+ 5
- 0
releasenotes/notes/gzip-env-variable-94e61e0c043f4f1f.yaml View File

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

Loading…
Cancel
Save