ejes consulting

Techincal Consulting Design and Automation

Archive for May 2010

GNU dnsmasq for OpenSolaris SPARC

with 2 comments

I recently have been trying to migrate my FreeNAS server to a SPARC based system runing OpenSolaris.  Mainly for the benefits of ZFS – but also to learn more about OpenSolaris and shellcode on SPARC.

In this light of learning more about OpenSolaris, I’ve been porting some of my lesser power hungry network applications to my little sparc pizzabox as well.  Since the pizzabox server is a little underpowered I wanted to use some pertty trim services to keep it’s availablility up as a NAS.

The first service I thought about was dnsmasq, who on my OpenBSD system works as my DHCP and dynmaically updateable DNS server.  I really like dnsmasq (http://www.thekelleys.org.uk/dnsmasq/doc.html), and have been using it as my primary dns/dhcp server for some time now – it’s fast, feature rich, easy to configure and cheap on resources.  It’s perfect for the home user.

Now just to get in running on my sparc.  After all the searching in the world, I couldn’t find any (trivial) dnsmasq on Solaris documentation. 

This left me no choice:

I’m not afraid of compling source.  Thankfully, DNSmasq 2.52 (http://www.thekelleys.org.uk/dnsmasq/dnsmasq-2.52.tar.gz) compiles cleanly on sparc – so this is the base I used.  In order to compile and run make install properly, I had to change the “Makefile” to use “ginstall” instead of BSD install that is used by default on Solaris systems; the Makefile also uses “cc” instead of “gcc” so I symlinked my “gcc” binary from /usr/bin to /usr/bin/cc.

Once installed I had to deal with the silly Solaris SMF (Service Management Facility).  In order to maintain some continuity across all my services I decded to build a nice smf xml for my dnsmasq as well.  I just copied ssh’s, and modified it to support my newly compiled dnsmasq package.  I also had to write a simple starup script since the SMF facility is just a fancy way of calling /lib/svc/method/ shell scripts who look suspcisouly like “init.d” type scripts.

Compiled, scripted and input into my smf (using svccfg import), my dnsmasq seems to starup great – my netbook got an ip, and it’s pingable by using “ping netbook” .

GREAT!

To save you wonderful internet users some headaches, I built a Solaris “.pkg” file for general consumption.  (http://www.filehosting.org/file/details/143734/GNUdnsmsq.pkg

I followed the instructions here (http://www.ibiblio.org/pub/packages/solaris/sparc/html/creating.solaris.packages.html ) for creaing the Solaris package, then used “pkgtrans -s . GNUdnsmaq.pkg” to translate the package to a “.pkg” file.

Enjoy!

Advertisements

Written by ejes

May 12, 2010 at 12:18 pm

Posted in Hacking, Tutorials

Tagged with , ,