Skip to content
xranby edited this page Jan 9, 2012 · 16 revisions

Welcome to the meta-java wiki!

meta-java openjdk-6 cross-compilation tutorial using oe-core+meta-java on Debian/Ubuntu hosts.

You will need about 40gb of free hard disk drive space, a fast Internet connection and about 12h compilation time on a 2Gb RAM, AMD 64 Live system in order to complete this tutorial.

# First we need to install all packages needed to clone and run OpenEmbedded-core on Debian/Ubuntu.
# OpenEmbedded will stop and print all the packages you need if they are not already installed.
# svn are provided by the subversion package and
# makeinfo are provided by the texinfo package.
# libgl1-mesa-dev libglu1-mesa-dev libsdl1.2-dev are needed to build qemu-native

sudo apt-get install git g++ diffstat texi2html texinfo subversion chrpath libgl1-mesa-dev libglu1-mesa-dev libsdl1.2-dev

# Clone the main oe-core git layer, bitbake and all the required sub-layers that meta-java depend on:
# oe-core git = 68.02 MiB
# bitbake git = 3.15 MiB
# meta-openembedded git = 14.91 MiB
# meta-java git = 141.86 KiB

git clone git://git.openembedded.org/openembedded-core oe-core
cd oe-core
git clone git://git.openembedded.org/bitbake bitbake
git clone git://git.openembedded.org/meta-openembedded
git clone https://github.com/woglinde/meta-java.git



# Initialize the oe-core build environment and edit configuration files 
# 
# This following command line line will create your build directory, setup your build environment,
# automatically place the current work directory inside the build dir and
# print out some useful information on how to bitbake packages.
# You can rerun this command every time you want to re-setup your build environment!

. ./oe-init-build-env

option A manually edit the conf/*.conf files to enable the meta-java layer and run bitbake

# The default created configuration files inside the build dir are missing all the extra layers 
# that we need so we need to update the two configuration files conf/local.conf and conf/bblayers.conf 
# inside the build dir. 
#

gedit conf/local.conf

# Add the following META-JAVA SPECIFIC settings to the top of the local.conf file:

PREFERRED_PROVIDER_virtual/java-native = "jamvm-native"
PREFERRED_PROVIDER_virtual/javac-native = "ecj-bootstrap-native"
PREFERRED_VERSION_cacaoh-native = "0.99.3"
PREFERRED_VERSION_icedtea6-native = "1.8.11"

# A good idea are to read through the whole local.conf file and at least update/set
# MACHINE, BB_NUMBER_THREADS and PARALLEL_MAKE

MACHINE ?= "qemuarm"
BB_NUMBER_THREADS = "2"
PARALLEL_MAKE = "-j 2"

# Done with local.conf editing!

gedit conf/bblayers.conf

# Add the paths for all the bitbake layers so that the file looks something like this:

# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "4"

BBFILES ?= ""
BBLAYERS = " \
  /home/user/oe-core/meta \
  /home/user/oe-core/meta-openembedded/meta-oe \
  /home/user/oe-core/meta-java \
  "
# Done with bblayers.conf editing!

# Finally we are ready to start the bitbake cross compilation
# build of openjdk-6 and all its dependencies!
# During this bitbake step
# 2.8Gb of source-code data will be fetched and placed into the build/download directory.
# run bitbake from inside your build dir!
bitbake openjdk-6

option B run Hob to bring up a GUI where you can configure a rootfs image with openjdk-6 included

# Hob are a nice GUI where you can prepare a complete rootfs including all the extra packages you need.
# you can add the meta-oe and meta-java layers from inside Hob!
# run hob from inside your build dir!
hob
Clone this wiki locally