mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 12:53:59 +03:00
initrd-ssh module: don't check if network is up
We already do this in initrd-network.
This commit is contained in:
parent
b4528a696a
commit
1dce7c0b82
@ -96,29 +96,27 @@ in
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
boot.initrd.network.postCommands = ''
|
boot.initrd.network.postCommands = ''
|
||||||
if [ -n "$hasNetwork" ]; then
|
mkdir /dev/pts
|
||||||
mkdir /dev/pts
|
mount -t devpts devpts /dev/pts
|
||||||
mount -t devpts devpts /dev/pts
|
|
||||||
|
|
||||||
echo '${cfg.shell}' > /etc/shells
|
echo '${cfg.shell}' > /etc/shells
|
||||||
echo 'root:x:0:0:root:/root:${cfg.shell}' > /etc/passwd
|
echo 'root:x:0:0:root:/root:${cfg.shell}' > /etc/passwd
|
||||||
echo 'passwd: files' > /etc/nsswitch.conf
|
echo 'passwd: files' > /etc/nsswitch.conf
|
||||||
|
|
||||||
mkdir -p /var/log
|
mkdir -p /var/log
|
||||||
touch /var/log/lastlog
|
touch /var/log/lastlog
|
||||||
|
|
||||||
mkdir -p /etc/dropbear
|
mkdir -p /etc/dropbear
|
||||||
${optionalString (cfg.hostRSAKey != null) "ln -s ${cfg.hostRSAKey} /etc/dropbear/dropbear_rsa_host_key"}
|
${optionalString (cfg.hostRSAKey != null) "ln -s ${cfg.hostRSAKey} /etc/dropbear/dropbear_rsa_host_key"}
|
||||||
${optionalString (cfg.hostDSSKey != null) "ln -s ${cfg.hostDSSKey} /etc/dropbear/dropbear_dss_host_key"}
|
${optionalString (cfg.hostDSSKey != null) "ln -s ${cfg.hostDSSKey} /etc/dropbear/dropbear_dss_host_key"}
|
||||||
${optionalString (cfg.hostECDSAKey != null) "ln -s ${cfg.hostECDSAKey} /etc/dropbear/dropbear_ecdsa_host_key"}
|
${optionalString (cfg.hostECDSAKey != null) "ln -s ${cfg.hostECDSAKey} /etc/dropbear/dropbear_ecdsa_host_key"}
|
||||||
|
|
||||||
mkdir -p /root/.ssh
|
mkdir -p /root/.ssh
|
||||||
${concatStrings (map (key: ''
|
${concatStrings (map (key: ''
|
||||||
echo -n ${escapeShellArg key} >> /root/.ssh/authorized_keys
|
echo -n ${escapeShellArg key} >> /root/.ssh/authorized_keys
|
||||||
'') cfg.authorizedKeys)}
|
'') cfg.authorizedKeys)}
|
||||||
|
|
||||||
dropbear -s -j -k -E -m -p ${toString cfg.port}
|
dropbear -s -j -k -E -m -p ${toString cfg.port}
|
||||||
fi
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user