diff options
Diffstat (limited to 'guix/scripts/system.scm')
-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)) |