* [bug#60699] [PATCH 1/2] gnu: Add fwupd service.
@ 2023-01-10 1:19 phodina via Guix-patches via
2023-01-10 10:21 ` Jelle Licht
0 siblings, 1 reply; 4+ messages in thread
From: phodina via Guix-patches via @ 2023-01-10 1:19 UTC (permalink / raw)
To: 60699; +Cc: Ludovic Courtès
[-- Attachment #1.1: Type: text/plain, Size: 371 bytes --]
Hello,
this patch adds the service for the fwupd package (commit 23152ff70f0ed4966d8207846f54c793d7cb4f86).
Also the Gnome Shell provides nice GUI integration as shown in the attached screenshot.
The package in the service configuration is there so users can choose the fwupd they want to use as the
one in Guix upstream does not support non-libre firmware.
----
Petr
[-- Attachment #1.2: Type: text/html, Size: 496 bytes --]
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-fwupd-service.patch --]
[-- Type: text/x-patch; name=0001-gnu-Add-fwupd-service.patch, Size: 3351 bytes --]
From 9eba8a2400ad296ed3ee8bc581528cabff969cd5 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 7 Sep 2022 07:48:41 +0200
Subject: [PATCH 1/2] gnu: Add fwupd service.
* gnu/services/firmware.scm (fwupd): New variable.
diff --git a/gnu/services/firmware.scm b/gnu/services/firmware.scm
new file mode 100644
index 0000000000..7539c56202
--- /dev/null
+++ b/gnu/services/firmware.scm
@@ -0,0 +1,70 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright ?? 2022 Petr Hodina <phodina@protonmail.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu services firmware)
+ #:use-module (guix diagnostics)
+ #:use-module (guix gexp)
+ #:use-module (guix records)
+ #:use-module (guix modules)
+ #:use-module (guix i18n)
+ #:use-module (guix ui)
+ #:use-module (gnu services)
+ #:use-module (gnu services base)
+ #:use-module (gnu services shepherd)
+ #:use-module (gnu packages firmware)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-26)
+ #:use-module (srfi srfi-34)
+ #:use-module (srfi srfi-35)
+ #:use-module (ice-9 match)
+ #:export (fwupd-configuration fwupd-service-type))
+
+\f
+;;;
+;;; Fwupd daemon.
+;;;
+
+(define-record-type* <fwupd-configuration> fwupd-configuration
+ make-fwupd-configuration fwupd-configuration?
+ (fwupd fwupd-configuration-fwupd
+ (default fwupd)))
+
+(define fwupd-activation-service
+ #~(begin
+ (use-modules (guix build utils))
+ (mkdir-p "/var/lib/fwupd")))
+
+(define (fwupd-shepherd-service config)
+ (shepherd-service (documentation "Run the fwupd daemon.")
+ (provision '(fwupd))
+ (requirement '(dbus-system udev))
+ (start #~(make-forkexec-constructor (list (string-append #$fwupd
+ "/libexec/fwupd/fwupd"))))
+ (stop #~(make-kill-destructor))))
+
+(define fwupd-service-type
+ (service-type (name 'fwupd)
+ (default-value (fwupd-configuration))
+ (extensions (list (service-extension activation-service-type
+ (const
+ fwupd-activation-service))
+ (service-extension
+ shepherd-root-service-type
+ (compose list fwupd-shepherd-service))))
+ (description
+ "Run @command{fwupd}, the Firmware update daemon.")))
base-commit: 437718442ca758a3857702cecfe5c80aa5df272b
--
2.38.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-Add-gnome-firmware.patch --]
[-- Type: text/x-patch; name=0002-gnu-Add-gnome-firmware.patch, Size: 2332 bytes --]
From 108b4e57aa1682359195205e8b5679eae81445dd Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Tue, 6 Sep 2022 06:06:26 +0200
Subject: [PATCH 2/2] gnu: Add gnome-firmware.
* gnu/packages/gnome.scm (gnome-firmware): New variable.
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 78e65d7400..f9c627b56a 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -123,6 +123,7 @@ (define-module (gnu packages gnome)
#:use-module (gnu packages flex)
#:use-module (gnu packages fonts)
#:use-module (gnu packages file-systems)
+ #:use-module (gnu packages firmware)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages game-development)
@@ -2330,6 +2331,41 @@ (define-public gnome-disk-utility
(description "Disk management utility for GNOME.")
(license license:gpl2+)))
+(define-public gnome-firmware
+ (package
+ (name "gnome-firmware")
+ (version "42.2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.gnome.org/World/gnome-firmware")
+ (commit version)))
+ (sha256
+ (base32
+ "0p9fyqy3d5x6ap2ixw0wabmpdpzh7sdspaxl4f6qxx1sfnapci1g"))))
+ (build-system meson-build-system)
+ (arguments
+ (list #:glib-or-gtk? #t
+ #:configure-flags #~(list "-Dsystemd=false" "-Delogind=true")))
+ (native-inputs (list desktop-file-utils
+ gettext-minimal
+ `(,glib "bin")
+ `(,gtk "bin")
+ help2man
+ pkg-config))
+ (inputs (list gtk fwupd libadwaita libxmlb elogind))
+ (synopsis "Manage firmware on devices")
+ (description
+ "This package provides integration of firmware manager:
+ @itemize
+@item Upgrade, Downgrade, & Reinstall firmware on devices supported by fwupd.
+@item Unlock locked fwupd devices
+@item Verify firmware on supported devices
+@item Display all releases for a fwupd device
+@end itemize")
+ (home-page "https://gitlab.gnome.org/World/gnome-firmware")
+ (license license:gpl2+)))
+
(define-public gnome-font-viewer
(package
(name "gnome-font-viewer")
--
2.38.1
[-- Attachment #4: Screenshot from 2023-01-09 18-04-00.png --]
[-- Type: image/png, Size: 144650 bytes --]
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [bug#60699] [PATCH 1/2] gnu: Add fwupd service.
2023-01-10 1:19 [bug#60699] [PATCH 1/2] gnu: Add fwupd service phodina via Guix-patches via
@ 2023-01-10 10:21 ` Jelle Licht
2023-01-10 12:06 ` phodina via Guix-patches via
0 siblings, 1 reply; 4+ messages in thread
From: Jelle Licht @ 2023-01-10 10:21 UTC (permalink / raw)
To: phodina, 60699; +Cc: Ludovic Courtès
Hello Petr,
phodina via Guix-patches via <guix-patches@gnu.org> writes:
> Hello,
>
> this patch adds the service for the fwupd package (commit 23152ff70f0ed4966d8207846f54c793d7cb4f86).
>
> Also the Gnome Shell provides nice GUI integration as shown in the attached screenshot.
>
> The package in the service configuration is there so users can choose the fwupd they want to use as the
> one in Guix upstream does not support non-libre firmware.
>
> ----
> Petr
> From 9eba8a2400ad296ed3ee8bc581528cabff969cd5 Mon Sep 17 00:00:00 2001
> From: Petr Hodina <phodina@protonmail.com>
> Date: Wed, 7 Sep 2022 07:48:41 +0200
> Subject: [PATCH 1/2] gnu: Add fwupd service.
>
> * gnu/services/firmware.scm (fwupd): New variable.
>
> diff --git a/gnu/services/firmware.scm b/gnu/services/firmware.scm
> new file mode 100644
> index 0000000000..7539c56202
> --- /dev/null
> +++ b/gnu/services/firmware.scm
> @@ -0,0 +1,70 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright ?? 2022 Petr Hodina <phodina@protonmail.com>
^
Something seems to have gone wrong with the encoding
here. Could you try resending it?
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
> +
> +(define-module (gnu services firmware)
> + #:use-module (guix diagnostics)
> + #:use-module (guix gexp)
> + #:use-module (guix records)
> + #:use-module (guix modules)
> + #:use-module (guix i18n)
> + #:use-module (guix ui)
> + #:use-module (gnu services)
> + #:use-module (gnu services base)
> + #:use-module (gnu services shepherd)
> + #:use-module (gnu packages firmware)
> + #:use-module (srfi srfi-1)
> + #:use-module (srfi srfi-26)
> + #:use-module (srfi srfi-34)
> + #:use-module (srfi srfi-35)
> + #:use-module (ice-9 match)
> + #:export (fwupd-configuration fwupd-service-type))
> +
> +\f
> +;;;
> +;;; Fwupd daemon.
> +;;;
> +
> +(define-record-type* <fwupd-configuration> fwupd-configuration
> + make-fwupd-configuration fwupd-configuration?
> + (fwupd fwupd-configuration-fwupd
> + (default fwupd)))
> +
> +(define fwupd-activation-service
> + #~(begin
> + (use-modules (guix build utils))
> + (mkdir-p "/var/lib/fwupd")))
> +
> +(define (fwupd-shepherd-service config)
> + (shepherd-service (documentation "Run the fwupd daemon.")
> + (provision '(fwupd))
> + (requirement '(dbus-system udev))
> + (start #~(make-forkexec-constructor (list (string-append #$fwupd
> + "/libexec/fwupd/fwupd"))))
> + (stop #~(make-kill-destructor))))
> +
> +(define fwupd-service-type
> + (service-type (name 'fwupd)
> + (default-value (fwupd-configuration))
> + (extensions (list (service-extension activation-service-type
> + (const
> + fwupd-activation-service))
> + (service-extension
> + shepherd-root-service-type
> + (compose list fwupd-shepherd-service))))
> + (description
> + "Run @command{fwupd}, the Firmware update daemon.")))
Looks great! Does this actually work in practice though? I ran into some
issues trying to run fwupd myself w.r.t. polkit (see
https://issues.guix.gnu.org/60065). Never mind if it actually works for
you though, IWBN if no further tweaks are required to get this to work.
> base-commit: 437718442ca758a3857702cecfe5c80aa5df272b
> --
> 2.38.1
>
> From 108b4e57aa1682359195205e8b5679eae81445dd Mon Sep 17 00:00:00 2001
> From: Petr Hodina <phodina@protonmail.com>
> Date: Tue, 6 Sep 2022 06:06:26 +0200
> Subject: [PATCH 2/2] gnu: Add gnome-firmware.
>
> * gnu/packages/gnome.scm (gnome-firmware): New variable.
>
> diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
> index 78e65d7400..f9c627b56a 100644
> --- a/gnu/packages/gnome.scm
> +++ b/gnu/packages/gnome.scm
> @@ -123,6 +123,7 @@ (define-module (gnu packages gnome)
> #:use-module (gnu packages flex)
> #:use-module (gnu packages fonts)
> #:use-module (gnu packages file-systems)
> + #:use-module (gnu packages firmware)
> #:use-module (gnu packages fontutils)
> #:use-module (gnu packages freedesktop)
> #:use-module (gnu packages game-development)
> @@ -2330,6 +2331,41 @@ (define-public gnome-disk-utility
> (description "Disk management utility for GNOME.")
> (license license:gpl2+)))
>
> +(define-public gnome-firmware
> + (package
> + (name "gnome-firmware")
> + (version "42.2")
> + (source (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://gitlab.gnome.org/World/gnome-firmware")
> + (commit version)))
> + (sha256
> + (base32
> + "0p9fyqy3d5x6ap2ixw0wabmpdpzh7sdspaxl4f6qxx1sfnapci1g"))))
> + (build-system meson-build-system)
> + (arguments
> + (list #:glib-or-gtk? #t
> + #:configure-flags #~(list "-Dsystemd=false" "-Delogind=true")))
> + (native-inputs (list desktop-file-utils
> + gettext-minimal
> + `(,glib "bin")
> + `(,gtk "bin")
> + help2man
> + pkg-config))
> + (inputs (list gtk fwupd libadwaita libxmlb elogind))
> + (synopsis "Manage firmware on devices")
'Manage' is a word that does not really with low signal-to-noise
ratio. Would there be a way to rephrase this?
> + (description
> + "This package provides integration of firmware manager:
> + @itemize
> +@item Upgrade, Downgrade, & Reinstall firmware on devices supported by fwupd.
> +@item Unlock locked fwupd devices
> +@item Verify firmware on supported devices
> +@item Display all releases for a fwupd device
Releases of what? What's a fwupd device?
Thanks for the patches!
- Jelle
^ permalink raw reply [flat|nested] 4+ messages in thread
* [bug#60699] [PATCH 1/2] gnu: Add fwupd service.
2023-01-10 10:21 ` Jelle Licht
@ 2023-01-10 12:06 ` phodina via Guix-patches via
2023-01-11 14:31 ` Jelle Licht
0 siblings, 1 reply; 4+ messages in thread
From: phodina via Guix-patches via @ 2023-01-10 12:06 UTC (permalink / raw)
To: Jelle Licht; +Cc: Ludovic Courtès, 60699
[-- Attachment #1: Type: text/plain, Size: 574 bytes --]
Hi Jelle,
I've tested the fwupd on my Asus Zenbook machine - see the attached screenshot.
Without the service running the gnome-firmware or fwupdtool didn't work.
With the service running I get some information about the firmware, EFI... It hasn't been battle tested by updating anything as the firmware there is the latest.
I've also tried adding polkit extension but it seems to run without it in my case. Could you please test the patch if it works also for you, if not we can add it :-)
Check the rewritten synposis for gnome-firmware.
----
Petr
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v2-0002-gnu-Add-gnome-firmware.patch --]
[-- Type: text/x-patch; name=v2-0002-gnu-Add-gnome-firmware.patch, Size: 2377 bytes --]
From 108b4e57aa1682359195205e8b5679eae81445dd Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Tue, 6 Sep 2022 06:06:26 +0200
Subject: [PATCH 2/2] gnu: Add gnome-firmware.
* gnu/packages/gnome.scm (gnome-firmware): New variable.
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 78e65d7400..f9c627b56a 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -123,6 +123,7 @@ (define-module (gnu packages gnome)
#:use-module (gnu packages flex)
#:use-module (gnu packages fonts)
#:use-module (gnu packages file-systems)
+ #:use-module (gnu packages firmware)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages game-development)
@@ -2330,6 +2331,41 @@ (define-public gnome-disk-utility
(description "Disk management utility for GNOME.")
(license license:gpl2+)))
+(define-public gnome-firmware
+ (package
+ (name "gnome-firmware")
+ (version "42.2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.gnome.org/World/gnome-firmware")
+ (commit version)))
+ (sha256
+ (base32
+ "0p9fyqy3d5x6ap2ixw0wabmpdpzh7sdspaxl4f6qxx1sfnapci1g"))))
+ (build-system meson-build-system)
+ (arguments
+ (list #:glib-or-gtk? #t
+ #:configure-flags #~(list "-Dsystemd=false" "-Delogind=true")))
+ (native-inputs (list desktop-file-utils
+ gettext-minimal
+ `(,glib "bin")
+ `(,gtk "bin")
+ help2man
+ pkg-config))
+ (inputs (list gtk fwupd libadwaita libxmlb elogind))
+ (synopsis "Update, reinstall and downgrade firmware on devices supported
+by fwupd")
+ (description
+ "This package provides integration of firmware manager:
+ @itemize
+@item Upgrade, Downgrade, & Reinstall firmware on devices supported by fwupd.
+@item Unlock locked fwupd devices
+@item Verify firmware on supported devices
+@item Display all releases for a fwupd device
+@end itemize")
+ (home-page "https://gitlab.gnome.org/World/gnome-firmware")
+ (license license:gpl2+)))
+
(define-public gnome-font-viewer
(package
(name "gnome-font-viewer")
--
2.38.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [bug#60699] [PATCH 1/2] gnu: Add fwupd service.
2023-01-10 12:06 ` phodina via Guix-patches via
@ 2023-01-11 14:31 ` Jelle Licht
0 siblings, 0 replies; 4+ messages in thread
From: Jelle Licht @ 2023-01-11 14:31 UTC (permalink / raw)
To: phodina; +Cc: Ludovic Courtès, 60699
phodina <phodina@protonmail.com> writes:
> Hi Jelle,
>
> I've tested the fwupd on my Asus Zenbook machine - see the attached screenshot.
>
> Without the service running the gnome-firmware or fwupdtool didn't work.
>
> With the service running I get some information about the firmware, EFI... It hasn't been battle tested by updating anything as the firmware there is the latest.
>
> I've also tried adding polkit extension but it seems to run without it in my case. Could you please test the patch if it works also for you, if not we can add it :-)
>
From my system logs:
--8<---------------cut here---------------start------------->8---
Jan 11 15:17:09 localhost shepherd[1]: [fwupd] 14:17:09:0330 FuMain
another service has claimed the dbus name org.freedesktop.fwupd
Jan 11 15:17:09 localhost shepherd[1]: Respawning fwupd.
--8<---------------cut here---------------end--------------->8---
(and this repeated till shepherd disables the fwupd service).
Note that 'another service has claimed the dbus name' seems to be a
misleading error message:
Running `sudo herd enable fwupd', `sudo herd start fwupd', while paying
attention to the output of `sudo dbus-monitor --system' (/w `guix shell
dbus') in another terminal:
--8<---------------cut here---------------start------------->8---
method call time=1673446874.805907 sender=:1.162 -> destination=org.freedesktop.DBus serial=645 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName
string "org.freedesktop.fwupd"
uint32 3
error time=1673446874.805914 sender=org.freedesktop.DBus -> destination=:1.162 error_name=org.freedesktop.DBus.Error.AccessDenied reply_serial=645
string "Connection ":1.162" is not allowed to own the service "org.freedesktop.fwupd" due to security policies in the configuration file"
--8<---------------cut here---------------end--------------->8---
WDYT about adding a system test that verifies that fwupd can be started?
Then we will know whether it's an anomaly on either of our respective
machines :-).
Additionally, would you be able to write documentation for the new
service as well?
> Check the rewritten synposis for gnome-firmware.
LGTM.
Thanks!
- Jelle
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-01-11 14:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-10 1:19 [bug#60699] [PATCH 1/2] gnu: Add fwupd service phodina via Guix-patches via
2023-01-10 10:21 ` Jelle Licht
2023-01-10 12:06 ` phodina via Guix-patches via
2023-01-11 14:31 ` Jelle Licht
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).