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:
1 2 3 4 5 6 |
root@beaglebone:~/git# curl -k -O https://www.kernel.org/pub/software/scm/git/git-1.8.3.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4365k 100 4365k 0 0 7145 0 0:10:25 0:10:25 --:--:-- 7664 root@beaglebone:~/git# tar xvf git-1.8.3.tar.gz root@beaglebone:~/git# cd git-1.8.3 |
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.
1 2 3 4 |
root@beaglebone:~/git/git-1.8.3# opkg update root@beaglebone:~/git/git-1.8.3# opkg install python root@beaglebone:~/git/git-1.8.3# opkg install python-pyserial root@beaglebone:~/git/git-1.8.3# opkg install python-distutils |
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:
1 2 |
# cd /usr/lib/python2.7 # curl -k -O https://raw.github.com/pypy/pypy/master/lib-python/2.7/py_compile.py |
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:
1 |
opkg remove git |
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:
1 2 |
root@beaglebone:~/git/git-1.8.3# ./configure --without-tcltk root@beaglebone:~/git/git-1.8.3# make NO_TCLTK=Yes NO_MSGFMT=Yes NO_GETTEXT=Yes install |
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:
1 2 |
root@beaglebone:~# git version git version 1.8.3 |
Sir I tried commands to build git. I getting the following output.
root@beaglebone:~# cd git/curl -k -0 https://www.kernel.org/pub/software/scm/git/git-1.8.3.tar
-sh: cd: git/curl: No such file or directory
Kindly help me. Thank you.
its -k -O ( capital letter o), you have a 0 ( zero)
Well I could not make it, python updated as per instruction, including the extra curl part, ntp used to set to correct time.
I get the following error
~/src/git/git-1.8.3#make NO_TCLTK=Yes NO_MSGFMT=Yes NO_GETTEXT=Yes install
/usr/bin/perl5.14.2 -pe “s” blib/lib/Git.pm
SUBDIR git_remote_helpers
Traceback (most recent call last):
File “setup.py”, line 5, in
from distutils.core import setup
File “/usr/lib/python2.7/distutils/core.py”, line 20, in
from distutils.dist import Distribution
File “/usr/lib/python2.7/distutils/dist.py”, line 10, in
from email import message_from_file
ImportError: No module named email
make[1]: *** [all] Error 1
make: *** [all] Error 2
~/src/git/git-1.8.3#
Well solved the problem. you have to install py-email. So kindly adding the next line to your python update section would be more helpful.
~/src/git/git-1.8.3# opkg install python-email
Installing python-email (2.7.3-r0.3.7) to root…
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/python/python-email_2.7.3-r0.3.7_armv7a-vfp-neon.ipk.
Installing python-image (2.7.3-r0.3.7) to root…
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/python/python-image_2.7.3-r0.3.7_armv7a-vfp-neon.ipk.
Installing python-audio (2.7.3-r0.3.7) to root…
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/python/python-audio_2.7.3-r0.3.7_armv7a-vfp-neon.ipk.
Configuring python-image.
Configuring python-audio.
Configuring python-email.
~/src/git/git-1.8.3#
While running:
make NO_TCLTK=Yes NO_MSGFMT=Yes NO_GETTEXT=Yes install
Why am I getting this?
AR libgit.a
ar: invalid option — ‘r’
BusyBox v1.19.3 (2012-01-10 08:25:36 CET) multi-call binary.
Usage: ar [-o] [-v] [-p] [-t] [-x] ARCHIVE FILES
make: *** [libgit.a] Error 1
I was using a beagle board, not a beagle bone. My problem was not able to control (turn off/on) the GPIOs.
I had to use linux kernel 2.X and gcc. So ubuntu 12.10 handles OMAP3 with linux kernel 3.2 and works just fine.