spec file and scripts : for selective performance, add start script and execute this... 29/266429/3
authordyamy-lee <dyamy.lee@samsung.com>
Fri, 12 Nov 2021 05:21:06 +0000 (14:21 +0900)
committerdyamy-lee <dyamy.lee@samsung.com>
Mon, 15 Nov 2021 09:15:20 +0000 (18:15 +0900)
Change-Id: Id9144de7b32788f97447b9d3ad537a1f9e01699a

data/units/display-manager.service
data/units/headless_server_start.sh [new file with mode: 0644]
packaging/headless-server.spec

index 5b4663d..3394286 100644 (file)
@@ -6,7 +6,7 @@ Type=simple
 EnvironmentFile=/etc/sysconfig/display-manager.env
 SmackProcessLabel=System
 ExecStartPre=/usr/bin/bash -c "/usr/bin/mkdir -p ${XDG_RUNTIME_DIR}/pepper/"
-ExecStart=/usr/bin/headless_server
+ExecStart=/usr/bin/headless_server_start.sh
 
 [Install]
 WantedBy=graphical.target
diff --git a/data/units/headless_server_start.sh b/data/units/headless_server_start.sh
new file mode 100644 (file)
index 0000000..6ea7157
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ -e ${RUN_WITH_SPEAKER} ]
+then
+    _tizen_project_target=`grep TZ_BUILD_PROJECT /etc/tizen-build.conf | awk -F '[=]' '{ print $2 }' | awk -F '[-]' '{ print $NF }'`
+    if [ ${_tizen_project_target} = "Speaker" ]
+    then
+        export RUN_WITH_SPEAKER=1
+    fi
+fi
+/usr/bin/headless_server
index 27894f1..9913623 100644 (file)
@@ -72,6 +72,8 @@ install -m 0644 data/units/display-manager.env %{buildroot}%{_sysconfdir}/syscon
 %__mkdir_p %{buildroot}%{_sysconfdir}/profile.d
 install -m 0644 data/units/display_env.sh %{buildroot}%{_sysconfdir}/profile.d
 
+install -m 0755 data/units/headless_server_start.sh %{buildroot}/%{_bindir}
+
 %post -n %{name} -p /sbin/ldconfig
 %postun -n %{name} -p /sbin/ldconfig