Skip to contentSkip to conversation

Add polkit distro feature

PATCH In review Stefan Agner 2 participants 7 messages Jan 15, 2019

lore
Share & tools
lore
#0 lore raw

cover Add polkit distro feature

From: Stefan Agner <[email protected]>

This patchset adds Polkit (formerly known as PolicyKit) as a distro feature. Polkit is used to centrally manage system policies and allows non-privileged processes access privileged operations.

Since various packages such as systemd, ConnMan or NetworkManager allow building with/without Polkit support it is sensible to have a global policy by using a distro feature to descide whether to use Polkit.

Currently there is NetworkManager and xfce4 which enable polkit if systemd is enabled. Using Polkit as a distro feature allows to easily prevent any Polkit use while still using systemd.

I plan to send another patch to wire this up in various packages in meta-openembedded as well as documentation update.

--
Stefan

Stefan Agner (5):
systemd: only enable polkit if DISTRO_FEATURES asks for polkit
gconf: rename policykit to polkit
gconf: enable polkit if polkit distro feature is set
consolekit: rename policykit to polkit
consolekit: enable polkit if polkit distro feature is set

 meta/recipes-core/systemd/systemd_239.bb            | 3 +--
 meta/recipes-gnome/gnome/gconf_3.2.6.bb             | 7 +++----
 meta/recipes-support/consolekit/consolekit_0.4.6.bb | 4 ++--
 3 files changed, 6 insertions(+), 8 deletions(-)
Signature · 1 line
2.13.6
#1 lore raw

PATCH 1/5 systemd: only enable polkit if DISTRO_FEATURES asks for polkit

From: Stefan Agner <[email protected]>

Only add polkit to PACKAGECONFIG if polkit is in DISTRO_FEATURES.

---
 meta/recipes-core/systemd/systemd_239.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta/recipes-core/systemd/systemd_239.bb +1 -2
index be836ffa42..586ef65299 100644
@@ -76,7 +76,7 @@ PAM_PLUGINS = " \
 "
 
 PACKAGECONFIG ??= " \
-    ${@bb.utils.filter('DISTRO_FEATURES', 'efi ldconfig pam selinux usrmerge', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'efi ldconfig pam selinux usrmerge polkit', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
     acl \
@@ -94,7 +94,6 @@ PACKAGECONFIG ??= " \
     myhostname \
     networkd \
     nss \
-    polkit \
     quotacheck \
     randomseed \
     resolved \
Signature · 1 line
2.13.6
#2 lore raw

PATCH 2/5 gconf: rename policykit to polkit

In reply to Stefan Agner

From: Stefan Agner <[email protected]>

PolicyKit has been renamed to Polkit since quite a while. Rename the PACKAGECONFIG accordingly.

---
 meta/recipes-gnome/gnome/gconf_3.2.6.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/recipes-gnome/gnome/gconf_3.2.6.bb +3 -3
index 120ae3e021..1e8ca2e5d2 100644
@@ -22,12 +22,12 @@ S = "${WORKDIR}/GConf-${PV}"
 EXTRA_OECONF = "--enable-shared --disable-static \
                 --disable-orbit --with-openldap=no --disable-gtk"
 
-# Disable PolicyKit by default
+# Disable Polkit by default
 PACKAGECONFIG ??= ""
-# We really don't want PolicyKit for native
+# We really don't want Polkit for native
 PACKAGECONFIG_class-native = ""
 
-PACKAGECONFIG[policykit] = "--enable-defaults-service,--disable-defaults-service,polkit"
+PACKAGECONFIG[polkit] = "--enable-defaults-service,--disable-defaults-service,polkit"
 PACKAGECONFIG[debug] = "--enable-debug=yes, --enable-debug=minimum"
 
 do_install_append() {
Signature · 1 line
2.13.6
#3 lore raw

PATCH 3/5 gconf: enable polkit if polkit distro feature is set

In reply to Stefan Agner

From: Stefan Agner <[email protected]>

Enable polkit depending on whether polkit distro feature is set.

---
 meta/recipes-gnome/gnome/gconf_3.2.6.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta/recipes-gnome/gnome/gconf_3.2.6.bb +1 -2
index 1e8ca2e5d2..e6742f37d8 100644
@@ -22,8 +22,7 @@ S = "${WORKDIR}/GConf-${PV}"
 EXTRA_OECONF = "--enable-shared --disable-static \
                 --disable-orbit --with-openldap=no --disable-gtk"
 
-# Disable Polkit by default
-PACKAGECONFIG ??= ""
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'polkit', d)}"
 # We really don't want Polkit for native
 PACKAGECONFIG_class-native = ""
 
