I use github.com for all of my source code source version control. I noticed that in the past few days git push had stopped working for me on the Beaglebone Black (BBB) for one of my repositories. I decided to build git from source to see if it was a version issue. The version of git on the BBB is version 1.7.7 and it appears that this is quite old. A “opkg install git” keeps it a slightly higher revision of version 1.7.7.

There were quite a number of small issues to resolve, so I have written this up to remember them for the future and make them available to all.

Building Git for the Beaglebone

Find the version of git that you would like to install: https://www.kernel.org/pub/software/scm/git/

I’m going to build and install 1.8.3, a fair update from 1.7.7.

First we need to download the source code. I cannot get wget to work with https links on the beaglebone, so I use curl; however, on the Beaglebone black I find that I have to add a “-k” to get curl to work with https sites, otherwise I get an error “curl (77) problem with the ssl ca cert“. However, the downside of “-k” is that you are using curl in insecure mode, allowing connections so SSL sites without certificates. I’m not having much luck with certificates on the beaglebone and need to give this some attention.

This is not a long term fix to the problem as it could leave you vulnerable to man-in-the-middle attacks. However, lets take a chance on kernel.org! At some stage in the future I will look into a proper solution for this.

So, to get started:

You are now in the source directory ~/git/git-1.8.3/ . If you are using the Beaglebone black standard image then you should have all of the dependencies that you need (in particular, build-essentials, ssh, tk, python etc.). You do need python-pyserial and python-distutils. Ensure that you install these before you call make.

Now this part is a bit of a hack and I’m not sure if there is a better way. py_compile.py was missing from my python install and not being a python user I had to hack my version to add the missing script. I did it by:

Before you do the next step, make sure that your time is correct as the make is doing a time check. Use “date” to check your time. If you haven’t set your clock for NTP, see my guide: Setting the Beaglebone Black time using NTP

Next, I need to remove the current git version – do this before the make install step, which is next:

Back to my downloaded git source folder to do a .configure. I’m doing this without tcltk as I don’t need a front-end UI:

This takes quite some time on the BBB – maybe 20 minutes + (Note: My build went into an infinite loop that I had to kill and then run the make step again) The options NO_MSGFMT and NO_GETTEXT were added to remove problems that I had during build. They may be release specific and may not be required in later versions/Angstrom distributions.

Okay, the build ends with a simple prompt, with no errors thankfully. The install at the end of the make  call installs the new version of git on your system. Don’t do a make install afterwards, without listing the options as above as it will be seen as a new build configuration.

I am finished, and just to check: