summary refs log tree commit diff
path: root/gnu/build/vm.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-12-14 11:55:07 +0100
committerLudovic Courtès <ludo@gnu.org>2014-12-14 11:55:07 +0100
commitc4a1b6c2ba479c6abcd22cab6a1fcd560469e986 (patch)
tree057fb773fcac4200ea66a0267a818be61cca3104 /gnu/build/vm.scm
parent2ed11b3a3e05549ed6ef8a604464f424c0eeae1c (diff)
parent45c5b47b96a238c764c2d32966267f7f897bcc3d (diff)
downloadguix-c4a1b6c2ba479c6abcd22cab6a1fcd560469e986.tar.gz
Merge branch 'master' into 'core-updates'.
Diffstat (limited to 'gnu/build/vm.scm')
-rw-r--r--gnu/build/vm.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 03db1cd5f9..2c53cf5dd9 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -178,6 +178,12 @@ volume name."
   (display "populating...\n")
   (populate-root-file-system system-directory target-directory))
 
+(define (register-grub.cfg-root target grub.cfg)
+  "On file system TARGET, register GRUB.CFG as a GC root."
+  (let ((directory (string-append target "/var/guix/gcroots")))
+    (mkdir-p directory)
+    (symlink grub.cfg (string-append directory "/grub.cfg"))))
+
 (define* (initialize-hard-disk device
                                #:key
                                system-directory
@@ -222,6 +228,9 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation."
 
   (install-grub grub.cfg device target-directory)
 
+  ;; Register GRUB.CFG as a GC root.
+  (register-grub.cfg-root target-directory grub.cfg)
+
   ;; 'guix-register' resets timestamps and everything, so no need to do it
   ;; once more in that case.
   (unless register-closures?