summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/dhcp
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-09 20:59:03 (GMT)
committerTudor Florea <tudor.florea@enea.com>2015-10-09 20:59:03 (GMT)
commit972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch)
tree97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-connectivity/dhcp
downloadpoky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-connectivity/dhcp')
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp.inc115
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch70
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp/dhcp-3.0.3-dhclient-dbus.patch86
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp/fix-external-bind.patch112
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp/fixsepbuild.patch90
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp/link-with-lcrypto.patch25
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp/replace-ifconfig-route.patch176
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp/site.h21
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp_4.3.0.bb12
-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/dhcpd.service11
-rw-r--r--meta/recipes-connectivity/dhcp/files/dhcrelay.service9
-rw-r--r--meta/recipes-connectivity/dhcp/files/init-relay44
-rw-r--r--meta/recipes-connectivity/dhcp/files/init-server44
17 files changed, 992 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/dhcp/dhcp.inc b/meta/recipes-connectivity/dhcp/dhcp.inc
new file mode 100644
index 0000000..4949e02
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp.inc
@@ -0,0 +1,115 @@
1SECTION = "console/network"
2SUMMARY = "Internet Software Consortium DHCP package"
3DESCRIPTION = "DHCP (Dynamic Host Configuration Protocol) is a protocol \
4which allows individual devices on an IP network to get their own \
5network configuration information from a server. DHCP helps make it \
6easier to administer devices."
7
8HOMEPAGE = "http://www.isc.org/"
9
10LICENSE = "ISC"
11LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=c5c64d696107f84b56fe337d14da1753"
12
13DEPENDS = "openssl bind"
14
15SRC_URI = "ftp://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
16 file://site.h \
17 file://init-relay file://default-relay \
18 file://init-server file://default-server \
19 file://dhclient.conf file://dhcpd.conf \
20 file://dhcpd.service file://dhcrelay.service"
21
22inherit autotools systemd
23
24SYSTEMD_PACKAGES = "${PN}-server ${PN}-relay"
25SYSTEMD_SERVICE_${PN}-server = "dhcpd.service"
26SYSTEMD_AUTO_ENABLE_${PN}-server = "disable"
27
28SYSTEMD_SERVICE_${PN}-relay = "dhcrelay.service"
29SYSTEMD_AUTO_ENABLE_${PN}-relay = "disable"
30
31TARGET_CFLAGS += "-D_GNU_SOURCE"
32EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \
33 --with-srv6-lease-file=${localstatedir}/lib/dhcp/dhcpd6.leases \
34 --with-cli-lease-file=${localstatedir}/lib/dhcp/dhclient.leases \
35 --with-cli6-lease-file=${localstatedir}/lib/dhcp/dhclient6.leases \
36 --with-libbind=${STAGING_LIBDIR}/ \
37 "
38
39do_compile_prepend () {
40 cp -f ${WORKDIR}/site.h ${S}/includes
41}
42
43do_install_append () {
44 install -d ${D}${sysconfdir}/init.d
45 install -d ${D}${sysconfdir}/default
46 install -d ${D}${sysconfdir}/dhcp
47 install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
48 install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
49 install -m 0755 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server
50 install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server
51
52 rm -f ${D}${sysconfdir}/dhclient.conf*
53 rm -f ${D}${sysconfdir}/dhcpd.conf*
54 install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf
55 install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf
56
57 install -d ${D}${base_sbindir}/
58 if [ "${sbindir}" != "${base_sbindir}" ]; then
59 mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
60 fi
61 install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
62
63 # Install systemd unit files
64 install -d ${D}${systemd_unitdir}/system
65 install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system
66 install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system
67 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd.service ${D}${systemd_unitdir}/system/dhcrelay.service
68 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcpd.service
69}
70
71PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell"
72
73FILES_${PN} = ""
74RDEPENDS_${PN}-dev = ""
75RDEPENDS_${PN}-staticdev = ""
76
77FILES_dhcp-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server"
78RRECOMMENDS_dhcp-server = "dhcp-server-config"
79
80FILES_dhcp-server-config = "${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp/dhcpd.conf"
81
82FILES_dhcp-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay"
83
84FILES_dhcp-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf"
85RDEPENDS_dhcp-client = "bash"
86
87FILES_dhcp-omshell = "${bindir}/omshell"
88
89pkg_postinst_dhcp-server() {
90 mkdir -p $D/${localstatedir}/lib/dhcp
91 touch $D/${localstatedir}/lib/dhcp/dhcpd.leases
92 touch $D/${localstatedir}/lib/dhcp/dhcpd6.leases
93}
94
95pkg_postinst_dhcp-client() {
96 mkdir -p $D/${localstatedir}/lib/dhcp
97}
98
99pkg_postrm_dhcp-server() {
100 rm -f $D/${localstatedir}/lib/dhcp/dhcpd.leases
101 rm -f $D/${localstatedir}/lib/dhcp/dhcpd6.leases
102
103 if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then
104 echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty."
105 fi
106}
107
108pkg_postrm_dhcp-client() {
109 rm -f $D/${localstatedir}/lib/dhcp/dhclient.leases
110 rm -f $D/${localstatedir}/lib/dhcp/dhclient6.leases
111
112 if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then
113 echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty."
114 fi
115}
diff --git a/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch b/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
new file mode 100644
index 0000000..47ea555
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
@@ -0,0 +1,70 @@
1dhcp-client: fix invoke dhclient-script failed on Read-only file system
2
3In read-only file system, '/etc' is on the readonly partition,
4and '/etc/resolv.conf' is symlinked to a separate writable
5partition.
6
7In this situation, we should use shell variable to instead of
8temp files '/etc/resolv.conf.dhclient' and '/etc/resolv.conf.dhclient6'.
9
10Upstream-Status: Pending
11Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
12---
13 client/scripts/linux | 20 +++++++++-----------
14 1 file changed, 9 insertions(+), 11 deletions(-)
15
16diff --git a/client/scripts/linux b/client/scripts/linux
17--- a/client/scripts/linux
18+++ b/client/scripts/linux
19@@ -27,27 +27,25 @@ ip=/sbin/ip
20
21 make_resolv_conf() {
22 if [ x"$new_domain_name_servers" != x ]; then
23- cat /dev/null > /etc/resolv.conf.dhclient
24- chmod 644 /etc/resolv.conf.dhclient
25+ resolv_conf=""
26 if [ x"$new_domain_search" != x ]; then
27- echo search $new_domain_search >> /etc/resolv.conf.dhclient
28+ resolv_conf="search ${new_domain_search}\n"
29 elif [ x"$new_domain_name" != x ]; then
30 # Note that the DHCP 'Domain Name Option' is really just a domain
31 # name, and that this practice of using the domain name option as
32 # a search path is both nonstandard and deprecated.
33- echo search $new_domain_name >> /etc/resolv.conf.dhclient
34+ resolv_conf="search ${new_domain_name}\n"
35 fi
36 for nameserver in $new_domain_name_servers; do
37- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
38+ resolv_conf="${resolv_conf}nameserver ${nameserver}\n"
39 done
40
41- mv /etc/resolv.conf.dhclient /etc/resolv.conf
42+ echo -e "${resolv_conf}" > /etc/resolv.conf
43 elif [ "x${new_dhcp6_name_servers}" != x ] ; then
44- cat /dev/null > /etc/resolv.conf.dhclient6
45- chmod 644 /etc/resolv.conf.dhclient6
46+ resolv_conf=""
47
48 if [ "x${new_dhcp6_domain_search}" != x ] ; then
49- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
50+ resolv_conf="search ${new_dhcp6_domain_search}\n"
51 fi
52 shopt -s nocasematch
53 for nameserver in ${new_dhcp6_name_servers} ; do
54@@ -59,11 +57,11 @@ make_resolv_conf() {
55 else
56 zone_id=
57 fi
58- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
59+ resolv_conf="${resolv_conf}nameserver ${nameserver}$zone_id\n"
60 done
61 shopt -u nocasematch
62
63- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
64+ echo -e "${resolv_conf}" > /etc/resolv.conf
65 fi
66 }
67
68--
691.8.1.2
70
diff --git a/meta/recipes-connectivity/dhcp/dhcp/dhcp-3.0.3-dhclient-dbus.patch b/meta/recipes-connectivity/dhcp/dhcp/dhcp-3.0.3-dhclient-dbus.patch
new file mode 100644
index 0000000..b4a666d
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/dhcp-3.0.3-dhclient-dbus.patch
@@ -0,0 +1,86 @@
1Upstream-Status: Inappropriate [distribution]
2
3--- client/scripts/bsdos
4+++ client/scripts/bsdos
5@@ -47,6 +47,11 @@
6 . /etc/dhcp/dhclient-exit-hooks
7 fi
8 # probably should do something with exit status of the local script
9+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
10+ dbus-send --system --dest=com.redhat.dhcp \
11+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
12+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
13+ fi
14 exit $exit_status
15 }
16
17--- client/scripts/freebsd
18+++ client/scripts/freebsd
19@@ -57,6 +57,11 @@
20 . /etc/dhcp/dhclient-exit-hooks
21 fi
22 # probably should do something with exit status of the local script
23+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
24+ dbus-send --system --dest=com.redhat.dhcp \
25+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
26+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
27+ fi
28 exit $exit_status
29 }
30
31--- client/scripts/linux
32+++ client/scripts/linux
33@@ -69,6 +69,11 @@
34 . /etc/dhcp/dhclient-exit-hooks
35 fi
36 # probably should do something with exit status of the local script
37+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
38+ dbus-send --system --dest=com.redhat.dhcp \
39+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
40+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
41+ fi
42 exit $exit_status
43 }
44
45--- client/scripts/netbsd
46+++ client/scripts/netbsd
47@@ -47,6 +47,11 @@
48 . /etc/dhcp/dhclient-exit-hooks
49 fi
50 # probably should do something with exit status of the local script
51+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
52+ dbus-send --system --dest=com.redhat.dhcp \
53+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
54+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
55+ fi
56 exit $exit_status
57 }
58
59--- client/scripts/openbsd
60+++ client/scripts/openbsd
61@@ -47,6 +47,11 @@
62 . /etc/dhcp/dhclient-exit-hooks
63 fi
64 # probably should do something with exit status of the local script
65+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
66+ dbus-send --system --dest=com.redhat.dhcp \
67+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
68+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
69+ fi
70 exit $exit_status
71 }
72
73--- client/scripts/solaris
74+++ client/scripts/solaris
75@@ -47,6 +47,11 @@
76 . /etc/dhcp/dhclient-exit-hooks
77 fi
78 # probably should do something with exit status of the local script
79+ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
80+ dbus-send --system --dest=com.redhat.dhcp \
81+ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
82+ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
83+ fi
84 exit $exit_status
85 }
86
diff --git a/meta/recipes-connectivity/dhcp/dhcp/fix-external-bind.patch b/meta/recipes-connectivity/dhcp/dhcp/fix-external-bind.patch
new file mode 100644
index 0000000..a291fda
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/fix-external-bind.patch
@@ -0,0 +1,112 @@
1Upstream-Status: Pending
2
311/30/2010
4--with-libbind=PATH is available but not used by Makefile,
5this patch is to allow building with external bind
6
7Signed-off-by: Qing He <qing.he@intel.com>
8
9Index: dhcp-4.3.0/Makefile.am
10===================================================================
11--- dhcp-4.3.0.orig/Makefile.am
12+++ dhcp-4.3.0/Makefile.am
13@@ -25,7 +25,7 @@ EXTRA_DIST = RELNOTES LICENSE \
14 bind/Makefile bind/bind.tar.gz bind/version.tmp \
15 common/tests/Atffile server/tests/Atffile
16
17-SUBDIRS = bind includes tests common dst omapip client dhcpctl relay server
18+SUBDIRS = includes tests common dst omapip client dhcpctl relay server
19
20 nobase_include_HEADERS = dhcpctl/dhcpctl.h
21
22Index: dhcp-4.3.0/client/Makefile.am
23===================================================================
24--- dhcp-4.3.0.orig/client/Makefile.am
25+++ dhcp-4.3.0/client/Makefile.am
26@@ -4,8 +4,8 @@ dhclient_SOURCES = clparse.c dhclient.c
27 scripts/bsdos scripts/freebsd scripts/linux scripts/macos \
28 scripts/netbsd scripts/nextstep scripts/openbsd \
29 scripts/solaris scripts/openwrt
30-dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a ../bind/lib/libirs.a \
31- ../bind/lib/libdns.a ../bind/lib/libisccfg.a ../bind/lib/libisc.a
32+dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a $(libbind)/libirs.a \
33+ $(libbind)/libdns.a $(libbind)/libisccfg.a $(libbind)/libisc.a
34 man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
35 EXTRA_DIST = $(man_MANS)
36
37Index: dhcp-4.3.0/configure.ac
38===================================================================
39--- dhcp-4.3.0.orig/configure.ac
40+++ dhcp-4.3.0/configure.ac
41@@ -566,6 +566,7 @@ no)
42 libbind="$use_libbind"
43 ;;
44 esac
45+AC_SUBST([libbind])
46
47 # OpenLDAP support.
48 AC_ARG_WITH(ldap,
49Index: dhcp-4.3.0/dhcpctl/Makefile.am
50===================================================================
51--- dhcp-4.3.0.orig/dhcpctl/Makefile.am
52+++ dhcp-4.3.0/dhcpctl/Makefile.am
53@@ -6,12 +6,12 @@ EXTRA_DIST = $(man_MANS)
54
55 omshell_SOURCES = omshell.c
56 omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
57- ../bind/lib/libirs.a ../bind/lib/libdns.a \
58- ../bind/lib/libisccfg.a ../bind/lib/libisc.a
59+ $(libbind)/libirs.a $(libbind)/libdns.a \
60+ $(libbind)/libisccfg.a $(libbind)/libisc.a
61
62 libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
63
64 cltest_SOURCES = cltest.c
65 cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
66- ../bind/lib/libirs.a ../bind/lib/libdns.a \
67- ../bind/lib/libisccfg.a ../bind/lib/libisc.a
68+ $(libbind)/libirs.a $(libbind)/libdns.a \
69+ $(libbind)/libisccfg.a $(libbind)/libisc.a
70Index: dhcp-4.3.0/omapip/Makefile.am
71===================================================================
72--- dhcp-4.3.0.orig/omapip/Makefile.am
73+++ dhcp-4.3.0/omapip/Makefile.am
74@@ -10,6 +10,6 @@ man_MANS = omapi.3
75 EXTRA_DIST = $(man_MANS)
76
77 svtest_SOURCES = test.c
78-svtest_LDADD = libomapi.a ../bind/lib/libirs.a ../bind/lib/libdns.a \
79- ../bind/lib/libisccfg.a ../bind/lib/libisc.a
80+svtest_LDADD = libomapi.a $(libbind)/libirs.a $(libbind)/libdns.a \
81+ $(libbind)/libisccfg.a $(libbind)/libisc.a
82
83Index: dhcp-4.3.0/relay/Makefile.am
84===================================================================
85--- dhcp-4.3.0.orig/relay/Makefile.am
86+++ dhcp-4.3.0/relay/Makefile.am
87@@ -3,8 +3,8 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localst
88 sbin_PROGRAMS = dhcrelay
89 dhcrelay_SOURCES = dhcrelay.c
90 dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
91- ../bind/lib/libirs.a ../bind/lib/libdns.a \
92- ../bind/lib/libisccfg.a ../bind/lib/libisc.a
93+ $(libbind)/libirs.a $(libbind)/libdns.a \
94+ $(libbind)/libisccfg.a $(libbind)/libisc.a
95 man_MANS = dhcrelay.8
96 EXTRA_DIST = $(man_MANS)
97
98Index: dhcp-4.3.0/server/Makefile.am
99===================================================================
100--- dhcp-4.3.0.orig/server/Makefile.am
101+++ dhcp-4.3.0/server/Makefile.am
102@@ -14,8 +14,8 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c
103
104 dhcpd_CFLAGS = $(LDAP_CFLAGS)
105 dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
106- ../dhcpctl/libdhcpctl.a ../bind/lib/libirs.a \
107- ../bind/lib/libdns.a ../bind/lib/libisccfg.a ../bind/lib/libisc.a
108+ ../dhcpctl/libdhcpctl.a $(libbind)/libirs.a \
109+ $(libbind)/libdns.a $(libbind)/libisccfg.a $(libbind)/libisc.a
110
111 man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
112 EXTRA_DIST = $(man_MANS)
diff --git a/meta/recipes-connectivity/dhcp/dhcp/fixsepbuild.patch b/meta/recipes-connectivity/dhcp/dhcp/fixsepbuild.patch
new file mode 100644
index 0000000..e686afd
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/fixsepbuild.patch
@@ -0,0 +1,90 @@
1Fix out of tree builds
2
3Upstream-Status: Pending
4
5RP 2013/03/21
6
7Index: dhcp-4.2.5/common/Makefile.am
8===================================================================
9--- dhcp-4.2.5.orig/common/Makefile.am 2013-03-21 12:54:11.345063519 +0000
10+++ dhcp-4.2.5/common/Makefile.am 2013-03-21 12:54:11.805063510 +0000
11@@ -1,4 +1,4 @@
12-AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
13+AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"'
14 AM_CFLAGS = $(LDAP_CFLAGS)
15
16 noinst_LIBRARIES = libdhcp.a
17Index: dhcp-4.2.5/dst/Makefile.am
18===================================================================
19--- dhcp-4.2.5.orig/dst/Makefile.am 2013-03-21 12:54:11.345063519 +0000
20+++ dhcp-4.2.5/dst/Makefile.am 2013-03-21 12:54:11.805063510 +0000
21@@ -1,4 +1,4 @@
22-AM_CPPFLAGS = -DMINIRES_LIB -DHMAC_MD5
23+AM_CPPFLAGS = -DMINIRES_LIB -DHMAC_MD5 -I$(top_srcdir)/includes
24
25 lib_LIBRARIES = libdst.a
26
27Index: dhcp-4.2.5/omapip/Makefile.am
28===================================================================
29--- dhcp-4.2.5.orig/omapip/Makefile.am 2013-03-21 12:54:11.677063511 +0000
30+++ dhcp-4.2.5/omapip/Makefile.am 2013-03-21 12:54:11.809063510 +0000
31@@ -1,3 +1,5 @@
32+AM_CPPFLAGS = -I$(top_srcdir)/includes
33+
34 lib_LIBRARIES = libomapi.a
35 noinst_PROGRAMS = svtest
36
37Index: dhcp-4.2.5/client/Makefile.am
38===================================================================
39--- dhcp-4.2.5.orig/client/Makefile.am 2013-03-21 12:54:11.677063511 +0000
40+++ dhcp-4.2.5/client/Makefile.am 2013-03-21 12:54:11.809063510 +0000
41@@ -1,3 +1,5 @@
42+AM_CPPFLAGS = -I$(top_srcdir)/includes
43+
44 dist_sysconf_DATA = dhclient.conf.example
45 sbin_PROGRAMS = dhclient
46 dhclient_SOURCES = clparse.c dhclient.c dhc6.c \
47@@ -11,8 +13,8 @@
48
49 dhclient.o: dhclient.c
50 $(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
51- -DLOCALSTATEDIR='"$(localstatedir)"' -c dhclient.c
52+ -DLOCALSTATEDIR='"$(localstatedir)"' -c $(srcdir)/dhclient.c
53
54 dhc6.o: dhc6.c
55 $(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
56- -DLOCALSTATEDIR='"$(localstatedir)"' -c dhc6.c
57+ -DLOCALSTATEDIR='"$(localstatedir)"' -c $(srcdir)/dhc6.c
58Index: dhcp-4.2.5/dhcpctl/Makefile.am
59===================================================================
60--- dhcp-4.2.5.orig/dhcpctl/Makefile.am 2013-03-21 12:54:11.677063511 +0000
61+++ dhcp-4.2.5/dhcpctl/Makefile.am 2013-03-21 12:54:11.809063510 +0000
62@@ -1,3 +1,5 @@
63+AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir)
64+
65 bin_PROGRAMS = omshell
66 lib_LIBRARIES = libdhcpctl.a
67 noinst_PROGRAMS = cltest
68Index: dhcp-4.2.5/relay/Makefile.am
69===================================================================
70--- dhcp-4.2.5.orig/relay/Makefile.am 2013-03-21 12:54:11.677063511 +0000
71+++ dhcp-4.2.5/relay/Makefile.am 2013-03-21 12:54:11.809063510 +0000
72@@ -1,4 +1,4 @@
73-AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'
74+AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
75
76 sbin_PROGRAMS = dhcrelay
77 dhcrelay_SOURCES = dhcrelay.c
78Index: dhcp-4.2.5/server/Makefile.am
79===================================================================
80--- dhcp-4.2.5.orig/server/Makefile.am 2013-03-21 12:54:11.677063511 +0000
81+++ dhcp-4.2.5/server/Makefile.am 2013-03-21 12:55:01.509062081 +0000
82@@ -4,7 +4,7 @@
83 # production code. Sadly, we are not there yet.
84 SUBDIRS = . tests
85
86-AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
87+AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
88
89 dist_sysconf_DATA = dhcpd.conf.example
90 sbin_PROGRAMS = dhcpd
diff --git a/meta/recipes-connectivity/dhcp/dhcp/link-with-lcrypto.patch b/meta/recipes-connectivity/dhcp/dhcp/link-with-lcrypto.patch
new file mode 100644
index 0000000..57e10b0
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/link-with-lcrypto.patch
@@ -0,0 +1,25 @@
1Author: Andrei Gherzan <andrei@gherzan.ro>
2Date: Thu Feb 2 23:59:11 2012 +0200
3
4From 4.2.0 final release, -lcrypto check was removed and we compile static libraries
5from bind that are linked to libcrypto. This is why i added a patch in order to add
6-lcrypto to LIBS.
7
8Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
9Upstream-Status: Pending
10
11Index: dhcp-4.2.3-P2-r0/dhcp-4.2.3-P2/configure.ac
12===================================================================
13--- dhcp-4.2.3-P2.orig/configure.ac 2012-02-02 18:04:20.843023196 +0200
14+++ dhcp-4.2.3-P2/configure.ac 2012-02-02 17:58:16.000000000 +0200
15@@ -456,6 +456,10 @@
16 # Look for optional headers.
17 AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
18
19+# find an MD5 library
20+AC_SEARCH_LIBS(MD5_Init, [crypto])
21+AC_SEARCH_LIBS(MD5Init, [crypto])
22+
23 # Solaris needs some libraries for functions
24 AC_SEARCH_LIBS(socket, [socket])
25 AC_SEARCH_LIBS(inet_ntoa, [nsl])
diff --git a/meta/recipes-connectivity/dhcp/dhcp/replace-ifconfig-route.patch b/meta/recipes-connectivity/dhcp/dhcp/replace-ifconfig-route.patch
new file mode 100644
index 0000000..61dd6a7
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/replace-ifconfig-route.patch
@@ -0,0 +1,176 @@
1Found this patch here:
2https://lists.isc.org/pipermail/dhcp-users/2011-January/012910.html
3
4and made some adjustments/updates to make it work with this version.
5Wasn't able to find that why this patch was not accepted by ISC DHCP developers.
6
7Upstream-Status: Pending
8
9Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
10
11--- dhcp-4.2.5-P1/client/scripts/linux.orig 2013-09-04 12:22:55.000000000 +0500
12+++ dhcp-4.2.5-P1/client/scripts/linux 2013-09-04 12:52:19.068761518 +0500
13@@ -103,17 +103,11 @@
14 if [ x$old_broadcast_address != x ]; then
15 old_broadcast_arg="broadcast $old_broadcast_address"
16 fi
17-if [ x$new_subnet_mask != x ]; then
18- new_subnet_arg="netmask $new_subnet_mask"
19-fi
20-if [ x$old_subnet_mask != x ]; then
21- old_subnet_arg="netmask $old_subnet_mask"
22-fi
23-if [ x$alias_subnet_mask != x ]; then
24- alias_subnet_arg="netmask $alias_subnet_mask"
25+if [ -n "$new_subnet_mask" ]; then
26+ new_mask="/$new_subnet_mask"
27 fi
28-if [ x$new_interface_mtu != x ]; then
29- mtu_arg="mtu $new_interface_mtu"
30+if [ -n "$alias_subnet_mask" ]; then
31+ alias_mask="/$alias_subnet_mask"
32 fi
33 if [ x$IF_METRIC != x ]; then
34 metric_arg="metric $IF_METRIC"
35@@ -127,9 +121,9 @@
36 if [ x$reason = xPREINIT ]; then
37 if [ x$alias_ip_address != x ]; then
38 # Bring down alias interface. Its routes will disappear too.
39- ifconfig $interface:0- inet 0
40+ ${ip} -4 addr flush dev ${interface} label ${interface}:0
41 fi
42- ifconfig $interface 0 up
43+ ${ip} link set dev ${interface} up
44
45 # We need to give the kernel some time to get the interface up.
46 sleep 1
47@@ -156,25 +150,30 @@
48 if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
49 [ x$alias_ip_address != x$old_ip_address ]; then
50 # Possible new alias. Remove old alias.
51- ifconfig $interface:0- inet 0
52+ ${ip} -4 addr flush dev ${interface} label ${interface}:0
53 fi
54 if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
55 # IP address changed. Bringing down the interface will delete all routes,
56 # and clear the ARP cache.
57- ifconfig $interface inet 0 down
58+ ${ip} -4 addr flush dev ${interface} label ${interface}
59
60 fi
61 if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
62 [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
63
64- ifconfig $interface inet $new_ip_address $new_subnet_arg \
65- $new_broadcast_arg $mtu_arg
66+ ${ip} -4 addr add ${new_ip_address}${new_mask} ${new_broadcast_arg} \
67+ dev ${interface} label ${interface}
68+ if [ -n "$new_interface_mtu" ]; then
69+ # set MTU
70+ ${ip} link set dev ${interface} mtu ${new_interface_mtu}
71+ fi
72 # Add a network route to the computed network address.
73 for router in $new_routers; do
74 if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
75- route add -host $router dev $interface
76+ ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
77 fi
78- route add default gw $router $metric_arg dev $interface
79+ ${ip} -4 route add default via ${router} dev ${interface} \
80+ ${metric_arg} >/dev/null 2>&1
81 done
82 else
83 # we haven't changed the address, have we changed other options
84@@ -182,21 +181,23 @@
85 if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then
86 # if we've changed routers delete the old and add the new.
87 for router in $old_routers; do
88- route del default gw $router
89+ ${ip} -4 route delete default via ${router}
90 done
91 for router in $new_routers; do
92 if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
93- route add -host $router dev $interface
94- fi
95- route add default gw $router $metric_arg dev $interface
96+ ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
97+ fi
98+ ${ip} -4 route add default via ${router} dev ${interface} \
99+ ${metric_arg} >/dev/null 2>&1
100 done
101 fi
102 fi
103 if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
104 then
105- ifconfig $interface:0- inet 0
106- ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
107- route add -host $alias_ip_address $interface:0
108+ ${ip} -4 addr flush dev ${interface} label ${interface}:0
109+ ${ip} -4 addr add ${alias_ip_address}${alias_mask} \
110+ dev ${interface} label ${interface}:0
111+ ${ip} -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
112 fi
113 make_resolv_conf
114 exit_with_hooks 0
115@@ -206,42 +207,49 @@
116 || [ x$reason = xSTOP ]; then
117 if [ x$alias_ip_address != x ]; then
118 # Turn off alias interface.
119- ifconfig $interface:0- inet 0
120+ ${ip} -4 addr flush dev ${interface} label ${interface}:0
121 fi
122 if [ x$old_ip_address != x ]; then
123 # Shut down interface, which will delete routes and clear arp cache.
124- ifconfig $interface inet 0 down
125+ ${ip} -4 addr flush dev ${interface} label ${interface}
126 fi
127 if [ x$alias_ip_address != x ]; then
128- ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
129- route add -host $alias_ip_address $interface:0
130+ ${ip} -4 addr add ${alias_ip_address}${alias_network_arg} \
131+ dev ${interface} label ${interface}:0
132+ ${ip} -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
133 fi
134 exit_with_hooks 0
135 fi
136
137 if [ x$reason = xTIMEOUT ]; then
138 if [ x$alias_ip_address != x ]; then
139- ifconfig $interface:0- inet 0
140+ ${ip} -4 addr flush dev ${interface} label ${interface}:0
141+ fi
142+ ${ip} -4 addr add ${new_ip_address}${new_mask} ${new_broadcast_arg} \
143+ dev ${interface} label ${interface}
144+ if [ -n "$new_interface_mtu" ]; then
145+ # set MTU
146+ ip link set dev ${interface} mtu ${new_interface_mtu}
147 fi
148- ifconfig $interface inet $new_ip_address $new_subnet_arg \
149- $new_broadcast_arg $mtu_arg
150 set $new_routers
151 if ping -q -c 1 $1; then
152 if [ x$new_ip_address != x$alias_ip_address ] && \
153 [ x$alias_ip_address != x ]; then
154- ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
155- route add -host $alias_ip_address dev $interface:0
156+ ${ip} -4 addr add ${alias_ip_address}${alias_mask} \
157+ dev ${interface} label ${interface}:0
158+ ${ip} -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
159 fi
160 for router in $new_routers; do
161 if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
162- route add -host $router dev $interface
163+ ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
164 fi
165- route add default gw $router $metric_arg dev $interface
166+ ${ip} -4 route add default via ${router} dev ${interface} \
167+ ${metric_arg} >/dev/null 2>&1
168 done
169 make_resolv_conf
170 exit_with_hooks 0
171 fi
172- ifconfig $interface inet 0 down
173+ ${ip} -4 addr flush dev ${interface}
174 exit_with_hooks 1
175 fi
176
diff --git a/meta/recipes-connectivity/dhcp/dhcp/site.h b/meta/recipes-connectivity/dhcp/dhcp/site.h
new file mode 100644
index 0000000..2289554
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/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/dhcp_4.3.0.bb b/meta/recipes-connectivity/dhcp/dhcp_4.3.0.bb
new file mode 100644
index 0000000..13bcceb
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp_4.3.0.bb
@@ -0,0 +1,12 @@
1require dhcp.inc
2
3SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
4 file://fix-external-bind.patch \
5 file://link-with-lcrypto.patch \
6 file://fixsepbuild.patch \
7 file://dhclient-script-drop-resolv.conf.dhclient.patch \
8 file://replace-ifconfig-route.patch \
9 "
10
11SRC_URI[md5sum] = "1020d77e1a4c1f01b76279caff9beb80"
12SRC_URI[sha256sum] = "a7b6517d5cf32c5e49d2323a63de00efe5391df7cb0045dfa0ec8f6ee46ebe8a"
diff --git a/meta/recipes-connectivity/dhcp/files/default-relay b/meta/recipes-connectivity/dhcp/files/default-relay
new file mode 100644
index 0000000..7961f01
--- /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=""
diff --git a/meta/recipes-connectivity/dhcp/files/default-server b/meta/recipes-connectivity/dhcp/files/default-server
new file mode 100644
index 0000000..0385d16
--- /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 0000000..0e6dcf9
--- /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 0000000..0001c0f
--- /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/dhcpd.service b/meta/recipes-connectivity/dhcp/files/dhcpd.service
new file mode 100644
index 0000000..8648f1a2
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/dhcpd.service
@@ -0,0 +1,11 @@
1[Unit]
2Description=DHCP Server Daemon
3After=network.target
4After=time-sync.target
5
6[Service]
7EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
8ExecStart=-@SBINDIR@/dhcpd -q $INTERFACES
9
10[Install]
11WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/dhcp/files/dhcrelay.service b/meta/recipes-connectivity/dhcp/files/dhcrelay.service
new file mode 100644
index 0000000..a2d8189
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/dhcrelay.service
@@ -0,0 +1,9 @@
1[Unit]
2Description=DHCP Relay Agent Daemon
3After=network.target
4
5[Service]
6ExecStart=@SBINDIR@/dhcrelay -d --no-pid
7
8[Install]
9WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/dhcp/files/init-relay b/meta/recipes-connectivity/dhcp/files/init-relay
new file mode 100644
index 0000000..019a7e8
--- /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 0000000..34c2085
--- /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