Signature · 1 line
2.13.6
#4 lore raw

PATCH 4/5 consolekit: rename policykit to polkit

In reply to Stefan Agner

From: Stefan Agner <[email protected]>

PolicyKit has been renamed to Polkit since quite a while. Rename the PACKAGECONFIG accordingly.

---
 meta/recipes-support/consolekit/consolekit_0.4.6.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/consolekit/consolekit_0.4.6.bb +1 -1
index 80d48bf84f..15b39046e3 100644
@@ -26,7 +26,7 @@ S = "${WORKDIR}/ConsoleKit-${PV}"
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
 
 PACKAGECONFIG[pam] = "--enable-pam-module --with-pam-module-dir=${base_libdir}/security,--disable-pam-module,libpam"
-PACKAGECONFIG[policykit] = "--with-polkit,--without-polkit,polkit"
+PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit"
 PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--with-systemdsystemunitdir="
 
 FILES_${PN} += "${exec_prefix}/lib/ConsoleKit \
Signature · 1 line
2.13.6
#5 lore raw

PATCH 5/5 consolekit: enable polkit if polkit distro feature is set

In reply to Stefan Agner

From: Stefan Agner <[email protected]>

Enable polkit depending on whether polkit distro feature is set.

---
 meta/recipes-support/consolekit/consolekit_0.4.6.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/consolekit/consolekit_0.4.6.bb +1 -1
index 15b39046e3..a17f739d4d 100644
@@ -23,7 +23,7 @@ SRC_URI[sha256sum] = "b41d17e06f80059589fbeefe96ad07bcc564c49e65516da1caf9751464
 
 S = "${WORKDIR}/ConsoleKit-${PV}"
 
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd polkit', d)}"
 
 PACKAGECONFIG[pam] = "--enable-pam-module --with-pam-module-dir=${base_libdir}/security,--disable-pam-module,libpam"
 PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit"
Signature · 1 line
2.13.6
#6 lore raw
In reply to Stefan Agner
Quoted 10 lines · Stefan Agner

From: Stefan Agner <[email protected]>

This patchset adds Polkit (formerly known as PolicyKit) as a distro feature. Polkit is used to centrally manage system policies and allows non-privileged processes access privileged operations.

Since various packages such as systemd, ConnMan or NetworkManager allow building with/without Polkit support it is sensible to have a global policy by using a distro feature to descide whether to use Polkit.

Quoted 6 lines

Currently there is NetworkManager and xfce4 which enable polkit if systemd is enabled. Using Polkit as a distro feature allows to easily prevent any Polkit use while still using systemd.

I plan to send another patch to wire this up in various packages in meta-openembedded as well as documentation update.

Thanks.

The patches are pretty straight-forward.
LGTM.

../Randy

Quoted 16 lines

--
Stefan

Stefan Agner (5):
systemd: only enable polkit if DISTRO_FEATURES asks for polkit
gconf: rename policykit to polkit
gconf: enable polkit if polkit distro feature is set
consolekit: rename policykit to polkit
consolekit: enable polkit if polkit distro feature is set

  meta/recipes-core/systemd/systemd_239.bb            | 3 +--
  meta/recipes-gnome/gnome/gconf_3.2.6.bb             | 7 +++----
  meta/recipes-support/consolekit/consolekit_0.4.6.bb | 4 ++--
  3 files changed, 6 insertions(+), 8 deletions(-)
Signature · 2 lines
# Randy MacLeod
# Wind River Linux