Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can the zstd compression level settings be modified? #301

Open
niazi-in opened this issue Mar 31, 2024 · 3 comments
Open

Can the zstd compression level settings be modified? #301

niazi-in opened this issue Mar 31, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@niazi-in
Copy link

I am customizing Linux Mint 21.3 (MATE as well as Cinnamon-Edge) to put on a Ventoy thumb drive. I want to modify the zstd compression level settings to something like 19 to minimize the size of the custom iso file. Is it possible to do so? Where can I make these modifications? What default compression level does cubic use?

@niazi-in niazi-in added the question Further information is requested label Mar 31, 2024
@PJ-Singh-001 PJ-Singh-001 self-assigned this Mar 31, 2024
@PJ-Singh-001
Copy link
Owner

According to the man page, mksquashfs takes the --comp option.
Allowed arguments are gzip (default), lzo, lz4, xz, and zstd.

If zstd is supplied as an argument, then an additional option may be supplied, -Xcompression-level COMPRESSION-LEVEL, where COMPRESSION-LEVEL can be a value between 1 to 22, and the default is 15.

Other values for the --comp option have their own specific options:

COMPRESSORS AVAILABLE AND COMPRESSOR SPECIFIC OPTIONS

gzip (default):
-Xcompression-level COMPRESSION-LEVEL
    COMPRESSION-LEVEL should be 1 .. 9 (default 9).
-Xwindow-size WINDOW-SIZE
    WINDOW-SIZE should be 8 .. 15 (default 15).
-Xstrategy strategy1,strategy2,...,strategyN
    Compress using strategy1,strategy2,...,strategyN in turn and choose the best compression. Available strategies: default, filtered, huffman_only, run_length_encoded and fixed.

lzo:
-Xalgorithm ALGORITHM
    Where ALGORITHM is one of: lzo1x_1, lzo1x_1_11, lzo1x_1_12, lzo1x_1_15, lzo1x_999 (default).
-Xcompression-level COMPRESSION-LEVEL
    COMPRESSION-LEVEL should be 1 .. 9 (default 8) Only applies to lzo1x_999 algorithm.

lz4:
-Xhc
    Compress using LZ4 High Compression.

xz:
-Xbcj filter1,filter2,...,filterN
    Compress using filter1,filter2,...,filterN in turn (in addition to no filter), and choose the best compression. Available filters: x86, arm, armthumb, powerpc, sparc, ia64.
-Xdict-size DICT-SIZE
    Use DICT-SIZE as the XZ dictionary size. The dictionary size can be specified as a percentage of the block size, or as an absolute value. The dictionary size must be less than or equal to the block size and 8192 bytes or larger. It must also be storable in the xz header as either 2^n or as 2^n+2^(n+1). Example dict-sizes are 75%, 50%, 37.5%, 25%, or 32K, 16K, 8K etc.

zstd:
-Xcompression-level COMPRESSION-LEVEL
    COMPRESSION-LEVEL should be 1 .. 22 (default 15).

It would become quite complex to capture all of these options in the Cubic UI, so I do not have plans to add this capability into Cubic.

If you are looking for a smaller ISO, you can try the xz option.

However, if it is very critical, I may be able to give you a small patch to update your personal install of Cubic to hard code Xcompression-level to 19. Of course, I won't be able to grantee this wouldn't break any of the other compression options.

@niazi-in
Copy link
Author

niazi-in commented Apr 2, 2024

Thank you. The default ZSTD compression level 15 is not too low. However. I shall first try using XZ compression if that gives a significant size saving without much greater decompression time. I shall let you know if a hard-coded patch for ZSTD level 19 is required.
The reason I was looking at ZSTD level 19 was that it was the setting used by Wolflandbuilder 6 by Brett Bogert, a remastersys fork, which worked well for ubuntu 20.04 and Mint 20.x. The resulting iso is less than 4GB and can be copied onto FAT32 partitioned flash drives, and I am able to use the old 4GB flash drives I have.
For Mint 21.x, I had initially tried to use the updated version Wolflandbuilder 7 kindly shared by Brett. The live custom iso (made from a customized Vbox installation) boots up fine, but it crashes during installation ( ubi-prepare crashes) due to some changes in ubuntu 22.04/Mint 21.x .
The custom iso made using Cubic has no problems while installing to another hdd (physical or Vbox). It is however, larger than 4GB, so I am using Ventoy with ex-FAT on 8/16GB flash drives. It would be great if I can stay below the 4GB limit , for the above reasons.

@Augusto7743
Copy link

If not is possible add an option to configure the compression level settings will be good be Cubic always use maximum compression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants