Differences
This shows you the differences between two versions of the page.
|
doc:howto:build [2012/10/12 11:05] hcg Replace V=99 with V=s |
doc:howto:build [2013/03/24 16:13] (current) mforkel |
||
|---|---|---|---|
| Line 23: | Line 23: | ||
| ==== Updating Feeds ==== | ==== Updating Feeds ==== | ||
| + | Please cf. [[doc/devel/feeds|What are feeds?]]. | ||
| - Update feeds: <code>./scripts/feeds update -a</code> | - Update feeds: <code>./scripts/feeds update -a</code> | ||
| - | - Install the downloaded packages: | + | - Make downloaded package/packages available in ''make menuconfig'': |
| - | Note that //installing// in context of ''./scripts/feeds'' script means "making package available in ''make menuconfig''" rather than really installing or compiling package. | + | * single package:<code>./scripts/feeds install <PACKAGENAME></code> |
| + | * all packages:<code>./scripts/feeds install -a</code> | ||
| - | * To install single package:<code>./scripts/feeds install <PACKAGENAME></code> | + | Please note that //installing// in context of ''./scripts/feeds'' script means "making package available in ''make menuconfig''" rather than really installing or compiling package. |
| - | * Alternatively, install all packages:<code>./scripts/feeds install -a</code> | + | |
| ===== Image Configuration ===== | ===== Image Configuration ===== | ||
| - | Start OpenWrt Buildroot's [[wp>ncurses]] [[wp>Text-based user interface|text-based]] configuration interface:\\ | + | The **OpenWrt Buildroot configuration interface** allows you to select the target platform, which version of the toolchain you want to use to build, which packages you want included in the firmware image file and which ones compiled. Start the OpenWrt Buildroot configuration interface by entering:\\ |
| <code> | <code> | ||
| make menuconfig | make menuconfig | ||
| </code> | </code> | ||
| - | Similar to the Linux kernel config, almost every option has three choices, **y**, **m**, **n** which are represented as follows: | + | {{ OpenWrt Buildroot TUI.gif}} |
| - | * pressing **y** yields to ''<*>'' label \\ This package will be included in the firmware image | + | |
| - | * pressing **m** yields to ''<M>'' label \\ This package will be compiled (to be installed with ''[[doc:techref:opkg]]'' after [[doc:howto:generic.flashing|Flashing OpenWrt]]) but the package will **not** be included in the firmware-image | + | |
| - | * pressing **n** yields to ''< >'' label \\ This package will not be compiled. | + | |
| - | When you save your configuration, the file ''~/openwrt/trunk/.config'' will be created according to your configuration. | + | Similar to the configuration interface of the Linux kernel, almost every option has three choices, **y**, **m**, **n** which are represented as follows: |
| + | * pressing <html><strong><kbd>y</kbd></strong></html> yields to ''**<*>**'' label \\ This package will be compiled and included in the firmware image file. | ||
| + | * pressing <html><strong><kbd>m</kbd></strong></html> yields to ''**<M>**'' label \\ This package will be compiled, but **not** included in the firmware image file. (To be installed with ''[[doc:techref:opkg]]'' after [[doc:howto:generic.flashing|flashing]] the firmware image file.) | ||
| + | * pressing <html><strong><kbd>n</kbd></strong></html> yields to ''**< >**'' label \\ This package will not be compiled. | ||
| + | |||
| + | When you save your configuration, the file **''<buildroot dir>/.config''** will be created according to your configuration. | ||
| + | |||
| + | |||
| + | ==== Manual editing of files ==== | ||
| + | In case you want to manually alter certain files, you can do that as well: e.g. | ||
| + | * to alter the vanilla Kernel-Settings, edit the file ''<buildroot dir>**/package/base-files/files/etc/sysctl.conf**'' on your build machine. | ||
| + | * to alter the [[doc/howto/wireless.hotspot.wifidog|WifiDog]]-configuration file, edit ''<buildroot dir>**/feeds/packages/net/wifidog/files/wifidog.conf**'' on your build machine. | ||
| + | * etc. | ||
| + | |||
| + | As you can learn in [[doc/techref/flash.layout]], all the files you edit now, will be located on the <color magenta>''/rom''</color>-partition, which is formated with the [[doc:techref:filesystems#SquashFS]] read-only file system. But because OpenWrt utilizes [[doc:techref:filesystems#overlayfs|overlayfs]], you will of course still be able to alter the files again once the image has been flashed to the router. However: | ||
| + | |||
| + | | {{:meta:icons:tango:48px-dialog-warning.svg.png?nolink}} | <color red>**Warning! Be carefull!**</color> [[doc/howto/generic.failsafe|OpenWrt failsafe]] relies on 100%-working base files on the <color magenta>''/rom''</color>-partition, so in case you misconfigure or misspell something, you will end up with a non-working failsafe and be forced to used more rudimentary methods to [[doc/howto/generic.debrick|debrick]] your device again! | | ||
| + | |||
| + | | {{:meta:icons:tango:48px-emblem-important.svg.png?nolink}} | To edit source-files, OpenWrt Buildroot integrates quilt, cf. [[doc/devel/patches]]! | | ||
| - | The devs offer such a file for OpenWrt 'Backfire' 10.03.1-RC5, e.g. [[http://downloads.openwrt.org/backfire/10.03.1-rc5/ar71xx/config|for ar71xx]]. | ||
| - | {{ OpenWrt Buildroot TUI.gif}} | ||
| - | * The menu above allows you to select the target platform, which version of toolchain you want to use to build and what packages you want included in the firmware image. | ||
| - | * Run this configuration interface after updating sources and feeds to ensure that the latest packages are included in your configuration. | ||
| Line 137: | Line 149: | ||
| ==== Make options ==== | ==== Make options ==== | ||
| === Building on multi-core CPU === | === Building on multi-core CPU === | ||
| + | **Build may FAIL** | ||
| The build process can be accelerated by running multiple concurrent job processes using the ''-j''-option: | The build process can be accelerated by running multiple concurrent job processes using the ''-j''-option: | ||
| Line 142: | Line 155: | ||
| make -j 3 | make -j 3 | ||
| </code> | </code> | ||
| - | * Use the standard formula ''<your number of CPUs + 1>'' | + | * Use the standard formula ''<your number of CPU cores + 1>'' |
| * If this produces random build errors try compiling again without the ''-j''-option | * If this produces random build errors try compiling again without the ''-j''-option | ||
| Line 149: | Line 162: | ||
| <code> | <code> | ||
| - | ionice -c 3 nice -n 20 make -j 2 | + | ionice -c 3 nice -n19 make -j 2 |
| </code> | </code> | ||
| Line 213: | Line 226: | ||
| </code> | </code> | ||
| - | deletes contents of ''/bin'' and ''/build_dir'' directories and additionally ''/staging_dir'' and ''/toolchain'' (=the cross-compile tools). 'Dirclean' is your basic "Full clean" operation. | + | deletes contents of ''/bin'' and ''/build_dir'' directories and additionally ''/staging_dir'' and ''/toolchain'' (=the cross-compile tools) plus ''/logs''. 'Dirclean' is your basic "Full clean" operation. |
| Line 253: | Line 266: | ||
| ==== I can't find my <package> in menuconfig ==== | ==== I can't find my <package> in menuconfig ==== | ||
| - Have you run this command? [[doc:howto:build#updating.feeds|See this.]] <code>./scripts/feeds install <package></code> | - Have you run this command? [[doc:howto:build#updating.feeds|See this.]] <code>./scripts/feeds install <package></code> | ||
| - | - Maybe you are not looking for it in the right submenu. See ''Makefile'' of the package to find out. <code>cat package/feeds/packages/<package>/Makefile</code> | + | - Maybe you are not looking for it in the right submenu. See ''Makefile'' of the package to find out. <code>cat package/feeds/packages/<package>/Makefile</code> You are looking for this: \\ ''define Package/<package>/Default |
| - | + | ||
| - | You are looking for this: | + | |
| - | |''define Package/<package>/Default | + | |
| SUBMENU:=**Firewall** | SUBMENU:=**Firewall** | ||
| SECTION:=net | SECTION:=net | ||
| - | CATEGORY:=**Network** | + | CATEGORY:=**Network**'' |
| - | ''| | + | - Menuconfig appears to cache package lists and (especially) profiles. Try deleting the ''trunk/tmp'' directory (in trunk, not your machine's ''/tmp'' directory!) and then running ''make menuconfig'' again. <code>cd trunk |
| + | rm -rf tmp | ||
| + | make menuconfig</code> Also try refreshing your package indexes: <code>./scripts/feeds update -i</code> The ''-i'' is important if you're not using the latest revisions of any packages, as this flag prevents updates from the feed sources. | ||
| ==== Error: No rule to make target... ==== | ==== Error: No rule to make target... ==== | ||
doc/howto/build.1350032705.txt.bz2 · Last modified: 2012/10/12 11:05 by hcg
