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/vm.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gnu/build/vm.scm') diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 03db1cd5f9..1762582343 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -178,6 +178,18 @@ volume name." (display "populating...\n") (populate-root-file-system system-directory target-directory)) +(define (register-grub.cfg-root target) + "On file system TARGET, make '/boot/grub/grub.cfg' an indirect GC root." + (define hash + ;; XXX: Believe it or not, this is that nix-base32-encoded SHA1 of the + ;; string "/boot/grub/grub.cfg". We need it here, but gcrypt isn't + ;; available (a random hash would do as well, though.) + "kv0yq1d48kavqfhjfzvc4lcyazx2mqhv") + + (let ((directory (string-append target "/var/guix/gcroots/auto"))) + (mkdir-p directory) + (symlink "/boot/grub/grub.cfg" (string-append directory "/" hash)))) + (define* (initialize-hard-disk device #:key system-directory @@ -222,6 +234,10 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation." (install-grub grub.cfg device target-directory) + ;; Register $target/boot/grub/grub.cfg as an indirect root, so that GRUB.CFG + ;; is not reclaimed. + (register-grub.cfg-root target-directory) + ;; 'guix-register' resets timestamps and everything, so no need to do it ;; once more in that case. (unless register-closures? -- cgit v1.2.3 orm>
AgeCommit message (Expand)Author