+-------------------------+
|1. Update OpenWrt sources|
+-------------------------+
You can perform a new check out of trunk with (for instance) 
  svn co svn://svn.openwrt.org/openwrt/trunk/ trunk

You can check out a currently installed revision with 
  svn info

Update sources: 
  svn update

+-----------------------------------+
|2. Update and install package feeds|
+-----------------------------------+
Update feeds:
  ./scripts/feeds update -a

Make downloaded package/packages available in make menuconfig:
>single package:
  ./scripts/feeds install 

>all packages:
  ./scripts/feeds install -a

Please note that installing in context of ./scripts/feeds script means "making package available in make menuconfig" rather than really installing or compiling package.

+--------------------------------------------------+
|3. Configure the firmware image you want to obtain|
+--------------------------------------------------+
The OpenWrt Buildroot configuration interface handles 
 the selection of the target platform,
 packages to be compiled,
 packages to be included in the firmware file,
 some kernel options, etc.

Start the OpenWrt Buildroot configuration interface by issuing the following command:
  make menuconfig

You have three options: y, m, n which are represented as follows: 
>> pressing y sets the <*> built-in label
    This package will be compiled and included in the firmware image file.
>> pressing m sets the  package label
    This package will be compiled, but not included in the firmware image file.
 (E.g. to be installed with opkg after flashing the firmware image file to the device.)
>> pressing n sets the < > excluded label
    The source code will not be processed.

This will update the dependencies of your existing configuration automatically, and you can now proceed to build your updated images.

When you save your configuration, the file /.config will be created according to your configuration.

Exit the TUI, and choose to save your settings.

Kernel Configuration
 --------------------

While you won't typically need to do this, you can do it: 
  make kernel_menuconfig

The changes can be reviewed with 
  svn diff target/linux/

and reverted with 
  svn revert -R target/linux/

Note that make kernel_menuconfig modifies the Kernel configuration templates of the build tree and clearing the build_dir will not revert them !!

Custom files
 ------------

In case you want to include some custom configuration files, the correct place to put them is: 
  /files/

For example, let's say that you want an image with a custom /etc/config/firewall or a custom etc/sysctl.conf, then create this files as: 
  /files/etc/config/firewall
  /files/etc/sysctl.conf

E.g. if your  is /openwrt/trunk and you want some files to be copied into firmware image's /etc/config directory, the correct place to put them is
   /openwrt/trunk/files/etc/config.

+---------+
   |Defconfig|
   +---------+

**** select your target before issuing defconfig 
  make defconfig

will produce a general purpose configuration of the build system including a check of dependencies and prerequisites for the build environment etc. Check for dependencies, Install missing and run again.

+------------------+
|4. Start the build|
+------------------+
The final step before the process of compiling the intended image(s) is to exit menuconfig
  this also includes the option to save a specific configuration or
  load an already existing, and pre-configured, version.

Now ready for building the image(s), which is done with one single command: 
  make

This simple command will trigger a cascade of activity. As already stated, it will 
1. compile the toolchain
2. then crosscompile the sources with this toolchain
3. create opkg-packages
4. generate a firmware image file ready to be flashed.

Building in the background
  ----------------------------

You can have the build process use only idle I/O and CPU capacity like this (dualcore CPU): 
   ionice -c 3 nice -n19 make -j 2

Building single Packages
  --------------------------

When developing or packaging software for OpenWrt, it is convenient to be able to build only the package in question
 (e.g. with package cups):

make package/cups/compile V=s

For a rebuild: 
    make package/cups/{clean,compile,install} V=s

It doesn't matter what feed the package is located in, this same syntax works for any installed package.

Spotting build errors
  -----------------------

If for some reason the build fails, the easiest way to spot the error is to do:

make V=s 2>&1 | tee build.log | grep -i error

The above saves a full verbose copy of the build output (with stdout piped to stderr) in /openwrt/trunk/build.log and only shows errors on the screen.

+--------------------------------+
|5. Proceed to Installing OpenWrt|
+--------------------------------+

After a successful build, the freshly built image(s) can be found in the newly created /bin directory.
The compiled files are additionally classified by the target platform, so
  e.g. a firmware built for an ar71xx device will be located in /bin/ar71xx directory.

E.g. if your  is ~/openwrt/trunk, the binaries are in ~/openwrt/trunk/bin/ar71xx.

+-----------+
  |Cleaning Up|
  +-----------+

You might need to clean your build environment every now and then. The following make-targets are useful for that job:

Clean - deletes contents of the directories /bin and /build_dir. 
  -------
  make clean

Dirclean - deletes contents of the directories /bin and /build_dir and additionally /staging_dir and /toolchain (=the cross-compile tools) and /logs. 'Dirclean' is your basic "Full clean" operation.
  -----------
  make dirclean

Distclean - nukes everything you have compiled or configured and all downloaded feeds contents and package sources. 
  -----------
  make distclean

**CAUTION: In addition to all else, this will erase your build configuration (/.config), your toolchain and all other sources. Use with care!

Clean small part
  -----------------

In more time, you may not want to clean so many objects, then you can use some of the commands below to do it.

Clean linux objects. 
  make target/linux/clean

Clean package base-files objects. 
  make package/base-files/clean

Clean luci. 
  make package/luci/clean

1. OpenWrt Buildroot - About
http://wiki.openwrt.org/about/toolchain

2. OpenWrt Buildroot - Installation
http://wiki.openwrt.org/doc/howto/buildroot.exigence

3. OpenWrt Buildroot - Usage
http://wiki.openwrt.org/doc/howto/build

4. OpenWrt Buildroot - Patches
http://wiki.openwrt.org/doc/devel/patches

Labels: my.