From: Otavio Salvador <otavio@ossystems.com.br>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 1/4] dhcp: move dhcp leases files handling to postinst/postrm
Date: Tue, 7 Feb 2012 21:09:48 +0000 [thread overview]
Message-ID: <f3c82bbf545c086ccd89c06020f8721637fe9202.1328648562.git.otavio@ossystems.com.br> (raw)
In-Reply-To: <cover.1328648562.git.otavio@ossystems.com.br>
In-Reply-To: <cover.1328648562.git.otavio@ossystems.com.br>
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>
---
meta/recipes-connectivity/dhcp/dhcp.inc | 25 ++++++++++++++++++++++++-
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 be256ce..f66dfba 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 a3a560b..3b1c0e2 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 \
--
1.7.2.5
next prev parent reply other threads:[~2012-02-07 21:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-07 21:09 [PATCH 0/4] Pending patches at O.S. Systems' tree Otavio Salvador
2012-02-07 21:09 ` Otavio Salvador [this message]
2012-02-07 21:09 ` [PATCH 2/4] udev: stop providing cache support by default Otavio Salvador
2012-02-07 21:09 ` [PATCH 3/4] cross.bbclass: add virtclass handler Otavio Salvador
2012-02-08 10:52 ` Richard Purdie
2012-02-08 11:04 ` Otavio Salvador
2012-02-07 21:09 ` [PATCH 4/4] useradd.bbclass: skip processing on virtclass-cross extended packages Otavio Salvador
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f3c82bbf545c086ccd89c06020f8721637fe9202.1328648562.git.otavio@ossystems.com.br \
--to=otavio@ossystems.com.br \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.