All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][master][kirkstone][PATCH] fwupd: fix ${datadir}/polkit-1/rules.d permissions
@ 2022-10-28 13:10 Mikko Rapeli
  2022-10-28 14:57 ` [oe] " Ross Burton
  0 siblings, 1 reply; 3+ messages in thread
From: Mikko Rapeli @ 2022-10-28 13:10 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Mikko Rapeli

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.

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta-oe/recipes-bsp/fwupd/fwupd_1.7.6.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta-oe/recipes-bsp/fwupd/fwupd_1.7.6.bb b/meta-oe/recipes-bsp/fwupd/fwupd_1.7.6.bb
index 53f1720b0..ccce4b1df 100644
--- a/meta-oe/recipes-bsp/fwupd/fwupd_1.7.6.bb
+++ b/meta-oe/recipes-bsp/fwupd/fwupd_1.7.6.bb
@@ -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
+}
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [oe] [meta-oe][master][kirkstone][PATCH] fwupd: fix ${datadir}/polkit-1/rules.d permissions
  2022-10-28 13:10 [meta-oe][master][kirkstone][PATCH] fwupd: fix ${datadir}/polkit-1/rules.d permissions Mikko Rapeli
@ 2022-10-28 14:57 ` Ross Burton
  2022-10-31  7:40   ` Mikko Rapeli
  0 siblings, 1 reply; 3+ messages in thread
From: Ross Burton @ 2022-10-28 14:57 UTC (permalink / raw)
  To: mikko.rapeli; +Cc: openembedded-devel


> On 28 Oct 2022, at 14:10, Mikko Rapeli via lists.openembedded.org <mikko.rapeli=linaro.org@lists.openembedded.org> wrote:
> +        if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
> +                if [ -d ${D}${datadir}/polkit-1/rules.d ]; then

No point to have the double check here: just check if the directory exists.

Ross

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [oe] [meta-oe][master][kirkstone][PATCH] fwupd: fix ${datadir}/polkit-1/rules.d permissions
  2022-10-28 14:57 ` [oe] " Ross Burton
@ 2022-10-31  7:40   ` Mikko Rapeli
  0 siblings, 0 replies; 3+ messages in thread
From: Mikko Rapeli @ 2022-10-31  7:40 UTC (permalink / raw)
  To: Ross Burton; +Cc: openembedded-devel

Hi,

On Fri, Oct 28, 2022 at 02:57:50PM +0000, Ross Burton wrote:
> 
> > On 28 Oct 2022, at 14:10, Mikko Rapeli via lists.openembedded.org <mikko.rapeli=linaro.org@lists.openembedded.org> wrote:
> > +        if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
> > +                if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
> 
> No point to have the double check here: just check if the directory exists.

This is direct copy paste from systemd recipe. I think it should stay
like that. I think there are still some configurations where this will
break again though. I'm hoping that polkit would imply also systemd.

Cheers,

-Mikko


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-31  7:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 13:10 [meta-oe][master][kirkstone][PATCH] fwupd: fix ${datadir}/polkit-1/rules.d permissions Mikko Rapeli
2022-10-28 14:57 ` [oe] " Ross Burton
2022-10-31  7:40   ` Mikko Rapeli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.