All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Pending patches at O.S. Systems' tree
@ 2012-02-07 21:09 Otavio Salvador
  2012-02-07 21:09 ` [PATCH 1/4] dhcp: move dhcp leases files handling to postinst/postrm Otavio Salvador
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Otavio Salvador @ 2012-02-07 21:09 UTC (permalink / raw)
  To: openembedded-core

I am sending the patches that are waiting in our tree. dhcp and udev
patches ought to have been handled by Saul but in any case they are
present here.

The following changes since commit 18d9fcfc4bc4b01f73e89f3b988c9d3d543c7705:

  libzypp: add missing runtime dependences on gzip and gnupg (2012-02-03 17:23:28 +0000)

are available in the git repository at:
  git://github.com/OSSystems/oe-core master
  https://github.com/OSSystems/oe-core/tree/HEAD

Otavio Salvador (4):
  dhcp: move dhcp leases files handling to postinst/postrm
  udev: stop providing cache support by default
  cross.bbclass: add virtclass handler
  useradd.bbclass: skip processing on virtclass-cross extended packages

 meta/classes/cross.bbclass                   |   39 ++++++++++++++++++++++++++
 meta/classes/useradd.bbclass                 |    3 ++
 meta/recipes-connectivity/dhcp/dhcp.inc      |   25 ++++++++++++++++-
 meta/recipes-connectivity/dhcp/dhcp_4.2.0.bb |    2 +-
 meta/recipes-core/udev/udev.inc              |    2 +-
 meta/recipes-core/udev/udev_164.bb           |    2 +-
 6 files changed, 69 insertions(+), 4 deletions(-)

-- 
1.7.2.5




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

* [PATCH 1/4] dhcp: move dhcp leases files handling to postinst/postrm
  2012-02-07 21:09 [PATCH 0/4] Pending patches at O.S. Systems' tree Otavio Salvador
@ 2012-02-07 21:09 ` Otavio Salvador
  2012-02-07 21:09 ` [PATCH 2/4] udev: stop providing cache support by default Otavio Salvador
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Otavio Salvador @ 2012-02-07 21:09 UTC (permalink / raw)
  To: openembedded-core

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




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

* [PATCH 2/4] udev: stop providing cache support by default
  2012-02-07 21:09 [PATCH 0/4] Pending patches at O.S. Systems' tree Otavio Salvador
  2012-02-07 21:09 ` [PATCH 1/4] dhcp: move dhcp leases files handling to postinst/postrm Otavio Salvador
@ 2012-02-07 21:09 ` Otavio Salvador
  2012-02-07 21:09 ` [PATCH 3/4] cross.bbclass: add virtclass handler Otavio Salvador
  2012-02-07 21:09 ` [PATCH 4/4] useradd.bbclass: skip processing on virtclass-cross extended packages Otavio Salvador
  3 siblings, 0 replies; 7+ messages in thread
From: Otavio Salvador @ 2012-02-07 21:09 UTC (permalink / raw)
  To: openembedded-core

The usefulness of cache nowadays has been reduced a lot and thus it's
better to stop using it by default. Dropping the recommends allows for
image to decide if they want or not to have cache enabled, instead of
require a machine override.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/recipes-core/udev/udev.inc    |    2 +-
 meta/recipes-core/udev/udev_164.bb |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/udev/udev.inc b/meta/recipes-core/udev/udev.inc
index e5fbe40..7949f22 100644
--- a/meta/recipes-core/udev/udev.inc
+++ b/meta/recipes-core/udev/udev.inc
@@ -12,7 +12,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
 
 DEPENDS = "acl glib-2.0 libusb usbutils pciutils gperf-native libxslt-native"
 RPROVIDES_${PN} = "hotplug"
-RRECOMMENDS_${PN} += "udev-extraconf udev-cache usbutils-ids pciutils-ids"
+RRECOMMENDS_${PN} += "udev-extraconf usbutils-ids pciutils-ids"
 RDEPENDS_libudev = "${PN} (= ${EXTENDPKGV})"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
diff --git a/meta/recipes-core/udev/udev_164.bb b/meta/recipes-core/udev/udev_164.bb
index 6d71f4d..b993a13 100644
--- a/meta/recipes-core/udev/udev_164.bb
+++ b/meta/recipes-core/udev/udev_164.bb
@@ -1,6 +1,6 @@
 include udev.inc
 
-PR = "r10"
+PR = "r11"
 
 SRC_URI += "file://udev-166-v4l1-1.patch"
 
-- 
1.7.2.5




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

* [PATCH 3/4] cross.bbclass: add virtclass handler
  2012-02-07 21:09 [PATCH 0/4] Pending patches at O.S. Systems' tree Otavio Salvador
  2012-02-07 21:09 ` [PATCH 1/4] dhcp: move dhcp leases files handling to postinst/postrm Otavio Salvador
  2012-02-07 21:09 ` [PATCH 2/4] udev: stop providing cache support by default Otavio Salvador
@ 2012-02-07 21:09 ` Otavio Salvador
  2012-02-08 10:52   ` Richard Purdie
  2012-02-07 21:09 ` [PATCH 4/4] useradd.bbclass: skip processing on virtclass-cross extended packages Otavio Salvador
  3 siblings, 1 reply; 7+ messages in thread
