* Sync with the trunk.

svn path=/nixos/branches/boot-order/; revision=22349
This commit is contained in:
Eelco Dolstra 2010-06-20 20:54:31 +00:00
parent 061ea1674f
commit d43d321e86
7 changed files with 37 additions and 9 deletions

View File

@ -30,7 +30,7 @@ esac
# the GRUB config file must be relative to the root of the /boot
# filesystem. `$bootRoot' is the path to be prepended to paths under
# /boot.
if [ "$(stat -f -c '%i' /)" = "$(stat -f -c '%i' /boot)" ]; then
if [ "$(stat -c '%D' /.)" = "$(stat -c '%D' /boot/.)" ]; then
bootRoot=/boot
copyKernels="@copyKernels@" # user can override in the NixOS config
else

View File

@ -287,7 +287,15 @@ in
daemonType = "none";
respawn = false;
respawn = true;
script = ''
while ${pkgs.procps}/bin/ps `${pkgs.coreutils}/bin/cat /var/postfix/queue/pid/master.pid` |
grep -q postfix
do
${pkgs.coreutils}/bin/sleep 1m
done
'';
preStart =
''

View File

@ -162,6 +162,10 @@ in
internal = true;
default = "";
merge = mergeStringOption;
example = ''
export NIX_TARGET_LOAD=$(( 3 * $(${pkgs.coreutils}/bin/nproc) / 2 ))
export NIX_MAX_PARALLELIZATION=$NIX_TARGET_LOAD
'';
description = "
Environment variables used by Nix.
";

View File

@ -106,6 +106,11 @@ in
services.dbus.packages = [cups];
# cups uses libusb to talk to printers, and does not use the
# linux kernel driver. If the driver is not in a black list, it
# gets loaded, and then cups cannot access the printers.
boot.blacklistedKernelModules = [ "usblp" ];
environment.etc =
[ # CUPS expects the following files in its ServerRoot.
{ source = "${cups}/etc/cups/mime.convs";
@ -122,15 +127,17 @@ in
startOn = "started network-interfaces";
stopOn = "stopping network-interfaces";
environment = {
# Cups scripts for printing (psto...) require awk, sed, grep, ...
PATH = "${config.system.path}/bin";
};
preStart =
''
mkdir -m 0755 -p ${logDir}
mkdir -m 0700 -p /var/cache/cups
mkdir -m 0700 -p /var/spool/cups
mkdir -m 0755 -p ${cfg.tempDir}
# Make USB printers show up.
${modprobe}/sbin/modprobe usblp || true
'';
exec = "${cups}/sbin/cupsd -c ${pkgs.writeText "cupsd.conf" cfg.cupsdConf} -F";

View File

@ -131,9 +131,15 @@ echo "running activation script..."
@activateConfiguration@ "$systemConfig"
# Record the boot configuration. !!! Should this be a GC root?
# Record the boot configuration.
if test -n "$systemConfig"; then
ln -sfn "$systemConfig" /var/run/booted-system
# Prevent the booted system form being garbage-collected
# If it weren't a gcroot, if we were running a different kernel,
# switched system, and garbage collected all, we could not load
# kernel modules anymore.
ln -sfn /var/run/booted-system /nix/var/nix/gcroots/booted-system
fi

View File

@ -21,6 +21,7 @@ let
makeJob = job:
let
hasMain = job.script != "" || job.exec != "";
jobText =
let log = "/var/log/upstart/${job.name}"; in
@ -77,12 +78,14 @@ let
${optionalString job.task "task"}
${optionalString (!job.task && job.respawn) "respawn"}
${optionalString (job.preStop != "") ''
${ # preStop is run only if there is exec or script.
# (upstart 0.6.5, job.c:562)
optionalString (job.preStop != "") (assert hasMain; ''
pre-stop script
exec >> ${log} 2>&1
${job.preStop}
end script
''}
'')}
${optionalString (job.postStop != "") ''
post-stop script

View File

@ -19,7 +19,7 @@ let
# To build the kernel with coverage instrumentation, we need a
# special patch to make coverage data available under /proc.
kernel = pkgs.kernel.override (orig: {
linux = pkgs.linux.override (orig: {
stdenv = cleanupBuildTree (keepBuildTree orig.stdenv);
extraConfig =
''