Building Your Toolchain
Using a Linux computer, you will be downloading all the necessary packages and then cross-compiling a custom ARM-compatible image. It is essential that your Linux computer be quite fast, as cross-compiling translates the C code into ARM-compatible code and it's pretty compute intensive.
Tip: While you can use CoLinux and build a custom kernel from within Windows, I don't recommend it. You're better off using a native Linux distro.
You will need to install a Subversion client on your Linux box, which you can get here. Subversion is an open source version control system alternative to CVS that will build a catalog of necessary files for the build and then download them from a central repository on the Internet . You'll then make a custom Linux distribution for the Gumstix ARM processor from those files. Subversion will also install files necessary for you to cross-compile the Bluetooth hacking programs, which are described later in this article.
After you install Subversion, issue the following command from a shell prompt to start building the library tree:
svn co http://svn.rungie.com/svn/gumstix-buildroot/trunk gumstix-buildroot
The Subversion client will make a directory called gumstix-buildroot. Go into the directory by typing in the following.
cd gumstix-buildroot
Now, you need to change the make file to add in the Bluetooth-libs and utils. Edit the make file with a text editor of your choice (I used EMACS).
emacs Makefile
Find
#For Bluetooth
within the makefile, and change the line following it to
TARGETS+=bluez-utils bluez-libs
Figure 2 shows the changed line. This will substitute the newest BlueZ drivers for the standard Bluetooth modules. After making the edit, save the file and exit.
Figure 2: Modifying the make file
(click image to enlarge)
Update August 13, 2005
Two additional Bluetooth applications - btscanner and carwhisperer - have been added to the buildroot. The TARGETS line described above and shown in Figure 2 should be modified to be:TARGETS+=bluez-utils bluez-libs btscanner carwhispererto include these applications, which are described in the Finishing Up section.
It is also a good idea to add PERL support on the Gumstix, which will allow you to run and make your own Bluetooth PERL scripts. Add in the following line to the make file.
TARGETS+=perl
You can add this line right after the edited Bluetooth line and add a comment above it. Remember to start the comment line with a "#"!
Figure 3: Make in progress
(click image to enlarge)
You're now ready to start the "make" or compile. Type in
make
and gcc will start compiling the custom kernel. It will take around an hour or so for make to download and compile the files, so you may want to grab lunch. After the compile is finished, you will have a file around three megaBytes in size called root_fs_arm, located in the directory that you started the make from. This is the file that you will transfer to the Gumstix.