Hacking OpenEbmedded slugos-image

Note this page is a rush job done on the AM before my OSCON 2007 presentation referencing the Open Embedded hacking done on my robot.  I will be updating this post OSCON so please come back later for more complete and spell checked content.  This is just enough to reproduce the build I'm running as of July 20, 2007

These notes are to capture how to customize the slugos-image build of open Embedded.  It mostly walks through my current patch against the July 20, 2007 version of the org.openembedded.dev bitbake recipe tree to create a SlugOS root file system with python, video for Linux and usb drivers for the camera and usb to serial dongle.

Use these notes after you have read/attempted the instructions on the openembedded web pages and my earlier page: SlugOS usng open embedded

Tweaking Slugs-image:

DISTRO = "slugos"
DL_DIR = "${HOME}/oe_downloads"
MACHINE = "nslu2le"
# you want the littel endean build for a smaller image, and working usb camera's
DISTRO = "slugos"
export PATH=/home/mgross/_dev/oe/bitbake/bin:$PATH
export BBPATH=/home/mgross/_dev/oe/build:/home/mgross/_dev/oe/org.openembedded.dev
I'm going to try to clean up the build some more, but for now the following is the patch to my bit bake files that implements my current hack on the slugos OE build  (I'll come back later and make my own OE distro/image files later) ....

diff -urN -X dontdiff baseline.org.openembedded.dev/classes/kernel.bbclass org.openembedded.dev/classes/kernel.bbclass
--- baseline.org.openembedded.dev/classes/kernel.bbclass    2007-07-20 17:00:12.000000000 -0700
+++ org.openembedded.dev/classes/kernel.bbclass    2007-07-20 16:33:00.000000000 -0700
@@ -43,7 +43,7 @@
 
 KERNEL_LOCALVERSION ?= ""
 
