From 1d70e2fb7533ffa87120323257f9c6ea0c4c8c9c Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 3 Feb 2016 14:43:36 +0300 Subject: [PATCH] initrd modules: move passwd and nsswitch back to initrd-ssh Partially reverts commit 901163c0c707d36323400394bf6e75adc4621e2f. This has broken remote SSH into initrd because ${cfg.shell} is not expanded. Also, nsswitch is useless without libnss_files.so which are installed by initrd-ssh. --- nixos/modules/system/boot/initrd-ssh.nix | 2 ++ nixos/modules/system/boot/stage-1-init.sh | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/nixos/modules/system/boot/initrd-ssh.nix b/nixos/modules/system/boot/initrd-ssh.nix index 6809aefb711..506e42bc024 100644 --- a/nixos/modules/system/boot/initrd-ssh.nix +++ b/nixos/modules/system/boot/initrd-ssh.nix @@ -101,6 +101,8 @@ in mount -t devpts devpts /dev/pts echo '${cfg.shell}' > /etc/shells + echo 'root:x:0:0:root:/root:${cfg.shell}' > /etc/passwd + echo 'passwd: files' > /etc/nsswitch.conf mkdir -p /var/log touch /var/log/lastlog diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh index c3d402eca04..95df0ace1ca 100644 --- a/nixos/modules/system/boot/stage-1-init.sh +++ b/nixos/modules/system/boot/stage-1-init.sh @@ -72,11 +72,6 @@ mkdir -p /run mount -t tmpfs -o "mode=0755,size=@runSize@" tmpfs /run -# Initialise /etc. -echo 'root:x:0:0:root:/root:${cfg.shell}' > /etc/passwd -echo 'passwd: files' > /etc/nsswitch.conf - - # Process the kernel command line. export stage2Init=/init for o in $(cat /proc/cmdline); do