bootloader: grub: Fix serial mode.

* gnu/bootloader/grub.scm (grub-setup-io): Fix serial mode display by
declaring the serial property before the terminal_input and terminal_output
properties.
This commit is contained in:
Mathieu Othacehe 2022-01-13 11:06:31 +01:00
parent 4addc484b9
commit ea71ec1630
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -264,36 +264,38 @@ is a string that can be inserted in grub.cfg."
at_keyboard usb_keyboard)) at_keyboard usb_keyboard))
(io (string-append (io (string-append
"terminal_output " ;; UNIT and SPEED are arguments to the same GRUB command
(symbols->string ;; ("serial"), so we process them together.
(map (if (or unit speed)
(lambda (output) (string-append
(if (memq output valid-outputs) output #f)) outputs)) "\n"
(if (null? inputs)
""
(string-append
"terminal_input "
(symbols->string
(map
(lambda (input)
(if (memq input valid-inputs) input #f)) inputs)) "\n"))
;; UNIT and SPEED are arguments to the same GRUB command
;; ("serial"), so we process them together.
(if (or unit speed)
(string-append
"serial" "serial"
(if unit (if unit
;; COM ports 1 through 4 ;; COM ports 1 through 4
(if (and (exact-integer? unit) (<= unit 3) (>= unit 0)) (if (and (exact-integer? unit) (<= unit 3) (>= unit 0))
(string-append " --unit=" (number->string unit)) (string-append " --unit=" (number->string unit))
#f) #f)
"") "")
(if speed (if speed
(if (exact-integer? speed) (if (exact-integer? speed)
(string-append " --speed=" (number->string speed)) (string-append " --speed=" (number->string speed))
#f) #f)
"")) "")
"")))) "\n")
"")
(if (null? inputs)
""
(string-append
"terminal_input "
(symbols->string
(map
(lambda (input)
(if (memq input valid-inputs) input #f)) inputs))
"\n"))
"terminal_output "
(symbols->string
(map
(lambda (output)
(if (memq output valid-outputs) output #f)) outputs)))))
(format #f "~a" io))) (format #f "~a" io)))
(define (grub-root-search device file) (define (grub-root-search device file)