[Buildroot] [PATCH v6 5/6] package/polkit: add init service file

aduskett at gmail.com aduskett at gmail.com
Fri Dec 6 23:46:48 UTC 2019


From: Adam Duskett <Aduskett at gmail.com>

Add a S50polkit file which starts polkit for non-systemd based systems.

Signed-off-by: Adam Duskett <Aduskett at gmail.com>
---
Changes v1 -> v5:
 - Use start-stop-daemon in the init file. (Thomas)
 - Reorder this patch in the series.

 package/polkit/S50polkit | 15 +++++++++++++++
 package/polkit/polkit.mk |  5 +++++
 2 files changed, 20 insertions(+)
 create mode 100644 package/polkit/S50polkit

diff --git a/package/polkit/S50polkit b/package/polkit/S50polkit
new file mode 100644
index 0000000000..55c10e99ae
--- /dev/null
+++ b/package/polkit/S50polkit
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# start polkitd
+#
+
+case "$1" in
+	start)
+		start-stop-daemon -q -S -x /usr/lib/polkit-1/polkitd -- --no-debug &
+		;;
+	*)
+  echo "Usage: $0 {start}"
+		exit 1
+esac
+
+exit $?
diff --git a/package/polkit/polkit.mk b/package/polkit/polkit.mk
index b440cd2f1c..8bb4512aee 100644
--- a/package/polkit/polkit.mk
+++ b/package/polkit/polkit.mk
@@ -44,4 +44,9 @@ define POLKIT_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/polkit.service
 endef
 
+define POLKIT_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/polkit/S50polkit \
+		$(TARGET_DIR)/etc/init.d/S50polkit
+endef
+
 $(eval $(autotools-package))
-- 
2.23.0



More information about the buildroot mailing list