diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2012-02-06 15:16:02 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-08 00:50:29 +0000 |
commit | b9ff9682b3bac2c6e23f9c9ba15f25530228e2c7 (patch) | |
tree | 0d6fc81f98789bf073881174483a03289b424235 /meta/recipes-connectivity/dhcp/dhcp.inc | |
parent | 54fd9ad71b70cf823be702b980459980bcb05de6 (diff) | |
download | poky-b9ff9682b3bac2c6e23f9c9ba15f25530228e2c7.tar.gz |
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.
(From OE-Core rev: c8a9ae7c047051958b8667e77288c5ac295766c6)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/dhcp/dhcp.inc')
-rw-r--r-- | meta/recipes-connectivity/dhcp/dhcp.inc | 25 |
1 files changed, 24 insertions, 1 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 | |||
66 | 66 | ||
67 | FILES_dhcp-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay" | 67 | FILES_dhcp-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay" |
68 | 68 | ||
69 | FILES_dhcp-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf ${localstatedir}/lib/dhcp/" | 69 | FILES_dhcp-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf" |
70 | RDEPENDS_dhcp-client = "bash" | 70 | RDEPENDS_dhcp-client = "bash" |
71 | 71 | ||
72 | FILES_dhcp-omshell = "${bindir}/omshell" | 72 | FILES_dhcp-omshell = "${bindir}/omshell" |
73 | 73 | ||
74 | pkg_postinst_dhcp-server() { | 74 | pkg_postinst_dhcp-server() { |
75 | mkdir -p $D/${localstatedir}/lib/dhcp | ||
75 | touch $D/${localstatedir}/lib/dhcp/dhcpd.leases | 76 | touch $D/${localstatedir}/lib/dhcp/dhcpd.leases |
76 | touch $D/${localstatedir}/lib/dhcp/dhcpd6.leases | 77 | touch $D/${localstatedir}/lib/dhcp/dhcpd6.leases |
77 | } | 78 | } |
79 | |||
80 | pkg_postinst_dhcp-client() { | ||
81 | mkdir -p $D/${localstatedir}/lib/dhcp | ||
82 | } | ||
83 | |||
84 | pkg_postrm_dhcp-server() { | ||
85 | rm -f $D/${localstatedir}/lib/dhcp/dhcpd.leases | ||
86 | rm -f $D/${localstatedir}/lib/dhcp/dhcpd6.leases | ||
87 | |||
88 | if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then | ||
89 | echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty." | ||
90 | fi | ||
91 | } | ||
92 | |||
93 | pkg_postrm_dhcp-client() { | ||
94 | rm -f $D/${localstatedir}/lib/dhcp/dhclient.leases | ||
95 | rm -f $D/${localstatedir}/lib/dhcp/dhclient6.leases | ||
96 | |||
97 | if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then | ||
98 | echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty." | ||
99 | fi | ||
100 | } | ||