* Sync with the trunk.
svn path=/nixos/branches/boot-order/; revision=22349
This commit is contained in:
parent
061ea1674f
commit
d43d321e86
@ -30,7 +30,7 @@ esac
|
|||||||
# the GRUB config file must be relative to the root of the /boot
|
# the GRUB config file must be relative to the root of the /boot
|
||||||
# filesystem. `$bootRoot' is the path to be prepended to paths under
|
# filesystem. `$bootRoot' is the path to be prepended to paths under
|
||||||
# /boot.
|
# /boot.
|
||||||
if [ "$(stat -f -c '%i' /)" = "$(stat -f -c '%i' /boot)" ]; then
|
if [ "$(stat -c '%D' /.)" = "$(stat -c '%D' /boot/.)" ]; then
|
||||||
bootRoot=/boot
|
bootRoot=/boot
|
||||||
copyKernels="@copyKernels@" # user can override in the NixOS config
|
copyKernels="@copyKernels@" # user can override in the NixOS config
|
||||||
else
|
else
|
||||||
|
@ -287,7 +287,15 @@ in
|
|||||||
|
|
||||||
daemonType = "none";
|
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 =
|
preStart =
|
||||||
''
|
''
|
||||||
|
@ -162,6 +162,10 @@ in
|
|||||||
internal = true;
|
internal = true;
|
||||||
default = "";
|
default = "";
|
||||||
merge = mergeStringOption;
|
merge = mergeStringOption;
|
||||||
|
example = ''
|
||||||
|
export NIX_TARGET_LOAD=$(( 3 * $(${pkgs.coreutils}/bin/nproc) / 2 ))
|
||||||
|
export NIX_MAX_PARALLELIZATION=$NIX_TARGET_LOAD
|
||||||
|
'';
|
||||||
description = "
|
description = "
|
||||||
Environment variables used by Nix.
|
Environment variables used by Nix.
|
||||||
";
|
";
|
||||||
|
@ -106,6 +106,11 @@ in
|
|||||||
|
|
||||||
services.dbus.packages = [cups];
|
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 =
|
environment.etc =
|
||||||
[ # CUPS expects the following files in its ServerRoot.
|
[ # CUPS expects the following files in its ServerRoot.
|
||||||
{ source = "${cups}/etc/cups/mime.convs";
|
{ source = "${cups}/etc/cups/mime.convs";
|
||||||
@ -122,15 +127,17 @@ in
|
|||||||
startOn = "started network-interfaces";
|
startOn = "started network-interfaces";
|
||||||
stopOn = "stopping network-interfaces";
|
stopOn = "stopping network-interfaces";
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
# Cups scripts for printing (psto...) require awk, sed, grep, ...
|
||||||
|
PATH = "${config.system.path}/bin";
|
||||||
|
};
|
||||||
|
|
||||||
preStart =
|
preStart =
|
||||||
''
|
''
|
||||||
mkdir -m 0755 -p ${logDir}
|
mkdir -m 0755 -p ${logDir}
|
||||||
mkdir -m 0700 -p /var/cache/cups
|
mkdir -m 0700 -p /var/cache/cups
|
||||||
mkdir -m 0700 -p /var/spool/cups
|
mkdir -m 0700 -p /var/spool/cups
|
||||||
mkdir -m 0755 -p ${cfg.tempDir}
|
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";
|
exec = "${cups}/sbin/cupsd -c ${pkgs.writeText "cupsd.conf" cfg.cupsdConf} -F";
|
||||||
|
@ -131,9 +131,15 @@ echo "running activation script..."
|
|||||||
@activateConfiguration@ "$systemConfig"
|
@activateConfiguration@ "$systemConfig"
|
||||||
|
|
||||||
|
|
||||||
# Record the boot configuration. !!! Should this be a GC root?
|
# Record the boot configuration.
|
||||||
if test -n "$systemConfig"; then
|
if test -n "$systemConfig"; then
|
||||||
ln -sfn "$systemConfig" /var/run/booted-system
|
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
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ let
|
|||||||
makeJob = job:
|
makeJob = job:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
hasMain = job.script != "" || job.exec != "";
|
||||||
|
|
||||||
jobText =
|
jobText =
|
||||||
let log = "/var/log/upstart/${job.name}"; in
|
let log = "/var/log/upstart/${job.name}"; in
|
||||||
@ -77,12 +78,14 @@ let
|
|||||||
${optionalString job.task "task"}
|
${optionalString job.task "task"}
|
||||||
${optionalString (!job.task && job.respawn) "respawn"}
|
${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
|
pre-stop script
|
||||||
exec >> ${log} 2>&1
|
exec >> ${log} 2>&1
|
||||||
${job.preStop}
|
${job.preStop}
|
||||||
end script
|
end script
|
||||||
''}
|
'')}
|
||||||
|
|
||||||
${optionalString (job.postStop != "") ''
|
${optionalString (job.postStop != "") ''
|
||||||
post-stop script
|
post-stop script
|
||||||
|
@ -19,7 +19,7 @@ let
|
|||||||
|
|
||||||
# To build the kernel with coverage instrumentation, we need a
|
# To build the kernel with coverage instrumentation, we need a
|
||||||
# special patch to make coverage data available under /proc.
|
# special patch to make coverage data available under /proc.
|
||||||
kernel = pkgs.kernel.override (orig: {
|
linux = pkgs.linux.override (orig: {
|
||||||
stdenv = cleanupBuildTree (keepBuildTree orig.stdenv);
|
stdenv = cleanupBuildTree (keepBuildTree orig.stdenv);
|
||||||
extraConfig =
|
extraConfig =
|
||||||
''
|
''
|
||||||
|
Loading…
Reference in New Issue
Block a user