From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:48979) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iK4BT-0005jp-Qf for guix-patches@gnu.org; Mon, 14 Oct 2019 13:31:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iK4BS-00020C-9W for guix-patches@gnu.org; Mon, 14 Oct 2019 13:31:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:32816) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iK4BS-000207-5i for guix-patches@gnu.org; Mon, 14 Oct 2019 13:31:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iK4BS-0003Sv-0U for guix-patches@gnu.org; Mon, 14 Oct 2019 13:31:02 -0400 Subject: [bug#37750] inputattach: Add baud rate option Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:48942) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iK4Ax-0005G2-UW for guix-patches@gnu.org; Mon, 14 Oct 2019 13:30:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iK4Aw-0001ps-Mp for guix-patches@gnu.org; Mon, 14 Oct 2019 13:30:31 -0400 Received: from sonic302-21.consmr.mail.ir2.yahoo.com ([87.248.110.84]:41082) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iK4Aw-0001oL-AE for guix-patches@gnu.org; Mon, 14 Oct 2019 13:30:30 -0400 Date: Mon, 14 Oct 2019 19:30:22 +0200 Message-ID: <87d0ezb5g1.fsf@yahoo.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" Reply-to: Tim Gesthuizen via Guix-patches From: Tim Gesthuizen via Guix-patches via To: 37750@debbugs.gnu.org --=-=-= Content-Type: text/plain Hi Guix, The attached patch adds a baud-rate option to the inputattach-service which is needed for some devices. It would be nice if someone could review and commit if the patch is fine. Tim. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-Add-baud-rate-parameter-to-inputattach-service.patch >From 29bf34ead05c47a1d045dd60185c803dd6af204a Mon Sep 17 00:00:00 2001 From: Tim Gesthuizen Date: Thu, 10 Oct 2019 18:38:36 +0200 Subject: [PATCH] gnu: Add baud-rate parameter to inputattach-service * gnu/services/desktop.scm (inputattach-configuration): Add baud-rate field. (inputattach-shepherd-service): Add baud-rate to parameters when specified. --- gnu/services/desktop.scm | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index a32756e040..35320bdde2 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -1021,23 +1021,31 @@ as expected."))) (default "wacom")) (device inputattach-configuration-device (default "/dev/ttyS0")) + (baud-rate inputattach-configuration-baud-rate + (default #f)) (log-file inputattach-configuration-log-file (default #f))) (define inputattach-shepherd-service (match-lambda - (($ type device log-file) - (list (shepherd-service - (provision '(inputattach)) - (requirement '(udev)) - (documentation "inputattach daemon") - (start #~(make-forkexec-constructor - (list (string-append #$inputattach - "/bin/inputattach") - (string-append "--" #$type) - #$device) - #:log-file #$log-file)) - (stop #~(make-kill-destructor))))))) + (($ type device baud-rate log-file) + (let ((args (append (if baud-rate + (if (number? baud-rate) + (list "--baud-rate" (number->string baud-rate)) + (error "Expected baud-rate to be a number or #f" baud-rate)) + '()) + (list (string-append "--" type) + device)))) + (list (shepherd-service + (provision '(inputattach)) + (requirement '(udev)) + (documentation "inputattach daemon") + (start #~(make-forkexec-constructor + (cons (string-append #$inputattach + "/bin/inputattach") + (quote #$args)) + #:log-file #$log-file)) + (stop #~(make-kill-destructor)))))))) (define inputattach-service-type (service-type -- 2.23.0 --=-=-=--