git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit1d70e2fb7533ffa87120323257f9c6ea0c4c8c9c authorNikolay Amiantov <ab@fmap.me> dateWed 3 Feb 2016, 14:43 (11 years ago) parent815ff00
2 files changed+2−5
nixos/modules/system/boot/initrd-ssh.nix+2 nixos/modules/system/boot/stage-1-init.sh−5
nixos/modules/system/boot/initrd-ssh.nix+2
@@ -101,6 +101,8 @@ in
101101 mount -t devpts devpts /dev/pts
102102
103103 echo '${cfg.shell}' > /etc/shells
104+ echo 'root:x:0:0:root:/root:${cfg.shell}' > /etc/passwd
105+ echo 'passwd: files' > /etc/nsswitch.conf
104106
105107 mkdir -p /var/log
106108 touch /var/log/lastlog
nixos/modules/system/boot/stage-1-init.sh−5
@@ -72,11 +72,6 @@ mkdir -p /run
7272mount -t tmpfs -o "mode=0755,size=@runSize@" tmpfs /run
7373
7474
75−# Initialise /etc.
76−echo 'root:x:0:0:root:/root:${cfg.shell}' > /etc/passwd
77−echo 'passwd: files' > /etc/nsswitch.conf
78−
79−
8075# Process the kernel command line.
8176export stage2Init=/init
8277for o in $(cat /proc/cmdline); do