Difference between revisions of "OEandYourDistro"

From Openembedded.org
Jump to: navigation, search
m (openSUSE all version - zypper)
m (typo)
Line 109: Line 109:
 
===== other useful packages =====
 
===== other useful packages =====
  
These packages may be useful as well if you want to build *-doc packages
+
Those packages may be useful as well if you want to build *-doc packages:
  
 
   sudo zypper in  openjade docbook-xml-website docbook-dsssl-stylesheets docbook-utils sgmltools-lite texinfo
 
   sudo zypper in  openjade docbook-xml-website docbook-dsssl-stylesheets docbook-utils sgmltools-lite texinfo

Revision as of 13:45, 1 December 2011

Note: the information here is liable to be out of date. Please see the Required software for information on which software is required on the host system.

Using OpenEmbedded on Linux systems

deb-based distributions

The easiest way is via apt-get'able Openembedded which will pull the OE meta-data for you and keep it up-to-date. Plus, it makes sure all necessary software for cross-compilation is installed. Easy as 1-2-3.

Debian

Mandatory packages

aptitude install sed wget cvs subversion git-core \
   coreutils unzip texi2html texinfo docbook-utils \
   gawk python-pysqlite2 diffstat help2man make gcc build-essential g++ \
   desktop-file-utils chrpath

Git

On debian you may have to run

 update-alternatives --config git (as root)

and select /usr/bin/git-scm to provide git instead of /usr/bin/git.transition. This is not necessary in sid

Supplementary packages

apt-get install libxml2-utils xmlto python-psyco apr


OPTIONAL: these packages and their dependencies need to be installed in order to build the bitbake documentation (warning: over 160MB of installed packages).

apt-get install docbook

This package is necessary to build some packages (in particular the esound documentation needs it).

Building in container (LXC/OpenVZ)

NOTE: If you are building in container (LXC/OpenVZ) check presence of loadkeys tool (/bin/loadkeys). If there is no loadkeys, install console-tools package.

Ubuntu

Ubuntu is based on Debian and instructions above for Debian apply here as well. Make sure that you have the universe repositories in your apt configuration.

  • Check that /bin/sh (ls -l /bin/sh) is not symbolically linked to dash. "dash" is a POSIX compliant shell that is much smaller than "bash" -- however some broken shell scripts still make use of bash extensions while calling into /bin/sh. To work around this issue call "sudo dpkg-reconfigure dash" and select No when it asks you to install dash as /bin/sh.
  • You can also install Psyco Python JIT compiler to speed up BitBake. Psyco works on 32-bit x86 platforms only. "aptitude install python-psyco
  • there are known gcc issues in Intrepid and later when cross-compiling with OE

[SOLVED - update 2010-05]

  • qemu-arm fails whilst building locales (Ubuntu 10.04 LTS and possibly other releases). This is due to a kernel setting which restricts memory mapping to low addresses. To work around this you can either:
    • a) Enter 'echo 128 > /proc/sys/vm/mmap_min_addr' prior to running bitbake.
    • b) Set permanent parameter 'sudo sysctl -w vm.mmap_min_addr=128'.

With current qemu in OE mmap_min_addr tricks are not needed at all. So now it should work on every system with readable /proc/sys/vm/mmap_min_addr or /proc/sys/vm/mmap_min_addr <= 65536.

rpm-based distributions

Mandriva Linux

Follow the Debian instructions, only using `urpmi` instead of `apt-get install`. You can find it in the contrib section of any Mandriva mirror or seach for it using the Mandriva Club rpm database [1]. You may need libpythonV.V-devel for bitbake setup instead of python-dev. If you're building a 2.6 kernel, you also need the glibc-static-devel package.

with Mandriva Linux 2006, you need to issue the following command:

urpmi python python-devel python-psyco patch m4 sed bison make wget bzip2 \
cvs gawk glibc-devel gcc-c++ subversion sharutils coreutils docbook-utils openjade \
quilt pcre-devel unzip glibc-static-devel

openSUSE

openSUSE 11.4/12.1 - 1-click install

