編譯 OpenWrt Kamikaze 原始碼

2015/03/13更新:

先參考官網的安裝部分吧,


Building OpenWrt Kamikaze from source

1. install packages required by the OpenWrt Kamikaze buildsystem

apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils subversion libncurses5-dev zlib1g-dev gawk qemu-img

2. checkout and prepare Kamikaze and the packages

cd ~

svn co https://svn.openwrt.org/openwrt/trunk/

svn co https://svn.openwrt.org/openwrt/packages/ ~/trunk/feeds/packages/

To include all packages, issue the following command:

cd ~/trunk/

make package/symlinks

2.1 Configure Kamikaze (select target system) and the packages (a full build with all packages selected requires about 9GB of free disk space)

make menuconfig

x86 vmware setting (就是編譯firmware是RUN在X86平台上)

=============================================================

Target System: (x86) —>

Subtarget (Generic [2.6]) —>

Target Profile (Generic)  —>

Target Images  —>

– squashfs: n

– jffs2: n

– ex2:y

– Build VMware image files (VMDK). Requires qemu-img: y

Kernel modules  —> Network Devices

– kmod-e1000: y

Administration  —> webif

– webif: y

– webif-theme-xwrt-mini: y

=============================================================

2.2 If you select extra packages it’s a good idea to check if you have all prerequisites installed. Check with:

make prereq

TIP: To find the missing packages search at http://packages.ubuntu.com/

2.3 Finally build Kamikaze (to download all packages at once use ‘make download world’)

make

3. After the build finished, ready to use images can be found in $(TOPDIR)/bin

Targets for ‘make’

download

download all source tarballs (from the selected packages and it’s dependencies) at once before starting the build

prereq

checks if you have all prerequisites installed on the host-system for building the selected packages

world

build everything

tools/install toolchain/install

only build the tools and the toolchain

clean

cleans the packages (NOT the tools and toolchain)

distclean

cleans up everything expect $(TOPDIR)/.config and $(TOPDIR)/dl/

package/<package_name>-{clean,compile}

rebuild a single package

package/index

updates $(TOPDIR)/bin/packages/Packages

V=99

turns on debugging

make kernel_menuconfig

If you want, you can also modify the kernel config for the selected target system. Simply run “make kernel_menuconfig” and the build system will unpack the kernel sources (if necessary), run menuconfig inside of the kernel tree, and thencopy the kernel config to target/linux/<platform>/config so that it is preserved over “make clean” call.

Maybe this helps.

package is for exactly that – packages. In an OpenWrt firmware, almost everything is an .ipk,

a software package which can be added to the firmware to provide new features or removed to save space.

Note that packages are also maintained outside of the main trunk and can be obtained from subversion using the package feeds system

Checkout the feeds with the extra packages

./scripts/feeds update

Only symlink the packages you like to compile

./scripts/feeds install <pkg_name_1> <pkg_name_2>

e.g.:

./scripts/feeds install nano wget webif vpnc

Collecting package info: done

Collecting target info: done

Installing package ‘nano’

Installing package ‘wget’

Installing package ‘haserl’

Installing package ‘webif’

Installing package ‘libgpg-error’

Installing package ‘libgcrypt’

Installing package ‘vpnc’

Run menuconfig select features and packages

convert the image to an VMware image using qemu-img

qemu-img convert -f raw bin/openwrt-x86-ext2.image -O vmdk bin/openwrt-x86-ext2.vmdk

References:

OpenWrt Documentation

http://downloads.openwrt.org/kamikaze/docs/openwrt.html

OpenWrt  Development Environment– Directory structure

http://jeulnet.blogspot.com/2007/12/openwrt_13.html

Kamikaze Configuration

http://wiki.openwrt.org/OpenWrtDocs/KamikazeConfiguration

BuildRoot

http://wiki.openwrt.org/BuildRoot#head-5598891b5d6921f00d2cfeafa4c86d14ee8d6ca8

BuildingPackagesHowTo

http://wiki.openwrt.org/BuildingPackagesHowTo?action=show&redirect=BuildingPackages

OpenWrt – Building software packages

http://hanez.org/openwrt-building-software-packages.html

ipkg

http://ipkg.nslu2-linux.org/feeds/

發表迴響

Copy Protected by Chetan's WP-Copyprotect.