From patchwork Wed Feb 1 20:27:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/3] dhcp: move dhcp leases files handling to postinst/postrm Date: Wed, 01 Feb 2012 20:27:44 -0000 From: Otavio Salvador X-Patchwork-Id: 20513 Message-Id: <429ddbe3779c6957e6ecad5ae37200865e19fa0f.1328127940.git.otavio@ossystems.com.br> To: openembedded-core@lists.openembedded.org Both server and client needs access to leases files so its creation and removal are now handled by postinst/postrm scripts. Signed-off-by: Otavio Salvador --- meta/recipes-connectivity/dhcp/dhcp.inc | 19 ++++++++++++++++++- meta/recipes-connectivity/dhcp/dhcp_4.2.0.bb | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/meta/recipes-connectivity/dhcp/dhcp.inc b/meta/recipes-connectivity/dhcp/dhcp.inc index be256ce..9f0c5ea 100644 --- a/meta/recipes-connectivity/dhcp/dhcp.inc +++ b/meta/recipes-connectivity/dhcp/dhcp.inc @@ -66,12 +66,29 @@ FILES_dhcp-server-config = "${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp FILES_dhcp-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay" -FILES_dhcp-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf ${localstatedir}/lib/dhcp/" +FILES_dhcp-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf" RDEPENDS_dhcp-client = "bash" FILES_dhcp-omshell = "${bindir}/omshell" pkg_postinst_dhcp-server() { + install -d $D/${localstatedir}/lib/dhcp touch $D/${localstatedir}/lib/dhcp/dhcpd.leases touch $D/${localstatedir}/lib/dhcp/dhcpd6.leases } + +pkg_postinst_dhcp-client() { + install -d $D/${localstatedir}/lib/dhcp +} + +pkg_postrm_dhcp-server() { + rm -f $D/${localstatedir}/lib/dhcp/dhcpd.leases + rm -f $D/${localstatedir}/lib/dhcp/dhcpd6.leases + rmdir $D/${localstatedir}/lib/dhcp +} + +pkg_postrm_dhcp-client() { + rm -f $D/${localstatedir}/lib/dhcp/dhclient.leases + rm -f $D/${localstatedir}/lib/dhcp/dhclient6.leases + rmdir $D/${localstatedir}/lib/dhcp +} diff --git a/meta/recipes-connectivity/dhcp/dhcp_4.2.0.bb b/meta/recipes-connectivity/dhcp/dhcp_4.2.0.bb index a3a560b..478fd06 100644 --- a/meta/recipes-connectivity/dhcp/dhcp_4.2.0.bb +++ b/meta/recipes-connectivity/dhcp/dhcp_4.2.0.bb @@ -1,6 +1,6 @@ require dhcp.inc -PR = "r5" +PR = "r6" SRC_URI += "file://fixincludes.patch \ file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \