GNU bug report logs - #30355
[PATCH] services: agetty: Make tty optional and add agetty instance to base services.

Previous Next

Package: guix-patches;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Mon, 5 Feb 2018 08:17:02 UTC

Severity: normal

Tags: patch

Done: Danny Milosavljevic <dannym <at> scratchpost.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 30355 <at> debbugs.gnu.org
Subject: [bug#30355] [PATCH] services: agetty: Make tty optional and add agetty instance to base services.
Date: Tue, 13 Feb 2018 23:04:10 +0100
Heya,

Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> I tried this now:
>
> (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=device,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) (ice-9 match))

[...]

>         (match specs
>          (() #f)
>          ((spec _ ...)
>           ;; Extract device name from first spec.
>           (match (string-tokenize spec not-comma)
>            ((device-name _ ...)
>             device-name)))))))
>
> I get 
>
> $ ./pre-inst-env guix system reconfigure /etc/config.scm --fallback
> ...
> guix system: error: exception caught while executing 'eval' on service 'root':
> ERROR: Syntax error:
> unknown location: unexpected syntax in form ()

That’s a sign that the outermost ‘match’ wasn’t macro-expanded, hence
the error about ().

I got it: that’s because this gexp is spliced in a non-top-level
context.  The end result is something like:

  (let ((foo bar)
        (baz (begin (use-modules …) …)))
    …)

and the ‘use-modules’ there doesn’t have the desired effect.

The fix is to remove this ‘use-modules’ form and instead to pass the
modules as the ‘modules’ field of ‘shepherd-service’:

  (shepherd-service
    (modules '((ice-9 match) …))
    ;; …
    )

Does that work for you?

Sorry for overlooking this before!

Ludo’.




This bug report was last modified 6 years and 181 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.