From: Otavio Salvador @ 2012-02-07 21:09 UTC (permalink / raw)
  To: openembedded-core

Allow use of BBCLASSEXTEND with 'cross' and use of virtclass-cross in
recipes.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/classes/cross.bbclass |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
index 5681ab9..a764902 100644
--- a/meta/classes/cross.bbclass
+++ b/meta/classes/cross.bbclass
@@ -55,6 +55,45 @@ libexecdir = "${exec_prefix}/libexec/${CROSS_TARGET_SYS_DIR}"
 
 do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}"
 
+python cross_virtclass_handler () {
+    if not isinstance(e, bb.event.RecipePreFinalise):
+        return
+
+    classextend = e.data.getVar('BBCLASSEXTEND', True) or ""
+    if "cross" not in classextend:
+        return
+
+    pn = e.data.getVar("PN", True)
+    if not pn.endswith("-cross"):
+        return
+
+    def map_dependencies(varname, d, suffix = ""):
+        if suffix:
+            varname = varname + "_" + suffix
+        deps = d.getVar(varname, True)
+        if not deps:
+            return
+        deps = bb.utils.explode_deps(deps)
+        newdeps = []
+        for dep in deps:
+            if dep.endswith("-cross"):
+                newdeps.append(dep)
+            else:
+                newdeps.append(dep + "-cross")
+        bb.data.setVar(varname, " ".join(newdeps), d)
+
+    for pkg in (e.data.getVar("PACKAGES", True).split() + [""]):
+        map_dependencies("RDEPENDS", e.data, pkg)
+        map_dependencies("RRECOMMENDS", e.data, pkg)
+        map_dependencies("RSUGGESTS", e.data, pkg)
+        map_dependencies("RPROVIDES", e.data, pkg)
+        map_dependencies("RREPLACES", e.data, pkg)
+
+    bb.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-cross", e.data)
+}
+
+addhandler cross_virtclass_handler
+
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
 }
-- 
1.7.2.5




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

* [PATCH 4/4] useradd.bbclass: skip processing on virtclass-cross extended packages
  2012-02-07 21:09 [PATCH 0/4] Pending patches at O.S. Systems' tree Otavio Salvador
                   ` (2 preceding siblings ...)
  2012-02-07 21:09 ` [PATCH 3/4] cross.bbclass: add virtclass handler Otavio Salvador
