标签 openwrt编译 下的文章

OpenWrt Buildroot 基础教程

Prerequisites

to generate an installable OpenWrt firmware image file with a size of e.g. 8MB:

Install OpenWrt Buildroot and its prerequisites on your OS.
ca. 3-4 GB of available hard disk space
environment variables:
SED should not be set. If it is, run unset SED before compiling. (See Ticket 10612.)
GREP_OPTIONS should not have –initial-tab or other options affecting its output
Add /staging_dir/host/bin and /staging_dir/toolchain---/bin in front of your PATH variable in ~/.bashrc. The staging directory is created shortly after starting the build and the toolchain directory is created when the toolchain build begins. The build spawns multiple shells, some of which expect the toolchain binaries to be present in the PATH.
Procedure

  1. Update OpenWrt sources.
  2. Update and install package feeds.
  3. Configure the firmware image you want to obtain.
  4. Start the build. This will automatically compile toolchain,cross-compile sources, package packages, and finally generate an image ready to be flashed.
  5. Proceed to Installing OpenWrt

Updating Sources with Git

git pull

Updating Feeds
Update feeds:

./scripts/feeds update -a

Make downloaded package/packages available in make menuconfig:
single package:

./scripts/feeds install <PACKAGENAME>

all packages:

./scripts/feeds install -a

Image Configuration
Typical actions:

  1. run make menuconfig and set target;
  2. run make defconfig;
  3. run make menuconfig and modify set of package;
  4. run scripts/diffconfig.sh >mydiffconfig (save your changes in the
    text file mydiffconfig);
  5. run make V=s (build OpenWRT with console logging, you will look
    where build failed.).

Make menuconfig
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

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

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.
When you save your configuration, the file /.config will be created according to your configuration.

make kernel_menuconfig CONFIG_TARGET=subtarget
make defconfig
make or make world

The make sequience

Top command make world calls the following sequence of the commands:

make target/compile
make package/cleanup
make package/compile
make package/install
make package/preconfig
make target/install
make package/index

You may run each command independency. For example, if the process of compilation of packages stops on error, you may fix problem and next continue without cleanup:

make package/compile
make package/install
make package/preconfig
make target/install
make package/index

Warnings, errors and tracing

make V=s or make V=99

本文章由http://www.wifidog.pro/2015/08/02/OpenWrt-%E7%BC%96%E8%AF%91.html整理编辑,转载请注明出处

X86 openWRT 虚拟机编译教程 在ubuntu10中X86 OpenWRT的源码编译

X86 openWRT 虚拟机编译教程 在ubuntu10中X86 OpenWRT的源码编译

一、获取软件工具

获得各种工具软件的最新依赖关系包:

sudo apt-get update

直接拷贝下一命令,并执行安装所有要用到的工具软件

sudo apt-get -y install curl wget tree grep gcj texinfo sharutils subversion ncurses-term libtool autoconf automake gcc-multilib bison screen gcc g++ binutils patch bzip2 flex make gettext unzip libc6 git-core build-essential libncurses5-dev zlib1g-dev gawk quilt asciidoc libz-dev

二、获取openWRT源码

进入当前用户home目录,建立文件夹openwrt:

cd ~

mkdir openwrt

cd openwrt

如果你的网络速度较慢,不给力,我将下载好的openWRT(版本:r38938)打包成trunk.tar.gz,大家可以拷贝到本目录后直接解压 tar xvzf trunk.tar.gz即可,然后跳过如下几步,做openWRT配置。

使用svn命令行checkout出源代码:(版本:r38938)

svn checkout svn:svn.openwrt.org/openwrt/trunk –r38938 

本文章由 http://www.wifidog.pro/2015/07/07/ubuntu%E7%BC%96%E8%AF%91X86-openwrt.html 整理编辑,转载请注明出处