summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/dhcp/dhcp
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/dhcp/dhcp')
-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/site.h21
6 files changed, 404 insertions, 0 deletions
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 0000000000..47ea5554b8
--- /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 0000000000..b4a666d106
--- /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 0000000000..a291fdaf52
--- /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 0000000000..e686afd2d2
--- /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 0000000000..57e10b0297
--- /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/site.h b/meta/recipes-connectivity/dhcp/dhcp/site.h
new file mode 100644
index 0000000000..2289554ef3
--- /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"