@ 2012-02-07 21:09 ` Otavio Salvador
  3 siblings, 0 replies; 7+ messages in thread
From: Otavio Salvador @ 2012-02-07 21:09 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/classes/useradd.bbclass |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 8eb6444..1fed755 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -3,6 +3,7 @@
 # and support files needed to add and modify user and group accounts
 DEPENDS_append = "${USERADDDEPENDS}"
 USERADDDEPENDS = " base-passwd shadow-native shadow-sysroot shadow"
+USERADDDEPENDS_virtclass-cross = ""
 USERADDDEPENDS_virtclass-native = ""
 USERADDDEPENDS_virtclass-nativesdk = ""
 
@@ -104,10 +105,12 @@ useradd_sysroot_sstate () {
 
 do_install[prefuncs] += "${SYSROOTFUNC}"
 SYSROOTFUNC = "useradd_sysroot"
+SYSROOTFUNC_virtclass-cross = ""
 SYSROOTFUNC_virtclass-native = ""
 SYSROOTFUNC_virtclass-nativesdk = ""
 SSTATEPREINSTFUNCS += "${SYSROOTPOSTFUNC}"
 SYSROOTPOSTFUNC = "useradd_sysroot_sstate"
+SYSROOTPOSTFUNC_virtclass-cross = ""
 SYSROOTPOSTFUNC_virtclass-native = ""
 SYSROOTPOSTFUNC_virtclass-nativesdk = ""
 
-- 
1.7.2.5




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

* Re: [PATCH 3/4] cross.bbclass: add virtclass handler
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2012-02-08 10:52 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Tue, 2012-02-07 at 21:09 +0000, Otavio Salvador wrote:
> Allow use of BBCLASSEXTEND with 'cross' and use of virtclass-cross in
> recipes.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  meta/classes/cross.bbclass |   39 +++++++++++++++++++++++++++++++++++++++
>  1 files changed, 39 insertions(+), 0 deletions(-)
> 
> diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
> index 5681ab9..a764902 100644
> --- a/meta/classes/cross.bbclass
> +++ b/meta/classes/cross.bbclass
> @@ -55,6 +55,45 @@ libexecdir = "${exec_prefix}/libexec/${CROSS_TARGET_SYS_DIR}"
>  
>  do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}"
>  
> +python cross_virtclass_handler () {
> +    if not isinstance(e, bb.event.RecipePreFinalise):
> +        return
> +
> +    classextend = e.data.getVar('BBCLASSEXTEND', True) or ""
> +    if "cross" not in classextend:
> +        return
> +
> +    pn = e.data.getVar("PN", True)
> +    if not pn.endswith("-cross"):
> +        return
> +
> +    def map_dependencies(varname, d, suffix = ""):
> +        if suffix:
> +            varname = varname + "_" + suffix
> +        deps = d.getVar(varname, True)
> +        if not deps:
> +            return
> +        deps = bb.utils.explode_deps(deps)
> +        newdeps = []
> +        for dep in deps:
> +            if dep.endswith("-cross"):
> +                newdeps.append(dep)
> +            else:
> +                newdeps.append(dep + "-cross")
> +        bb.data.setVar(varname, " ".join(newdeps), d)
> +
> +    for pkg in (e.data.getVar("PACKAGES", True).split() + [""]):
> +        map_dependencies("RDEPENDS", e.data, pkg)
> +        map_dependencies("RRECOMMENDS", e.data, pkg)
> +        map_dependencies("RSUGGESTS", e.data, pkg)
> +        map_dependencies("RPROVIDES", e.data, pkg)
> +        map_dependencies("RREPLACES", e.data, pkg)

I want to highlight what this code does and I don't understand when it
would do something that makes sense. If for example we have a recipe
which:

RDEPENDS = "libc zlib"

it will now:

RDEPENDS = "lib-cross zlib-cross"

or a native recipe which had:

RDEPENDS = "pkgconfig-native"

will now:

RDEPENDS = "pkgconfig-native-cross"

Can you point me at the recipe you're using this in? I suspect we should
just remove the map_dependencies() pieces from this class entirely and
handle dependency issues with the override manually. I think at this
point all the BBCLASSEXTEND is going to give you is the removal of the
need to add a separate .bb file with "inherit cross" in it and enable an
override for your to use. I'm not sure we can write generic dependency
mapping code that would work for -cross.

Cheers,

Richard





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

* Re: [PATCH 3/4] cross.bbclass: add virtclass handler
  2012-02-08 10:52   ` Richard Purdie
@ 2012-02-08 11:04     ` Otavio Salvador
  0 siblings, 0 replies; 7+ messages in thread
From: Otavio Salvador @ 2012-02-08 11:04 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

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

On Wed, Feb 8, 2012 at 08:52, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> Can you point me at the recipe you're using this in? I suspect we should
> just remove the map_dependencies() pieces from this class entirely and
> handle dependency issues with the override manually. I think at this
> point all the BBCLASSEXTEND is going to give you is the removal of the
> need to add a separate .bb file with "inherit cross" in it and enable an
> override for your to use. I'm not sure we can write generic dependency
> mapping code that would work for -cross.
>

We use it a lot in the meta-chicken layer (
https://github.com/OSSystems/meta-chicken).

I agree about dropping map_dependencies from it. I will look at it and send
it again.

-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

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

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-07 21:09 [PATCH 0/4] Pending patches at O.S. Systems' tree Otavio Salvador
2012-02-07 21:09 ` [PATCH 1/4] dhcp: move dhcp leases files handling to postinst/postrm Otavio Salvador
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

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.