04-19-2014 08:56 AM
I've just got my first EdgeOS device and I'm very impressed. I've been a long-time user of OpenWRT and I deviated briefly into MikroTik but found that OpenWRT lacked acceleration capability and MikroTik was so closed it was impossible to acheive the things I needed.
So the EdgeRouter devices look like the perfect answer! I have an IPsec tunnel running at virtually no CPU impact that was bringing both the MikroTik and OpenWRT devices to their knees! Superb!
BUT ... in the course of getting it to do what I need I found that I needed to recompile dnsmasq, as I need version 2.64 or later so that it has ipset support (I'll post a separate message on that topic.)
It was difficult to find any clear instructions on how to build the package, I found some stuff around accel-ppp which helped, but it's not perfect.
I have installed the emdebian cross compiler, I have (eventually) figured out the xapt can help you get your dependencies sorted out, however when I actually try to build the package it tried to use 'gcc' (which is for x86) and pkg-config which looks at the x86 system and not the mips dependencies.
The pkg-config stuff I can work around by installing in both environments, but the gcc stuff required editing the rules file to force the mips compiler.
The end result is that it all worked ok, but I don't think I'm going about it in the right way.
Is there a concise description of how we should go about setting up a system for cross-compiling and then an example of compiling one of the base packages for EdgeOS? (for non debian experts!)
04-19-2014 09:48 AM
Last time, i've just created qemu virtual mashine with mips64 arch, installed debian squeze on it, and build packages using debhelper
It's creepy but doesn't require to learn xapt and other things that could blow your mind
04-20-2014 04:36 PM
Yeah I just took a quick look at the dnsmasq build scripts (Makefile etc.) and looks like they weren't written with cross-compile in mind. So probably what you did was necessary to get it to build correctly. If you could post the changes you made that may be helpful too (e.g., if we need to update to a newer version with squeeze) Thanks!
04-20-2014 10:53 PM
Ok, I've had a go at fixing this properly ... but I'm no debian expert and I've not done this before so this could be completely wrong.
Basically I copied a section from another debian/rules file that seems to properly set the CC variable, then use that instead of hardcoded "gcc".
I also added some code to set PKG_CONFIG_PATH.
It seems to work ok.
Can I please make a request for a later version of dnsmasq in the next release? I need a version with ipset support, which I think means 2.66 or later. I'm experimenting with 2.69 (the latest) and it seems to drop in with no other issues.
With the ipset version of dnsmasq it's possible to build address groups based on the results of domain name lookups ... this enables qos/routing/firewalling by domain name. For me, I use this to route specific traffic over IPsec so that it appears to come from another geo, but I'm sure there are lots of uses. I've added cli options and scripts to support it ... I'll post shortly once I've finished tidying up.
> DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
> DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
> DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
> DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
> ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
> export PKG_CONFIG_PATH=/usr/$(DEB_HOST_GNU_TYPE)/lib/pkgconfig
< make $(TARGET) PREFIX=/usr DESTDIR=`pwd`/debian/base CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="$(COPTS)" CC=gcc
> make $(TARGET) PREFIX=/usr DESTDIR=`pwd`/debian/base CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="$(COPTS)" CC="$(CC)"
< make -C contrib/wrt PREFIX=/usr DESTDIR=`pwd`/debian/utils CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="$(COPTS)" CC=gcc
> make -C contrib/wrt PREFIX=/usr DESTDIR=`pwd`/debian/utils CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" COPTS="$(COPTS)" CC="$(CC)"
04-23-2014 06:15 PM
Yeah it would certainly be good to have a newer version. The issue is that currently we're using the Debian wheezy binary package directly, which is 2.62. Debian jessie has 2.69 but the binary package is not compatible (requires newer libc etc.). So at the moment, to move to newer version means we'd need to import the source code and start building the binary package on our own, which would be extra maintenance work and we will need to see if that is feasible based on resources availability etc. The changes you provided would be useful if we do go that route though, so thanks for the contributions!