Archived
1
0
Fork 0

system: <boot-parameters> does not use "/dev" device names.

Fixes <https://bugs.gnu.org/28445>.
Reported by Mark H Weaver and Roel Janssen.

* gnu/system.scm (read-boot-parameters)[ensure-not-/dev]: New procedure.
Use it.
This commit is contained in:
Ludovic Courtès 2017-09-21 22:30:59 +02:00
parent e2a95f8b16
commit db4e8fd5d4
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -243,6 +243,11 @@ directly by the user."
((? string? device) ((? string? device)
device))) device)))
(define (ensure-not-/dev device)
(if (and (string? device) (string-prefix? "/" device))
#f
device))
(match (read port) (match (read port)
(('boot-parameters ('version 0) (('boot-parameters ('version 0)
('label label) ('root-device root) ('label label) ('root-device root)
@ -277,17 +282,16 @@ directly by the user."
file))) file)))
(store-device (store-device
(match (assq 'store rest) ;; Linux device names like "/dev/sda1" are not suitable GRUB device
(('store ('device #f) _ ...) ;; identifiers, so we just filter them out.
root-device) (ensure-not-/dev
(('store ('device device) _ ...) (match (assq 'store rest)
(device-sexp->device device)) (('store ('device #f) _ ...)
(_ ;the old format root-device)
;; Root might be a device path like "/dev/sda1", which is not a (('store ('device device) _ ...)
;; suitable GRUB device identifier. (device-sexp->device device))
(if (string-prefix? "/" root) (_ ;the old format
#f root-device))))
root))))
(store-mount-point (store-mount-point
(match (assq 'store rest) (match (assq 'store rest)