Site Overlay

Git installation bug in OpenWRT’s Chaos Calmer 15.05.1

If you compiled OpenWRT’s Chaos Calmer 15.05.1 stable release from source and installed git by opkg, you will get a git version which is both outdated (version 2.3.5-1 while the current version at the time of writing is 2.8.4) and “crippled”. This post shows how to get a more recent version without any limitations.

Major turn-offs of OpenWRT’s default git package

If you want to install git on your OpenWRT router, you have two options:

  1. Either you use the opkg install command to add the git package to a running router or…
  2. …you compile it from the package sources after you activated the package in the menuconfig.

If you go for option 1 as recommended in my contribution about setting up a git server on OpenWRT, the drawback is that you will get a ridiculously outdated version (something around 2.3.5 while the current version at the time of writing is 2.8.4) and your git installation will be crippled in the sense that essential parts like the templates will not be installed.

If you go for option 2, at least there is a more recent vesion (2.8.2 at the time of writing), but the installation will still be crippled. For instance, gitolite which runs on top of git was unable to create new repos. You will get some kind of warning and FATAL messages which include some hint that git lacks a template folder:

Solution

Strangely the maintainer of the oWRT git package deliberately removed the template files from the installation. The idea therefore is a to create a simplified Makefile ressembling the one which was in place prior to the modifications done in the commit linked above.

So we checkout the current package sources for git:

And then change the Makefile to:

In order to avoid collisions between our customized git and the default git which ships with oWRT, we first uninstall the default git from the menuconfig:

We then physically remove the default oWRT git feed:

And then activate our own git feed from the menuconfig:

Once the correct git appears in your menuconfig, M-select the package. There is no need to add the git-http package. Then trigger a build run by issuing make package/git/compile.