about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2024-01-26 22:54:35 +0100
committerGitHub <noreply@github.com>2024-01-26 22:54:35 +0100
commit0dfe2e933f4418afdff7e69d1782b1aa86ca8b95 (patch)
tree158a129541c664ee829b8b0983430faac5a97cb3 /pkgs/build-support
parentf5dced05c654619cb8dab71c9f415efd01339ae7 (diff)
parent14f83d5c6f98a93b7cce1d0a90b24aa9908ea57e (diff)
downloadnixlib-0dfe2e933f4418afdff7e69d1782b1aa86ca8b95.tar
nixlib-0dfe2e933f4418afdff7e69d1782b1aa86ca8b95.tar.gz
nixlib-0dfe2e933f4418afdff7e69d1782b1aa86ca8b95.tar.bz2
nixlib-0dfe2e933f4418afdff7e69d1782b1aa86ca8b95.tar.lz
nixlib-0dfe2e933f4418afdff7e69d1782b1aa86ca8b95.tar.xz
nixlib-0dfe2e933f4418afdff7e69d1782b1aa86ca8b95.tar.zst
nixlib-0dfe2e933f4418afdff7e69d1782b1aa86ca8b95.zip
Merge pull request #283110 from fpletz/pkgs/compress-firmware-xz-ln-filesuffix
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/kernel/compress-firmware-xz.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/build-support/kernel/compress-firmware-xz.nix b/pkgs/build-support/kernel/compress-firmware-xz.nix
index cfb06a5c0f15..a69b31bb3bd0 100644
--- a/pkgs/build-support/kernel/compress-firmware-xz.nix
+++ b/pkgs/build-support/kernel/compress-firmware-xz.nix
@@ -15,6 +15,10 @@ runCommand "${firmware.name}-xz" args ''
           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")"
-      ln -vs -- "''${target/^${firmware}/$out}.xz" "$out/$link.xz"
+      if [ -f $target ]; then
+        ln -vs -- "''${target/^${firmware}/$out}.xz" "$out/$link.xz"
+      else
+        ln -vs -- "''${target/^${firmware}/$out}" "$out/$link"
+      fi
   done
 ''