Fix ISU deviced.service 84/296584/6 accepted/tizen/unified/20230907.055340
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Mon, 31 Jul 2023 12:59:26 +0000 (14:59 +0200)
committerChanwoo Choi <cw00.choi@samsung.com>
Tue, 29 Aug 2023 02:41:57 +0000 (02:41 +0000)
Deviced cannot be run in the sandbox (in a different mount namespace)
because for USB gadget purposes it mounts FunctionFS, which is that case
is not visible outside this sandbox.

Change-Id: I761d72573d884827f1fbc742883a0e26b3312706

isu/CMakeLists.txt
isu/deviced.service
isu/etc-deviced.mount [new file with mode: 0644]
isu/isu.cfg

index 5b86da3..7d4d556 100644 (file)
@@ -2,4 +2,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(ISU C)
 
 INSTALL(FILES isu.cfg DESTINATION /etc/isu/deviced/ PERMISSIONS OWNER_WRITE OWNER_READ)
-INSTALL(FILES deviced.service DESTINATION /etc/isu/deviced/system-services/ PERMISSIONS OWNER_WRITE OWNER_READ)
+INSTALL(FILES deviced.service DESTINATION /etc/isu/deviced/system-services/ PERMISSIONS OWNER_WRITE OWNER_READ WORLD_READ)
+INSTALL(FILES etc-deviced.mount DESTINATION /etc/isu/deviced/system-services/ PERMISSIONS OWNER_WRITE OWNER_READ WORLD_READ)
index bbc6201..2f47472 100644 (file)
@@ -1,5 +1,7 @@
 [Unit]
 Description=System device daemon
+After=etc-deviced.mount
+BindsTo=etc-deviced.mount
 
 # Caution: never uncomment below "Wants=" and "After=" entries.
 # Just information, deviced internally wait for /run/.wm_ready
@@ -8,15 +10,10 @@ Description=System device daemon
 
 [Service]
 Type=notify
-NotifyAccess=all
 SmackProcessLabel=System::Privileged
 Environment=XDG_RUNTIME_DIR=/run
-Environment=LD_LIBRARY_PATH=/run/isu/deviced/rootfs/usr/lib/
-EnvironmentFile=/etc/isu/service-common.inc
-ExecStart=/bin/isu-sandbox $ISU_SANDBOX_INVOCATION \
-                     --bind #ISU_RUN_PATH#/deviced/rootfs #ISU_RUN_PATH#/deviced/rootfs/ \
-                     --bind #ISU_RUN_PATH#/deviced/rootfs/usr/bin/deviced /usr/bin/deviced \
-                     /usr/bin/deviced
+Environment=LD_LIBRARY_PATH=#ISU_RUN_PATH#/deviced/rootfs/usr/lib64:#ISU_RUN_PATH#/deviced/rootfs/usr/lib
+ExecStart=#ISU_RUN_PATH#/deviced/rootfs/usr/bin/deviced
 Restart=on-failure
 RestartSec=0
 KillSignal=SIGUSR1
diff --git a/isu/etc-deviced.mount b/isu/etc-deviced.mount
new file mode 100644 (file)
index 0000000..4450cca
--- /dev/null
@@ -0,0 +1,9 @@
+[Unit]
+Before=local-fs.target
+ConditionPathIsMountPoint=!/etc/deviced
+
+[Mount]
+What=#ISU_RUN_PATH#/deviced/rootfs/etc/deviced
+Where=/etc/deviced
+Options=defaults,relatime,bind,ro
+
index 0da0ce7..c99f369 100644 (file)
@@ -1,8 +1,9 @@
 [isu]
 name=#NAME#
 version=#VERSION#
-system_service=deviced.service
+system_service=deviced.service etc-deviced.mount
 
 [files]
 /usr/bin/deviced
-
+/etc/deviced/
+/usr/lib*/libdeviced-common-private.so