You can install all the needed dependencies (except bitbake) with the following 1-click install link: OE_dep.ymp


openSUSE all version - zypper

Use zypper to install the required packages (except bitbake and tools needed to build *-doc packages):

 sudo zypper in python python-ply python-progressbar patch m4 make perl diffstat \
 wget curl ftp cvs subversion git mercurial tar bzip2 gzip unzip sed bison bc \
 glibc-devel pcre-devel libSDL-devel coreutils help2man gawk chrpath

Additional packages

psyco

In order to speed up the build, you can install python psyco package.

Please note pysco is only available for 32-bit x86 systems only.

from sourceforge

You can use python psyco package (from http://sourceforge.net/projects/psyco/files/) to speed up building. You need to install python-devel:

 sudo zypper in python-devel

and then install psyco via

 sudo python setup.py install

in the psyco directory.

from community repo (only 11.3)

Alternatively you can install psyco directly from a community repo.

zypper ar -f http://download.opensuse.org/repositories/home:/elchevive/openSUSE_11.3/ 11.3-psyco
zypper in  python-psyco
other useful packages

Those packages may be useful as well if you want to build *-doc packages:

 sudo zypper in  openjade docbook-xml-website docbook-dsssl-stylesheets docbook-utils sgmltools-lite texinfo

Fedora

Fedora Core 2/3

Much of the following is probably already installed, but you can check with the following commands. You may want to use the yum.conf located at http://www.fedorafaq.org/. Note, this has not been tested yes as I am in the process of setting up a development environment.

 yum install python patch m4 sed make docbook* openjade glibc-devel xmlto
  • psyco: Download psyco-1.4-src.tar.gz (or later) and extract it. Go to the psycho top-level directory and run: `python setup.py install`.
  • patch: FC3 default version should be enough. Optionally, install SuSe 9.1 package of it.

Fedora Core 4

Almost all required packages for Openembedded are available in Fedora Core 4 and the Fedora Extras for Core 4. You can download them from <http://download.fedora.redhat.com/pub/fedora/linux/core> and <http://download.fedora.redhat.com/pub/fedora/linux/extras>. Check <http://download.fedora.redhat.com/pub/fedora/linux/core/updates/4> for updates on the Core 4 packages.

Apart from the usual (native) development packages like gcc and binutils, you should check that you have the following RPM's installed:

  • bison
  • docbook* packages
  • libpcre
  • m4
  • make
  • openjade
  • patch
  • PyQt
  • python
  • python-psyco
  • sed
  • xmlto
  • quilt (not required as OE builds it by itself, but install it if you want to use gquilt)

Use apt, synaptic, up2date or yum to automagically retrieve these packages or download and install them manually (lots of work).

Fedora Core 5/6

Commands I used to install OE pre-requisites on FC5/6

This long command will ensure all pre-requisites are installed (patch is 2.5.4, not 2.5.9, but appears to work).

su -c "yum install python m4 make wget curl ftp cvs subversion tar bzip2 gzip \
unzip python-psyco perl texinfo texi2html diffstat openjade docbook-style-dsssl \
docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel gcc binutils \
pcre pcre-devel git quilt groff linuxdoc-tools patch gcc gcc-c++ python-sqlite2 help2man"

or download the metapackage http://www.openembedded.org/dl/packages/rpm/openembedded-essential-1.1-1.noarch.rpm (may be out of date).

then do

su -c "yum localinstall openembedded-essential-1.1-1.noarch.rpm"


There are also rpm and src.rpm packages of bitbake 1.6.2 at http://www.openembedded.org/dl/packages/rpm/ pending a later version in Extras, currently 1.6.0.

Update - Current FC6 version is patch-2.5.4-29.2.2 as of this writing and works-for-me (see revision history for build instructions if current patch does not work for you).

I didn't install SGML tools. Please add if you know how

Update - Since about 2002 sgml-tools has apparently been replaced by linuxdoc-tools for FC.

Fedora 7

This long command will ensure all pre-requisites are installed (patch is 2.5.4, not 2.5.9, but appears to work).

su -c "yum install python m4 make wget curl ftp cvs subversion tar bzip2 gzip unzip \
python-psyco perl texinfo texi2html diffstat openjade docbook-style-dsssl \
docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel gcc binutils \
pcre pcre-devel git quilt groff linuxdoc-tools patch linuxdoc-tools gcc gcc-c++ \
help2man perl-ExtUtils-MakeMaker"

(if this is hard to copy from this HTML page, go to edit mode and copy from editor)

Fedora 11

Fedora 11, compared to previous versions, brings the need to install "glibc-static" as well:

su -c "yum install python m4 make wget curl ftp cvs subversion tar bzip2 gzip unzip \
python-psyco perl texinfo texi2html diffstat openjade docbook-style-dsssl \
docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel glibc-static \
gcc binutils pcre pcre-devel git quilt groff linuxdoc-tools patch linuxdoc-tools \
gcc-c++ help2man perl-ExtUtils-MakeMaker"

(if this is hard to copy from this HTML page, go to edit mode and copy from editor)

Fedora 12

Recommended to use Fedora 12 64 bit when possible

If you are setting up from scratch

sudo yum groupinstall 'Development Tools'
sudo yum install python m4 make wget curl ftp cvs subversion tar bzip2 gzip unzip \
python-psyco perl texinfo texi2html diffstat openjade docbook-style-dsssl \
docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel glibc-static \
gcc binutils pcre pcre-devel git quilt groff linuxdoc-tools patch linuxdoc-tools \
gcc-c++ help2man perl-ExtUtils-MakeMaker tcl-devel gettext ccache chrpath

note python-pyscho is only available for 32bit linux

Fedora 13 , 14 and 15

Recommended to use Fedora 13/14/15 64 bit when/where possible

If you are setting up from scratch

sudo yum groupinstall 'Development Tools'

Then update all packages

sudo yum update

Then

sudo yum install python m4 make wget curl ftp cvs subversion tar bzip2 gzip unzip \
python-psyco perl texinfo texi2html diffstat openjade docbook-style-dsssl \
docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel glibc-static \
gcc binutils pcre pcre-devel git quilt groff linuxdoc-tools patch linuxdoc-tools \
gcc-c++ help2man perl-ExtUtils-MakeMaker tcl-devel gettext ccache chrpath cmake ncurses \
apr

(some or most of these packages may have been added by the previous step e.g. for console-image build on f14 only texi2html chrpath wget perl-ExtUtils-MakeMaker glibc-static were required in addition to ' Development Tools')

note python-pyscho is currently only available for 32bit linux

Note for fedora 14 as of 17th March 2011 if you have patch-2.6.1.-8.fc14 installed you may need to downgrade
to an older version if you are getting patching errors during building.

to downgrade

 sudo yum downgrade patch 

CentOS 4.4 / Red Hat Enterprise Linux 4

May also work for true EL4 or Scientific Linux - another RHEL rebuild

Even with several optional and 3rd party yum repos enabled (centosplus, kbsingh, RPMforge/Dag, Dries) a number of required packages are too old or unavailable for CentOS4. [It should be possible to use other package managers including apt/synaptic, up2date, and smart to get the required packages. The following assumes yum.]

I re-built the following SRPMS (with "$ rpmbuild --rebuild ..."):

Might also want to try the rpm and src.rpm packages of bitbake 1.6.2 at http://www.openembedded.org/dl/packages/rpm/ - I have not.

Extra requirements for the builds included rpmdevtools, xmlto, and lynx.

I put packages in a local repo so I can do "yum install ...", otherwise can do "yum localinstall foo.1.2.3.noarch.rpm ...". It may be necessary to temporarily set "gpgcheck=0" in /etc/yum.conf to avoid complaints about unsigned packages.

For EL4 texi2html is available from the tetex package, currently tetex-2.0.2-22.EL4.7

Note that the the metapackage http://www.openembedded.org/dl/packages/rpm/openembedded-essential-1.1-1.noarch.rpm should work except that it depends on texi2html.

Instead as root do

yum install bison coreutils cvs docbook-utils gawk git-core python quilt rpmlib \
sed subversion tetex texinfo unzip wget

I ended up with the following set of relevant packages after several iterations of building/updating to get "bitbake nano" to complete successfully:

  • python-2.3.4-14.3
  • m4-1.4.1-16
  • make-3.80-6.EL4
  • wget-1.10.2-0.40E
  • curl-7.12.1-8.rhel4
  • ftp-0.17-22
  • cvs-1.11.17-9.RHEL4
  • subversion-1.4.3-0.1.el4.rf
  • tar-1.14-12.RHEL4
  • bzip2-1.0.2-13.EL4.3
  • gzip-1.3.3-16.rhel4
  • unzip-5.51-7
  • python-psyco-1.5-3.el4.kb
  • perl-5.8.5-36.RHEL4
  • texinfo-4.7-5.el4.2
  • tetex-2.0.2-22.EL4.7
  • diffstat-1.34-0_6.el4.at
  • openjade-1.3.2-16_9.el4.at
  • docbook-style-dsssl-1.78-4
  • docbook-style-xsl-1.65.1-2
  • docbook-dtds-1.0-25
  • docbook-utils-0.6.14-4
  • sed-4.1.2-5.EL4
  • bison-1.875c-2
  • bc-1.06-17.1
  • glibc-devel-2.3.4-2.25
  • gcc-3.4.6-3
  • binutils-2.15.92.0.2-21
  • pcre-4.5-3.2.RHEL4
  • pcre-devel-4.5-3.2.RHEL4
  • git-1.4.4.2-2.el4.kb
  • bitbake-1.6.2-1

ALT Linux

You can read more about ALT Linux here: http://www.altlinux.com/en/

You can use synaptic or aptitude to install packages. Or use apt-get as shown below.

apt-get install git-core python python-dev python-module-psyco python-modules-sqlite3 \
patch m4 sed bison make wget bzip2 cvs gawk gcc-c++ subversion sharutils coreutils \
docbook-utils openjade quilt libpcre-devel unzip glibc-devel glibc-devel-static \
help2man texi2html perl-devel chrpath

For building bitbake manuals you have to install 'xmlto' package:

apt-get install xmlto

NOTES:

  • This is tested on ALD 4.0/4.1/5.0.
  • gcc-c++ is virtual package and can be provided by gcc4.3-c++ (ALD 5.0) and gcc4.1-c++ (ALD 4.0/4.1). Just select higher version.
  • As I have no OE installation on ALT Linux more this page can have obsolete information.

Ark Linux 2008.1

Ark Linux is a modern distribution well suited for Openembedded development. Footprint only 2.1G.

Required steps:

1) install required packages

