unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: phodina <phodina@protonmail.com>
Cc: Sarah Morgensen <iskarian@mgsn.dev>, 49578@debbugs.gnu.org
Subject: [bug#49578] [PATCH] Add bolt
Date: Wed, 14 Dec 2022 12:22:48 +0100	[thread overview]
Message-ID: <874jtytek7.fsf_-_@gnu.org> (raw)
In-Reply-To: <rp8SpAlHZIINbm9ZNO_4lI_mK0OlLOQM9EdTQt8Zzz_9c5mpXm_xvGC8gpNjRMDew1MOpECQp6y5MpJWgEk7buLEMmBQleiH1NycK7uKAys=@protonmail.com> (phodina@protonmail.com's message of "Sun, 14 Aug 2022 22:00:32 +0000")

Hi,

Thanks a lot, Sarah, for the review work.  Somehow it eventually fell
through the cracks but it’s never too late.  :-)

phodina <phodina@protonmail.com> skribis:

> From 538eeedf7ee64f98b17507ea11d38512525ef29f Mon Sep 17 00:00:00 2001
> From: Petr Hodina <phodina@protonmail.com>
> Date: Sun, 18 Jul 2021 12:11:55 +0200
> Subject: [PATCH v4 1/2] gnu: Add bolt.
>
> * gnu/packages/linux.scm (bolt): New variable.

LGTM!  I went ahead and applied it.

> From e054c89f9964686670e7716c820ca9ebb9f41543 Mon Sep 17 00:00:00 2001
> From: Petr Hodina <phodina@protonmail.com>
> Date: Sat, 18 Sep 2021 13:11:18 +0200
> Subject: [PATCH v4 2/2] services: Add a service for bolt.
>
> * gnu/services/linux.scm (bolt-service-type)
> (bolt-shepherd-service, bolt-dbus-service)
> (bolt-configuration, bolt-configuration?): New procedures.

[...]

> +(define-record-type* <bolt-configuration>
> +  bolt-configuration make-bolt-configuration bolt-configuration?
> +  (package bolt-configuration-package ; package
> +           (default bolt)))
> +
> +(define bolt-shepherd-service
> +  (match-lambda
> +    (($ <bolt-configuration> package)

Just call ‘bolt-configuration-package’ instead of using ‘match’ here.

> +     (with-imported-modules (source-module-closure
> +                             '((gnu build shepherd)))
> +       (shepherd-service
> +        (documentation "Thunderbolt daemon")
> +        (provision '(thunderbolt))
> +        (requirement '(networking))
> +        (modules '((gnu build shepherd)))
> +        (start #~(make-forkexec-constructor/container
> +                  (list #$(file-append package "/libexec/boltd"))
> +		  ))

Please move the parens to the previous line.  :-)

> +        (stop #~(make-kill-destructor)))))))
> +
> +(define %bolt-activation
> +  #~(begin
> +      (use-modules (guix build utils))
> +      (mkdir-p "/var/lib/boltd")))
> +
> +(define (bolt-dbus-service config)
> +  (list (wrapped-dbus-service (bolt-configuration-bolt config)
> +			      "libexec/boltd"
> +			      `(("BOLT_CONF_FILE_NAME"
> +				 '("share/dbus-1/interfaces/org.freedesktop.bolt.xml"))))))
> +
> +(define %bolt-accounts
> + (list (user-group (name "boltd") (system? #t))
> +       (user-account
> +	 (name "boltd")
> +	 (group "boltd")
> +	 (system? #t)
> +	 (comment "Boltd daemon user")
> +	 (home-directory "/var/empty")
> +	 (shell "/run/current-system/profile/sbin/nologin"))))

This is creating accounts, but ‘boltd’ is started as root.  Is that
expected?  Does ‘boltd’ setuids by itself?  If so, please add a comment
above the ‘make-forkexec-constructor’ call.

> +(define bolt-udev-rule
> +  (match-lambda
> +    (($ <bolt-configuration> package)

Same comment as above.

> +(define bolt-service-type
> +  (service-type
> +   (name 'boltd)
> +   (description
> +    "Thunderbolt daemon")

Please write full sentences here, giving enough context to make ‘guix
system search’ useful.

> +   (extensions
> +    (list (service-extension udev-service-type
> +			     (compose list bolt-udev-rule))
> +	  (service-extension activation-service-type
> +			     (const %bolt-activation))
> +	  (service-extension dbus-root-service-type
> +	  (compose list bolt-configuration-package))
> +	;		     bolt-dbus-service)

Maybe remove this line?

One last thing: please document it in ‘doc/guix.texi’.  In particular,
make sure to add a paragraph that gives a bit of context andq a
configuration example.

Could you send an updated patch?

Thanks,
Ludo’.




  reply	other threads:[~2022-12-14 11:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 16:46 [bug#49578] [PATCH] Add bolt phodina via Guix-patches via
2021-07-22  1:50 ` Sarah Morgensen
2021-07-22 11:32   ` phodina via Guix-patches via
2021-07-22 11:36     ` phodina via Guix-patches via
2021-07-22 20:02       ` Sarah Morgensen
2021-09-18 11:20 ` [bug#49578] [PATCH v3 1/2] gnu: " phodina via Guix-patches via
2021-09-23  1:11   ` Sarah Morgensen
2021-11-05  8:39     ` phodina via Guix-patches via
2022-08-14 22:00       ` [bug#49578] [PATCH v4] " phodina via Guix-patches via
2022-12-14 11:22         ` Ludovic Courtès [this message]
2023-01-05 21:28         ` [bug#49578] [PATCH] " Ludovic Courtès
2023-01-10  2:49           ` phodina via Guix-patches via
2021-09-18 11:21 ` [bug#49578] [PATCH v3 2/2] services: Add a service for bolt phodina via Guix-patches via
2022-01-22  6:55 ` [bug#49578] [PATCH] Add bolt David Conner
2022-02-02 16:19   ` David Conner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jtytek7.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=49578@debbugs.gnu.org \
    --cc=iskarian@mgsn.dev \
    --cc=phodina@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).