Difference between revisions of "OEandYourDistro"

From Openembedded.org
Jump to: navigation, search
(Debian)
(Debian)
Line 9: Line 9:
 
=== Debian ===
 
=== Debian ===
  
If this is not correct in lenny+ please change me
+
FIXME:If this is not correct in lenny+ please change this page
  
 
==== Mandatory packages ====
 
==== Mandatory packages ====

Revision as of 16:50, 12 April 2009

See Required software for the list of the software required by Openembedded.

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

FIXME:If this is not correct in lenny+ please change this page

Mandatory packages

apt-get install ccache sed wget cvs subversion git-core \
   coreutils unzip texi2html texinfo libsdl1.2-dev docbook-utils \
   gawk python-pysqlite2 diffstat help2man

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

Supplimentary packages

apt-get install libxml2-utils xmlto python-psyco


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).

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

Ubuntu 8.10 (Intrepid) introduced a change to the default compiler flags. This is likely to cause build failures. Its possible to fix this behaviour by adding the following line to your local.conf file:

 BUILD_CPPFLAGS += "-Wno-format-security -U_FORTIFY_SOURCE" 

You could also add these flags to the BUILD_CPPFLAGS variable in bitbake.conf, but typically you should never edit the bitbake.conf directly.

rpm-based distributions

Mandriva Linux

Follow the Debian instructions, only using `urpmi` instead of `apt-get install`. Also, `ccache` is not an official Mandriva package. 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 ccache 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 instructions

Use zypper to install the required packages:

 zypper in subversion git python help2man diffstat wget gcc gcc-c++ libstdc++ glibc-devel

These packages may be useful as well: ccache, bison and gcc33 (for faster build using ASSUME_PROVIDED), gtk2-devel (in case your build will fail on missing gdk-pixbuf-csource), bc (for collie kernel), ncurses-devel (if you want to call kernel menuconfig). python psyco package is optional.

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
  • `yum install ccache` (not required, also not a FC3 package)
  • 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
  • ccache (not required, but advised to speed up building)
  • 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 ccache 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 ccache 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)

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 ccache 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
  • ccache-2.4-1.2.el4.rf
  • 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

other Linux distributions

Gentoo instructions

emerge -n \
  psyco \
  ccache \
  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

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

Ark Linux 2007.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

2) upgrade

apt-get update
apt-get upgrade 

The following packages will be REPLACED:
  texi2html (by tetex-texi2html)
The following NEW packages will be installed:
  tetex-texi2html

3) help2man

help2man is missing from the ArkLinux repositories. The sources must be configured, compiled and installed. The compilation of help2man requires the installation of some additional packages:

apt-get install gettext-devel gettext-tools perl-Locale-gettext

4) finally create your OE tree and provide bitbake (see Getting started instructions)

Arch Linux (Duke)

Most of the packages are available in the repositories.

sudo pacman -S psyco ccache patch make sed python m4 bison cvs quilt sgmltools-lite docbook-xml xmlto pcre boost jade git texinfo

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:

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

to be done, maybe there is some information in the old wiki

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
  • ccache == /usr/ports/devel/ccache
  • 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 - old wiki link appears to be dead.

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.