summaryrefslogtreecommitdiff
path: root/gnu/packages/firmware.scm
diff options
context:
space:
mode:
authorRutherther <rutherther@ditigal.xyz>2025-04-11 21:54:01 +0200
committerLudovic Courtès <ludo@gnu.org>2025-04-15 10:21:01 +0200
commita47fef62ab51c84081f11196748f8f87e96b7603 (patch)
tree69cc5b3c516f2ebf02a053bced1be9ac60172721 /gnu/packages/firmware.scm
parent3193f0e61b6c86435bf98af74cb38832f047d5d4 (diff)
gnu: fwupd: Check polkit actions at correct location
The polkit rules check in fwupdmgr doesn't make sense with Guix packaging, as it's checking if there is fwupd policy files in the polkit's store path. This will never be true, and the check will always fail. One fix would be to skip the check completely. But that seems unnecessary as the polkit actions are always in /etc/polkit-1/actions on the Guix system. On foreign distros, it will be necessary to turn the check off manually by FWUPD_POLKIT_NOCHECK=1. But it's important to note that this was the case even till now, there is no new breakage. I think it's unlikely someone will be using fwupd package from Guix on foreign distros anyway. * gnu/packages/firmware.scm (fwupd)[arguments]{phases}: substitute polkit actions directory to point to /etc/polkit-1/actions Change-Id: Ia29d7a32f68a3da7951f45fe823e3ab8059cb670 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/firmware.scm')
-rw-r--r--gnu/packages/firmware.scm14
1 files changed, 13 insertions, 1 deletions
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 5e89edc621..715b9ab132 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -250,7 +250,19 @@ driver.")
(find-files "."))
(substitute* "src/fu-self-test.c"
(("/bin/sh")
- (which "sh")))))
+ (which "sh")))
+ ;; fwupdmgr checks for missing polkit actions, prints
+ ;; error message and exits if the polkit actions are
+ ;; not found.
+ ;; The path points to gnu store path of polkit and
+ ;; there are no actions there. Point this to the actual
+ ;; location used on Guix System. This will still fail on
+ ;; foreign distros as /usr/share/polkit-1 is used mostly.
+ (substitute* "src/fu-util.c"
+ (("g_autofree gchar \\*directory = NULL;")
+ "")
+ (("directory = fu_path_from_kind\\(FU_PATH_KIND_POLKIT_ACTIONS\\)")
+ "const gchar* directory = \"/etc/polkit-1/actions\""))))
;; These two files are zipped by Python, so need a newer timestamp.
(add-after 'unpack 'newer-timestamps-for-python-zip
(lambda _