All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dhcp: move dhcp leases files handling to postinst/postrm
@ 2012-02-03 15:46 Andrei Gherzan
  2012-02-08  4:08 ` Saul Wold
  0 siblings, 1 reply; 3+ messages in thread
From: Andrei Gherzan @ 2012-02-03 15:46 UTC (permalink / raw)
  To: openembedded-core; +Cc: contato

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>
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
---
 meta/recipes-connectivity/dhcp/dhcp.inc         |   19 ++++++++++++++++++-
 meta/recipes-connectivity/dhcp/dhcp_4.2.3-P2.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 051190f..53479a8 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() {
+    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
+    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
+}
\ No newline at end of file
diff --git a/meta/recipes-connectivity/dhcp/dhcp_4.2.3-P2.bb b/meta/recipes-connectivity/dhcp/dhcp_4.2.3-P2.bb
index 24b50ba..67af3e2 100644
--- a/meta/recipes-connectivity/dhcp/dhcp_4.2.3-P2.bb
+++ b/meta/recipes-connectivity/dhcp/dhcp_4.2.3-P2.bb
@@ -1,6 +1,6 @@
 require dhcp.inc
 
-PR = "r0"
+PR = "r1"
 
 SRC_URI += "file://fixincludes.patch \
             file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dhcp: move dhcp leases files handling to postinst/postrm
  2012-02-03 15:46 [PATCH] dhcp: move dhcp leases files handling to postinst/postrm Andrei Gherzan
@ 2012-02-08  4:08 ` Saul Wold
  2012-02-08  8:35   ` Andrei Gherzan
  0 siblings, 1 reply; 3+ messages in thread
From: Saul Wold @ 2012-02-08  4:08 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: contato

On 02/03/2012 07:46 AM, Andrei Gherzan wrote:
> 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>
> Signed-off-by: Andrei Gherzan<andrei@gherzan.ro>
> ---
>   meta/recipes-connectivity/dhcp/dhcp.inc         |   19 ++++++++++++++++++-
>   meta/recipes-connectivity/dhcp/dhcp_4.2.3-P2.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 051190f..53479a8 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() {
> +    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
> +    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
> +}
> \ No newline at end of file
> diff --git a/meta/recipes-connectivity/dhcp/dhcp_4.2.3-P2.bb b/meta/recipes-connectivity/dhcp/dhcp_4.2.3-P2.bb
> index 24b50ba..67af3e2 100644
> --- a/meta/recipes-connectivity/dhcp/dhcp_4.2.3-P2.bb
> +++ b/meta/recipes-connectivity/dhcp/dhcp_4.2.3-P2.bb
> @@ -1,6 +1,6 @@
>   require dhcp.inc
>
> -PR = "r0"
> +PR = "r1"
>
>   SRC_URI += "file://fixincludes.patch \
>               file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \

I have merged Otavio's patch, so you will need to rebase your DHCP patch 
now I think.

Sau!



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dhcp: move dhcp leases files handling to postinst/postrm
  2012-02-08  4:08 ` Saul Wold
@ 2012-02-08  8:35   ` Andrei Gherzan
  0 siblings, 0 replies; 3+ messages in thread
From: Andrei Gherzan @ 2012-02-08  8:35 UTC (permalink / raw)
  To: Saul Wold; +Cc: contato, openembedded

[-- Attachment #1: Type: text/plain, Size: 126 bytes --]

> I have merged Otavio's patch, so you will need to rebase your DHCP patch
now I think.
>
> Sau!

I will today. Thanks.

[-- Attachment #2: Type: text/html, Size: 170 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-08  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-03 15:46 [PATCH] dhcp: move dhcp leases files handling to postinst/postrm Andrei Gherzan
2012-02-08  4:08 ` Saul Wold
2012-02-08  8:35   ` Andrei Gherzan

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.