OpenWrt Forum Archive

Topic: [howto] Building OpenWrt Kamikaze from source

The content of this topic has been archived on 7 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Building OpenWrt Kamikaze from source

Assuming you are using Ubuntu 6.06.1 LTS (on a physical system or in the VMware Player)


1. install packages required by the OpenWrt Kamikaze buildsystem

aptitude install build-essential binutils flex bison autoconf gettext texinfo sharutils subversion libncurses5-dev ncurses-term zlib1g-dev

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/
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

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 world

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 then
    copy the kernel config to target/linux/<platform>/config so that it is preserved over "make clean" call. 


Also look at the OpenWrt Kamikaze documentation at
- http://nbd.name/openwrt.html#x1-250002.1 or
- http://nbd.name/openwrt.pdf

Some more useful URLs:
- Free VMware Player (enough for most users, no need for the VMware Server)
- Download VMDK and VMX files for VMware Player
- Ubuntu (for the Ubuntu ISO image)
- Free VMware Server (also includes the VMware Tools)

(Last edited by forum2006 on 6 May 2007, 19:24)

Use a local mirror for downloading the source tarballs:

echo "http://local.mirror/path/" > scripts/localmirrors

From now on it first tries to download the tarballs from . If you don't have a local copy it'll be downloaded from the internet.

I tried to build kamikaze from source in a clean OpenVZ debian system. I added the programs from post #1. The build world failed and V=99 showed that python was missing.

I tried to build the kamikaze from source. I followed this post + the docs, used brcm-2.4, it flashed successfully to my Asus WL-500Gp, but it was not possible to reach it via 192.168.1.1 via any of the ports. It actually did boot something partly working - I was able to associate with the OpenWrt SSID, but not to communicate.

The nightly brcm-2.4 build from http://downloads.openwrt.org/snapshots/ (11. 3.) works without problems.

For a start, how do I get the same settings the nightly builds use? I am using KUbuntu 6.10 with recent updates as the build system. I tried to google for the docs, but did not found anything relevant. Thanks.

numo wrote:

For a start, how do I get the same settings the nightly builds use?

Hm.. nevermind, today's build works... I did the config from scratch - I probably messed up something yesterday..

The command make world gave an error during the build of package/busybox. After some searching I found that there was no include and lib map in staging_dir_mipsel/usr (there were two files include and lib; which was obviously wrong). The content of include was libcgi.h so it looks like the copy instruction did go wrong. After replacing these two files with a map with the same name (include and lib) the make went ok.

I'm new to openwrt and have a WL-500G Premium. I've been tinkering this weekend and first installed White Russian, then Kamakazi openwrt-brcm-2.4-squashfs.trx. It worked fine so I decided to roll my own on my ubuntu box with a 2.6 kernel.

I built then installed the openwrt-brcm47xx-2.6-squashfs.trx firmware and notice that I have only 6Mb of space on /jffs where previously I had 14.7Mb additional I think on /tmp. Have I built the wrong target for my hardware or screwed something up?

Jeff

Just to followup, I rebuilt for the 2.4 kernel and it seems to function identically to the image I downloaded. Is a 2.6 kernel not suited for the WL-500gP?  I noticed in the roadmap that the goal was 2.4 on this hardware, but I think I've seen forum posts where folks had built 2.6 kernels.

Thanks,

Jeff

(Last edited by JeffElkins on 26 Mar 2007, 03:46)

The
svn co https://svn.openwrt.org/openwrt/packages/ ~/trunk/feeds/packages - line is wrong

its unneed after building the toolchain all you need is the make package/symlinks
(You can add extra feeds in developer options -> build options (seperated by a space)
and make package/symlinks automatically checks then out to a directory of

https_svn.openwrt.org_openwrt_packages_ (that form)

You can also add extra source repositories - by adding them space seperated to that

Excelent howto, this should go in the wiki!!

This is an excellent guide! Thanks OP.

I followed this post and was able to compile and build successfully for Simpleshare NAS250.

Target System: Broadcom BCM947xx/953xx [2.6]
Target profile: No WiFi

During make menuconfig, I included the kernel modules kmod-ide-core and kmod-ide-aec62xx as <M>. However, it did not build these packages.

The packages are not in the bin/packages directory.
Also, there are no .o files in the directory - ~/trunk/build_mipsel/linux-2.6-brcm47xx/linux-2.6.19.2/drivers/ide.

It seems these kernel packages were not compiled. Did I miss some settings or configuration?

I will appreciate any help.

Thanks.
- Kali

This should probably be made into a page on the wiki.

(Last edited by exobyte on 23 Apr 2007, 21:19)

kalibom wrote:

It seems these kernel packages were not compiled. Did I miss some settings or configuration?

Hmm, thought a kernel_menuconfig is enough, but it isn't. After running 'make kernel_menuconfig' and enabling the modules manually and executing 'make target/linux-{clean,install} V=99' there are still no IDE modules sad

Something is fishy here.

Yes. In fact, there are no ide kernel modules being built for all 2.6 based devices, except the x86...

try to include them not as module. I think then these modules will be included in your built

forum2006 wrote:

Building OpenWrt Kamikaze from source

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

distclean deletes my download directory... Which is as I'd expect.  Please correct!

bifferos wrote:
forum2006 wrote:

Building OpenWrt Kamikaze from source

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

distclean deletes my download directory... Which is as I'd expect.  Please correct!

... or did you really mean 'expect' instead of 'except'?  smile.

After building, you will find all sorts of files in the TOP_DIR/bin directory:

openwrt-atheros-root.jffs2-128k                   
openwrt-atheros-root.jffs2-64k                     
openwrt-atheros-root.squashfs                     
openwrt-atheros-ubnt2-jffs2-128k.bin           
openwrt-atheros-ubnt2-jffs2-64k.bin             
openwrt-atheros-ubnt2-squashfs.bin             
openwrt-atheros-ubnt5-jffs2-128k.bin           
openwrt-atheros-ubnt5-jffs2-64k.bin             
openwrt-atheros-ubnt5-squashfs.bin             
openwrt-atheros-vmlinux.elf                       
openwrt-atheros-vmlinux.gz                         
openwrt-atheros-vmlinux.lzma                     

Only a pair of kernel files (vmlinux) and filesystem (jffs2 or squashfs) are necessary. For jffs2 there is a choice between 64k and 128k memory blocks in which the flash is organized. squashfs helps preserving flash lifetime as the physical space actually being used is wrapping around as opposed to writing the same sector all the time.

ubnt2 and ubnt5 are root file systems specially made for the ubiquity nanostation.

(Last edited by correll on 23 Jan 2009, 18:03)

One addition in item 2 in the first post.  After "make package/symlinks", use "./scripts/feeds install" to put packages into the menuconfig selection list, for example,

./scripts/feeds install nano usbutils samba3

to add nano, usbutils (for lsusb), and samba3 to menuconfig.  This will mean that these programs are synced with the correct kernel, which they won't necessarily be if you use "opkg install" to get them.

hey, how we add packages to the source for compile? ty

The discussion might have continued from here.