diff options
author | Nikolay Amiantov <ab@fmap.me> | 2016-08-08 18:58:31 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-08 18:58:31 +0400 |
commit | d609df13dd4be8ecfe802876ba4f22767325f9ac (patch) | |
tree | bcc57e2e1725bb0f6f7d3c7b8d5675a079c93407 | |
parent | d7544072d7eb3d4198ba77227633a02be914a80e (diff) | |
parent | 68922e3f7407c5aecd8cc9cc3d22d753269b3f31 (diff) |
Merge pull request #17596 from ttuegel/stage-1
nixos/stage-1: use `readlink -e` in builder
-rw-r--r-- | nixos/modules/system/boot/stage-1.nix | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index a74cfafdd37fd..70429e9c0a227 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -87,15 +87,11 @@ let LDD="$(ldd $BIN)" || continue LIBS="$(echo "$LDD" | awk '{print $3}' | sed '/^$/d')" for LIB in $LIBS; do - [ ! -f "$out/lib/$(basename $LIB)" ] && cp -pdv $LIB $out/lib - while [ "$(readlink $LIB)" != "" ]; do - LINK="$(readlink $LIB)" - if [ "''${LINK:0:1}" != "/" ]; then - LINK="$(dirname $LIB)/$LINK" - fi - LIB="$LINK" - [ ! -f "$out/lib/$(basename $LIB)" ] && cp -pdv $LIB $out/lib - done + TGT="$out/lib/$(basename $LIB)" + if [ ! -f "$TGT" ]; then + SRC="$(readlink -e $LIB)" + cp -pdv "$SRC" "$TGT" + fi done done |