apt-get install devel-core diffstat texi2html cvs subversion git texinfo psyco python-devel \
                python-encodings python-sqlite chrpath help2man

2) upgrade

apt-get update
apt-get dist-upgrade 

3) finally create your OE tree (see Getting started instructions).

other Linux distributions

Gentoo instructions

Note that Psyco, the Python JIT compiler, works on 32-bit x86 platforms only.

emerge -n \
  psyco \
  patch \
  make \
  sed \
  dev-lang/python \
  m4 \
  bison \
  cvs \
  openjade \
  quilt \
  sgmltools-lite \
  docbook-xml-dtd \
  docbook-dsssl-stylesheets \
  xmlto \
  docbook-sgml-utils \
  libpcre \
  boost \
  subversion \
  texi2html \
  pysqlite \
  chrpath

Then follow the instructions in Getting started for obtaining bitbake and start the build.

Arch Linux (Duke)

Note: Arch Linux has switched to using Python 3 by default. BitBake does not support Python 3. Please ensure you have Python 2.6.x or 2.7.x installed and set to be the default Python interpreter.

Most of the packages are available in the repositories.

sudo pacman -S patch make sed python m4 bison cvs quilt sgmltools-lite docbook-xml \
xmlto pcre boost jade git texinfo texi2html help2man subversion chrpath

