Openwrt Build
Openwrt Build
Openwrt Build
All it takes is a make at this point. I like to use make V=s because I like to
watch it do its thing
make V=s
ili
make
1
ili
make V=99
#koristio ovo
Clean
make clean
Dirclean
make dirclean
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.
Distclean
make distclean
Introduction
OpenWrt is an open source firmware project targeting routers and systems of almost any
architecture. Knowing how to build from source is important for developers and others that
want to change the default installation image. For example we can change the QoS
algorithms, include LuCI by default, or create an openflow switch (using Open vSwitch or
CPqD's OpenFlow). The purpose of this article is to show you how.
The compilation process is involved and a mistake (or a bug) can brick your router. I haven't
encountered an issue yet, but you should know how to debrick just in case.
Background on Configuration
The build configuration (.config file) controls the target platform, packages to compile into
firmware, packages to compile for opkg install, and many other options.
In the .config, a package is in one of three states:
3
Since we can download and install packages post-flash using opkg, we'll transition all m
packages to n. NOTE: DO NOT USE SPACEBAR to disable packages, use the n on the
keyboard; spacebar switches the inclusion state which can unintentionally include (many)
other packages. Disabling these makes the build MUCH faster. Read more about
configuration at OpenWrt's build wiki here.
Background on Feeds
OpenWrt describes feeds as "additional predefined package build recipes for OpenWrt
Buildroot", where each feed resides on a remote host and are downloaded (from, say,
GitHub). The scripts/feeds script is used to fetch and enable ("install") the packages in
menuconfig, making them visible for selection.
It's easy to enable custom feeds to make your own packages or include others. In a later post
I'll use feeds to include CPqD's OpenFlow 1.3 userspace module or Open vSwitch (OVS) to
talk to a controller (such as Floodlight or OpenDaylight). Those controllers let us manage lots
of switches from a centralized location.
Enough about feeds here, and read OpenWrt's wiki on feeds if you need more information.
NEEEEEEE:
# Disable the compile-only packages AND disable the SDK (for fast builds)
# and make sure we have build prereqs
sed --in-place=.bak -e 's/=m$/=n/g' -e 's/^CONFIG_SDK=y$/CONFIG_SDK=n/'
.config
That was a ton of setup and configuration. But hey, we're ready to build! Use -j to run
parallel jobs and V=s to capture the output.
# BUILD IT
time make V=s -j20 2>&1 | tee build.log | grep -i error
Build issue tip: Just retry the build if it fails. If it continues to fail use V=s -j1 and check the
active tickets; my build failed because the gdb-linaro download url changed so if you have
that issue, look at this ticket for a workaround.
After the build is done, scp the file to your router and use sysupgrade <build>.bin (with -n
to clear the config files). Read up on how to configure OpenWrt and have fun!
I'll make another post soon on how to include openflow in the build and configure for
OpenDaylight or Floodlight controllers.
Greske:
I hope this reply doesn't come too late for you, but I ran into the same problem, in my case: