Generate Environment file when booting 67/35767/1 accepted/tizen/tv/20150225.070443 submit/tizen_tv/20150225.042126
authorSangjung Woo <sangjung.woo@samsung.com>
Tue, 24 Feb 2015 10:58:04 +0000 (19:58 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Tue, 24 Feb 2015 10:58:04 +0000 (19:58 +0900)
Some important daemons need system-level shared environment variables
such as DISPLAY. For this purpose, this patch generates the Environment
file for system daemon in /run directory.

Change-Id: I824eff47e355502a82124ef07e375a50eb6f2ad4
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
scripts/tv-generate-env.post [new file with mode: 0644]
tv.yaml

diff --git a/scripts/tv-generate-env.post b/scripts/tv-generate-env.post
new file mode 100644 (file)
index 0000000..d1d6ca2
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+echo "############### tv-generate-env.post ################"
+
+cat > /usr/lib/systemd/system/tizen-system-env.service << EOF
+[Unit]
+Description=Generate environment from /etc/profile.d
+DefaultDependencies=no
+Before=basic.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/env -i sh -c 'source /etc/profile; env | /bin/egrep -v "^(HOME|PWD|SHLVL|_|USER|MAIL|LOGNAME)=" > /run/tizen-system-env'
+
+[Install]
+WantedBy=basic.target
+EOF
+
+mkdir -p /usr/lib/systemd/system/basic.target.wants
+ln -s ../tizen-system-env.service /usr/lib/systemd/system/basic.target.wants/tizen-system-env.service
diff --git a/tv.yaml b/tv.yaml
index 72c5cd8..e0c3acc 100644 (file)
--- a/tv.yaml
+++ b/tv.yaml
@@ -161,6 +161,7 @@ X11:
         - tv-x11
         - tv-mbr-3parts
         - tv-users
+        - tv-generate-env
     Repos: []
     NoChrootScripts:
         - buildname