Broadband-Hamnet™ Forum :: General
Welcome Guest   [Register]  [Login]
 Subject :building openWRT on OS X.. 2010-10-13- 03:08:46 
Joined: 2010-09-18- 23:38:56
Posts: 16

While hsmm-mesh for linksys routers is currently based off of 7.09, openWRT has more recent code that provides support for newer models of wifi routers such as the Ubiquiti devices. There are two newer openWRT branches: 8.09 and 10.03.

One of the nice things about 8.09 (particularly when your callsign ends in OSX) is that it can be built on a Mac.

First off, when you first get your mac, the filesystem on it is case-insensitive. Coming from a UNIX background, I've always found this strange, particularly because OS X is UNIX underneath the glitzy user interface. Unfortunately, openWRT builds require a case-sensitive filesystem. There are two ways to resolve this:

  • reinstall OS X and select the option for a case-sensitive filesystem.
  • create a hard disk image in which to perform the builds.
    • Applications->Utilities->DiskUtility.
    • NewImage
    • Size->Custom->5G
    • Format->Mac OS Extended (Case sensitive)
    • Partitions->Hard disk
    • SaveAs->whatever
    • Create

Then, when you want to use it, mount it with DiskUtility, and you'll see it in your Finder windows. After it is mounted, cd into it at /Volumes/Disk Image (or whatever mount point you selected), and run the svn commands, etc, in that location.

(Conversely, if you filesystem is case-sensitive, you may need to create a disk image to play games like WoW which require a case-insensitive filesystem.)

You can, of course, select any size you want. My current build directory for 8.09 is slightly over 2gig in size.

There are some tools that you'll need to install. These include the following:

  • Apple's Xcode development environment (free):
  • macports:
  • sudo port install getopt
  • sudo port install coreutils
  • cd /opt/local/bin && sudo ln -s gmktemp mktemp
  • sudo port install gawk
  • sudo port install wget
  • sudo port install findutils # os x /usr/bin/find not compatible with openwrt makefiles
  • sudo port install gnutar #  (for r14898, but not top of branch)
  • cd /opt/local/bin && sudo ln -s gnutar gtar
  • cd /opt/local/bin && sudo ln -s gnutar tar

When macports is installed, it modifies the $PATH environment variable for the account used to install the tools to include /opt/local/bin. Because some of the tools that are installed are incompatible with OS X tools of the same name (stored in a different location), it'd be best to install the tools with a separate loginid that will only be used to build openWRT. (That or set up an alias that will modify your $PATH environment variable when you build openWRT.)

The Mac that I'm currently building on is running 10.6.4 and is Intel based. However, given that openWRT is based on a cross compiler, PowerPC Macs can also probably build openWRT.

Note however, that the hsmm-mesh development environment includes binaries (eg, the gcc cross compiler toolchain) that were built on linux for use on linux systems. These tools cannot be run natively on a mac system. (You could, however, set up a linux virtual machine on OS X that will allow you to build using hsmm-mesh's development environment.)

IP Logged
Page # 

Powered by ccBoard