From 6412e58a6843aaec573a65bacf58308ac4ee9035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 9 Dec 2014 11:06:22 +0100 Subject: system: Don't make /boot/grub/grub.cfg a symlink to the store. This would not work when /boot is a separate partition, as reported by Nikita Karetnikov in . This fixes a regression introduced in 39d1f82. * gnu/build/install.scm (install-grub): Copy GRUB.CFG instead of symlinking it, as was the case before 39d1f82. * gnu/build/vm.scm (register-grub.cfg-root): Add 'grub.cfg' parameter. Make it a permanent GC root instead of an indirect GC root. (initialize-hard-disk): Adjust accordingly. * guix/scripts/system.scm (install-grub*): Replace use of 'add-indirect-root' by the addition of a permanent GC root in %GC-ROOTS-DIRECTORY. --- gnu/build/install.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gnu/build/install.scm') diff --git a/gnu/build/install.scm b/gnu/build/install.scm index 111b79ee59..aa901f6971 100644 --- a/gnu/build/install.scm +++ b/gnu/build/install.scm @@ -36,15 +36,18 @@ (define* (install-grub grub.cfg device mount-point) "Install GRUB with GRUB.CFG on DEVICE, which is assumed to be mounted on -MOUNT-POINT. Note that the caller must make sure that GRUB.CFG is registered -as a GC root." +MOUNT-POINT. + +Note that the caller must make sure that GRUB.CFG is registered as a GC root +so that the fonts, background images, etc. referred to by GRUB.CFG are not +GC'd." (let* ((target (string-append mount-point "/boot/grub/grub.cfg")) (pivot (string-append target ".new"))) (mkdir-p (dirname target)) - ;; Symlink GRUB.CFG, under the assumption that it has been registered as a - ;; GC root somewhere. Do that atomically. - (symlink grub.cfg pivot) + ;; Copy GRUB.CFG instead of just symlinking it, because symlinks won't + ;; work when /boot is on a separate partition. Do that atomically. + (copy-file grub.cfg pivot) (rename-file pivot target) (unless (zero? (system* "grub-install" "--no-floppy" -- cgit v1.2.3