WIP: erofs: zstd compression #8

Draft
dln wants to merge 1 commit from dln/push-strqroxxqtqm into main
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"
];
})