[oe-commits] org.oe.dev helloworld: package plus image for truly minimal user space, a statically linked hello world executable.

likewise commit openembedded-commits at lists.openembedded.org
Thu May 17 16:43:59 UTC 2007


helloworld: package plus image for truly minimal user space, a statically linked hello world executable.

Author: likewise at openembedded.org
Branch: org.openembedded.dev
Revision: 1d3cbf1f69da57387c0d0eb4329fc5054a9ccec0
ViewMTN: http://monotone.openembedded.org/revision.psp?id=1d3cbf1f69da57387c0d0eb4329fc5054a9ccec0
Files:
1
packages/helloworld
packages/helloworld/helloworld_1.0.0.bb
packages/images/helloworld-image.bb
packages/images/angstrom-minimal-image.bb
Diffs:

#
# mt diff -r5d1b115fdc0cd4dcc8356e8e2c5aaeca756b6e99 -r1d3cbf1f69da57387c0d0eb4329fc5054a9ccec0
#
# 
# 
# add_dir "packages/helloworld"
# 
# add_file "packages/helloworld/helloworld_1.0.0.bb"
#  content [ff6a98a829c03ec3edde494f5342ff80d5a39a58]
# 
# add_file "packages/images/helloworld-image.bb"
#  content [1fe93c338852dd78cd17c1f8497c9f8ce9a7dcf0]
# 
# patch "packages/images/angstrom-minimal-image.bb"
#  from [9fc996ad7cc5cf3c8dfc1610cda27b4a37423fd4]
#    to [7b97fe77abef735efe99de61eedf4f99c8533a77]
# 
============================================================
--- packages/helloworld/helloworld_1.0.0.bb	ff6a98a829c03ec3edde494f5342ff80d5a39a58
+++ packages/helloworld/helloworld_1.0.0.bb	ff6a98a829c03ec3edde494f5342ff80d5a39a58
@@ -0,0 +1,25 @@
+DESCRIPTION = "Minimal statically compiled Hello world!"
+LICENSE = "GPL"
+PR = "r0"
+
+S = "${WORKDIR}/${P}"
+
+do_fetch () {
+	mkdir -p ${WORKDIR}/${P}
+	cd ${WORKDIR}/${P}
+	echo -e "#include <stdio.h>\nint main(void)\n{\n\tprintf(\"Hello world!\\\n\");\twhile(1);\n\treturn 0;\n}\n" >helloworld.c
+}
+
+do_compile () {
+	${CC} -o helloworld helloworld.c -static
+}
+
+do_install () {
+	install -d ${D}${bindir}
+	install -m 0755 helloworld ${D}${bindir}/
+	# /bin/init is on purpose, it is tried after /sbin/init and /etc/init
+	# so if a sysvinit is installed, it will be used instead of helloworld
+	install -d ${D}${base_bindir}
+	ln -sf ${bindir}/helloworld ${D}${base_bindir}/init
+}
+
============================================================
--- packages/images/helloworld-image.bb	1fe93c338852dd78cd17c1f8497c9f8ce9a7dcf0
+++ packages/images/helloworld-image.bb	1fe93c338852dd78cd17c1f8497c9f8ce9a7dcf0
@@ -0,0 +1,14 @@
+# Hello world image
+# Contains *only* a statically linked hello world init program
+LICENSE = "MIT"
+PR = "r0"
+
+RDEPENDS = "helloworld"
+
+export IMAGE_BASENAME = "helloworld-image"
+export IMAGE_LINGUAS = ""
+
+PACKAGE_INSTALL = ${RDEPENDS}
+
+inherit image
+
============================================================
--- packages/images/angstrom-minimal-image.bb	9fc996ad7cc5cf3c8dfc1610cda27b4a37423fd4
+++ packages/images/angstrom-minimal-image.bb	7b97fe77abef735efe99de61eedf4f99c8533a77
@@ -1,22 +1,10 @@
-#Angstrom minimalist image
-#gives you a small images with ssh access
+# Hello world image
+# gives you a small image with a statically linked
 LICENSE = "MIT"
 PR = "r0"
 
-ANGSTROM_EXTRA_INSTALL ?= ""
-DISTRO_SSH_DAEMON ?= "dropbear"
-
-DEPENDS = "task-base \
-           ${DISTRO_SSH_DAEMON} \
-	  "
-
-RDEPENDS = "task-boot \
-            ${DISTRO_SSH_DAEMON} \
-	   "
-
-export IMAGE_BASENAME = "minimalist-image"
+export IMAGE_BASENAME = "helloworld-image"
 export IMAGE_LINGUAS = ""
-export PACKAGE_INSTALL = "${RDEPENDS}"
 
 inherit image
 






More information about the Openembedded-commits mailing list