In Arch Linux the install command is in /bin/install. Since most of Linux distribution assume that install is located in /usr/bin/install, you have to create a symlink:

sudo ln -s /bin/install /usr/bin/install

You can build BitBake by using this PKGBUILD or install it from the AUR:

pkgname=bitbake
pkgver=1.8.4
pkgrel=1
pkgdesc="A simple tool for task execution derived from Gentoo's portage"
url="http://developer.berlios.de/projects/bitbake/"
arch=('i686')
license=('GPL' 'custom')
depends=('python')
source=(http://download.berlios.de/bitbake/${pkgname}-${pkgver}.tar.gz)
md5sums=('508d9a61c635d469be8facc95151158b')

build() {
  cd ${startdir}/src/${pkgname}-${pkgver}
  python setup.py install --root=${startdir}/pkg

  # Install vim extensions
  install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/contrib/vim/ftdetect/bitbake.vim \
                ${startdir}/pkg/usr/share/vim/ftplugin/bitbake.vim
  install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/contrib/vim/syntax/bitbake.vim \
                ${startdir}/pkg/usr/share/vim/syntax/bitbake.vim

  # Handle MIT license
  install -D -m644 ${startdir}/src/${pkgname}-${pkgver}/doc/COPYING.MIT \
                ${startdir}/pkg/usr/share/licenses/${pkgname}/COPYING.MIT
}

Using OpenEmbedded on FreeBSD and other NON Linux Systems

tbd

FreeBSD

  • Python == /usr/ports/lang/python
  • GNU Patch == /usr/ports/devel/patch
  • GNU m4 == /usr/ports/devel/m4
  • GNU make == /usr/ports/devel/gmake
  • wget == /usr/ports/ftp/wget
  • Psyco JIT Compiler == /usr/ports/devel/py-psyco
  • GNU sed == /usr/ports/textproc/gsed
  • Bison == /usr/ports/devel/bison
  • GCC 2.95.3 == /usr/ports/lang/gcc295
  • bc == already in FreeBSD
  • PyQt == /usr/ports/x11-toolkits/py-qt
  • glibc headers (ignore)
  • subversion == /usr/ports/devel/subversion
  • git == /usr/ports/devel/git
  • pcre == /usr/ports/devel/pcre

Ports has also has these: fileutils, jade, docbook, dsssl-docbook-modular, sgmltools

Using OpenEmbedded on Mac OS X

By default OS X uses a filesystem that is not case sensitive. You need to ensure that at least your tmp directory is on a case sensitive filesystem or you may come across various packages that break, including the Linux kernel! These steps were carried out on a early 32 bit 10.5/Intel Mac - the install order matters for a couple of packages as does having them installed in a more normal location.

  1. Register at ADC and download and install Xcode
  2. Compile and install GNU gettext
  3. Using CPAN install Locale::gettext
  4. Compile and install help2man 1.29 - newer versions will not build without hacks
  5. Compile and install wget, gawk, coreutils and git - wget appears to not work if you install it in /usr/local so use --prefix=/usr also note OS X provides a different version of mktemp which functions differently, be careful not to overwrite this as OS X might need it
  6. If you are on a 32 bit Mac you can of course install psyco
  7. Fixup your PATH variable for your build user so that /usr/local/bin (or where ever coreutils etc is installed) comes before the OS X version in /usr/bin
  8. Install GNU sed 3.0.2, this will give you a version of sed that allows you to build sed 4.1.5 - you will need to overwrite the one provided by OS X with --prefix=/usr and ensure you are using 4.1.5 not 3.0.2 as 3.0.2 does not provide various options you need
  9. Install getopt from here - modify WITHOUT_GETTEXT=0 to WITHOUT_GETTEXT=1 in the Makefile and add -DWITHOUT_GETTEXT=$(WITHOUT_GETTEXT) to the line beginning with CPPFLAGS=

Now follow the Getting Started OpenEmbedded wiki guide. Unfortunately there are various issues building on OS X that will most likely prevent the toolchain from building.

Unfinished - tbd

Using OpenEmbedded on Windows/Cygwin Systems

Building Openembedded on Windows is currently unsupported, but work is in progress to support buidling of meta-toolchain.bb on Windows/Cygwin hosts.

new user