summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorThomas Strobel <ts468@cam.ac.uk>2015-07-15 12:19:38 +0200
committerThomas Strobel <ts468@cam.ac.uk>2015-07-15 12:38:37 +0200
commit2ff91293374111a7a07345b912b5b4316d562a44 (patch)
treec3ee5c01abac1d81c036f12f0dd8225e18f69baa /nixos/modules
parentdf038c93cc823fef9ceb547e3d635317bdd7d39e (diff)
downloadnixlib-2ff91293374111a7a07345b912b5b4316d562a44.tar
nixlib-2ff91293374111a7a07345b912b5b4316d562a44.tar.gz
nixlib-2ff91293374111a7a07345b912b5b4316d562a44.tar.bz2
nixlib-2ff91293374111a7a07345b912b5b4316d562a44.tar.lz
nixlib-2ff91293374111a7a07345b912b5b4316d562a44.tar.xz
nixlib-2ff91293374111a7a07345b912b5b4316d562a44.tar.zst
nixlib-2ff91293374111a7a07345b912b5b4316d562a44.zip
xen: fixes (authored by michalpalka)
Xen required a few changes in order to be usable:
* Include xenfs module in initrd as loading it in the activation
  script was failing.
* Include /etc/default/xendomains, which is needed by
  xen-domains service.
* Create /var/log/xen and /var/lib/xen directories in
  the xen-store service, which are needed by the xl command.
  The directories could be created by any other script as long as
  they are guaranteed to exist before xl is called.
* Fix a reference to /bin/ls in the xendomains script.
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/virtualisation/xen-dom0.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/nixos/modules/virtualisation/xen-dom0.nix b/nixos/modules/virtualisation/xen-dom0.nix
index c750286a3970..a0b2d5363eb2 100644
--- a/nixos/modules/virtualisation/xen-dom0.nix
+++ b/nixos/modules/virtualisation/xen-dom0.nix
@@ -121,6 +121,10 @@ in
         "xenfs"
       ];
 
+    # The xenfs module is needed in system.activationScripts.xen, but
+    # the modprobe command there fails silently. Include xenfs in the
+    # initrd as a work around.
+    boot.initrd.kernelModules = [ "xenfs" ];
 
     # The radeonfb kernel module causes the screen to go black as soon
     # as it's loaded, so don't load it.
@@ -182,6 +186,9 @@ in
         { source = "${pkgs.xen}/etc/xen/scripts";
           target = "xen/scripts";
         }
+        { source = "${pkgs.xen}/etc/default/xendomains";
+          target = "default/xendomains";
+        }
       ];
 
     # Xen provides udev rules.
@@ -199,7 +206,8 @@ in
         rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
 
         mkdir -p /var/run
-        ${optionalString cfg.trace "mkdir -p /var/log/xen"}
+        mkdir -p /var/log/xen # Running xl requires /var/log/xen and /var/lib/xen,
+        mkdir -p /var/lib/xen # so we create them here unconditionally.
         grep -q control_d /proc/xen/capabilities
         '';
       serviceConfig.ExecStart = ''