meta-tizen: Add script to export $UID
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Wed, 28 May 2014 14:48:09 +0000 (16:48 +0200)
committerPatrick Ohly <patrick.ohly@intel.com>
Fri, 9 Jan 2015 17:20:13 +0000 (09:20 -0800)
Busybox doesn't export such environment variable so we use a patch to
do it.

Change-Id: I3c7c4f5cb6908247630bf9e2d041ce3632305eb3
(From meta-tizen rev: 2eacc5602d32f3563192516795711a665c1cc8f5)

Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
meta-tizen/recipes-tizen/weston-common/weston-common-extraconf.inc
meta-tizen/recipes-tizen/weston-common/weston-common/0001-Add-a-script-to-export-UID.patch [new file with mode: 0644]

index 98b7313..b89abb8 100644 (file)
@@ -1,8 +1,9 @@
 inherit useradd
 
-FILESEXTRAPATHS_prepend := "${THISDIR}/weston-common"
+FILESEXTRAPATHS_append := "${THISDIR}/weston-common"
 
 SRC_URI += "file://0001-Fix-path-to-binary-ln-and-chmod.patch"
+SRC_URI += "file://0001-Add-a-script-to-export-UID.patch"
 
 USERADD_PACKAGES = "${PN}"
 
@@ -14,6 +15,10 @@ USERADD_PARAM_${PN} += " -d /home/bob   -m -u 5002   -g users   -G display -r -s
 USERADD_PARAM_${PN} += " -d /home/carole -m -u 5003   -g users   -G display -r -s /bin/sh carole; "
 USERADD_PARAM_${PN} += " -d /home/guest -m -u 9999   -g users   -G display -r -s /bin/sh guest "
 
+do_install_append() {
+       install -m 755 uid.sh ${D}/etc/profile.d
+}
+
 pkg_postinst_${PN} () {
 for user in alice bob carol app guest; do
        for appdir in desktop manifest dbspace; do
diff --git a/meta-tizen/recipes-tizen/weston-common/weston-common/0001-Add-a-script-to-export-UID.patch b/meta-tizen/recipes-tizen/weston-common/weston-common/0001-Add-a-script-to-export-UID.patch
new file mode 100644 (file)
index 0000000..f1823a6
--- /dev/null
@@ -0,0 +1,30 @@
+From 7959e00beeb3590b759aed5e8b473d550e4ea612 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?K=C3=A9vin=20THIERRY?= <kevin.thierry@open.eurogiciel.org>
+Date: Wed, 28 May 2014 16:37:48 +0200
+Subject: [PATCH] meta-tizen: Add a script to export $UID
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Busybox doesn't export such environment variable so we do it with this
+script.
+
+Change-Id: I8e14be602f7d3b198dbd17bfac677ba73856a500
+Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
+---
+ uid.sh | 3 +++
+ 1 file changed, 3 insertions(+)
+ create mode 100755 uid.sh
+
+diff --git a/uid.sh b/uid.sh
+new file mode 100755
+index 0000000..14aee34
+--- /dev/null
++++ b/uid.sh
+@@ -0,0 +1,3 @@
++#!/bin/sh
++
++export UID=$(cut  -f1,3 -d':' /etc/passwd |grep `whoami` |cut -f2 -d':')
+-- 
+1.8.1.4
+