WIP: erofs: zstd compression
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful

FIXME: needs zstd support in the kernel, so probablt not a great idea
for now
This commit is contained in:
Daniel Lundin 2024-11-14 20:06:23 +01:00
parent a4d0e10cc4
commit 936e38be15
Signed by: dln
SSH key fingerprint: SHA256:dQy1Xj3UiqJYpKR5ggQ2bxgz4jCH8IF+k3AB8o0kmdI
3 changed files with 15 additions and 2 deletions

View file

@ -5,6 +5,7 @@
(final: prev: {
composefs = final.callPackage ../../pkgs/composefs.nix { inherit prev; };
erofs-utils = final.callPackage ../../pkgs/erofs-utils.nix { inherit prev; };
qemu_tiny = final.callPackage ../../pkgs/qemu.nix { inherit prev; };
systemdUkify = final.callPackage ../../pkgs/systemd-ukify.nix { inherit prev; };

View file

@ -46,8 +46,10 @@ let
split = true;
mkfsOptions = lib.mkIf config.image.compress {
erofs = [
"-zlz4hc,level=12"
"-Efragments,dedupe,ztailpacking"
"-zzstd,6" # Zstd compression
"-T0" # Fixed timestamp for all files
"-C1048576" # 1 MiB cluster size
"-Efragments,dedupe,ztailpacking" # Extra features
];
};
partitions = initialPartitions;

10
pkgs/erofs-utils.nix Normal file
View file

@ -0,0 +1,10 @@
{ prev, ... }:
# Build mkfs.erofs with zstd support
prev.erofs-utils.overrideAttrs (final: p: {
buildInputs = p.buildInputs ++ [ prev.zstd ];
configureFlags = p.configureFlags ++ [
"--enable-multithreading"
"--enable-zstd"
];
})