From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekEgR-0007uJ-De for guix-patches@gnu.org; Fri, 09 Feb 2018 14:50:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekEgM-0001RN-Gj for guix-patches@gnu.org; Fri, 09 Feb 2018 14:50:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:56032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ekEgM-0001RH-CE for guix-patches@gnu.org; Fri, 09 Feb 2018 14:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ekEgM-0004Tx-0O for guix-patches@gnu.org; Fri, 09 Feb 2018 14:50:02 -0500 Subject: [bug#30355] [PATCH] services: agetty: Make tty optional and add agetty instance to base services. Resent-Message-ID: Date: Fri, 9 Feb 2018 20:49:12 +0100 From: Danny Milosavljevic Message-ID: <20180209204912.379ddae7@scratchpost.org> In-Reply-To: <87d11e1dbj.fsf@gnu.org> References: <20180205081553.5930-1-dannym@scratchpost.org> <87d11e1dbj.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30355@debbugs.gnu.org > Please make that a single =E2=80=98filter=E2=80=99 or =E2=80=98remove=E2= =80=99 call, for clarity. OK! > Rather: >=20 > (match (append agetty-specs console-specs) > (() #f) > ((spec _ ...) > (string-tokenize spec not-comma))) Crashes boot process with form error (). I can't get "match" to work at all in this location. It works fine when I start guile on a normally running system, but in this initrd guile thing, (use-modules (ice-9 match)) doesn't help either. What does help is (@ (ice-9 match) match). Why? (define (default-serial-port) "Return a gexp that determines a reasonable default serial port to use as the tty. This is primarily useful for headless systems." #~(begin ;; console=3Ddevice,options ;; device: can be tty0, ttyS0, lp0, ttyUSB0 (serial). ;; options: BBBBPNF. P n|o|e, N number of bits, ;; F flow control (r RTS) (use-modules (gnu build linux-boot)) (let* ((not-comma (char-set-complement (char-set #\,))) (command (linux-command-line)) (agetty-specs (find-long-options "agetty.tty" command)) (console-specs (filter (lambda (spec) (and (string-prefix? "tty" spec) (not (or (string-prefix? "tty0" spec) (string-prefix? "tty1" spec) (string-prefix? "tty2" spec) (string-prefix? "tty3" spec) (string-prefix? "tty4" spec) (string-prefix? "tty5" spec) (string-prefix? "tty6" spec) (string-prefix? "tty7" spec) (string-prefix? "tty8" spec) (string-prefix? "tty9" spec= ))))) (find-long-options "console" command))) (specs (append agetty-specs console-specs))) (use-modules (ice-9 match)) (match specs (() #f) ; form error here ((spec _ ...) ; underscore is undefined ;; Extract device name from first spec. (match (string-tokenize spec not-comma) ((device-name _ ...) ; underscore is undefined device-name))))))) Works just fine if I execute it in a running system, mind you...