3
0
Fork 0
forked from mirrors/nixpkgs

* 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
# Can't use useradd, since it complain that it doesn't know us
# (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
groupadd -g 0 root
echo | passwd --stdin root

View file

@ -1,4 +1,4 @@
{config, pkgs, upstartJobs, systemPath, wrapperDir}:
{config, pkgs, upstartJobs, systemPath, wrapperDir, defaultShell}:
let
@ -64,6 +64,14 @@ import ../helpers/make-etc.nix {
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.
source = pkgs.substituteAll {
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.
etc = import ./etc.nix {
inherit config pkgs upstartJobs systemPath wrapperDir;
inherit config pkgs upstartJobs systemPath wrapperDir defaultShell;
};
@ -222,6 +222,9 @@ rec {
ignoreCollisions = true;
};
defaultShell = "/var/run/current-system/sw/bin/bash";
# The script that activates the configuration, i.e., it sets up
# /etc, accounts, etc. It doesn't do anything that can only be done
@ -230,7 +233,7 @@ rec {
src = ./activate-configuration.sh;
isExecutable = true;
inherit etc wrapperDir systemPath modprobe;
inherit etc wrapperDir systemPath modprobe defaultShell;
inherit (pkgs) kernel;
readOnlyRoot = config.get ["boot" "readOnlyRoot"];
hostName = config.get ["networking" "hostName"];