compressFirmwareXz: fix with empty lib/firmware

Fixes: 8aa8e0ce7f ("nixos/udev: compress all firmware if supported")
This commit is contained in:
Alyssa Ross 2022-05-26 07:06:13 +00:00
parent b7207e2235
commit 76405e3077
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0

View file

@ -7,7 +7,7 @@ runCommand "${firmware.name}-xz" {} ''
(cd ${firmware} && find lib/firmware -type d -print0) |
(cd $out && xargs -0 mkdir -v --)
(cd ${firmware} && find lib/firmware -type f -print0) |
(cd $out && xargs -0tP "$NIX_BUILD_CORES" -n1 \
(cd $out && xargs -0rtP "$NIX_BUILD_CORES" -n1 \
sh -c 'xz -9c -T1 -C crc32 --lzma2=dict=2MiB "${firmware}/$1" > "$1.xz"' --)
(cd ${firmware} && find lib/firmware -type l) | while read link; do
target="$(readlink "${firmware}/$link")"