mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
system: Don't emit a GRUB 'search' command when passed a GRUB file name.
Reported by Tomáš Čech <tcech@suse.com> at <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20067#26>. * gnu/system/grub.scm (grub-root-search): Don't emit anything when FILE is a string that does not denote an absolute file name.
This commit is contained in:
parent
7acd71d13d
commit
5babe521c8
1 changed files with 17 additions and 12 deletions
|
@ -234,18 +234,23 @@ (define (grub-root-search root-fs file)
|
||||||
"Return the GRUB 'search' command to look for ROOT-FS, which contains FILE,
|
"Return the GRUB 'search' command to look for ROOT-FS, which contains FILE,
|
||||||
a gexp. The result is a gexp that can be inserted in the grub.cfg-generation
|
a gexp. The result is a gexp that can be inserted in the grub.cfg-generation
|
||||||
code."
|
code."
|
||||||
(case (file-system-title root-fs)
|
;; Usually FILE is a file name gexp like "/gnu/store/…-linux/vmlinuz", but
|
||||||
;; Preferably refer to ROOT-FS by its UUID or label. This is more
|
;; it can also be something like "(hd0,msdos1)/vmlinuz" in the case of
|
||||||
;; efficient and less ambiguous, see <>.
|
;; custom menu entries. In the latter case, don't emit a 'search' command.
|
||||||
((uuid)
|
(if (and (string? file) (not (string-prefix? "/" file)))
|
||||||
(format #f "search --fs-uuid --set ~a"
|
""
|
||||||
(uuid->string (file-system-device root-fs))))
|
(case (file-system-title root-fs)
|
||||||
((label)
|
;; Preferably refer to ROOT-FS by its UUID or label. This is more
|
||||||
(format #f "search --label --set ~a"
|
;; efficient and less ambiguous, see <>.
|
||||||
(file-system-device root-fs)))
|
((uuid)
|
||||||
(else
|
(format #f "search --fs-uuid --set ~a"
|
||||||
;; As a last resort, look for any device containing FILE.
|
(uuid->string (file-system-device root-fs))))
|
||||||
#~(format #f "search --file --set ~a" #$file))))
|
((label)
|
||||||
|
(format #f "search --label --set ~a"
|
||||||
|
(file-system-device root-fs)))
|
||||||
|
(else
|
||||||
|
;; As a last resort, look for any device containing FILE.
|
||||||
|
#~(format #f "search --file --set ~a" #$file)))))
|
||||||
|
|
||||||
(define* (grub-configuration-file config store-fs entries
|
(define* (grub-configuration-file config store-fs entries
|
||||||
#:key
|
#:key
|
||||||
|
|
Loading…
Reference in a new issue