Skip to content
Build system for Berlin firmware
Shell Makefile
Branch: master
Clone or download
SvenRoederer ipq806x-generic: do not set internal OpenWrt-options not reachable on…
… manual configuration

without this options there in no difference in the generated .config for OpenWrt
Latest commit 1cfbb77 Jul 10, 2019

README.md

Freifunk Berlin Firmware

https://wiki.freifunk.net/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 berlin@berlin.freifunk.net or come to our weekly meetings. If you find bugs please report them at: https://github.com/freifunk-berlin/firmware/issues

Development

Info

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.

Build Prerequisites

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.

On Ubuntu/Debian:

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

On openSUSE:

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

On Arch/Antergos:

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 such as -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.

Directory Layout

You can find the actual firmware images generated by the ImageBuilder (and the ImageBuilder itself) in 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 packages/. 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.

customizing make

make will use by default TARGET and 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.

additional options

  • 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

The firmware is built automatically by our buildbot farm. If you have a bit of CPU+RAM+storage capacity on one of your servers, you can provide a buildbot slave (see berlin-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 quilt).

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:

cd openwrt

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

Submitting patches

Freifunk Berlin

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.

OpenWrt

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:

git send-email \
  --to=openwrt-devel@lists.openwrt.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

You can’t perform that action at this time.