From 39d1f82b520df44c80fa4acf6614709bb05a0f4c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 4 Dec 2014 23:52:28 +0100 Subject: system: Make /boot/grub/grub.cfg an indirect GC root. Fixes . * 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. --- gnu/build/install.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gnu/build/install.scm') diff --git a/gnu/build/install.scm b/gnu/build/install.scm index a472259a4a..111b79ee59 100644 --- a/gnu/build/install.scm +++ b/gnu/build/install.scm @@ -36,14 +36,15 @@ (define* (install-grub grub.cfg device mount-point) "Install GRUB with GRUB.CFG on DEVICE, which is assumed to be mounted on -MOUNT-POINT." +MOUNT-POINT. Note that the caller must make sure that GRUB.CFG is registered +as a GC root." (let* ((target (string-append mount-point "/boot/grub/grub.cfg")) (pivot (string-append target ".new"))) (mkdir-p (dirname target)) - ;; Copy GRUB.CFG instead of just symlinking it since it's not a GC root. - ;; Do that atomically. - (copy-file grub.cfg pivot) + ;; Symlink GRUB.CFG, under the assumption that it has been registered as a + ;; GC root somewhere. Do that atomically. + (symlink grub.cfg pivot) (rename-file pivot target) (unless (zero? (system* "grub-install" "--no-floppy" -- cgit v1.2.3