- Use a fast machine with big and fast disks.
Select a reasonably fast multi-core build host with with lots of RAM
and a fast I/O system,
for example a large multi-spindle RAID0 array.
Plan for at least 500...1000 GiB disk space. If you have the
money available, go for SSDs.
- Select source tree / git repository / branch to build:
$ cd ~/git/
$ git clone git://git.denx.de/eldk.git
$ cd eldk
$ git checkout eldk-5.2.1
- Select build directory and initialize data
$ git log --pretty='format:%d %h %ci %s' "$@" | head -1
(HEAD, eldk-5.2.1) 33c5d31 2012-06-20 13:32:37 +0200 Merge branch '5.2-backports' into eldk-rel-v5.2
$ BUILD_NAME=$(git branch | sed -ne '/(no branch)/d' -e 's/$/-/' -e 's/^\* //p')$(git log --format="%ad-%h" --date=short HEAD^\!)
$ echo $BUILD_NAME
2012-06-20-33c5d31
Note 1: When building in a git branch, above commands will
prepend the current branch name to the build directory file
name; output might then look like this:
$ git log --pretty='format:%d %h %ci %s' "$@" | head -1
(HEAD, eldk-5.2.1, eldk-rel-v5.2) 33c5d31 2012-06-20 13:32:37 +0200 Merge branch '5.2-backports' into eldk-rel-v5.2
resp.
$ echo $BUILD_NAME
eldk-rel-v5.2-2012-06-20-33c5d31
Note: 2 When building images for a specific target architecture,
it is usually a good idea to include this name in the BUILD_NAME
as in the following example:
$ source oe-init-build-env /opt/eldk/build/${BUILD_NAME}-armv7a
- Edit
"conf/bblayers.conf"
to add meta-eldk
layer.
$ cp -vp conf/bblayers.conf{,.ORIG}
$ vi conf/bblayers.conf
$ diff -u conf/bblayers.conf.ORIG conf/bblayers.conf
--- conf/bblayers.conf.ORIG 2012-04-27 11:38:58.000000000 +0200
+++ conf/bblayers.conf 2012-04-27 11:42:33.918272655 +0200
@@ -6,4 +6,5 @@
BBLAYERS ?= " \
/home/wd/git/eldk/meta \
/home/wd/git/eldk/meta-yocto \
+ /home/wd/git/eldk/meta-eldk \
"
- Edit
"conf/local.conf"
as needed; append
"add_machine_symlinks"
to the USER_CLASSES
variable
$ cp -vp conf/local.conf{,.ORIG}
$ vi conf/local.conf
$ diff -u conf/local.conf{.ORIG,}
--- conf/local.conf.ORIG 2012-04-27 11:38:58.168222148 +0200
+++ conf/local.conf 2012-04-27 11:40:17.855762980 +0200
@@ -26,6 +26,8 @@
#
# For a quad-core machine, BB_NUMBER_THREADS = "4", PARALLEL_MAKE = "-j 4" would
# be appropriate for example.
+BB_NUMBER_THREADS = "4"
+PARALLEL_MAKE = "-j 4"
#
# Machine Selection
@@ -61,7 +63,7 @@
#
# The default is a downloads directory under TOPDIR which is the build directory.
#
-#DL_DIR ?= "${TOPDIR}/downloads"
+DL_DIR = "/opt/eldk/downloads"
#
# Where to place shared-state files
@@ -99,7 +101,7 @@
# Ultimately when creating custom policy, people will likely end up subclassing
# these defaults.
#
-DISTRO ?= "poky"
+DISTRO ?= "eldk"
# As an example of a subclass there is a "bleeding" edge policy configuration
# where many versions are set to the absolute latest code from the upstream
# source control systems. This is just mentioned here as an example, its not
@@ -118,7 +120,7 @@
# - 'package_rpm' for rpm style packages
# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
# We default to rpm:
-PACKAGE_CLASSES ?= "package_rpm"
+PACKAGE_CLASSES ?= "package_ipk"
#
# SDK/ADT target architecture
@@ -127,7 +129,7 @@
# you can build the SDK packages for architectures other than the machine you are
# running the build on (i.e. building i686 packages on an x86_64 host._
# Supported values are i686 and x86_64
-#SDKMACHINE ?= "i686"
+SDKMACHINE ?= "i686"
#
# Extra image configuration defaults
@@ -162,7 +164,7 @@
# - 'image-swab' to perform host system intrusion detection
# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
-USER_CLASSES ?= "buildstats image-mklibs image-prelink"
+USER_CLASSES ?= "buildstats image-mklibs image-prelink add_machine_symlinks"
#
# Runtime testing of images
Note: after adapting the "/home/wd"
strings to your local
directory structure, the patch provided in
"~/git/eldk/meta-eldk/tools/eldk-conf.patch"
can be used to
make these steps easier:
$ patch -p0 -b -z.ORIG <~/git/eldk/meta-eldk/tools/eldk-conf.patch
- Sanitize
PATH
, i. e. make sure it does not include "."
or
other local directories which potentially might confuse bitbake.
Note: after adapting the "/home/wd"
strings to your local
directory structure, the following file can be sourced:
$ source ~/git/eldk/meta-eldk/tools/set-path
- Select target architecture:
Currently we support the following MACHINE
definitions:
- generic-armv4t
- generic-armv5te
- generic-armv6
- generic-armv7a
- generic-armv7a-hf
- generic-mips
- generic-powerpc
- generic-powerpc-softfloat
- generic-powerpc-4xx
- generic-powerpc-4xx-softfloat
- generic-powerpc-e500v2
Please see table
1.4. Supported Target Architectures
for details.
- Select image(s) to build:
For each of the machines, we can build (for example)
these images:
- core-image-minimal
- core-image-minimal-mtdutils
- core-image-minimal-dev
- core-image-base
- core-image-basic
- core-image-clutter
- core-image-lsb
- core-image-lsb-dev
- core-image-lsb-sdk
- core-image-sato
- core-image-sato-dev
- core-image-sato-sdk
- core-image-qte-sdk
- core-image-x11 (ELDK 5.2.1 and older: core-image-core)
- meta-toolchain-sdk
- meta-toolchain-qte
Please see table
1.5. Supported Target Configurations
for details.
- For simple tests you can run
bitbake
manually, like this:
$ MACHINE=generic-armv7a bitbake core-image-minimal
- For regression testing or production builds where you want to build
supported images it is usually easier to use the provided script:
$ MACHINE=generic-armv7a ~/git/eldk/meta-eldk/tools/eldk-build.sh
Note: You can also pass a list of images to build in the environment,
like that:
$ MACHINE=generic-armv7a \
IMAGES="core-image-minimal core-image-lsb-sdk meta-toolchain-sdk" \
~/git/eldk/meta-eldk/tools/eldk-build.sh
Note: it is recommended to chose a separate build directory for
each of the MACHINE settings.
- The results of the build can be found in the
"tmp/deploy/images"
resp. "tmp/deploy/sdk"
directories.