From 348935e3b65b5058e65f66682df6a5b184eaacb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Tue, 15 Aug 2017 15:25:18 +0200 Subject: [PATCH] ssh-client: Include nss_ libraries SSH uses passwd database and thus need various NSS plugin libraries, depending upon setting in nsswitch.conf. SSH binary fails within the dracut environment without the libraries: #:/ ssh No user exist for uid 0 --- modules.d/95ssh-client/module-setup.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules.d/95ssh-client/module-setup.sh b/modules.d/95ssh-client/module-setup.sh index 2a7e0ee3..672de502 100755 --- a/modules.d/95ssh-client/module-setup.sh +++ b/modules.d/95ssh-client/module-setup.sh @@ -63,7 +63,16 @@ inst_sshenv() # called by dracut install() { + local _nsslibs + inst_multiple ssh scp inst_sshenv + + _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ + | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') + _nsslibs=${_nsslibs#|} + _nsslibs=${_nsslibs%|} + + inst_libdir_file -n "$_nsslibs" 'libnss_*.so*' }