2009年9月14日月曜日

How to get Buildroot up and running(OpenWrt)

How to get Buildroot up and running

  • Install Subversion (short: svn) to get the latest source or a specific revision, the typical build tools and screen if you want to put the compilation into the background

aptitude install subversion build-essential screen

Table of known prerequisites and their corresponding packages

make menuconfig
will tell you if more packages have to be installed via APT by the root user. Here's a table with the package name for each prerequisite separated for different Linux distributions.

PrerequisiteDebianSuseRed HatOS XFedora 11
binutils????binutils
bzip2????bzip2
fastjarfastjar???
flexflex???flex
g++g++???gcc-c++
gccgcc???gcc
GNU autoconfautoconf???autoconf
GNU awkgawk???gawk
GNU bisonbison???bison
gtk2.0-devlibgtk2.0-dev???
intltool-updateintltool???
jikesjikes???
libz-dev????
make????make
ncursesncurses-dev???ncurses-devel
openssl/ssl.hlibssl-dev???
patch????patch
perl-ExtUtils-MakeMaker????perl-ExtUtils-MakeMaker
rsyncrsync???
rubyruby???
sdccsdcc???
unzipunzip???unzip
wget????wget
working-sdcc????
xgettextgettext???gettext
xsltprocxsltproc???
zlibzlib1g-dev???zlib-devel

Installation examples:

Debian 5.0:

# aptitude install autoconf bison flex gawk ncurses-dev unzip zlib1g-dev

Fedora 11:

# yum install autoconf binutils bison bzip2 flex gawk gcc gcc-c++ gettext make ncurses-devel patch unzip wget zlib-devel

Notes:

  • Ubuntu = Debian
  • In Debian use
    apt-cache search ""

to find a fitting package for a prerequisite

~+Building Kamikaze HowTo+~

Valid for the following releases: Kamikaze, White Russian

Development Environment

If you are not used to a Linux development environment or not sure how to set it up correctly, then first check out the Setup Build Environment HowTo.

Requirements

The build-system checks for the requirements and print what's missing on your system. Then install the packages.

To manually check the prerequisites run

$ make prereq 

Note for Mac OS X Users: To build your images on a Mac OS X Machine all you need is the package “fileutils” from the fink project. (Tested on Leopard 10.5.3)

Actual commands

Login with a normal user, not root! Create a directory inside your home to hold the OpenWrt code. Then checkout the development code with Subversion (All about using Subversion). Accept the certificate when asked, you can verify its correctness with a browser and the same URL.

$ mkdir ~/kamikaze-trunk/ $ cd ~/kamikaze-trunk/ $ svn checkout svn://svn.openwrt.org/openwrt/trunk/ . 

If you want to store all downloaded source code packages outside the trunk, e.g. for easier backup or to use with multiple checkouts, then do the following:

mkdir ~/kamikaze-dl/ ln -s ../kamikaze-dl/ dl 

Get all the extra packages, the ones for Luci and if you wish the ones for Xwrt too. Then install the packages you need, so that you can choose them later in the menuconfig.

$ ./scripts/feeds update packages luci      # Checkout the extra packages $ ./scripts/feeds install -a -p luci        # Install the LuCI WebUI (selected and included in the final image by default) $ ./scripts/feeds install   # Creates the symlinks for the packages you like to install 

Call the configuration menu, set the desired target, select the wanted packages and save. Then start building with make.

$ make menuconfig                           # Select your target, packages and other options. Only select the packages you need. $ make V=99 ; echo -e '\a'                  # The echo is a bell/beep/alert in BASH (here Debian GNU/Linux), when make finishes 

Configuring a custom kernel

While you won't typically need to do this, if you need to modify the Linux kernel configuration, use this command to enter the regular Linux menuconfig:

$ make kernel_menuconfig 

Customizing the Target Filesystem

Directions are available here.

Additional Documentation

Packages that do not compile

  • Missing source code file, due to download problems.

First check if the URL path in the make file contains a trailing slash, then try with it removed (helped several times). Otherwise try to download the source code manually and put it into ~/kamikaze-trunk/dl

  • Compilation errors.

Try to update the main source and all the feeds (Warning! May result in other problems). Check for a related bug in (TRAC), use the filters to find it. Otherwise report the problem there, by mentioning the package, the target data (CPU, image, etc.) and the code revisions (main & package).

CategoryHowTo

0 件のコメント: