Date
1 - 1 of 1
[meta-oe][PATCH 3/3] blueman: add missing runtime dependency, add polkit rule
Markus Volk
Add a missing runtime dependency on python3-ctypes
Add a polkit rule to allow users of group wheel to use blueman without au=
thentification
Signed-off-by: Markus Volk <f_l_k@...>
---
.../blueman/blueman_2.3.5.bb | 28 ++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/meta-networking/recipes-connectivity/blueman/blueman_2.3.5.b=
b b/meta-networking/recipes-connectivity/blueman/blueman_2.3.5.bb
index 2343cec71..eb42e62f4 100644
--- a/meta-networking/recipes-connectivity/blueman/blueman_2.3.5.bb
+++ b/meta-networking/recipes-connectivity/blueman/blueman_2.3.5.bb
@@ -4,7 +4,7 @@ LIC_FILES_CHKSUM =3D "file://COPYING;md5=3Dd32239bcb67346=
3ab874e80d47fae504"
=20
DEPENDS =3D "gtk+3 glib-2.0 bluez5 python3-pygobject python3-cython-nati=
ve"
=20
-inherit meson gettext systemd gsettings pkgconfig python3native gtk-icon=
-cache
+inherit meson gettext systemd gsettings pkgconfig python3native gtk-icon=
-cache useradd
=20
SRC_URI =3D " \
git://github.com/blueman-project/blueman.git;protocol=3Dhttps;branch=
=3D2-3-stable \
@@ -23,6 +23,7 @@ SYSTEMD_AUTO_ENABLE:${PN} =3D "disable"
RRECOMMENDS:${PN} +=3D "adwaita-icon-theme"
RDEPENDS:${PN} +=3D " \
python3-core \
+ python3-ctypes \
python3-dbus \
python3-pygobject \
python3-terminal \
@@ -58,3 +59,28 @@ do_install:append() {
${D}${bindir}/blueman-tray
}
=20
+do_install:append() {
+ install -d ${D}${datadir}/polkit-1/rules.d
+ cat >${D}${datadir}/polkit-1/rules.d/51-blueman.rules <<EOF
+/* Allow users in wheel group to use blueman feature requiring root with=
out authentication */
+polkit.addRule(function(action, subject) {
+ if ((action.id =3D=3D "org.blueman.network.setup" ||
+ action.id =3D=3D "org.blueman.dhcp.client" ||
+ action.id =3D=3D "org.blueman.rfkill.setstate" ||
+ action.id =3D=3D "org.blueman.pppd.pppconnect") &&
+ subject.isInGroup("wheel")) {
+
+ return polkit.Result.YES;
+ }
+});
+EOF
+}
+
+USERADD_PACKAGES =3D "${PN}"
+USERADD_PARAM:${PN} =3D "--system --no-create-home --user-group --home-d=
ir ${sysconfdir}/polkit-1 --shell /bin/nologin polkitd"
+
+do_install:append() {
+ # Fix up permissions on polkit rules.d to work with rpm4 constra=
ints
+ chmod 700 ${D}/${datadir}/polkit-1/rules.d
+ chown polkitd:root ${D}/${datadir}/polkit-1/rules.d
+}
--=20
2.34.1
Add a polkit rule to allow users of group wheel to use blueman without au=
thentification
Signed-off-by: Markus Volk <f_l_k@...>
---
.../blueman/blueman_2.3.5.bb | 28 ++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/meta-networking/recipes-connectivity/blueman/blueman_2.3.5.b=
b b/meta-networking/recipes-connectivity/blueman/blueman_2.3.5.bb
index 2343cec71..eb42e62f4 100644
--- a/meta-networking/recipes-connectivity/blueman/blueman_2.3.5.bb
+++ b/meta-networking/recipes-connectivity/blueman/blueman_2.3.5.bb
@@ -4,7 +4,7 @@ LIC_FILES_CHKSUM =3D "file://COPYING;md5=3Dd32239bcb67346=
3ab874e80d47fae504"
=20
DEPENDS =3D "gtk+3 glib-2.0 bluez5 python3-pygobject python3-cython-nati=
ve"
=20
-inherit meson gettext systemd gsettings pkgconfig python3native gtk-icon=
-cache
+inherit meson gettext systemd gsettings pkgconfig python3native gtk-icon=
-cache useradd
=20
SRC_URI =3D " \
git://github.com/blueman-project/blueman.git;protocol=3Dhttps;branch=
=3D2-3-stable \
@@ -23,6 +23,7 @@ SYSTEMD_AUTO_ENABLE:${PN} =3D "disable"
RRECOMMENDS:${PN} +=3D "adwaita-icon-theme"
RDEPENDS:${PN} +=3D " \
python3-core \
+ python3-ctypes \
python3-dbus \
python3-pygobject \
python3-terminal \
@@ -58,3 +59,28 @@ do_install:append() {
${D}${bindir}/blueman-tray
}
=20
+do_install:append() {
+ install -d ${D}${datadir}/polkit-1/rules.d
+ cat >${D}${datadir}/polkit-1/rules.d/51-blueman.rules <<EOF
+/* Allow users in wheel group to use blueman feature requiring root with=
out authentication */
+polkit.addRule(function(action, subject) {
+ if ((action.id =3D=3D "org.blueman.network.setup" ||
+ action.id =3D=3D "org.blueman.dhcp.client" ||
+ action.id =3D=3D "org.blueman.rfkill.setstate" ||
+ action.id =3D=3D "org.blueman.pppd.pppconnect") &&
+ subject.isInGroup("wheel")) {
+
+ return polkit.Result.YES;
+ }
+});
+EOF
+}
+
+USERADD_PACKAGES =3D "${PN}"
+USERADD_PARAM:${PN} =3D "--system --no-create-home --user-group --home-d=
ir ${sysconfdir}/polkit-1 --shell /bin/nologin polkitd"
+
+do_install:append() {
+ # Fix up permissions on polkit rules.d to work with rpm4 constra=
ints
+ chmod 700 ${D}/${datadir}/polkit-1/rules.d
+ chown polkitd:root ${D}/${datadir}/polkit-1/rules.d
+}
--=20
2.34.1