summaryrefslogtreecommitdiff
path: root/distribution/yocto-advanced/meta-schulung-extended/recipes-app
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2017-12-19 11:16:28 +0100
committerJohn Ogness <john.ogness@linutronix.de>2017-12-19 11:16:28 +0100
commit6e7e1b7172813fc4ecb60597f903dd21a4616159 (patch)
treedbfe0b8f1a3d51c275722ba86d4ffe109ee88aef /distribution/yocto-advanced/meta-schulung-extended/recipes-app
parent270520b4a2eac8725c8575c3180964289722e191 (diff)
update yocto-advanced: sync to devel/manut/yocto
The devel/manut/yocto heavily diverted from master. Sync with latest version 8cd4956a9b48a316eab6dc6d1b1f6cd51362fecf. Signed-off-by: John Ogness <john.ogness@linutronix.de>
Diffstat (limited to 'distribution/yocto-advanced/meta-schulung-extended/recipes-app')
-rw-r--r--distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello-init.sh12
-rw-r--r--distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello.c12
-rw-r--r--distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/hello_1.0.bb49
3 files changed, 73 insertions, 0 deletions
diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello-init.sh b/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello-init.sh
new file mode 100644
index 0000000..1d40092
--- /dev/null
+++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello-init.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+case $1 in
+start)
+ exec hello
+ ;;
+stop)
+ exit 0
+ ;;
+esac
+
+exit 1
diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello.c b/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello.c
new file mode 100644
index 0000000..aea8503
--- /dev/null
+++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/files/hello.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+
+/*
+ * A simple application to greet the world.
+ */
+
+int main(void)
+{
+ printf("Hello, world!\n");
+ return 0;
+}
+
diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/hello_1.0.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/hello_1.0.bb
new file mode 100644
index 0000000..3f9b9c2
--- /dev/null
+++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-app/greeting/hello_1.0.bb
@@ -0,0 +1,49 @@
+# packages require licenses!
+LICENSE = "MIT"
+
+# if the license is not "CLOSED", a checksum is required
+# (we are using a common license file since this
+# application does not provide LICENSE text)
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+# specify files needed to build the package
+SRC_URI = " \
+ file://hello.c \
+ file://hello-init.sh \
+"
+
+S = "${WORKDIR}"
+
+# specify a new compile task
+# - by default, poky calls "make", but we have no Makefile
+# - this task is called from the ${S} directory, ${WORKDIR}/${PN}/${PV}
+# - poky appropriately sets ${CC}, ${CFLAGS}, ${LDFLAGS} and exports
+# them to the shell process environment
+do_compile () {
+ $CC $CFLAGS $LDFLAGS -o${B}/hello ${S}/hello.c
+}
+
+# specify an install task
+# - by default, do_install is empty
+# - this task is called from the ${S} directory, ${WORKDIR}/${PN}-${PV}
+# - anything copy to ${D} will be packaged
+# - by default, poky sets ${base_bindir} to "/bin"
+do_install () {
+ install -D -m 0755 ${B}/hello ${D}${base_bindir}/hello
+
+ # install the init script
+ install -D -m 0755 ${WORKDIR}/hello-init.sh \
+ ${D}${sysconfdir}/init.d/hello
+}
+
+# specify the name of the init script
+# (it is will be expected to be in /etc/init.d)
+INITSCRIPT_NAME="hello"
+
+# setup the init script
+# (this will create the link: /etc/rcS.d/S20hello)
+INITSCRIPT_PARAMS = "start 20 S ."
+
+# use the update-rc.d class to setup the init scripts
+# (this class uses INITSCRIPT_NAME and INITSCRIPT_PARAMS)
+inherit update-rc.d