Author: eelco
Date: 2010-06-20 20:54:31 +0000 (Sun, 20 Jun 2010)
New Revision: 22349

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22349&view=rev

Modified:
   nixos/branches/boot-order/
   nixos/branches/boot-order/modules/installer/grub/grub-menu-builder.sh
   nixos/branches/boot-order/modules/services/mail/postfix.nix
   nixos/branches/boot-order/modules/services/misc/nix-daemon.nix
   nixos/branches/boot-order/modules/services/printing/cupsd.nix
   nixos/branches/boot-order/modules/system/boot/stage-2-init.sh
   nixos/branches/boot-order/modules/system/upstart/upstart.nix
   nixos/branches/boot-order/tests/subversion.nix

Log:
* Sync with the trunk.


Changes:


Property changes on: nixos/branches/boot-order
___________________________________________________________________
Modified: svn:mergeinfo
   - /nixos/branches/fix-style:13689-13861,14192-14408,14450-14826
/nixos/branches/upstart-0.6:18180-18619
/nixos/trunk:13326-15006,15032,15058,15061-15062,15074,15086,15145,15192,15204,15208,15211,15274,15312,15326,15340,15344-15346,15348,15368-15370,15391,15396-15397,15407-15408,15413,15424,15427-15428,15430,15464,15468-15469,15480,15505,15508-15509,15519,15548,15577,15580,15609,15620,15633,15656,15660-15661,15669,15695-15696,15704-15705,15779,15811,15822-15824,15831,15899,16050,16196,16200
   + /nixos/branches/fix-style:13689-13861,14192-14408,14450-14826
/nixos/branches/upstart-0.6:18180-18619
/nixos/trunk:13326-15006,15032,15058,15061-15062,15074,15086,15145,15192,15204,15208,15211,15274,15312,15326,15340,15344-15346,15348,15368-15370,15391,15396-15397,15407-15408,15413,15424,15427-15428,15430,15464,15468-15469,15480,15505,15508-15509,15519,15548,15577,15580,15609,15620,15633,15656,15660-15661,15669,15695-15696,15704-15705,15779,15811,15822-15824,15831,15899,16050,16196,16200,22147-22346

Modified: nixos/branches/boot-order/modules/installer/grub/grub-menu-builder.sh
===================================================================
--- nixos/branches/boot-order/modules/installer/grub/grub-menu-builder.sh       
2010-06-20 20:52:42 UTC (rev 22348)
+++ nixos/branches/boot-order/modules/installer/grub/grub-menu-builder.sh       
2010-06-20 20:54:31 UTC (rev 22349)
@@ -30,7 +30,7 @@
 # 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

Modified: nixos/branches/boot-order/modules/services/mail/postfix.nix
===================================================================
--- nixos/branches/boot-order/modules/services/mail/postfix.nix 2010-06-20 
20:52:42 UTC (rev 22348)
+++ nixos/branches/boot-order/modules/services/mail/postfix.nix 2010-06-20 
20:54:31 UTC (rev 22349)
@@ -287,8 +287,16 @@
 
         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 =
           ''
             if ! [ -d /var/spool/postfix ]; then

Modified: nixos/branches/boot-order/modules/services/misc/nix-daemon.nix
===================================================================
--- nixos/branches/boot-order/modules/services/misc/nix-daemon.nix      
2010-06-20 20:52:42 UTC (rev 22348)
+++ nixos/branches/boot-order/modules/services/misc/nix-daemon.nix      
2010-06-20 20:54:31 UTC (rev 22349)
@@ -162,6 +162,10 @@
         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.
         ";

Modified: nixos/branches/boot-order/modules/services/printing/cupsd.nix
===================================================================
--- nixos/branches/boot-order/modules/services/printing/cupsd.nix       
2010-06-20 20:52:42 UTC (rev 22348)
+++ nixos/branches/boot-order/modules/services/printing/cupsd.nix       
2010-06-20 20:54:31 UTC (rev 22349)
@@ -106,6 +106,11 @@
 
     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 @@
         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";

Modified: nixos/branches/boot-order/modules/system/boot/stage-2-init.sh
===================================================================
--- nixos/branches/boot-order/modules/system/boot/stage-2-init.sh       
2010-06-20 20:52:42 UTC (rev 22348)
+++ nixos/branches/boot-order/modules/system/boot/stage-2-init.sh       
2010-06-20 20:54:31 UTC (rev 22349)
@@ -131,9 +131,15 @@
 @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
 
 

Modified: nixos/branches/boot-order/modules/system/upstart/upstart.nix
===================================================================
--- nixos/branches/boot-order/modules/system/upstart/upstart.nix        
2010-06-20 20:52:42 UTC (rev 22348)
+++ nixos/branches/boot-order/modules/system/upstart/upstart.nix        
2010-06-20 20:54:31 UTC (rev 22349)
@@ -21,6 +21,7 @@
   makeJob = job:
 
     let
+      hasMain = job.script != "" || job.exec != "";
 
       jobText =
         let log = "/var/log/upstart/${job.name}"; in
@@ -77,12 +78,14 @@
           ${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

Modified: nixos/branches/boot-order/tests/subversion.nix
===================================================================
--- nixos/branches/boot-order/tests/subversion.nix      2010-06-20 20:52:42 UTC 
(rev 22348)
+++ nixos/branches/boot-order/tests/subversion.nix      2010-06-20 20:54:31 UTC 
(rev 22349)
@@ -19,7 +19,7 @@
 
         # 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 =
             ''

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to