Freifunk Berlin Firmware
This is the build-system for the Firmware of Freifunk Berlin. The firmware is based on vanilla OpenWrt with some modifications (to fix broken stuff in OpenWrt itself or for example LuCI) and additional default packages/configuration settings.
Contact / More information
More user relevant information about the firmware are on the wiki page at: https://wiki.freifunk.net/Berlin:Firmware. There you can also find the
For questions write a mail to email@example.com or come to our weekly meetings. If you find bugs please report them at: https://github.com/freifunk-berlin/firmware/issues
For the Berlin Freifunk firmware we use vanilla OpenWrt with additional patches and packages. The Makefile automates firmware creation and apply patches / integrates custom freifunk packages. All custom patches are located in patches/ and all additional packages can be found at http://github.com/freifunk-berlin/packages_berlin.
Please take a look at the OpenWrt documentation
for a complete and uptodate list of packages for your operating system. Make
sure the list contains
quilt. We use it for patch management.
apt-get install git build-essential libncurses5-dev zlib1g-dev gawk time \ unzip libxml-perl flex wget gawk libncurses5-dev gettext quilt python libssl-dev
zypper install --type pattern devel_basis zypper install git ncurses-devel zlib-devel gawk time \ unzip perl-libxml-perl flex wget gawk gettext-runtime quilt python libopenssl-devel
pacman -S base-devel git ncurses lib32-zlib gawk time unzip perl-xml-libxml \ flex wget gettext quilt python openssl
Building all firmwares
To get the source and build the firmware locally use:
git clone https://github.com/freifunk-berlin/firmware.git cd firmware make
The build will take some time. You can improve the build time with build options
-j <number of cores>.
V=s will give more verbose error messages.
An internet connection is required during the build process. A good internet connection can improve the build time.
You need approximately 10GB of space for the build.
You can find the actual firmware images generated by the ImageBuilder (and the ImageBuilder itself)
firmwares. The layout looks like the following:
firmwares/ TARGET/ backbone/ images.. default/ images.. ... OpenWrt-ImageBuilder-....tar.xz OpenWrt-SDK-....tar.xz initrd/ images.. packages/ packages/<ARCH> base/*.ipk luci/*.ipk packages/*.ipk packages_berlin/*.ipk routing/*.ipk targets/MAINTARGET/SUBTARGET/packages/ *.ipk
As you notice there are several different image variants ("backbone", "default", etc.).
These different packages lists are defined in
See the "Features" section above for a description of the purpose of each package list.
With the "OpenWrt-Imagebuilder" you can assemble your own image variant with your
packages lists without having to compile everything yourself. The "OpenWrt-SDK" is
the fastest way to build your own packages or programs without compiling OpenWrt itself.
The "initrd" directory contains some initrd-images for netboot, which are required on
some boards to initially install OpenWrt.
make will use by default
PACKAGES_LIST_DEFAULT defined in
config.mk. You can customize this by overriding them:
make TARGET=mpc85xx PACKAGES_LIST_DEFAULT=backbone
in addition you can build your own image from a prebuilt imagebuilder by something like:
make images IB_FILE=<file> TARGET=... PACKAGES_LIST_DEFAULT=...
The default target is
ar71xx-generic. For a complete list of supported targets look in
configs/ for the target-specific configs.
Each of these targets need a matching file in
profiles/ with the profiles (boards) that should be build with the imagebuilder.
- IS_BUILDBOT :
- this will be "yes" when running on the buildbot farm and helps to save some disc-space by removing files not required anymore. On manual builds you should not set this to "yes", as you have to rebuild the whole toolchain each time.
- SET_BUILDBOT :
- "env" the Makefile will honor the "IS_BUILDBOT" environment
- "yes" the Makefile will always act as "IS_BUILDBOT" was set to "yes"
- "no" the Makefile will always act as "IS_BUILDBOT" was set to "no" / is unset. This way we can run builds on the buildbot like a local build.
Continuous integration / Buildbot
All branches whose name complies to the "X.Y.Z" pattern are built and put into the "stable" downloads directory: http://buildbot.berlin.freifunk.net/buildbot/stable/
All branches with names not fitting the "X.Y.Z" pattern are built and put into the "unstable" directory: http://buildbot.berlin.freifunk.net/buildbot/unstable/ Note that in the directory there is no reference to the branch name; unstable builds can be identified by build number only.
Creating a release
Every release has a semantic version number; each major version has its own codename. We name our releases after important female computer scientists, hackers, etc. For inspiration please take a look at the related ticket.
For a new release, create a new branch. The branch name must be a semantic version number. Make sure you change the semantic version number and, for major releases, the codename in the README and config files (./configs/*)
The buildbot will build the release and place the files in the stable direcotry once you pushed the new branch to github.
Patches with quilt
Important: all patches should be pushed upstream!
If a patch is not yet included upstream, it can be placed in the
patches directory with the
quilt tool. Please configure
quilt as described in the OpenWrt wiki (which also provides a documentation of
Add, modify or delete a patch
In order to add, modify or delete a patch run:
make clean pre-patch
Then switch to the openwrt directory:
Now you can use the
quilt commands as described in the OpenWrt wiki.
Example: add a patch
quilt push -a # apply all patches quilt new 008-awesome.patch # tell quilt to create a new patch quilt edit somedir/somefile1 # edit files quilt edit somedir/somefile2 quilt refresh # creates/updates the patch file
Please create a pull request for the project you want to submit a patch. If you are already member of the Freifunk Berlin team, please delete branches once they have been merged.
Create a commit in the openwrt directory that contains your change. Use
git format-patch to create a patch:
git format-patch origin
Send a patch to the OpenWrt mailing list with
git send-email \ --firstname.lastname@example.org \ --smtp-server=mail.foo.bar \ --smtp-user=foo \ --smtp-encryption=tls \ 0001-a-fancy-change.patch
Additional information: https://dev.openwrt.org/wiki/SubmittingPatches