summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-1.nix
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2018-06-20 05:17:26 +0300
committerTuomas Tynkkynen <tuomas@tuxera.com>2018-06-20 17:58:02 +0300
commitf9218b1346a025d213dec6b838ef33864b3e3456 (patch)
treeb85d8c4decd657b81cfb0e78d7b76caa86c0e0a5 /nixos/modules/system/boot/stage-1.nix
parentd91c70171fb96ee42f10b2d447430b8a9cc576a8 (diff)
downloadnixlib-f9218b1346a025d213dec6b838ef33864b3e3456.tar
nixlib-f9218b1346a025d213dec6b838ef33864b3e3456.tar.gz
nixlib-f9218b1346a025d213dec6b838ef33864b3e3456.tar.bz2
nixlib-f9218b1346a025d213dec6b838ef33864b3e3456.tar.lz
nixlib-f9218b1346a025d213dec6b838ef33864b3e3456.tar.xz
nixlib-f9218b1346a025d213dec6b838ef33864b3e3456.tar.zst
nixlib-f9218b1346a025d213dec6b838ef33864b3e3456.zip
nixos/stage-1: Make find-libs not choke on dynamic linker being in DT_NEEDED
find-libs is currently choking when it finds the dynamic linker
as a DT_NEEDED dependency (from glibc) and bails out like this
(as glibc doesn't have a RPATH):

Couldn't satisfy dependency ld-linux-x86-64.so.2

Actually the caller of find-libs ignores the exit status, so the issue
almost always goes unnoticed and happens to work by chance. But
additionally what happens is that indirect .so dependencies are
left out from the dependency closure calculation, which breaks
latest cryptsetup as libssl.so isn't found anymore.
Diffstat (limited to 'nixos/modules/system/boot/stage-1.nix')
-rw-r--r--nixos/modules/system/boot/stage-1.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix
index 55bb6d3449c5..6756f68cdf72 100644
--- a/nixos/modules/system/boot/stage-1.nix
+++ b/nixos/modules/system/boot/stage-1.nix
@@ -56,6 +56,12 @@ let
       left=("''${left[@]:3}")
       if [ -z ''${seen[$next]+x} ]; then
         seen[$next]=1
+
+        # Ignore the dynamic linker which for some reason appears as a DT_NEEDED of glibc but isn't in glibc's RPATH.
+        case "$next" in
+          ld*.so.?) continue;;
+        esac
+
         IFS=: read -ra paths <<< $rpath
         res=
         for path in "''${paths[@]}"; do