summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/dnsmasq
diff options
context:
space:
mode:
Diffstat (limited to 'abs/mv-core/dnsmasq')
-rw-r--r--abs/mv-core/dnsmasq/PKGBUILD41
-rw-r--r--abs/mv-core/dnsmasq/dnsmasq-capability-config.patch14
-rw-r--r--abs/mv-core/dnsmasq/dnsmasq.conf38
-rw-r--r--abs/mv-core/dnsmasq/dnsmasq.install21
-rwxr-xr-xabs/mv-core/dnsmasq/dnsmasq.rc.d36
-rw-r--r--abs/mv-core/dnsmasq/pxelinux.0bin0 -> 13480 bytes
-rw-r--r--abs/mv-core/dnsmasq/pxelinux.default10
7 files changed, 160 insertions, 0 deletions
diff --git a/abs/mv-core/dnsmasq/PKGBUILD b/abs/mv-core/dnsmasq/PKGBUILD
new file mode 100644
index 0000000..339b95a
--- /dev/null
+++ b/abs/mv-core/dnsmasq/PKGBUILD
@@ -0,0 +1,41 @@
+pkgname=dnsmasq
+pkgver=2.42
+pkgrel=15
+pkgdesc="A lightweight DNS/DHCP server ideal for small/home networks using NAT"
+arch=(i686 x86_64)
+source=(http://www.thekelleys.org.uk/$pkgname/$pkgname-$pkgver.tar.gz \
+ dnsmasq.rc.d $pkgname-capability-config.patch dnsmasq.conf pxelinux.0 pxelinux.default )
+license=('GPL2')
+url="http://www.thekelleys.org.uk/dnsmasq/doc.html"
+depends=('glibc' 'bash')
+backup=(etc/dnsmasq.conf)
+install=$pkgname.install
+
+build() {
+ cd $startdir/src/$pkgname-$pkgver || return 1
+ # patch to add a note about capability module in the config file
+ patch -Np0 -i ../$pkgname-capability-config.patch || return 1
+
+ # build
+ cd $startdir/src/$pkgname-$pkgver || return 1
+ make || return 1
+
+ # install
+ mkdir -p $startdir/pkg/etc/rc.d || return 1
+ make PREFIX=/usr DESTDIR=$startdir/pkg install || return 1
+ install -D -m 0755 \
+ $startdir/src/dnsmasq.rc.d $startdir/pkg/etc/rc.d/dnsmasq || return 1
+ install -D -m 0644 \
+ dnsmasq.conf.example $startdir/pkg/etc/dnsmasq.conf.example || return 1
+ install -D -m 0644 $startdir/src/dnsmasq.conf $startdir/pkg/etc/dnsmasq.conf
+
+ mkdir -p $startdir/pkg/data/srv/tftp/pxelinux.cfg
+ install -m 755 $startdir/src/pxelinux.default $startdir/pkg/data/srv/tftp/pxelinux.cfg/default
+ install -m 755 $startdir/src/pxelinux.0 $startdir/pkg/data/srv/tftp/pxelinux.0
+
+
+ # make the required directories for DHCP server default directories
+ mkdir -p $startdir/pkg/var/db || return 1
+ mkdir -p $startdir/pkg/var/lib/misc || return 1
+}
+# vim: ts=2 sw=2 et ft=sh
diff --git a/abs/mv-core/dnsmasq/dnsmasq-capability-config.patch b/abs/mv-core/dnsmasq/dnsmasq-capability-config.patch
new file mode 100644
index 0000000..d8dbb82
--- /dev/null
+++ b/abs/mv-core/dnsmasq/dnsmasq-capability-config.patch
@@ -0,0 +1,14 @@
+diff -urN dnsmasq.conf.example dnsmasq.conf.example.fixed
+--- dnsmasq.conf.example 2006-10-18 16:24:50.000000000 -0400
++++ dnsmasq.conf.example.fixed 2006-11-20 22:07:12.000000000 -0500
+@@ -58,7 +58,9 @@
+ #address=/doubleclick.net/127.0.0.1
+
+ # If you want dnsmasq to change uid and gid to something other
+-# than the default, edit the following lines.
++# than root, you will need to have CONFIG_SECURITY_CAPABILITIES
++# enabled in your kernel. The default uid and gid of nobody will
++# be used if capability is available and this is not set.
+ #user=
+ #group=
+
diff --git a/abs/mv-core/dnsmasq/dnsmasq.conf b/abs/mv-core/dnsmasq/dnsmasq.conf
new file mode 100644
index 0000000..96e338e
--- /dev/null
+++ b/abs/mv-core/dnsmasq/dnsmasq.conf
@@ -0,0 +1,38 @@
+#logging
+log-async=5
+log-facility=DAEMON
+log-queries
+
+# filter what we send upstream
+domain-needed
+bogus-priv
+filterwin2k
+localise-queries
+
+# allow /etc/hosts and dhcp lookups via *.lan
+local=/lan/
+domain=lan
+expand-hosts
+
+# enable dhcp (start,end,netmask,leasetime)
+dhcp-authoritative
+dhcp-range=192.168.1.101,192.168.1.250,255.255.255.0,12h
+dhcp-leasefile=/tmp/dhcp.leases
+
+# use /etc/ethers for static hosts; same format as --dhcp-host
+# <hwaddr> <ipaddr>
+read-ethers
+
+# other useful options:
+# default route(s): dhcp-option=3,192.168.1.1,192.168.1.2
+# dns server(s): dhcp-option=6,192.168.1.1,192.168.1.2
+
+dhcp-option=3,192.168.1.1
+dhcp-option=6,192.168.1.1
+
+enable-tftp
+tftp-root=/data/srv/tftp/
+conf-file=/etc/dnsmasq.mvpmc.conf
+
+dhcp-boot=pxelinux.0
+
diff --git a/abs/mv-core/dnsmasq/dnsmasq.install b/abs/mv-core/dnsmasq/dnsmasq.install
new file mode 100644
index 0000000..25501a4
--- /dev/null
+++ b/abs/mv-core/dnsmasq/dnsmasq.install
@@ -0,0 +1,21 @@
+# arg 1: the new package version
+post_install() {
+ post_upgrade
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ touch /etc/dnsmasq.mvpmc.conf
+ chown nobody:nobody /etc/dnsmasq.mvpmc.conf
+}
+
+# arg 1: the old package version
+pre_remove() {
+ /bin/true
+}
+
+op=$1
+shift
+
+$op $*
diff --git a/abs/mv-core/dnsmasq/dnsmasq.rc.d b/abs/mv-core/dnsmasq/dnsmasq.rc.d
new file mode 100755
index 0000000..1676072
--- /dev/null
+++ b/abs/mv-core/dnsmasq/dnsmasq.rc.d
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/dnsmasq`
+case "$1" in
+ start)
+ stat_busy "Starting DNS/DHCP daemon"
+ [ -z "$PID" ] && /usr/sbin/dnsmasq
+ if [ $? -gt 0 ] ; then
+ stat_fail
+ else
+ add_daemon dnsmasq # create the 'state' dir
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping DNS/DHCP daemon"
+ [ "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon dnsmasq # remove the 'state' dir
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 5
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/abs/mv-core/dnsmasq/pxelinux.0 b/abs/mv-core/dnsmasq/pxelinux.0
new file mode 100644
index 0000000..cfe4420
--- /dev/null
+++ b/abs/mv-core/dnsmasq/pxelinux.0
Binary files differ
diff --git a/abs/mv-core/dnsmasq/pxelinux.default b/abs/mv-core/dnsmasq/pxelinux.default
new file mode 100644
index 0000000..6294d3c
--- /dev/null
+++ b/abs/mv-core/dnsmasq/pxelinux.default
@@ -0,0 +1,10 @@
+DISPLAY boot.txt
+
+DEFAULT install_image
+
+LABEL install_image
+ kernel masterbuild/boot/vmlinuz26
+ append vga=normal root=/dev/nfs rw netboot netinstall nfsroot=$REPLACEME:/data/srv/tftp/masterbuild,rsize=16384,wsize=16384,rw ip=dhcp initrd=masterbuild/boot/kernel26.img
+
+TIMEOUT 4
+prompt 20