system: Prevent grub.cfg from being GC'd.
* guix/build/install.scm (install-grub): Use 'copy-file' instead of 'symlink' for GRUB.CFG.
This commit is contained in:
parent
d5b429abda
commit
6ffd11f129
|
@ -38,11 +38,18 @@
|
||||||
(define* (install-grub grub.cfg device mount-point)
|
(define* (install-grub grub.cfg device mount-point)
|
||||||
"Install GRUB with GRUB.CFG on DEVICE, which is assumed to be mounted on
|
"Install GRUB with GRUB.CFG on DEVICE, which is assumed to be mounted on
|
||||||
MOUNT-POINT. Return #t on success."
|
MOUNT-POINT. Return #t on success."
|
||||||
(mkdir-p (string-append mount-point "/boot/grub"))
|
(let* ((target (string-append mount-point "/boot/grub/grub.cfg"))
|
||||||
(symlink grub.cfg (string-append mount-point "/boot/grub/grub.cfg"))
|
(pivot (string-append target ".new")))
|
||||||
(zero? (system* "grub-install" "--no-floppy"
|
(mkdir-p (dirname target))
|
||||||
"--boot-directory" (string-append mount-point "/boot")
|
|
||||||
device)))
|
;; Copy GRUB.CFG instead of just symlinking it since it's not a GC root.
|
||||||
|
;; Do that atomically.
|
||||||
|
(copy-file grub.cfg pivot)
|
||||||
|
(rename-file pivot target)
|
||||||
|
|
||||||
|
(zero? (system* "grub-install" "--no-floppy"
|
||||||
|
"--boot-directory" (string-append mount-point "/boot")
|
||||||
|
device))))
|
||||||
|
|
||||||
(define (evaluate-populate-directive directive target)
|
(define (evaluate-populate-directive directive target)
|
||||||
"Evaluate DIRECTIVE, an sexp describing a file or directory to create under
|
"Evaluate DIRECTIVE, an sexp describing a file or directory to create under
|
||||||
|
|
Loading…
Reference in New Issue