-# kernels are generally machine specific
+# kernels are gnerally machine specific
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 kernel_do_compile() {
@@ -72,7 +72,9 @@
     cp -fR include/asm-generic/* ${STAGING_KERNEL_DIR}/include/asm-generic/
 
     mkdir -p ${STAGING_KERNEL_DIR}/include/linux
+
     cp -fR include/linux/* ${STAGING_KERNEL_DIR}/include/linux/
+    cp -fR include/linux/autoconf.h ${STAGING_KERNEL_DIR}/include/linux/config.h
 
     mkdir -p ${STAGING_KERNEL_DIR}/include/net
     cp -fR include/net/* ${STAGING_KERNEL_DIR}/include/net/
@@ -121,7 +123,9 @@
         install -d ${STAGING_KERNEL_DIR}/arch/${ARCH}
         install -m 0644 arch/${ARCH}/Makefile* ${STAGING_KERNEL_DIR}/arch/${ARCH}
     fi
-    cp -fR include/config* ${STAGING_KERNEL_DIR}/include/   
+    cp -fR include/config* ${STAGING_KERNEL_DIR}/include/
+   
+   
     install -m 0644 ${KERNEL_OUTPUT} ${STAGING_KERNEL_DIR}/${KERNEL_IMAGETYPE}
     install -m 0644 System.map ${STAGING_KERNEL_DIR}/System.map-${KERNEL_VERSION}
     [ -e Module.symvers ] && install -m 0644 Module.symvers ${STAGING_KERNEL_DIR}/
diff -urN -X dontdiff baseline.org.openembedded.dev/packages/python/python_2.4.4.bb org.openembedded.dev/packages/python/python_2.4.4.bb
--- baseline.org.openembedded.dev/packages/python/python_2.4.4.bb    2007-07-20 17:00:40.000000000 -0700
+++ org.openembedded.dev/packages/python/python_2.4.4.bb    2007-07-20 15:15:50.000000000 -0700
@@ -3,7 +3,7 @@
 LICENSE = "PSF"
 SECTION = "devel/python"
 PRIORITY = "optional"
-DEPENDS = "python-native readline zlib gdbm openssl tcl tk"
+DEPENDS = "python-native readline zlib gdbm openssl tcl"
 DEPENDS_sharprom = "python-native readline zlib gdbm openssl"
 PR = "ml2"
 
diff -urN -X dontdiff baseline.org.openembedded.dev/packages/python/python-2.4.4-manifest.inc org.openembedded.dev/packages/python/python-2.4.4-manifest.inc
--- baseline.org.openembedded.dev/packages/python/python-2.4.4-manifest.inc    2007-07-20 17:00:40.000000000 -0700
+++ org.openembedded.dev/packages/python/python-2.4.4-manifest.inc    2007-07-20 15:33:29.000000000 -0700
@@ -8,9 +8,11 @@
 ########################################################################################################################
 
 
-PROVIDES+="python-profile python-threading python-distutils python-textutils python-codecs python-pickle python-datetime python-core python-io python-compiler python-compression python-re python-xmlrpc python-terminal python-email python-image python-core-dbg python-resource python-devel python-math python-hotshot python-unixadmin python-syslog python-tkinter python-gdbm python-fcntl python-netclient python-pprint python-netserver python-curses python-smtpd python-html python-readline python-subprocess python-pydoc python-logging python-mailbox python-xml python-mime python-tests python-unittest python-stringold python-robotparser python-lib-old-and-deprecated python-compile python-shell python-bsddb python-mmap python-zlib python-db python-crypt python-idle python-lang python-audio "
+PROVIDES+="python-profile python-threading python-distutils python-textutils python-codecs python-pickle python-datetime python-core python-io python-compiler python-compression python-re python-xmlrpc python-terminal python-email python-image python-core-dbg python-resource python-devel python-math python-hotshot python-unixadmin python-syslog python-gdbm python-fcntl python-netclient python-pprint python-netserver python-curses python-smtpd python-html python-readline python-subprocess python-pydoc python-logging python-mailbox python-xml python-mime python-tests python-unittest python-stringold python-robotparser python-lib-old-and-deprecated python-compile python-shell python-bsddb python-mmap python-zlib python-db python-crypt python-lang python-audio "
+# PROVIDES+="python-profile python-threading python-distutils python-textutils python-codecs python-pickle python-datetime python-core python-io python-compiler python-compression python-re python-xmlrpc python-terminal python-email python-image python-core-dbg python-resource python-devel python-math python-hotshot python-unixadmin python-syslog python-tkinter python-gdbm python-fcntl python-netclient python-pprint python-netserver python-curses python-smtpd python-html python-readline python-subprocess python-pydoc python-logging python-mailbox python-xml python-mime python-tests python-unittest python-stringold python-robotparser python-lib-old-and-deprecated python-compile python-shell python-bsddb python-mmap python-zlib python-db python-crypt python-idle python-lang python-audio "
 
-PACKAGES="python-profile python-threading python-distutils python-textutils python-codecs python-pickle python-datetime python-core python-io python-compiler python-compression python-re python-xmlrpc python-terminal python-email python-image python-core-dbg python-resource python-devel python-math python-hotshot python-unixadmin python-syslog python-tkinter python-gdbm python-fcntl python-netclient python-pprint python-netserver python-curses python-smtpd python-html python-readline python-subprocess python-pydoc python-logging python-mailbox python-xml python-mime python-tests python-unittest python-stringold python-robotparser python-lib-old-and-deprecated python-compile python-shell python-bsddb python-mmap python-zlib python-db python-crypt python-idle python-lang python-audio "
+PACKAGES="python-profile python-threading python-distutils python-textutils python-codecs python-pickle python-datetime python-core python-io python-compiler python-compression python-re python-xmlrpc python-terminal python-email python-image python-core-dbg python-resource python-devel python-math python-hotshot python-unixadmin python-syslog python-gdbm python-fcntl python-netclient python-pprint python-netserver python-curses python-smtpd python-html python-readline python-subprocess python-pydoc python-logging python-mailbox python-xml python-mime python-tests python-unittest python-stringold python-robotparser python-lib-old-and-deprecated python-compile python-shell python-bsddb python-mmap python-zlib python-db python-crypt python-lang python-audio "
+# PACKAGES="python-profile python-threading python-distutils python-textutils python-codecs python-pickle python-datetime python-core python-io python-compiler python-compression python-re python-xmlrpc python-terminal python-email python-image python-core-dbg python-resource python-devel python-math python-hotshot python-unixadmin python-syslog python-tkinter python-gdbm python-fcntl python-netclient python-pprint python-netserver python-curses python-smtpd python-html python-readline python-subprocess python-pydoc python-logging python-mailbox python-xml python-mime python-tests python-unittest python-stringold python-robotparser python-lib-old-and-deprecated python-compile python-shell python-bsddb python-mmap python-zlib python-db python-crypt python-idle python-lang python-audio "
 
 DESCRIPTION_python-profile="Python Basic Profiling Support"
 PR_python-profile="ml2"
diff -urN -X dontdiff baseline.org.openembedded.dev/packages/python/python-imaging_1.1.5.bb org.openembedded.dev/packages/python/python-imaging_1.1.5.bb
--- baseline.org.openembedded.dev/packages/python/python-imaging_1.1.5.bb    2007-07-20 17:00:37.000000000 -0700
+++ org.openembedded.dev/packages/python/python-imaging_1.1.5.bb    2007-07-20 15:24:08.000000000 -0700
@@ -2,7 +2,8 @@
 SECTION = "devel/python"
 PRIORITY = "optional"
 LICENSE = "GPL"
-DEPENDS = "freetype jpeg tiff"
+DEPENDS = ""
+#DEPENDS = "freetype jpeg tiff"
 RDEPENDS = "python-lang python-stringold"
 SRCNAME = "Imaging"
 
diff -urN -X dontdiff baseline.org.openembedded.dev/packages/python/python-pyv4l_0.5.0.bb org.openembedded.dev/packages/python/python-pyv4l_0.5.0.bb
--- baseline.org.openembedded.dev/packages/python/python-pyv4l_0.5.0.bb    1969-12-31 16:00:00.000000000 -0800
+++ org.openembedded.dev/packages/python/python-pyv4l_0.5.0.bb    2007-07-20 15:26:30.000000000 -0700
@@ -0,0 +1,37 @@
+DESCRIPTION = "Python v4l Library"
+SECTION = "devel/python"
+PRIORITY = "optional"
+LICENSE = "GPL"
+DEPENDS = ""
+RDEPENDS = "python-lang "
+SRCNAME = "pyv4l"
+
+PR = "r1"
+
+SRC_URI = "http://ftp.nlug.nl/ftp/pub/os/Linulll/distr/pardusrepo/sources/pyv4l-0.5.0.tar.bz2"
+##SRC_URI = "http://ftp.nluug.nl/ftp/pub/os/Linux/distr/pardusrepo/sources/pyv4l-0.5.0.tar.gz"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
+
+do_compile() {
+
+    export STAGING_LIBDIR=${STAGING_LIBDIR}
+    export STAGING_INCDIR=${STAGING_INCDIR}
+    distutils_do_compile
+}
+
+do_install() {
+
+    export STAGING_LIBDIR=${STAGING_LIBDIR}
+    export STAGING_INCDIR=${STAGING_INCDIR}
+
+    distutils_do_install
+
+    install -d ${D}${datadir}/doc/${PN}/html/
+    install -m 0644 ${S}/README ${D}${datadir}/doc/${PN}/
+    install -m 0644 ${S}/Docs/* ${D}${datadir}/doc/${PN}/html/
+
+}
+
diff -urN -X dontdiff baseline.org.openembedded.dev/packages/spca5xx/spca5xx-20060501/Makefile.patch org.openembedded.dev/packages/spca5xx/spca5xx-20060501/Makefile.patch
--- baseline.org.openembedded.dev/packages/spca5xx/spca5xx-20060501/Makefile.patch    2007-07-20 17:00:36.000000000 -0700
+++ org.openembedded.dev/packages/spca5xx/spca5xx-20060501/Makefile.patch    2007-07-20 15:25:40.000000000 -0700
@@ -17,3 +17,19 @@
  
   install:
       mkdir -p $(MODULE_INSTALLDIR)
+
+
+--- spca5xx-20060202/drivers/usb/spca5xx.c~    2006-04-29 08:38:07.000000000 -0700
++++ spca5xx-20060202/drivers/usb/spca5xx.c    2007-02-19 16:57:35.000000000 -0800
+@@ -54,6 +54,8 @@
+ #include <linux/pagemap.h>
+ #include <linux/usb.h>
+
++#include <media/v4l2-dev.h>
++
+ #include <asm/io.h>
+ #include <asm/semaphore.h>
+ #include <asm/page.h>
+
+
+
diff -urN -X dontdiff baseline.org.openembedded.dev/packages/tasks/task-slugos.bb org.openembedded.dev/packages/tasks/task-slugos.bb
--- baseline.org.openembedded.dev/packages/tasks/task-slugos.bb    2007-07-20 17:00:42.000000000 -0700
+++ org.openembedded.dev/packages/tasks/task-slugos.bb    2007-07-20 19:55:35.000000000 -0700
@@ -33,12 +33,12 @@
 # These lines add support for formatting ext2 and ext3 file systems
 # on a hard disk attached to the NSLU2.  ext3 is the standard Linux
 # file system.
-SLUGOS_STANDARD_RRECOMMENDS += "e2fsprogs-mke2fs e2fsprogs-fsck e2fsprogs-e2fsck e2fsprogs-badblocks"
+#SLUGOS_STANDARD_RRECOMMENDS += "e2fsprogs-mke2fs e2fsprogs-fsck e2fsprogs-e2fsck e2fsprogs-badblocks"
 
 # These lines add support for an X/Y/ZModem package called lrzsz
 # (this is of use for people with modified NSLU2 hardware which
 # supports a serial port.)
-SLUGOS_STANDARD_RRECOMMENDS += "lrzsz"
+#SLUGOS_STANDARD_RRECOMMENDS += "lrzsz"
 
 # Filesystem selection.  Adding entries here adds the module to the
 # image.  The module must be built as part of nslu2-kernel (i.e. it
@@ -58,47 +58,46 @@
 # attached disk - and install the nfs modules from ssh.)
 # The altboot mechanism requires kernel-module-loop.
 SLUGOS_STANDARD_RRECOMMENDS += "\
-kernel-module-ext2 \
-kernel-module-jbd \
-kernel-module-ext3 \
 kernel-module-vfat \
-kernel-module-isofs \
-kernel-module-udf \
-kernel-module-nfs \
-kernel-module-loop \
 kernel-module-nls-cp437 \
-kernel-module-nls-utf8 \
+kernel-module-loop \
+spca5xx \
+kernel-module-v4l2-common \
+kernel-module-v4l1-compat \
+kernel-module-videodev \
 "
 
 
 # Add daemon required for HW RNG support
-SLUGOS_RNG_TOOLS_PACKAGE = "rng-tools"
-SLUGOS_RNG_TOOLS_PACKAGE_linux-uclibc = ""
-SLUGOS_STANDARD_RRECOMMENDS += "\
-${SLUGOS_RNG_TOOLS_PACKAGE} \
-"
+#SLUGOS_RNG_TOOLS_PACKAGE = "rng-tools"
+#SLUGOS_RNG_TOOLS_PACKAGE_linux-uclibc = ""
+#SLUGOS_STANDARD_RRECOMMENDS += "\
+#${SLUGOS_RNG_TOOLS_PACKAGE} \
+#"
 
 # Add modules required for usb support
 SLUGOS_STANDARD_RRECOMMENDS += "\
 kernel-module-ohci-hcd \
 kernel-module-uhci-hcd \
+kernel-module-usbserial \
+kernel-module-pl2303 \
 "
 
 # Add modules required for IDE support
-SLUGOS_STANDARD_RRECOMMENDS += "\
-kernel-module-libata \
-kernel-module-pata-artop \
-"
+#SLUGOS_STANDARD_RRECOMMENDS += "\
+#kernel-module-libata \
+#kernel-module-pata-artop \
+#"
 
 # Add modules required for Network support
-SLUGOS_STANDARD_RRECOMMENDS += "\
-kernel-module-via-velocity \
-"
+#SLUGOS_STANDARD_RRECOMMENDS += "\
+#kernel-module-via-velocity \
+#"
 
 # Add modules required for Wifi support
-SLUGOS_STANDARD_RRECOMMENDS += "\
-madwifi-ng-modules madwifi-ng-tools wireless-tools \
-"
+#SLUGOS_STANDARD_RRECOMMENDS += "\
+#madwifi-ng-modules madwifi-ng-tools wireless-tools \
+#"
 
 ## Other wireless tools that should be considered
 ## should space be available in the rootfs
@@ -106,17 +105,19 @@
 # zd1211-firmware kernel-module-zd1211rw \
 
 # Add kexec tools for rebooting alternate kernels
-SLUGOS_STANDARD_RRECOMMENDS += "\
-kexec-tools \
-"
+#SLUGOS_STANDARD_RRECOMMENDS += "\
+#kexec-tools \
+#"
 
 # Add modules required for Network Console support
 # NOTE: This module is desirable for systems lacking a physical
 # console, but is usually only enabled if specific needs or issues
 # arise.  If space in the flash is at a premium, it can be omitted.
-SLUGOS_STANDARD_RRECOMMENDS += "\
-kernel-module-netconsole \
-"
+#SLUGOS_STANDARD_RRECOMMENDS += "\
+#kernel-module-netconsole \
+#"
+
+SLUGOS_STANDARD_RDEPENDS = "python python-pyserial python-imaging python-pyv4l"
 
 DISTRO_EXTRA_DEPENDS ?= ""
 DEPENDS += "${DISTRO_EXTRA_DEPENDS}"
@@ -129,12 +130,9 @@
         update-modules sysvinit tinylogin \
     module-init-tools modutils-initscripts \
         ipkg-collateral ipkg ipkg-link \
-    portmap \
     beep \
-    e2fsprogs-blkid \
     util-linux-mount \
     util-linux-umount \
-    util-linux-swaponoff \
     util-linux-losetup \
     ${SLUGOS_STANDARD_RDEPENDS} \
     ${DISTRO_EXTRA_RDEPENDS}"