services: inputattach: Add 'baud-rate' parameter.
* gnu/services/desktop.scm (inputattach-configuration): Add baud-rate field. (inputattach-shepherd-service): Add baud-rate to parameters when specified. * doc/guix.texi (Miscellaneous Services): [inputattach Service] Document baud-rate parameter. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
2f000f2ef4
commit
84261a233e
@ -24573,6 +24573,10 @@ The type of device to connect to. Run @command{inputattach --help}, from the
|
|||||||
@item @code{device} (default: @code{"/dev/ttyS0"})
|
@item @code{device} (default: @code{"/dev/ttyS0"})
|
||||||
The device file to connect to the device.
|
The device file to connect to the device.
|
||||||
|
|
||||||
|
@item @code{baud-rate} (default: @code{#f})
|
||||||
|
Baud rate to use for the serial connection.
|
||||||
|
Should be a number or @code{#f}.
|
||||||
|
|
||||||
@item @code{log-file} (default: @code{#f})
|
@item @code{log-file} (default: @code{#f})
|
||||||
If true, this must be the name of a file to log messages to.
|
If true, this must be the name of a file to log messages to.
|
||||||
@end table
|
@end table
|
||||||
|
@ -1028,23 +1028,29 @@ as expected.")))
|
|||||||
(default "wacom"))
|
(default "wacom"))
|
||||||
(device inputattach-configuration-device
|
(device inputattach-configuration-device
|
||||||
(default "/dev/ttyS0"))
|
(default "/dev/ttyS0"))
|
||||||
|
(baud-rate inputattach-configuration-baud-rate
|
||||||
|
(default #f))
|
||||||
(log-file inputattach-configuration-log-file
|
(log-file inputattach-configuration-log-file
|
||||||
(default #f)))
|
(default #f)))
|
||||||
|
|
||||||
(define inputattach-shepherd-service
|
(define inputattach-shepherd-service
|
||||||
(match-lambda
|
(match-lambda
|
||||||
(($ <inputattach-configuration> type device log-file)
|
(($ <inputattach-configuration> type device baud-rate log-file)
|
||||||
|
(let ((args (append (if baud-rate
|
||||||
|
(list "--baud-rate" (number->string baud-rate))
|
||||||
|
'())
|
||||||
|
(list (string-append "--" type)
|
||||||
|
device))))
|
||||||
(list (shepherd-service
|
(list (shepherd-service
|
||||||
(provision '(inputattach))
|
(provision '(inputattach))
|
||||||
(requirement '(udev))
|
(requirement '(udev))
|
||||||
(documentation "inputattach daemon")
|
(documentation "inputattach daemon")
|
||||||
(start #~(make-forkexec-constructor
|
(start #~(make-forkexec-constructor
|
||||||
(list (string-append #$inputattach
|
(cons (string-append #$inputattach
|
||||||
"/bin/inputattach")
|
"/bin/inputattach")
|
||||||
(string-append "--" #$type)
|
(quote #$args))
|
||||||
#$device)
|
|
||||||
#:log-file #$log-file))
|
#:log-file #$log-file))
|
||||||
(stop #~(make-kill-destructor)))))))
|
(stop #~(make-kill-destructor))))))))
|
||||||
|
|
||||||
(define inputattach-service-type
|
(define inputattach-service-type
|
||||||
(service-type
|
(service-type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user