OpenWrt Buildroot – Installation
OpenWrt Buildroot ist die bevorzugte Toolchain um OpenWrt zu compilieren. Es ist dringend empfohlen eine GNU/Linux Distribution zu benutzen, entweder als direkte Installation oder auch als Virtuelles System auf VMware oder Qemu (siehe hier). Cygwin wird sehr wahrscheinlich nicht korrekt funktionieren. Es ist theoretisch möglich OpenWrt Buildroot erfolgreich auf ~BSD oder auf MacOS X einzusetzen, aber ein Erfolg wird nicht garantiert! Versuchen Sie es und geben Sie hier uns eine Rückmeldung.
Vorgehensweise
- Installieren Sie
subversion(kurz:svn) um den OpenWrt Quellcode in geeigneter Weise herunterzuladen und die typischenBuild Tools, die Sie beim Kompilationsprozess unterstützen werden:sudo apt-get install subversion build-essential
- lesen Sie
svnund vergleichen Sie build-essential - lesen Sie
makeund die Subversion Dokumentation (deutsch!)
- Mit
svnkönne Sie nun den OpenWrt Quellcode beziehen, er beinhaltet OpenWrt Buildroot. Konsultieren Sie Downloading Sources und führen Sie als gewöhnlicher, nicht-root, User folgendes aus:mkdir ~/openwrt cd openwrt svn co svn://svn.openwrt.org/openwrt/trunk/
Für trunk R27988, wird das 14.382 Dateien mit einer Gesamtgröße 147.2 MiB herunterladen - Beziehen und installieren Sie feeds (nicht zwingend)
./scripts/feeds update -a ./scripts/feeds install -a
(Nach diesem Befehl, Revision 7367, hat meintrunk-Verzeichnis 26.650 Dateien beinhaltet, die insgesamt 302,0 MiB umfassen.) - begeben Sie sich nun in das <buildroot root>-Verzeichnis (z.B.
~/openwrt/trunk) und benutzen eines der folgenden Befehlemake defconfig make prereq make menuconfig
um eine Liste der noch fehlenden Pakete zu erhalten um OpenWrt Buildroot erfolgreich einsetzen zu können - installieren Sie die fehlenden Pakete (sehen Sie die ihrer Distribution entsprechenden Paket-Namen in der unteren Tabelle nach)
(Notiz: Nach einem Build-Vorgang, beinhaltet mein trunk-Verzeichnis 244.451 Dateien mit einer Gesamtgröße von 3,2GiB)
Tabelle bekannter Voraussetzungen und ihre korrespondierenden Pakete
| Prerequisite | Debian | Suse | Red Hat | OS X | Fedora | NetBSD |
|---|---|---|---|---|---|---|
| asciidoc | asciidoc | asciidoc | asciidoc | ? | asciidoc | ? |
| bash | ? | ? | ? | ? | ? | bash |
| binutils | binutils | binutils | binutils | ? | binutils | ? |
| bzip2 | bzip2 | bzip2 | bzip2 | ? | bzip2 | ? |
| fastjar | fastjar | fastjar | libgcj | ? | libgcj | ? |
| flex | flex | ? | ? | ? | flex | ? |
| g++ | g++ | gcc-c++ | gcc-c++ | ? | gcc-c++ | ? |
| gcc | gcc | gcc | gcc | ? | gcc | ? |
| getopt | ? | ? | ? | ? | ? | getopt |
| GNU awk | gawk | gawk | gawk | ? | gawk | ? |
| gtk2.0-dev | libgtk2.0-dev | ? | gtk2-devel | ? | gtk2-devel | ? |
| intltool-update | intltool | intltool | intltool | ? | intltool | ? |
| jikes | — | jikes | ? | ? | — | ? |
| libz, libz-dev | zlib1g-dev | zlib-devel | zlib-devel | ? | zlib-devel | ? |
| make | make | make | ? | ? | make | gmake |
| ncurses | libncurses5-dev | ncurses-devel | ncurses-devel | ? | ncurses-devel | ? |
| openssl/ssl.h | libssl-dev | libopenssl-devel | openssl-devel | ? | openssl-devel | ? |
| patch | patch | patch | ? | ? | patch | ? |
| perl-ExtUtils-MakeMaker | perl-modules | perl-ExtUtils-MakeMaker | perl-ExtUtils-MakeMaker | ? | perl-ExtUtils-MakeMaker | ? |
| rsync | rsync | rsync | ? | ? | rsync | ? |
| ruby | ruby | ruby | ? | ? | ruby | ? |
| sdcc | sdcc | sdcc | ? | ? | sdcc | ? |
| unzip | unzip | unzip | ? | ? | unzip | ? |
| wget | wget | wget | wget | ? | wget | ? |
| working-sdcc | — | ? | ? | ? | — | ? |
| xgettext | gettext | ? | ? | ? | gettext | ? |
| xsltproc | xsltproc | libxslt | ? | ? | libxslt | ? |
Unfortunately not all dependencies are checked by make config:
| Package | Prerequisite | Debian | Suse | Red Hat | OS X | Fedora | NetBSD |
|---|---|---|---|---|---|---|---|
| intltool | [Perl] XML::Parser | libxml-parser-perl | ? | ? | ? | ? | ? |
Beispiele
Debian 5.0 Lenny:
# aptitude install gawk ncurses-dev unzip zlib1g-dev |
Debian 6.0 Squeeze:
# aptitude install libncurses5-dev zlib1g-dev gawk flex |
Fedora 11:
# yum install binutils bzip2 gawk gcc gcc-c++ gettext make ncurses-devel \
patch unzip wget zlib-devel |
openSuSE 11.1
# zypper install binutils bzip2 gawk gcc gcc-c++ gettext make ncurses-devel \
patch unzip wget zlib-devel |
Ubuntu:
$ sudo apt-get install build-essential subversion libncurses5-dev zlib1g-dev gawk flex |
Ubuntu 9.10, I needed aldo these (30-03-2011):
$ sudo apt-get install gcc-multilib bison autoconf screen gcc g++ binutils patch bzip2 flex make gettext unzip libc6 git-core |
Ubuntu 64bit:
$ sudo apt-get install build-essential subversion libncurses5-dev zlib1g-dev gawk gcc-multilib flex |
Notizen:
- Unter Debian benutzen Sie
apt-cache search ""
um passende Pakete zu finden - Unter openSuSE benötigen einige Pakete zusätzliche Repositories. Suchen Sie auf http://packages.opensuse-community.org und fügen Sie Repos folgendermaßen hinzu
zypper ar "http://download.opensuse.org/repositories/devel:/languages:/perl/openSUSE_11.1/devel:languages:perl.repo"
- Unter Mac OS X benötigen Sie lediglich das Paket "fileutils" aus dem fink Projekt. (Getestet auf Leopard 10.5.3)
Downloading Sources
Short version: https://dev.openwrt.org/wiki/GetSource
You have two choices:
- Downloading the latest stable release, or
- downloading the bleeding edge development snapshot (currently named as "Attitude Adjustment", but often called "trunk").
Using Release Sources (stable)
As of this writing, the latest stable release is OpenWrt 10.03 "Backfire". There is a Backfire branch in SVN repository, which is still slowly being updated with verified patches. Using it will most likely produce a stable and working OpenWrt installation, but all the newest features and patches might not be there. As an example, this will check out the source code that the backfire release is built from (plus the latest backported fixes from trunk):
svn checkout svn://svn.openwrt.org/openwrt/branches/backfire
You could alternatively download a 'tagged' version of the backfire sources. For instance, if you insist on using the pristine release sources (no backported fixes applied after the last release), you could use:
svn checkout svn://svn.openwrt.org/openwrt/tags/backfire_10.03
You can checkout a certain revision:
svn checkout --revision=24045 svn://svn.openwrt.org/openwrt/branches/backfire/ ./build_dir
As for the packages copy feeds.conf.default in ./build_dir to feeds.conf and add "@24045" at the end of the line that checks out the package feed:
src-svn packages svn://svn.openwrt.org/openwrt/packages@24045
Using Development Sources (bleeding edge)
The current development branch (trunk) contains everything from documentation to experimental patches. It has all the features, but some of the new stuff may also break something for some hardware configurations, so using trunk is more adventurous.
svn checkout svn://svn.openwrt.org/openwrt/trunk/
de/doc/howto/buildroot.exigence.txt · Last modified: 2011/08/29 15:52 by the2masters