Skip to contentSkip to conversation

fwupd: fix ${datadir}/polkit-1/rules.d permissions

PATCH Superseded Mikko Rapeli 1 participant 1 message Nov 2, 2022

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 fwupd: fix ${datadir}/polkit-1/rules.d permissions

They need to be the same as systemd which creates the directory or rpm/dnf will fail rootfs build with error:

Error: Transaction test error:
file /usr/share/polkit-1/rules.d conflicts between attempted installs of fwupd-1.7.6-r0.qemuarm64 and systemd-1:250.5-r0.armv8a

"bitbake -c install systemd && bitbake -c devshell systemd" shows that the permissons should be:

2581167 1 drwx------ 2 polkitd root 3 Oct 28 11:22 ../image/usr/share/polkit-1/rules.d

but "bitbake -c install fwupd && bitbake -c devshell fwupd" shows the permissions as:

2554626 1 drwxr-xr-x 2 root root 3 Oct 28 11:17 ../image/usr/share/polkit-1/rules.d

Now they are fixed to be the same and installing both systemd and fwupd to rootfs works with rpm and dnf.

---
 meta-oe/recipes-bsp/fwupd/fwupd_1.7.6.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)

v2: removed check for polkit in PACKAGECONFIG, using these permissions for polkit-1/rules.d in all configurations

v1: https://lists.openembedded.org/g/openembedded-devel/message/99334

meta-oe/recipes-bsp/fwupd/fwupd_1.7.6.bb +11 -0
index 53f1720b0..ccce4b1df 100644
@@ -125,3 +125,14 @@ FILES:${PN} += "${libdir}/fwupd-plugins-* \
 FILES:${PN}-ptest += "${libexecdir}/installed-tests/ \
                       ${datadir}/installed-tests/"
 RDEPENDS:${PN}-ptest += "gnome-desktop-testing"
+
+do_install:append() {
+        # do the same as systemd to avoid rpm/dnf errors when installing both
+        # If polkit is setup fixup permissions and ownership
+        if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
+                if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
+                        chmod 700 ${D}${datadir}/polkit-1/rules.d
+                        chown polkitd:root ${D}${datadir}/polkit-1/rules.d
+                fi
+        fi
+}
Signature · 1 line
2.17.1