DiskImages/hdiutil: provide an imagekey to set LZMA compression preset level for ULMO-format disk images

Number:rdar://FB8739821 Date Originated:2020-09-24
Status:Open Resolved:
Product:macOS Product Version:10.15.7 19H2
Classification:Suggestion Reproducible:
macOS 10.15 introduced the new ULMO disk image format, which can be created with “hdiutil convert -format ULMO”. This format uses LZMA compression, which generally produces the smallest results of all of the compression algorithms supported by DiskImages.

Other compressed disk image formats allow the compression level to be tuned. UDZO (zlib compression) supports the “zlib-level” image key, which may be specified with “hdiutil convert -format UDZO -imagekey zlib-level=9”. Similarly, UDBZ (bzip2 compression, introduced in 10.4) supports the “bzip2-level” image key, introduced in 10.5. (see my radar report 8132167).

Please add an lama-level image key to customize the LZMA compression level used for ULMO disk image compression.


2021-02-01 18:15 UTC from Apple

We have determined that this issue is not to be fixed/changed. LZMA is only available through the standard apple compression library. LZMA doesn’t have a compression level setting. It is tuned to achieve the optimal compression/performance.

Reply to Apple

This is a less-than-great explanation. Apple Compression library does not have zlib levels, but somehow hdiutil understands zlib-level. For a while your OS even had a /usr/lib/liblzma.dylib, with all the bells and whistles that implies; you could probably bring it back if you really want to.

... Though to be fair, there really isn't too much to gain from just bumping the levels from 6 to 9. Sometimes the miracle lies in changing the pb and other settings (which would a lot of messy imagekeys). Some people even want BCJ for software distribution. That's surprisingly kinda-doable, because ULMO is xz (lzma2) and not legacy lzma, though the extra level of "since <OS version>" is definitely not worth it.

By arthur200126 at Feb. 14, 2024, 1:43 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!