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

login
register
mail settings
Submitter Zhai, Edwin
Date Dec. 21, 2011, 8:18 a.m.
Message ID <f13de6bacfca9935698b1f30f2729b28d9e9a71f.1324454963.git.edwin.zhai@intel.com>
Download mbox | patch
Permalink /patch/17361/
State New
Headers show

Comments

Zhai, Edwin - Dec. 21, 2011, 8:18 a.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 +++++++++++++++++++++
 meta/recipes-graphics/builder/files/auto_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/auto_start.sh
Saul Wold - Dec. 21, 2011, 7:37 p.m.
On 12/21/2011 12:18 AM, edwin.zhai@intel.com wrote:
> 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 +++++++++++++++++++++
>   meta/recipes-graphics/builder/files/auto_start.sh |   11 ++++++++

auto_start is a pretty generic script name, might be better to call it 
soemthing like builder_hob_start.sh or something more unique.

Sau!

>   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/auto_start.sh
>
> 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..abe329f
> --- /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://auto_start.sh;endline=5;md5=66d6c43a8b2583e3bd70c6b020f679a4"
> +
> +SRC_URI = "file://auto_start.sh"
> +
> +S = "${WORKDIR}"
> +
> +RDEPENDS_${PN} = "minix-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/minix/session.d
> +	install -p -m 755 auto_start.sh ${D}/etc/minix/session.d/
> +
> +	chown  ${PN}.${PN} ${D}/etc/minix/session.d/auto_start.sh
> +}
> +
> diff --git a/meta/recipes-graphics/builder/files/auto_start.sh b/meta/recipes-graphics/builder/files/auto_start.sh
> new file mode 100644
> index 0000000..7247d1c
> --- /dev/null
> +++ b/meta/recipes-graphics/builder/files/auto_start.sh
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +#This script will be called via minix X session on behalf of file owner, after
> +#installed in /etc/minix/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&

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..abe329f
--- /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://auto_start.sh;endline=5;md5=66d6c43a8b2583e3bd70c6b020f679a4"
+
+SRC_URI = "file://auto_start.sh"
+
+S = "${WORKDIR}"
+
+RDEPENDS_${PN} = "minix-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/minix/session.d
+	install -p -m 755 auto_start.sh ${D}/etc/minix/session.d/
+
+	chown  ${PN}.${PN} ${D}/etc/minix/session.d/auto_start.sh
+}
+
diff --git a/meta/recipes-graphics/builder/files/auto_start.sh b/meta/recipes-graphics/builder/files/auto_start.sh
new file mode 100644
index 0000000..7247d1c
--- /dev/null
+++ b/meta/recipes-graphics/builder/files/auto_start.sh
@@ -0,0 +1,11 @@ 
+#!/bin/sh
+#This script will be called via minix X session on behalf of file owner, after
+#installed in /etc/minix/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&