From cc937529cdf8fad47b9b988fe205406f75d61acd Mon Sep 17 00:00:00 2001 From: José Bollo Date: Fri, 3 May 2019 18:43:21 +0200 Subject: Refactor of system and user setup Since a long time, the creation of the user and system run environment was made by a sub-optimal, hardly maintainable and false-error generating. This change puts the user and system setup in separate shell scripts. This makes them more easy to maintain, update or tune. This facility will useful for further evolution. Bug-AGL: SPEC-1016 Change-Id: Iede81a659eacf4e5c21c561a33d300408e1bd058 Signed-off-by: Jose Bollo --- conf/system/afm-user-setup.sh.in | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 conf/system/afm-user-setup.sh.in (limited to 'conf/system/afm-user-setup.sh.in') 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 + -- cgit 1.2.3-korg