* Use /var/run/current-system/sw/bin/bash as the default shell for new

accounts.  Obviously we cannot put the store path of bash in
  /etc/passwd since it's too fragile (it could be garbage collected),
  hence this indirection.

svn path=/nixos/trunk/; revision=8383
This commit is contained in:
Eelco Dolstra 2007-03-20 13:30:14 +00:00
parent c10fe148a3
commit be8bcebfe0
4 changed files with 18 additions and 4 deletions

View File

@ -70,7 +70,7 @@ if ! test -e /etc/passwd; then
touch /etc/shadow; chmod 0600 /etc/shadow touch /etc/shadow; chmod 0600 /etc/shadow
# Can't use useradd, since it complain that it doesn't know us # Can't use useradd, since it complain that it doesn't know us
# (bootstrap problem!). # (bootstrap problem!).
echo "root:x:0:0:System administrator:$rootHome:@shell@" >> /etc/passwd echo "root:x:0:0:System administrator:$rootHome:@defaultShell@" >> /etc/passwd
echo "root::::::::" >> /etc/shadow echo "root::::::::" >> /etc/shadow
groupadd -g 0 root groupadd -g 0 root
echo | passwd --stdin root echo | passwd --stdin root

View File

@ -1,4 +1,4 @@
{config, pkgs, upstartJobs, systemPath, wrapperDir}: {config, pkgs, upstartJobs, systemPath, wrapperDir, defaultShell}:
let let
@ -64,6 +64,14 @@ import ../helpers/make-etc.nix {
target = "default/passwd"; target = "default/passwd";
} }
{ # Configuration for useradd.
source = pkgs.substituteAll {
src = ./etc/default/useradd;
inherit defaultShell;
};
target = "default/useradd";
}
{ # Dhclient hooks for emitting ip-up/ip-down events. { # Dhclient hooks for emitting ip-up/ip-down events.
source = pkgs.substituteAll { source = pkgs.substituteAll {
src = ./etc/dhclient-exit-hooks; src = ./etc/dhclient-exit-hooks;

View File

@ -0,0 +1,3 @@
GROUP=100
HOME=/home
SHELL=@defaultShell@

View File

@ -148,7 +148,7 @@ rec {
# The static parts of /etc. # The static parts of /etc.
etc = import ./etc.nix { etc = import ./etc.nix {
inherit config pkgs upstartJobs systemPath wrapperDir; inherit config pkgs upstartJobs systemPath wrapperDir defaultShell;
}; };
@ -222,6 +222,9 @@ rec {
ignoreCollisions = true; ignoreCollisions = true;
}; };
defaultShell = "/var/run/current-system/sw/bin/bash";
# The script that activates the configuration, i.e., it sets up # The script that activates the configuration, i.e., it sets up
# /etc, accounts, etc. It doesn't do anything that can only be done # /etc, accounts, etc. It doesn't do anything that can only be done
@ -230,7 +233,7 @@ rec {
src = ./activate-configuration.sh; src = ./activate-configuration.sh;
isExecutable = true; isExecutable = true;
inherit etc wrapperDir systemPath modprobe; inherit etc wrapperDir systemPath modprobe defaultShell;
inherit (pkgs) kernel; inherit (pkgs) kernel;
readOnlyRoot = config.get ["boot" "readOnlyRoot"]; readOnlyRoot = config.get ["boot" "readOnlyRoot"];
hostName = config.get ["networking" "hostName"]; hostName = config.get ["networking" "hostName"];