Patchwork [3/4] Add "builder" user for specific purpose.

login
register
mail settings
Submitter Zhai, Edwin
Date Dec. 22, 2011, 12:16 p.m.
Message ID <fb2e9d6deddc3958e06c5559b58d9e260dbc50f5.1324555824.git.edwin.zhai@intel.com>
Download mbox | patch
Permalink /patch/17465/
State Accepted
Commit fdb12302674101feb85f4e83936652474ffd231d
Headers show

Comments

Zhai, Edwin - Dec. 22, 2011, 12:16 p.m.
From: Zhai Edwin <edwin.zhai@intel.com>

"builder" can start some auto stuff by mini X session.

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
---
 meta/recipes-graphics/builder/builder_0.1.bb       |   27 ++++++++++++++++++++
 .../builder/files/builder_hob_start.sh             |   11 ++++++++
 2 files changed, 38 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-graphics/builder/builder_0.1.bb
 create mode 100644 meta/recipes-graphics/builder/files/builder_hob_start.sh

Patch

diff --git a/meta/recipes-graphics/builder/builder_0.1.bb b/meta/recipes-graphics/builder/builder_0.1.bb
new file mode 100644
index 0000000..ceb9612
--- /dev/null
+++ b/meta/recipes-graphics/builder/builder_0.1.bb
@@ -0,0 +1,27 @@ 
+SUMMARY = "New user to do specific job"
+DESCRIPTION = "This recipe create a new user named ${PN}, who is used for specific jobs like building. The task can be auto started via mini X"
+SECTION = "x11"
+PR = "r0"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://builder_hob_start.sh;endline=5;md5=84796c3c41785d86100fdabcbdade00e"
+
+SRC_URI = "file://builder_hob_start.sh"
+
+S = "${WORKDIR}"
+
+RDEPENDS_${PN} = "mini-x-session"
+
+inherit useradd
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --create-home \
+                       --groups video,tty,audio \
+                       --user-group ${PN}"
+
+do_install () {
+	install -d -m 755 ${D}/etc/mini_x/session.d
+	install -p -m 755 builder_hob_start.sh ${D}/etc/mini_x/session.d/
+
+	chown  ${PN}.${PN} ${D}/etc/mini_x/session.d/builder_hob_start.sh
+}
+
diff --git a/meta/recipes-graphics/builder/files/builder_hob_start.sh b/meta/recipes-graphics/builder/files/builder_hob_start.sh
new file mode 100644
index 0000000..fdafc4e
--- /dev/null
+++ b/meta/recipes-graphics/builder/files/builder_hob_start.sh
@@ -0,0 +1,11 @@ 
+#!/bin/sh
+#This script will be called via mini X session on behalf of file owner, after
+#installed in /etc/mini_x/session.d/. Any auto start jobs including X apps can
+#be put here
+
+# start hob here
+#cd /intel/poky/poky
+#. ./oe-init-build-env
+#../scripts/hob
+
+matchbox-terminal&