Support using lzma for initramfs compression

Reduces the size by roughly 30% at the expense of larger
decompression time.

Change-Id: I04613a26bd3f66ddcb1623e288d325666586fa6c
This commit is contained in:
Dmitry Tantsur 2020-11-26 17:44:03 +01:00
parent d1d3a7e555
commit 0f62572894
2 changed files with 10 additions and 0 deletions

View File

@ -53,6 +53,8 @@ def main():
"ironic-python-agent and requirements")
parser.add_argument("-v", "--verbose", action='store_true',
help="Enable verbose logging in diskimage-builder")
parser.add_argument("--lzma", action='store_true',
help="Use lzma compression for smaller images")
parser.add_argument("--extra-args",
help="Extra arguments to pass to diskimage-builder")
# TODO(dtantsur): handle distribution == tinyipa
@ -68,6 +70,9 @@ def main():
if args.branch:
os.environ['DIB_REPOREF_ironic_python_agent'] = args.branch
os.environ['DIB_REPOREF_requirements'] = args.branch
if args.lzma:
os.environ['DIB_IPA_COMPRESS_CMD'] = \
'xz --format=lzma --compress --stdout'
extra_args = shlex.split(args.extra_args) if args.extra_args else []
if args.verbose:
extra_args.append("-x")

View File

@ -0,0 +1,5 @@
---
features:
- |
The ``ironic-python-agent-builder`` CLI now supports ``--lzma`` flag to
compress images with the LZMA algorithm.