[oe] [meta-oe][PATCH 1/1] dhcp: add system support to dhcp-server

Otavio Salvador otavio at ossystems.com.br
Mon Nov 7 14:33:49 UTC 2011


Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
---
 .../recipes-connectivity/dhcp/dhcp_4.2.0.bbappend  |   19 +++++++++++++++++++
 .../recipes-connectivity/dhcp/files/dhcpd.service  |   12 ++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)
 create mode 100644 meta-oe/recipes-connectivity/dhcp/dhcp_4.2.0.bbappend
 create mode 100644 meta-oe/recipes-connectivity/dhcp/files/dhcpd.service

diff --git a/meta-oe/recipes-connectivity/dhcp/dhcp_4.2.0.bbappend b/meta-oe/recipes-connectivity/dhcp/dhcp_4.2.0.bbappend
new file mode 100644
index 0000000..d47f1ce
--- /dev/null
+++ b/meta-oe/recipes-connectivity/dhcp/dhcp_4.2.0.bbappend
@@ -0,0 +1,19 @@
+# look for files in the layer first
+FILESEXTRAPATHS := "${THISDIR}/files"
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "dhcp-server-systemd"
+SYSTEMD_SERVICE_dhcp-server-systemd = "dhcpd.service"
+
+SRC_URI += "file://dhcpd.service"
+
+do_install_append() {
+    install -d ${D}${base_libdir}/systemd/system
+    install -m 644 ${WORKDIR}/dhcpd.service ${D}${base_libdir}/systemd/system
+}
+
+PACKAGES =+ "dhcp-server-systemd"
+
+FILES_dhcp-server-systemd += "${base_libdir}/systemd"
+RDEPENDS_dhcp-server-systemd += "dhcp-server"
diff --git a/meta-oe/recipes-connectivity/dhcp/files/dhcpd.service b/meta-oe/recipes-connectivity/dhcp/files/dhcpd.service
new file mode 100644
index 0000000..70beee9
--- /dev/null
+++ b/meta-oe/recipes-connectivity/dhcp/files/dhcpd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Dynamic Host Configuration Protocol (DHCP)
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/dhcpd.pid
+EnvironmentFile=-/etc/default/dhcp-server
+ExecStart=/usr/sbin/dhcpd -cf /etc/dhcp/dhcpd.conf -q $INTERFACES
+
+[Install]
+WantedBy=multi-user.target
-- 
1.7.2.5





More information about the Openembedded-devel mailing list