summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/dhcp
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/dhcp')
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/dhcp-3.0.3-dhclient-dbus.patch84
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/fix-client-path.patch21
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/fixincludes.patch10
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/noattrmode.patch20
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/site.h21
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp3.inc53
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp4.inc57
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp_4.1.1-P1.bb7
-rw-r--r--meta/recipes-connectivity/dhcp/files/default-relay12
-rw-r--r--meta/recipes-connectivity/dhcp/files/default-server7
-rw-r--r--meta/recipes-connectivity/dhcp/files/dhclient.conf50
-rw-r--r--meta/recipes-connectivity/dhcp/files/dhcpd.conf108
-rw-r--r--meta/recipes-connectivity/dhcp/files/init-relay44
-rw-r--r--meta/recipes-connectivity/dhcp/files/init-server44
14 files changed, 538 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/dhcp-3.0.3-dhclient-dbus.patch b/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/dhcp-3.0.3-dhclient-dbus.patch
new file mode 100644
index 0000000000..579d72f484
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/dhcp-3.0.3-dhclient-dbus.patch
@@ -0,0 +1,84 @@
1--- client/scripts/bsdos
2+++ client/scripts/bsdos
3@@ -47,6 +47,11 @@
4 . /etc/dhcp/dhclient-exit-hooks
5 fi
6 # probably should do something with exit status of the local script
7+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
8+ dbus-send --system --dest=com.redhat.dhcp \
9+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
10+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
11+ fi
12 exit $exit_status
13 }
14
15--- client/scripts/freebsd
16+++ client/scripts/freebsd
17@@ -57,6 +57,11 @@
18 . /etc/dhcp/dhclient-exit-hooks
19 fi
20 # probably should do something with exit status of the local script
21+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
22+ dbus-send --system --dest=com.redhat.dhcp \
23+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
24+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
25+ fi
26 exit $exit_status
27 }
28
29--- client/scripts/linux
30+++ client/scripts/linux
31@@ -69,6 +69,11 @@
32 . /etc/dhcp/dhclient-exit-hooks
33 fi
34 # probably should do something with exit status of the local script
35+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
36+ dbus-send --system --dest=com.redhat.dhcp \
37+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
38+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
39+ fi
40 exit $exit_status
41 }
42
43--- client/scripts/netbsd
44+++ client/scripts/netbsd
45@@ -47,6 +47,11 @@
46 . /etc/dhcp/dhclient-exit-hooks
47 fi
48 # probably should do something with exit status of the local script
49+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
50+ dbus-send --system --dest=com.redhat.dhcp \
51+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
52+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
53+ fi
54 exit $exit_status
55 }
56
57--- client/scripts/openbsd
58+++ client/scripts/openbsd
59@@ -47,6 +47,11 @@
60 . /etc/dhcp/dhclient-exit-hooks
61 fi
62 # probably should do something with exit status of the local script
63+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
64+ dbus-send --system --dest=com.redhat.dhcp \
65+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
66+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
67+ fi
68 exit $exit_status
69 }
70
71--- client/scripts/solaris
72+++ client/scripts/solaris
73@@ -47,6 +47,11 @@
74 . /etc/dhcp/dhclient-exit-hooks
75 fi
76 # probably should do something with exit status of the local script
77+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
78+ dbus-send --system --dest=com.redhat.dhcp \
79+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
80+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
81+ fi
82 exit $exit_status
83 }
84
diff --git a/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/fix-client-path.patch b/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/fix-client-path.patch
new file mode 100644
index 0000000000..f6a7be1d81
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/fix-client-path.patch
@@ -0,0 +1,21 @@
1CLIENT_PATH is the only environment when executing dhclient-script,
2without this patch, dhclient-script won't run properly because it
3invokes ifconfig and route
4
57/28/2010 - qhe
6
7diff -ru dhcp-4.1.1-P1.orig//client/Makefile.am dhcp-4.1.1-P1/client/Makefile.am
8--- dhcp-4.1.1-P1.orig//client/Makefile.am 2010-07-29 13:20:05.000000000 +0800
9+++ dhcp-4.1.1-P1/client/Makefile.am 2010-07-29 13:28:14.000000000 +0800
10@@ -10,9 +10,9 @@
11 EXTRA_DIST = $(man_MANS)
12
13 dhclient.o: dhclient.c
14- $(COMPILE) -DCLIENT_PATH='"$(sbindir)"' \
15+ $(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):$(base_sbindir):$(bindir):$(base_bindir)"' \
16 -DLOCALSTATEDIR='"$(localstatedir)"' -c dhclient.c
17
18 dhc6.o: dhc6.c
19- $(COMPILE) -DCLIENT_PATH='"$(sbindir)"' \
20+ $(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):$(base_sbindir):$(bindir):$(base_bindir)"' \
21 -DLOCALSTATEDIR='"$(localstatedir)"' -c dhc6.c
diff --git a/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/fixincludes.patch b/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/fixincludes.patch
new file mode 100644
index 0000000000..91d99cce22
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/fixincludes.patch
@@ -0,0 +1,10 @@
1--- dhcp-3.0.2/common/tr.c~compile 2005-10-13 14:23:37.000000000 +0200
2+++ dhcp-3.0.2/common/tr.c 2005-10-13 14:23:45.000000000 +0200
3@@ -39,6 +39,7 @@
4 #include "includes/netinet/udp.h"
5 #include "includes/netinet/if_ether.h"
6 #include "netinet/if_tr.h"
7+#include <asm/types.h>
8 #include <sys/time.h>
9
10 /*
diff --git a/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/noattrmode.patch b/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/noattrmode.patch
new file mode 100644
index 0000000000..5c766d6c06
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/noattrmode.patch
@@ -0,0 +1,20 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- dhcp-3.0.1/includes/dhcpd.h~compile
7+++ dhcp-3.0.1/includes/dhcpd.h
8@@ -306,9 +306,9 @@
9 # define EPHEMERAL_FLAGS (MS_NULL_TERMINATION | \
10 UNICAST_BROADCAST_HACK)
11
12- binding_state_t __attribute__ ((mode (__byte__))) binding_state;
13- binding_state_t __attribute__ ((mode (__byte__))) next_binding_state;
14- binding_state_t __attribute__ ((mode (__byte__))) desired_binding_state;
15+ binding_state_t binding_state;
16+ binding_state_t next_binding_state;
17+ binding_state_t desired_binding_state;
18
19 struct lease_state *state;
20
diff --git a/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/site.h b/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/site.h
new file mode 100644
index 0000000000..2289554ef3
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp-4.1.1-P1/site.h
@@ -0,0 +1,21 @@
1/*
2 * define config file location in ${S}/includes/site.h
3 * still need to take care of installation path (${sysconfdir}/dhcpd.conf)
4 *
5 * 7/22/2010 - qhe
6 */
7
8/* Define this if you want DNS update functionality to be available. */
9
10#define NSUPDATE
11
12/* Define this if you aren't debugging and you want to save memory
13 (potentially a _lot_ of memory) by allocating leases in chunks rather
14 than one at a time. */
15
16#define COMPACT_LEASES
17
18
19/* local */
20#define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
21#define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf"
diff --git a/meta/recipes-connectivity/dhcp/dhcp3.inc b/meta/recipes-connectivity/dhcp/dhcp3.inc
new file mode 100644
index 0000000000..3f68f452d2
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp3.inc
@@ -0,0 +1,53 @@
1SECTION = "console/network"
2DESCRIPTION = "Internet Software Consortium DHCP package"
3HOMEPAGE = "http://www.isc.org/"
4
5LICENSE = "ISC"
6LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=bb6fd41f5895b67088ebea61ad365e74"
7
8SRC_URI = "ftp://ftp.isc.org/isc/dhcp/dhcp-${PV}.tar.gz \
9 file://init-relay file://default-relay \
10 file://init-server file://default-server \
11 file://dhclient.conf file://dhcpd.conf"
12
13inherit autotools
14
15TARGET_CFLAGS += "-D_GNU_SOURCE"
16
17do_compile() {
18 make RANLIB=${RANLIB} PREDEFINES='-D_PATH_DHCPD_DB=\"/var/lib/dhcp/dhcpd.leases\" \
19 -D_PATH_DHCLIENT_DB=\"/var/lib/dhcp/dhclient.leases\" \
20 -D_PATH_DHCLIENT_SCRIPT=\"/sbin/dhclient-script\" \
21 -D_PATH_DHCPD_CONF=\"/etc/dhcp/dhcpd.conf\" \
22 -D_PATH_DHCLIENT_CONF=\"/etc/dhcp/dhclient.conf\"'
23}
24
25do_install() {
26 make -e DESTDIR=${D} USRMANDIR=${mandir}/man1 ADMMANDIR=${mandir}/man8 FFMANDIR=${mandir}/man5 LIBMANDIR=${mandir}/man3 LIBDIR=${libdir} INCDIR=${includedir} install
27 install -d ${D}${sysconfdir}/init.d
28 install -d ${D}${sysconfdir}/default
29 install -d ${D}${sysconfdir}/dhcp
30 install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
31 install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
32 install -m 0755 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server
33 install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server
34 install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf
35 install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf
36 install -d ${D}${base_sbindir}/
37 mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
38 install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
39}
40
41PACKAGES += "dhcp-server dhcp-client dhcp-relay dhcp-omshell"
42FILES_${PN} = ""
43FILES_dhcp-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server ${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp/dhcpd.conf"
44FILES_dhcp-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay"
45
46FILES_dhcp-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf"
47RDEPENDS_dhcp-client = "bash"
48
49FILES_dhcp-omshell = "${bindir}/omshell"
50
51CONFFILES_dhcp-server_nylon = "/etc/dhcp/dhcpd.conf"
52CONFFILES_dhcp-relay_nylon = "/etc/default/dhcp-relay"
53CONFFILES_dhcp-client_nylon = "/etc/dhcp/dhclient.conf"
diff --git a/meta/recipes-connectivity/dhcp/dhcp4.inc b/meta/recipes-connectivity/dhcp/dhcp4.inc
new file mode 100644
index 0000000000..7652b948f0
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp4.inc
@@ -0,0 +1,57 @@
1SECTION = "console/network"
2DESCRIPTION = "Internet Software Consortium DHCP package"
3HOMEPAGE = "http://www.isc.org/"
4
5LICENSE = "ISC"
6LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=bb6fd41f5895b67088ebea61ad365e74"
7
8SRC_URI = "ftp://ftp.isc.org/isc/dhcp/dhcp-${PV}.tar.gz \
9 file://site.h \
10 file://init-relay file://default-relay \
11 file://init-server file://default-server \
12 file://dhclient.conf file://dhcpd.conf"
13
14inherit autotools
15
16TARGET_CFLAGS += "-D_GNU_SOURCE"
17EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \
18 --with-srv6-lease-file=${localstatedir}/lib/dhcp/dhcpd6.leases \
19 --with-cli-lease-file=${localstatedir}/lib/dhcp/dhclient.leases \
20 --with-cli6-lease-file=${localstatedir}/lib/dhcp/dhclient6.leases"
21
22do_compile_prepend () {
23 cp -f ${WORKDIR}/site.h ${S}/includes
24}
25
26do_install_append () {
27 install -d ${D}${sysconfdir}/init.d
28 install -d ${D}${sysconfdir}/default
29 install -d ${D}${sysconfdir}/dhcp
30 install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
31 install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
32 install -m 0755 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server
33 install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server
34
35 rm -f ${D}${sysconfdir}/dhclient.conf
36 rm -f ${D}${sysconfdir}/dhcpd.conf
37 install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf
38 install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf
39
40 install -d ${D}${base_sbindir}/
41 mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
42 install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
43}
44
45PACKAGES += "dhcp-server dhcp-client dhcp-relay dhcp-omshell"
46FILES_${PN} = ""
47FILES_dhcp-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server ${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp/dhcpd.conf"
48FILES_dhcp-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay"
49
50FILES_dhcp-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf"
51RDEPENDS_dhcp-client = "bash"
52
53FILES_dhcp-omshell = "${bindir}/omshell"
54
55CONFFILES_dhcp-server_nylon = "/etc/dhcp/dhcpd.conf"
56CONFFILES_dhcp-relay_nylon = "/etc/default/dhcp-relay"
57CONFFILES_dhcp-client_nylon = "/etc/dhcp/dhclient.conf"
diff --git a/meta/recipes-connectivity/dhcp/dhcp_4.1.1-P1.bb b/meta/recipes-connectivity/dhcp/dhcp_4.1.1-P1.bb
new file mode 100644
index 0000000000..e9759de56f
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp_4.1.1-P1.bb
@@ -0,0 +1,7 @@
1require dhcp4.inc
2
3PR = "r1"
4
5SRC_URI += "file://fixincludes.patch \
6 file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
7 file://fix-client-path.patch"
diff --git a/meta/recipes-connectivity/dhcp/files/default-relay b/meta/recipes-connectivity/dhcp/files/default-relay
new file mode 100644
index 0000000000..59249db283
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/default-relay
@@ -0,0 +1,12 @@
1# Defaults for dhcp-relay initscript
2# sourced by /etc/init.d/dhcp-relay
3
4# What servers should the DHCP relay forward requests to?
5# e.g: SERVERS="192.168.0.1"
6SERVERS=""
7
8# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
9INTERFACES=""
10
11# Additional options that are passed to the DHCP relay daemon?
12OPTIONS="" \ No newline at end of file
diff --git a/meta/recipes-connectivity/dhcp/files/default-server b/meta/recipes-connectivity/dhcp/files/default-server
new file mode 100644
index 0000000000..0385d16992
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/default-server
@@ -0,0 +1,7 @@
1# Defaults for dhcp initscript
2# sourced by /etc/init.d/dhcp-server
3# installed at /etc/default/dhcp-server by the maintainer scripts
4
5# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
6# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
7INTERFACES=""
diff --git a/meta/recipes-connectivity/dhcp/files/dhclient.conf b/meta/recipes-connectivity/dhcp/files/dhclient.conf
new file mode 100644
index 0000000000..0e6dcf96c2
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/dhclient.conf
@@ -0,0 +1,50 @@
1# Configuration file for /sbin/dhclient, which is included in Debian's
2# dhcp3-client package.
3#
4# This is a sample configuration file for dhclient. See dhclient.conf's
5# man page for more information about the syntax of this file
6# and a more comprehensive list of the parameters understood by
7# dhclient.
8#
9# Normally, if the DHCP server provides reasonable information and does
10# not leave anything out (like the domain name, for example), then
11# few changes must be made to this file, if any.
12#
13
14#send host-name "andare.fugue.com";
15#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
16#send dhcp-lease-time 3600;
17#supersede domain-name "fugue.com home.vix.com";
18#prepend domain-name-servers 127.0.0.1;
19request subnet-mask, broadcast-address, time-offset, routers,
20 domain-name, domain-name-servers, host-name,
21 netbios-name-servers, netbios-scope;
22#require subnet-mask, domain-name-servers;
23#timeout 60;
24#retry 60;
25#reboot 10;
26#select-timeout 5;
27#initial-interval 2;
28#script "/etc/dhcp3/dhclient-script";
29#media "-link0 -link1 -link2", "link0 link1";
30#reject 192.33.137.209;
31
32#alias {
33# interface "eth0";
34# fixed-address 192.5.5.213;
35# option subnet-mask 255.255.255.255;
36#}
37
38#lease {
39# interface "eth0";
40# fixed-address 192.33.137.200;
41# medium "link0 link1";
42# option host-name "andare.swiftmedia.com";
43# option subnet-mask 255.255.255.0;
44# option broadcast-address 192.33.137.255;
45# option routers 192.33.137.250;
46# option domain-name-servers 127.0.0.1;
47# renew 2 2000/1/12 00:00:01;
48# rebind 2 2000/1/12 00:00:01;
49# expire 2 2000/1/12 00:00:01;
50#}
diff --git a/meta/recipes-connectivity/dhcp/files/dhcpd.conf b/meta/recipes-connectivity/dhcp/files/dhcpd.conf
new file mode 100644
index 0000000000..0001c0f00e
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/dhcpd.conf
@@ -0,0 +1,108 @@
1#
2# Sample configuration file for ISC dhcpd for Debian
3#
4# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
5#
6
7# The ddns-updates-style parameter controls whether or not the server will
8# attempt to do a DNS update when a lease is confirmed. We default to the
9# behavior of the version 2 packages ('none', since DHCP v2 didn't
10# have support for DDNS.)
11ddns-update-style none;
12
13# option definitions common to all supported networks...
14option domain-name "example.org";
15option domain-name-servers ns1.example.org, ns2.example.org;
16
17default-lease-time 600;
18max-lease-time 7200;
19
20# If this DHCP server is the official DHCP server for the local
21# network, the authoritative directive should be uncommented.
22#authoritative;
23
24# Use this to send dhcp log messages to a different log file (you also
25# have to hack syslog.conf to complete the redirection).
26log-facility local7;
27
28# No service will be given on this subnet, but declaring it helps the
29# DHCP server to understand the network topology.
30
31#subnet 10.152.187.0 netmask 255.255.255.0 {
32#}
33
34# This is a very basic subnet declaration.
35
36#subnet 10.254.239.0 netmask 255.255.255.224 {
37# range 10.254.239.10 10.254.239.20;
38# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
39#}
40
41# This declaration allows BOOTP clients to get dynamic addresses,
42# which we don't really recommend.
43
44#subnet 10.254.239.32 netmask 255.255.255.224 {
45# range dynamic-bootp 10.254.239.40 10.254.239.60;
46# option broadcast-address 10.254.239.31;
47# option routers rtr-239-32-1.example.org;
48#}
49
50# A slightly different configuration for an internal subnet.
51#subnet 10.5.5.0 netmask 255.255.255.224 {
52# range 10.5.5.26 10.5.5.30;
53# option domain-name-servers ns1.internal.example.org;
54# option domain-name "internal.example.org";
55# option routers 10.5.5.1;
56# option broadcast-address 10.5.5.31;
57# default-lease-time 600;
58# max-lease-time 7200;
59#}
60
61# Hosts which require special configuration options can be listed in
62# host statements. If no address is specified, the address will be
63# allocated dynamically (if possible), but the host-specific information
64# will still come from the host declaration.
65
66#host passacaglia {
67# hardware ethernet 0:0:c0:5d:bd:95;
68# filename "vmunix.passacaglia";
69# server-name "toccata.fugue.com";
70#}
71
72# Fixed IP addresses can also be specified for hosts. These addresses
73# should not also be listed as being available for dynamic assignment.
74# Hosts for which fixed IP addresses have been specified can boot using
75# BOOTP or DHCP. Hosts for which no fixed address is specified can only
76# be booted with DHCP, unless there is an address range on the subnet
77# to which a BOOTP client is connected which has the dynamic-bootp flag
78# set.
79#host fantasia {
80# hardware ethernet 08:00:07:26:c0:a5;
81# fixed-address fantasia.fugue.com;
82#}
83
84# You can declare a class of clients and then do address allocation
85# based on that. The example below shows a case where all clients
86# in a certain class get addresses on the 10.17.224/24 subnet, and all
87# other clients get addresses on the 10.0.29/24 subnet.
88
89#class "foo" {
90# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
91#}
92
93#shared-network 224-29 {
94# subnet 10.17.224.0 netmask 255.255.255.0 {
95# option routers rtr-224.example.org;
96# }
97# subnet 10.0.29.0 netmask 255.255.255.0 {
98# option routers rtr-29.example.org;
99# }
100# pool {
101# allow members of "foo";
102# range 10.17.224.10 10.17.224.250;
103# }
104# pool {
105# deny members of "foo";
106# range 10.0.29.10 10.0.29.230;
107# }
108#}
diff --git a/meta/recipes-connectivity/dhcp/files/init-relay b/meta/recipes-connectivity/dhcp/files/init-relay
new file mode 100644
index 0000000000..019a7e84cf
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/init-relay
@@ -0,0 +1,44 @@
1#!/bin/sh
2#
3# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
4#
5
6# It is not safe to start if we don't have a default configuration...
7if [ ! -f /etc/default/dhcp-relay ]; then
8 echo "/etc/default/dhcp-relay does not exist! - Aborting..."
9 echo "create this file to fix the problem."
10 exit 1
11fi
12
13# Read init script configuration (interfaces the daemon should listen on
14# and the DHCP server we should forward requests to.)
15. /etc/default/dhcp-relay
16
17# Build command line for interfaces (will be passed to dhrelay below.)
18IFCMD=""
19if test "$INTERFACES" != ""; then
20 for I in $INTERFACES; do
21 IFCMD=${IFCMD}"-i "${I}" "
22 done
23fi
24
25DHCRELAYPID=/var/run/dhcrelay.pid
26
27case "$1" in
28 start)
29 start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
30 ;;
31 stop)
32 start-stop-daemon -K -x /usr/sbin/dhcrelay
33 ;;
34 restart | force-reload)
35 $0 stop
36 sleep 2
37 $0 start
38 ;;
39 *)
40 echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}"
41 exit 1
42esac
43
44exit 0
diff --git a/meta/recipes-connectivity/dhcp/files/init-server b/meta/recipes-connectivity/dhcp/files/init-server
new file mode 100644
index 0000000000..34c20852b9
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/init-server
@@ -0,0 +1,44 @@
1#!/bin/sh
2#
3# $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $
4#
5
6test -f /usr/sbin/dhcpd || exit 0
7
8# It is not safe to start if we don't have a default configuration...
9if [ ! -f /etc/default/dhcp-server ]; then
10 echo "/etc/default/dhcp-server does not exist! - Aborting..."
11 exit 0
12fi
13
14# Read init script configuration (so far only interfaces the daemon
15# should listen on.)
16. /etc/default/dhcp-server
17
18case "$1" in
19 start)
20 echo -n "Starting DHCP server: "
21 test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/
22 test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases
23 start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES
24 echo "."
25 ;;
26 stop)
27 echo -n "Stopping DHCP server: dhcpd3"
28 start-stop-daemon -K -x /usr/sbin/dhcpd
29 echo "."
30 ;;
31 restart | force-reload)
32 $0 stop
33 sleep 2
34 $0 start
35 if [ "$?" != "0" ]; then
36 exit 1
37 fi
38 ;;
39 *)
40 echo "Usage: /etc/init.d/dhcp-server {start|stop|restart|force-reload}"
41 exit 1
42esac
43
44exit 0