summaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
Diffstat (limited to 'conf')
-rw-r--r--conf/system/CMakeLists.txt17
-rw-r--r--conf/system/afm-system-setup.service9
-rw-r--r--conf/system/afm-system-setup.service.in6
-rw-r--r--conf/system/afm-system-setup.sh.in16
-rw-r--r--conf/system/afm-user-setup.sh.in28
-rw-r--r--conf/system/afm-user-setup@.service14
-rw-r--r--conf/system/afm-user-setup@.service.in7
7 files changed, 71 insertions, 26 deletions
diff --git a/conf/system/CMakeLists.txt b/conf/system/CMakeLists.txt
index cdece83..4f77f93 100644
--- a/conf/system/CMakeLists.txt
+++ b/conf/system/CMakeLists.txt
@@ -19,8 +19,12 @@
cmake_minimum_required(VERSION 2.8)
configure_file(afm-system-daemon.service.in afm-system-daemon.service)
-configure_file(afm-system-daemon.socket.in afm-system-daemon.socket)
+configure_file(afm-system-daemon.socket.in afm-system-daemon.socket)
+configure_file(afm-system-setup.service.in afm-system-setup.service)
+configure_file(afm-system-setup.sh.in afm-system-setup.sh)
configure_file(afm-api-afm-main@.service.in afm-api-afm-main@.service)
+configure_file(afm-user-setup@.service.in afm-user-setup@.service)
+configure_file(afm-user-setup.sh.in afm-user-setup.sh)
if(NOT USE_SDK)
set(SYSCONFDIR_DBUS_SYSTEM ${CMAKE_INSTALL_SYSCONFDIR}/dbus-1/system.d CACHE STRING "Path to dbus system configuration files")
@@ -34,12 +38,19 @@ if(NOT USE_SDK)
${CMAKE_CURRENT_BINARY_DIR}/afm-api-afm-main@.service
${CMAKE_CURRENT_BINARY_DIR}/afm-system-daemon.service
${CMAKE_CURRENT_BINARY_DIR}/afm-system-daemon.socket
- ${CMAKE_CURRENT_SOURCE_DIR}/afm-system-setup.service
+ ${CMAKE_CURRENT_BINARY_DIR}/afm-system-setup.service
${CMAKE_CURRENT_SOURCE_DIR}/afm-user-session@.service
${CMAKE_CURRENT_SOURCE_DIR}/afm-user-session@.target
- ${CMAKE_CURRENT_SOURCE_DIR}/afm-user-setup@.service
+ ${CMAKE_CURRENT_BINARY_DIR}/afm-user-setup@.service
DESTINATION
${UNITDIR_SYSTEM}
)
+ install(
+ PROGRAMS
+ ${CMAKE_CURRENT_BINARY_DIR}/afm-user-setup.sh
+ ${CMAKE_CURRENT_BINARY_DIR}/afm-system-setup.sh
+ DESTINATION
+ ${afm_libexecdir}
+ )
endif()
diff --git a/conf/system/afm-system-setup.service b/conf/system/afm-system-setup.service
deleted file mode 100644
index d624aeb..0000000
--- a/conf/system/afm-system-setup.service
+++ /dev/null
@@ -1,9 +0,0 @@
-[Unit]
-Description=Initiate afm-system-setup
-Before=weston.service afs-supervisor.service afm-system-daemon.service
-[Service]
-Type=oneshot
-ExecStart=-/bin/sh -c "/bin/mkdir -m 755 /run/platform; /usr/bin/chsmack -a '*' /run/platform"
-ExecStart=-/bin/sh -c "/bin/mkdir -m 755 /run/platform/display; /usr/bin/chsmack -a '*' /run/platform/display"
-ExecStart=-/bin/sh -c "/bin/mkdir -m 755 /run/platform/apis; /usr/bin/chsmack -a '*' /run/platform/apis"
-ExecStart=-/bin/sh -c "/bin/mkdir -m 755 /run/platform/apis/ws; /usr/bin/chsmack -a '*' /run/platform/apis/ws"
diff --git a/conf/system/afm-system-setup.service.in b/conf/system/afm-system-setup.service.in
new file mode 100644
index 0000000..694ac2d
--- /dev/null
+++ b/conf/system/afm-system-setup.service.in
@@ -0,0 +1,6 @@
+[Unit]
+Description=Initiate afm-system-setup
+Before=weston.service afs-supervisor.service afm-system-daemon.service
+[Service]
+Type=oneshot
+ExecStart=-@afm_libexecdir@/afm-system-setup.sh
diff --git a/conf/system/afm-system-setup.sh.in b/conf/system/afm-system-setup.sh.in
new file mode 100644
index 0000000..2af411c
--- /dev/null
+++ b/conf/system/afm-system-setup.sh.in
@@ -0,0 +1,16 @@
+#!bin/sh
+
+pdir=@afm_platform_rundir@
+
+dodir() {
+ if ! test -e $1; then
+ mkdir -m 755 $1
+ chsmack -a '*' $1
+ fi
+}
+
+dodir $pdir
+dodir $pdir/display
+dodir $pdir/apis
+dodir $pdir/apis/ws
+
diff --git a/conf/system/afm-user-setup.sh.in b/conf/system/afm-user-setup.sh.in
new file mode 100644
index 0000000..24795ae
--- /dev/null
+++ b/conf/system/afm-user-setup.sh.in
@@ -0,0 +1,28 @@
+#!bin/sh
+
+uid=$1
+udir=/run/user/$uid
+
+dodir() {
+ if ! test -e $1; then
+ mkdir -m 700 $1
+ chown $uid:$uid $1
+ chsmack -a '*' $1
+ fi
+}
+
+dodir $udir
+dodir $udir/apis
+dodir $udir/apis/ws
+dodir $udir/apis/link
+
+doln() {
+ if ! test -e $2; then
+ ln -sf $1 $2
+ chown -h $uid:$uid $2
+ chsmack -a '*' $2
+ fi
+}
+
+doln @afm_platform_rundir@/display/wayland-0 $udir/wayland-0
+
diff --git a/conf/system/afm-user-setup@.service b/conf/system/afm-user-setup@.service
deleted file mode 100644
index f23dcd3..0000000
--- a/conf/system/afm-user-setup@.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[Unit]
-Description=Initiate afm-user-setup %i
-After=user@%i.service
-[Service]
-Type=oneshot
-StartLimitInterval=0
-ExecStart=-/bin/sh -c "/bin/mkdir /run/user/%i; /bin/chown %i:%i /run/user/%i; /usr/bin/chsmack -a '*' /run/user/%i"
-ExecStart=-/bin/sh -c "/bin/mkdir /run/user/%i/apis; /bin/chown %i:%i /run/user/%i/apis; /usr/bin/chsmack -a '*' /run/user/%i/apis"
-ExecStart=-/bin/sh -c "/bin/mkdir /run/user/%i/apis/ws; /bin/chown %i:%i /run/user/%i/apis/ws; /usr/bin/chsmack -a '*' /run/user/%i/apis/ws"
-ExecStart=-/bin/sh -c "/bin/mkdir /run/user/%i/apis/link; /bin/chown %i:%i /run/user/%i/apis/link; /usr/bin/chsmack -a '*' /run/user/%i/apis/link"
-ExecStart=-/bin/sh -c "/bin/ln -sf /run/platform/display/wayland-0 /run/user/%i/wayland-0; /bin/chown -h %i:%i /run/user/%i/wayland-0; /usr/bin/chsmack -a '*' /run/user/%i/wayland-0"
-
-
-
diff --git a/conf/system/afm-user-setup@.service.in b/conf/system/afm-user-setup@.service.in
new file mode 100644
index 0000000..86c0422
--- /dev/null
+++ b/conf/system/afm-user-setup@.service.in
@@ -0,0 +1,7 @@
+[Unit]
+Description=Initiate afm-user-setup %i
+After=user@%i.service
+[Service]
+Type=oneshot
+StartLimitInterval=0
+ExecStart=-@afm_libexecdir@/afm-user-setup.sh %i