summary refs log tree commit diff
path: root/gnu/system
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-02-02 01:34:33 +0100
committerLudovic Courtès <ludo@gnu.org>2014-02-02 01:34:33 +0100
commitf6a9d0484c6cdd1554f6ce0e7372ec8b7f2a52ca (patch)
tree6e42090d0b19817a8e328be70ad88a29187933e5 /gnu/system
parent92cb2e28884ab6ecc5c113ef54eb5aeebae9bb2b (diff)
downloadguix-f6a9d0484c6cdd1554f6ce0e7372ec8b7f2a52ca.tar.gz
gnu: vm: Add /run/current-system and /bin/sh.
* gnu/system/vm.scm (operating-system-default-contents): Populate
  /run/current-system and create /bin/sh.
* gnu/system.scm (operating-system-profile-derivation,
  operating-system-profile-directory): New procedures.
  (operating-system-derivation): Use it.
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/vm.scm13
1 files changed, 9 insertions, 4 deletions
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index f36cfd0318..00edc8e40b 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -458,15 +458,20 @@ such as /etc files."
 (define (operating-system-default-contents os)
   "Return a list of directives suitable for 'system-qemu-image' describing the
 basic contents of the root file system of OS."
-  (mlet* %store-monad ((os-drv         (operating-system-derivation os))
-                       (os-dir      -> (derivation->output-path os-drv))
-                       (build-user-gid (operating-system-build-gid os)))
-    (return `((directory "/nix/store" 0 ,(or build-user-gid 0))
+  (mlet* %store-monad ((os-drv    (operating-system-derivation os))
+                       (os-dir -> (derivation->output-path os-drv))
+                       (build-gid (operating-system-build-gid os))
+                       (profile   (operating-system-profile-directory os)))
+    (return `((directory "/nix/store" 0 ,(or build-gid 0))
               (directory "/etc")
               (directory "/var/log")                     ; for dmd
               (directory "/var/run/nscd")
               (directory "/var/nix/gcroots")
               ("/var/nix/gcroots/system" -> ,os-dir)
+              (directory "/run")
+              ("/run/current-system" -> ,profile)
+              (directory "/bin")
+              ("/bin/sh" -> "/run/current-system/bin/sh")
               (directory "/tmp")
               (directory "/var/nix/profiles/per-user/root" 0 0)
               (directory "/var/nix/profiles/per-user/guest"