diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-12-04 23:52:28 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-12-04 23:53:16 +0100 |
commit | 39d1f82b520df44c80fa4acf6614709bb05a0f4c (patch) | |
tree | aaae85dbbe2f83491911bffffe77dec8d56ea823 /guix | |
parent | 764ee9e808e0de0c780c4286410dc9408f4bff4a (diff) | |
download | gnu-guix-39d1f82b520df44c80fa4acf6614709bb05a0f4c.tar gnu-guix-39d1f82b520df44c80fa4acf6614709bb05a0f4c.tar.gz |
system: Make /boot/grub/grub.cfg an indirect GC root.
Fixes <http://bugs.gnu.org/19160>.
* guix/scripts/system.scm (install-grub*): Make /boot/grub/grub.cfg an
indirect GC root.
* gnu/build/install.scm (install-grub): Make TARGET a symlink.
* gnu/build/vm.scm (register-grub.cfg-root): New procedure.
(initialize-hard-disk): Use it.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/scripts/system.scm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 35f858cf29..f2a25dd65a 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -134,10 +134,14 @@ TARGET, and register them." (define (install-grub* grub.cfg device target) "This is a variant of 'install-grub' with error handling, lifted in %STORE-MONAD" - (with-monad %store-monad - (unless (false-if-exception (install-grub grub.cfg device target)) - (leave (_ "failed to install GRUB on device '~a'~%") device)) - (return #t))) + (let ((add-root (store-lift add-indirect-root))) + (mbegin %store-monad + (munless (false-if-exception (install-grub grub.cfg device target)) + (leave (_ "failed to install GRUB on device '~a'~%") device)) + + ;; Register GRUB.CFG as a GC root so that its dependencies (background + ;; image, font, etc.) are not reclaimed. + (add-root "/boot/grub/grub.cfg")))) (define* (install os-drv target #:key (log-port (current-output-port)) |