diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2012-02-06 15:16:02 +0000 |
---|---|---|
committer | Saul Wold <sgw@linux.intel.com> | 2012-02-07 15:05:42 -0800 |
commit | c8a9ae7c047051958b8667e77288c5ac295766c6 (patch) | |
tree | 952648eb7b0dbb40657ed58c962a39391f5e94c1 /meta | |
parent | 9c575b5f37ee53eaf26bfdc468d4cbb661db703f (diff) | |
download | openembedded-core-c8a9ae7c047051958b8667e77288c5ac295766c6.tar.gz openembedded-core-c8a9ae7c047051958b8667e77288c5ac295766c6.tar.bz2 openembedded-core-c8a9ae7c047051958b8667e77288c5ac295766c6.zip |
dhcp: move dhcp leases files handling to postinst/postrm
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 <otavio@ossystems.com.br>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-connectivity/dhcp/dhcp.inc | 25 | ||||
-rw-r--r-- | meta/recipes-connectivity/dhcp/dhcp_4.2.0.bb | 2 |
2 files changed, 25 insertions, 2 deletions
diff --git a/meta/recipes-connectivity/dhcp/dhcp.inc b/meta/recipes-connectivity/dhcp/dhcp.inc index be256ce280..f66dfba964 100644 --- a/meta/recipes-connectivity/dhcp/dhcp.inc +++ b/meta/recipes-connectivity/dhcp/dhcp.inc @@ -66,12 +66,35 @@ 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() { + mkdir -p $D/${localstatedir}/lib/dhcp touch $D/${localstatedir}/lib/dhcp/dhcpd.leases touch $D/${localstatedir}/lib/dhcp/dhcpd6.leases } + +pkg_postinst_dhcp-client() { + mkdir -p $D/${localstatedir}/lib/dhcp +} + +pkg_postrm_dhcp-server() { + rm -f $D/${localstatedir}/lib/dhcp/dhcpd.leases + rm -f $D/${localstatedir}/lib/dhcp/dhcpd6.leases + + if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then + echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty." + fi +} + +pkg_postrm_dhcp-client() { + rm -f $D/${localstatedir}/lib/dhcp/dhclient.leases + rm -f $D/${localstatedir}/lib/dhcp/dhclient6.leases + + if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then + echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty." + fi +} diff --git a/meta/recipes-connectivity/dhcp/dhcp_4.2.0.bb b/meta/recipes-connectivity/dhcp/dhcp_4.2.0.bb index a3a560b991..3b1c0e2dd7 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 = "r7" SRC_URI += "file://fixincludes.patch \ file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \ |