Ensure home and workir to widget of scope-platform 58/23358/1 8.99.3 icefish/8.99.3 icefish_8.99.3
authorJosé Bollo <jose.bollo@iot.bzh>
Fri, 13 Dec 2019 15:47:45 +0000 (16:47 +0100)
committerJosé Bollo <jose.bollo@iot.bzh>
Fri, 13 Dec 2019 16:24:21 +0000 (17:24 +0100)
The widget requesting the permission to run at
platform scope: urn:AGL:permission::partner:scope-platform
should be able to record data and state.
This change provides a default place to achieve it.

Bug-AGL: SPEC-2998

Change-Id: I148a670d3e08e36603ebd318b533ea1e1a695750
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
CMakeLists.txt
conf/system/afm-system-setup.sh.in
conf/unit/macros.inc

index c83e59d..4e28c8b 100644 (file)
@@ -53,6 +53,7 @@ set(systemd_units_root      "${CMAKE_INSTALL_FULL_LIBDIR}/systemd" CACHE STRING
 set(wgtpkg_trusted_cert_dir "${afm_confdir}/certs" CACHE STRING "Path to internal certificates")
 set(afm_platform_rundir     "/run/platform" CACHE STRING "Path to location of platform runtime sockets")
 set(afm_users_rundir        "/run/user" CACHE STRING "Path to location of users runtime sockets")
+set(afm_scope_platform_dir  "/var/scope-platform" CACHE STRING "Path to home of scope-platform apps")
 
 if(USE_SIMULATION)
     set(SIMULATE_SECMGR ON)
index 4da558e..c3f827e 100644 (file)
@@ -5,7 +5,7 @@ pdir=@afm_platform_rundir@
 dodir() {
        if ! test -e $1; then
                mkdir -m 755  $1
-               chsmack -a '*' $1
+               chsmack -a '*' -T $1
        fi
 }
 
@@ -14,3 +14,10 @@ dodir $pdir/display
 dodir $pdir/apis
 dodir $pdir/apis/ws
 @create_platform_debug@
+
+spdir=@afm_scope_platform_dir@
+if ! test -e $spdir; then
+       mkdir -m 755 $spdir
+       chsmack -a '*' -T $spdir
+       chown daemon:daemon $spdir
+fi
index 2fc9bc5..1344df7 100644 (file)
@@ -60,8 +60,8 @@ define( `USER_RUN_DIR', `@afm_users_rundir@/%i')
 define( `DEBUGGING_DIR', `@afm_platform_rundir@/debug')
 define( `PLATFORM_RUN_DIR', `@afm_platform_rundir@')
 
-define( `APP_DATA_DIR', `ON_PERM(`:partner:scope-platform', `/tmp', `/home/%i/app-data')')
-define( `APP_WORK_DIR', `ON_PERM(`:partner:scope-platform', `/tmp', `APP_DATA_DIR/{{:id}}')')
+define( `APP_DATA_DIR', `ON_PERM(`:partner:scope-platform', `@afm_scope_platform_dir@', `/home/%i/app-data')')
+define( `APP_WORK_DIR', `APP_DATA_DIR/{{:id}}')
 define( `RUN_DIR', `ON_PERM(`:partner:scope-platform', `PLATFORM_RUN_DIR', `USER_RUN_DIR')')
 
 define( `API_PATH', `RUN_DIR/apis')