You are here

Build OpenWrt on Mac (Yosemite)

on Feb 20, 2015

1. Install XCode & Macports

# sudo port install coreutils asciidoc bzip2 fastjar flex getopt gtk2 intltool
python26 rsync ruby sdcc unzip gettext libxslt bison gawk autoconf wget gmake ncurses e2fsprogs ossp-uuid gawk findutils
gnutar bzr binutils jikes zlib openssl p5-extutils-makemaker util-linux libutil-linux e2fsprogs osso-uuid

2. Using Disk Utility to create a sparse disk image with case sensitive (Format: Mac OS Extended (case-sensitive) ). Mount it by double click

3. Check out the source code

4. Modify makefile

sed -i.bak 's/\(^tools.*\)e2fsprogs/\1/;/\/e2fsprogs/s/^/#/' /Volumes/OpenWRT/tools/Makefile

5. Fix dependencies:

cd /Volumes/OpenWRT/trunk;
mkdir -p staging_dir/host/include/e2fsprogs;
cp -R /opt/local/include/ossp staging_dir/host/include/e2fsprogs/;
cp /opt/local/lib/libuuid* staging_dir/host/lib

6. Modify config file or download it (For my Asus RT-N16)

wget http://downloads.openwrt.org/barrier_breaker/14.07/brcm47xx/mips74k/conf...

7. Update and install feeds

./scripts/feeds update -a
./scripts/feeds install -a

8. Make

make V=s

Sometimes need more detailed control:

make defconfig
make prereq
make menuconfig

References:

http://wiki.openwrt.org/doc/howto/buildroot.exigence.macosx

https://forum.openwrt.org/viewtopic.php?id=34676

Category: