This repository was archived by the owner on Aug 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
This repository was archived by the owner on Aug 7, 2025. It is now read-only.
Is it a good idea to compress rootfs in live-iso using zstd instead of gzip? #820
Copy link
Copy link
Open
Description
Is your feature request related to a problem? Please describe.
There is a hard-coded gzip compression at line 95:
clr-installer/isoutils/isoutils.go
Lines 88 to 106 in ffb386f
| args := []string{ | |
| "mksquashfs", | |
| tmpPaths[clrRootfs], | |
| tmpPaths[clrCdroot] + "/images/rootfs.img", | |
| "-b", | |
| "131072", | |
| "-comp", | |
| "gzip", | |
| "-e", | |
| "boot/", | |
| "-e", | |
| "proc/", | |
| "-e", | |
| "sys/", | |
| "-e", | |
| "dev/", | |
| "-e", | |
| "run/", | |
| } |
Lots of benchmarks shows that zstd decompresion speed is much faster than gzip even using compression level 22:
https://gist.github.com/baryluk/70a99b5f26df4671378dd05afef97fce
Describe the solution you'd like
Zstd with compression level 22 will make the rootfs.img smaller but it will consume more memory when the kernel decompress it.
args := []string{
"mksquashfs",
tmpPaths[clrRootfs],
tmpPaths[clrCdroot] + "/images/rootfs.img",
"-b",
"131072",
"-comp",
"zstd",
"-Xcompression-level",
"22",
"-e",
"boot/",
"-e",
"proc/",
"-e",
"sys/",
"-e",
"dev/",
"-e",
"run/",
}Describe alternatives you've considered
Zstd with compression level 19 will make the rootfs.img small and fast, consuming resonable memory.
args := []string{
"mksquashfs",
tmpPaths[clrRootfs],
tmpPaths[clrCdroot] + "/images/rootfs.img",
"-b",
"131072",
"-comp",
"zstd",
"-Xcompression-level",
"19",
"-e",
"boot/",
"-e",
"proc/",
"-e",
"sys/",
"-e",
"dev/",
"-e",
"run/",
}Additional context
Currently, zstd support for mksquashfs in ClearLinux seems broken. clearlinux/distribution#3235
But I still believe compress rootfs using zstd is good for both performance and disk usage.
Metadata
Metadata
Assignees
Labels
No labels