From f9218b1346a025d213dec6b838ef33864b3e3456 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Wed, 20 Jun 2018 05:17:26 +0300 Subject: [PATCH] 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. --- nixos/modules/system/boot/stage-1.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index 55bb6d3449c..6756f68cdf7 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