From b41d8ec2e258beaf90b472ea9089e0cd1ba4d19e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 3 Sep 2013 17:42:51 +0200 Subject: Add consolekit and polkit --- .../system/basic.target.wants/polkit.service | 1 + remote/modules/polkit/polkit.build | 26 ++++++++++++++++++++++ remote/modules/polkit/polkit.conf | 13 +++++++++++ remote/modules/polkit/polkit.conf.opensuse | 11 +++++++++ remote/modules/polkit/polkit.conf.ubuntu | 12 ++++++++++ remote/modules/polkit/templates/dbus.service | 6 +++++ remote/modules/polkit/templates/systemd.service | 8 +++++++ 7 files changed, 77 insertions(+) create mode 120000 remote/modules/polkit/data/etc/systemd/system/basic.target.wants/polkit.service create mode 100644 remote/modules/polkit/polkit.build create mode 100644 remote/modules/polkit/polkit.conf create mode 100644 remote/modules/polkit/polkit.conf.opensuse create mode 100644 remote/modules/polkit/polkit.conf.ubuntu create mode 100644 remote/modules/polkit/templates/dbus.service create mode 100644 remote/modules/polkit/templates/systemd.service (limited to 'remote/modules/polkit') diff --git a/remote/modules/polkit/data/etc/systemd/system/basic.target.wants/polkit.service b/remote/modules/polkit/data/etc/systemd/system/basic.target.wants/polkit.service new file mode 120000 index 00000000..b766f9ab --- /dev/null +++ b/remote/modules/polkit/data/etc/systemd/system/basic.target.wants/polkit.service @@ -0,0 +1 @@ +../polkit.service \ No newline at end of file diff --git a/remote/modules/polkit/polkit.build b/remote/modules/polkit/polkit.build new file mode 100644 index 00000000..eeae1e32 --- /dev/null +++ b/remote/modules/polkit/polkit.build @@ -0,0 +1,26 @@ +#tool/distro specific functions for fetching, building and installing dependencies + + +fetch_source () { + pinfo "Extracting from running system..." +} + +build () { + COPYLIST="$MODULE_DIR/list_dpkg_output" + [ -e "${COPYLIST}" ] && rm "${COPYLIST}" + + list_packet_files >> "${COPYLIST}" + tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}" + local POLPATH=$(find "$MODULE_BUILD_DIR" -name polkitd -executable | head -n 1) + POLPATH="/${POLPATH#$MODULE_BUILD_DIR}" + mkdir -p "$MODULE_BUILD_DIR/etc/systemd/system" "$MODULE_BUILD_DIR/usr/share/dbus-1/system-services" + sed "s,%POLKITD%,${POLPATH},g" "templates/systemd.service" > "$MODULE_BUILD_DIR/etc/systemd/system/polkit.service" || perror "Could not generate polkit.service for systemd" + sed "s,%POLKITD%,${POLPATH},g" "templates/dbus.service" > "$MODULE_BUILD_DIR/usr/share/dbus-1/system-services/org.freedesktop.PolicyKit1.service" || perror "Could not generate polkit.service for dbus" +} + +post_copy() { + #Add Polkit User/Group/Shadow to Stage3.2, required on opensuse + pinfo "Adding polkitd user to target system..." + add_user "polkitd" +} + diff --git a/remote/modules/polkit/polkit.conf b/remote/modules/polkit/polkit.conf new file mode 100644 index 00000000..97d4b892 --- /dev/null +++ b/remote/modules/polkit/polkit.conf @@ -0,0 +1,13 @@ +REQUIRED_DIRECTORIES=" + /etc/pam.d + /etc/polkit-1 + /usr/bin + /usr/share/polkit-1 + /etc/dbus-1/system.d +" +REQUIRED_FILES=" + /usr/share/dbus-1/system-services/org.freedesktop.PolicyKit1.service + /etc/systemd/system/polkit.service +" +REQUIRED_LIBRARIES="libmozjs185" + diff --git a/remote/modules/polkit/polkit.conf.opensuse b/remote/modules/polkit/polkit.conf.opensuse new file mode 100644 index 00000000..10cedbe9 --- /dev/null +++ b/remote/modules/polkit/polkit.conf.opensuse @@ -0,0 +1,11 @@ +REQUIRED_INSTALLED_PACKAGES=" + libmozjs185-1_0 +" +REQUIRED_CONTENT_PACKAGES=" + libmozjs185-1_0 + polkit +" +REQUIRED_DIRECTORIES+=" + /usr/lib/polkit-1 +" + diff --git a/remote/modules/polkit/polkit.conf.ubuntu b/remote/modules/polkit/polkit.conf.ubuntu new file mode 100644 index 00000000..76d31b9e --- /dev/null +++ b/remote/modules/polkit/polkit.conf.ubuntu @@ -0,0 +1,12 @@ +REQUIRED_INSTALLED_PACKAGES=" + libmozjs185-1.0 +" +REQUIRED_CONTENT_PACKAGES=" + libmozjs185-1.0 + policykit-1 +" +REQUIRED_DIRECTORIES+=" + /usr/lib/policykit-1 + /usr${ARCH_LIB_DIR}/polkit-1 +" + diff --git a/remote/modules/polkit/templates/dbus.service b/remote/modules/polkit/templates/dbus.service new file mode 100644 index 00000000..c9ee6c8b --- /dev/null +++ b/remote/modules/polkit/templates/dbus.service @@ -0,0 +1,6 @@ +[D-BUS Service] +Name=org.freedesktop.PolicyKit1 +Exec=%POLKITD% --no-debug +User=root +SystemdService=polkit.service + diff --git a/remote/modules/polkit/templates/systemd.service b/remote/modules/polkit/templates/systemd.service new file mode 100644 index 00000000..747fd7eb --- /dev/null +++ b/remote/modules/polkit/templates/systemd.service @@ -0,0 +1,8 @@ +[Unit] +Description=the cancer that is called PolKit + +[Service] +Type=dbus +BusName=org.freedesktop.PolicyKit1 +ExecStart=%POLKITD% --no-debug + -- cgit v1.2.3-55-g7522