This chapter describes one way to customize the openembedded repository to your needs. The idea is to provide an additional packages repository which is used to define the additional stuff.
We will explain that using an example directory myoe/packages, which is then similarly used as the org.openembedded.dev/packages repository. To inform bitbake about this new repository you have to extend the conf/local.conf file. The new BBFILES line(s) are e.g.
BBFILES := "${HOME}/dev/oe/org.openembedded.dev/packages/*/*.bb"
BBFILES += "${HOME}/myoe/packages/*/*.bb"
The next bitbake run will parse the dev/oe/org.openembedded.dev packages as well as all packages found in myoe/packages.
Unfortunately this can only be done in org.openembedded.dev/conf/machine for now. The easiest way to do is to copy a similar machine configuration and modify to your needs.
As an example I will build a machine based on my c7x0 (zaurus) and name that my1stmach.
cd org.openembedded.dev/conf/machine; cp c7x0.conf my1stmach.conf
followed by changing the content of my1stmach.conf to your needs (Description, ...).cd org.openembedded.dev/conf/machine; cp zaurus-clamshell.conf my1stmach-common.conf
provides a copy of the common used zaurus features. This common definitions
are included in my1stmach.conf (content of that to be changed to use my1stmach-common.conf)
and are only helpfull, if you want to use a group of similar devices (e.g. different flash sizes).Note that this is all to be done so far. All machine relevant dependencies should be defined here now.
Important Note!
As this is done inside the org.openembedded.dev dir, you should make a copy of your changes
before calling monotone to resync your repository, as you ma loose your changes.
Is done the same way as the machine.
As an example I will build a distro based on generic and name that my1stdistro.
cd org.openembedded.dev/conf/distro; cp generic.conf my1stdistro.conf
followed by changing the content of my1stdistro.conf to your needs (Description, ...).Note that this is all to be done so far. All distro relevant dependencies should be defined here now. Especially BOOTSTRAP_EXTRA_(R)DEPENDS are defined / added in here to extend the bootstrap-images content.
Important Note!
As this is done inside the org.openembedded.dev dir, you should make a copy of your changes
before calling monotone to resync your repository, as you ma loose your changes.
As we may want to modify lots of stuff here and use this to explain the above created additional package repository we do a deep copy of the related packages.
cp org.openembedded.dev/packages/meta/task-bootstrap.bb myoe/packages/meta/mytask-bootstrap.bbcp org.openembedded.dev/packages/meta/bootstrap-image.bb myoe/packages/meta/mybootstrap-image.bb
export IMAGE_BASENAME = "mybootstrap-image"
export IPKG_INSTALL = "mytask-bootstrap"
This entry defines, which packages are installed into the images root
file system (and thus the image itself).
DEPENDS = "mytask-bootstrap"
This section last but not least describes how you can build your first self designed bootstrap-image. To be able to do so, we start to define a new build target as we want to use the machine / distro definition above as well.
To prepare the build follow the hints below.
mkdir whereEver/build-my1stmachine will do so.cp env-whatever env-my1stmachine will do so.
OEBUILD=$OESYS2/build-my1stmachine
PS1="[OE-MY1ST]$PS1"
. env-my1stmachine.cp -a ../build-whatever/conf . will do so.
BBFILES := "${HOME}/dev/oe/org.openembedded.dev/packages/*/*.bb"
BBFILES += "${HOME}/myoe/packages/*/*.bb"
MACHINE = "my1stmach"
DISTRO = "my1stdistro"
You can now build your self designed bootstrap-image. A
bitbake mybootstrap-image
will start the build process. Some hours later you will probably
have a freshly created bootstrap image named tmp/deploy/images/mybootstrap-image_xxx.gz.
You can also add new packages if not already provided easily.
This section describes the integration of the schedutils package, which was needed during some tests. As this package is not "configured", but provides a "static" makefile, this is a good example how to handle that kind of stuff.
The following list describes the steps I needed to do to get the package building for the correct target.
LICENSE = "GPL"
DESCRIPTION = "schedutils tools : realtime process manipulation tools"
SECTION = "base"
PRIORITY = "optional"
MAINTAINER = "Werner Schulte <w1 at schulte-ac.de>"
PR = "r0"
SRC_URI = "${DEBIAN_MIRROR}/main/s/schedutils/schedutils_${PV}.orig.tar.gz \
file://schedutils_make.patch;patch=1;pnum=1"
S = "${WORKDIR}/schedutils-${PV}"
inherit autotools
PACKAGES = "${PN}"
FILES_${PN} = "/usr/local/bin/*"
# RDEPENDS_${PN} = ""
python do_package_prepend() {
destdir = "%s/usr/local/bin" % (bb.data.expand('${D}', d))
bb.mkdirhier(destdir)
}
The following list describes the main entries.
install) we
did already patch the file, but still hav the problem, that the install process
wants to create a directory in the images dir. To avoid this, whe have to add
(prepend) the package method. You can see, that this is python code. A subdir
to the image dir is created named usr/local/dir.bitbake schedutils in your targetThis subsection describes the changes I had to do on the Makefile and the way to create and provide an appropriate patch.
diff -Naur xxx xxx_orig > xxx_make.patch where xxx is
your packages dir name.Done that changes, you have the chance to build your new package.