diff options
Diffstat (limited to 'meta/recipes-connectivity/dhcp')
-rw-r--r-- | meta/recipes-connectivity/dhcp/dhcp.inc | 23 | ||||
-rw-r--r-- | meta/recipes-connectivity/dhcp/files/dhcpd.service | 11 | ||||
-rw-r--r-- | meta/recipes-connectivity/dhcp/files/dhcrelay.service | 9 |
3 files changed, 39 insertions, 4 deletions
diff --git a/meta/recipes-connectivity/dhcp/dhcp.inc b/meta/recipes-connectivity/dhcp/dhcp.inc index 512127cd4c..a1752548be 100644 --- a/meta/recipes-connectivity/dhcp/dhcp.inc +++ b/meta/recipes-connectivity/dhcp/dhcp.inc | |||
@@ -14,11 +14,19 @@ DEPENDS = "openssl bind" | |||
14 | 14 | ||
15 | SRC_URI = "ftp://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \ | 15 | SRC_URI = "ftp://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \ |
16 | file://site.h \ | 16 | file://site.h \ |
17 | file://init-relay file://default-relay \ | 17 | file://init-relay file://default-relay \ |
18 | file://init-server file://default-server \ | 18 | file://init-server file://default-server \ |
19 | file://dhclient.conf file://dhcpd.conf" | 19 | file://dhclient.conf file://dhcpd.conf \ |
20 | file://dhcpd.service file://dhcrelay.service" | ||
20 | 21 | ||
21 | inherit autotools | 22 | inherit autotools systemd |
23 | |||
24 | SYSTEMD_PACKAGES = "dhcp-server dhcp-relay" | ||
25 | SYSTEMD_SERVICE_dhcp-server = "dhcpd.service" | ||
26 | SYSTEMD_AUTO_ENABLE_dhcp-server = "disable" | ||
27 | |||
28 | SYSTEMD_SERVICE_dhcp-relay = "dhcrelay.service" | ||
29 | SYSTEMD_AUTO_ENABLE_dhcp-relay = "disable" | ||
22 | 30 | ||
23 | TARGET_CFLAGS += "-D_GNU_SOURCE" | 31 | TARGET_CFLAGS += "-D_GNU_SOURCE" |
24 | EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \ | 32 | EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \ |
@@ -51,6 +59,13 @@ do_install_append () { | |||
51 | mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/ | 59 | mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/ |
52 | fi | 60 | fi |
53 | install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script | 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 | ||
54 | } | 69 | } |
55 | 70 | ||
56 | PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell" | 71 | PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell" |
diff --git a/meta/recipes-connectivity/dhcp/files/dhcpd.service b/meta/recipes-connectivity/dhcp/files/dhcpd.service new file mode 100644 index 0000000000..8648f1a253 --- /dev/null +++ b/meta/recipes-connectivity/dhcp/files/dhcpd.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=DHCP Server Daemon | ||
3 | After=network.target | ||
4 | After=time-sync.target | ||
5 | |||
6 | [Service] | ||
7 | EnvironmentFile=@SYSCONFDIR@/default/dhcp-server | ||
8 | ExecStart=-@SBINDIR@/dhcpd -q $INTERFACES | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=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 0000000000..a2d818917d --- /dev/null +++ b/meta/recipes-connectivity/dhcp/files/dhcrelay.service | |||
@@ -0,0 +1,9 @@ | |||
1 | [Unit] | ||
2 | Description=DHCP Relay Agent Daemon | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | ExecStart=@SBINDIR@/dhcrelay -d --no-pid | ||
7 | |||
8 | [Install] | ||
9 | WantedBy=multi-user.target | ||