diff mbox series

[bug#49578] Add bolt

Message ID 1aJRSz6qFjmFhYY0CBesLTTG0pCFP3k4W0lONoiRV7XP6fDy07As2nMW1DicJXJws8O3IXC-qZLar49bOBNy1FD_I3kNTHUqNRUcNMMtXRo=@protonmail.com
State New
Headers show
Series [bug#49578] Add bolt | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

phodina July 22, 2021, 11:32 a.m. UTC
Hi Sarah,

Thanks for the suggestions. Fixes:

- polkit in alphabethical order
- line wraping
- /var dir location
- removed #t in phases
- simplified udev rules install
- more useful synopsis

---
index 41902e7785..6050871264 100644
--
2.31.1

Comments

phodina July 22, 2021, 11:36 a.m. UTC | #1
Also would you have recommendation on how to create a service for the daemon boltd?

Currently it's a good step to have it packaged, but without a running service it's little bit pointless.

There is probably something similar that I can check, learn how the services work and modify it for the thunderbolt case.
Sarah Morgensen July 22, 2021, 8:02 p.m. UTC | #2
Hi,

phodina <phodina@protonmail.com> writes:

> Also would you have recommendation on how to create a service for the daemon boltd?
>
> Currently it's a good step to have it packaged, but without a running service it's little bit pointless.
>
> There is probably something similar that I can check, learn how the services work and modify it for the thunderbolt case.

I'm assuming you mean a service to run on Guix System, yes?

There is a section in the manual on this

  https://guix.gnu.org/manual/en/html_node/Defining-Services.html

which has a couple examples. You'll probably want to make a shepherd
service (shepherd is Guix System's services manager). You can also read
the code for existing services in gnu/services/*.scm. I'm not very
familiar with services so unfortunately I can't point you at any similar
ones. Best of luck!

--
Sarah
diff mbox series

Patch

--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -119,6 +119,7 @@ 
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pciutils)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages polkit)
   #:use-module (gnu packages popt)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
@@ -2479,6 +2480,59 @@  IPv6 packet filter.
 Both commands are targeted at system administrators.")
     (license license:gpl2+)))

+(define-public bolt
+  (package
+    (name "bolt")
+    (version "0.9.1")
+    (source (origin
+              (method git-fetch)
+              (uri
+               (git-reference
+                (url "https://gitlab.freedesktop.org/bolt/bolt")
+                (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1phgp8fs0dlj74kbkqlvfniwc32daz47b3pvsxlfxqzyrp77xrfm"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:configure-flags (list "--localstatedir=/var")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'replace-directories
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "meson.build"
+               (("udev.get_pkgconfig_variable..udevdir..")
+                (string-append "'" (assoc-ref %outputs "out") "/lib/udev'")))
+	     (substitute* "meson.build"
+               ((".*scripts/meson-install.sh.*") ""))
+	       ))
+         (add-before 'install 'no-polkit-magic
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Meson ‘magically’ invokes pkexec, which fails (not setuid).
+             (setenv "PKEXEC_UID" "something")
+             )))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("dbus" ,dbus)
+       ("asciidoc" ,asciidoc)
+       ("umockdev" ,umockdev)))
+    (inputs
+     `(("glib:bin" ,glib "bin")
+      ("eudev" ,eudev)
+      ("polkit" ,polkit)))
+    (synopsis "Userspace system daemon to enable security levels
+for Thunderbolt™ on GNU/Linux®.")
+    (description "Userspace daemon 'boltd' exposes devices via D-Bus to clients.
+It stores database of previously authorized devices and depending
+on the policy set for the individual devices, auomatically authorize newly
+connected devices without user interaction. It also adapts its behaivour when
+iommu support is detected.
+Command line utility 'boltctl' can be used to manage thundebolt devices. It can
+list devices, monitor changes and initiate authorization of device.")
+    (home-page "https://gitlab.freedesktop.org/bolt/bolt")
+    (license license:gpl2+)))
+
 (define-public jitterentropy-rngd
   (package
     (name "jitterentropy-rngd")