Skip to contentSkip to conversation

dbus: Add missing RDEPENDS of base-files

PATCH In review [email protected] 4 participants 6 messages Jan 14, 2014 – Jan 17, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 dbus: Add missing RDEPENDS of base-files

From: Ting Liu <[email protected]>

Fix the below issue:

| Computing transaction...error: Can't install
| dbus-1-1.6.18-r0@ppce500v2: no package provides base-files
|
---
 meta/recipes-core/dbus/dbus.inc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
meta/recipes-core/dbus/dbus.inc +1 -1
index 9bdb489..88aca2e 100644
@@ -6,7 +6,7 @@ LICENSE = "AFL-2 | GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
                     file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
 DEPENDS = "expat virtual/libintl"
-RDEPENDS_dbus = "${@base_contains('DISTRO_FEATURES', 'ptest', 'dbus-ptest-ptest', '', d)} initscripts-functions"
+RDEPENDS_dbus = "${@base_contains('DISTRO_FEATURES', 'ptest', 'dbus-ptest-ptest', '', d)} initscripts-functions base-files"
 RDEPENDS_dbus_class-native = ""
 RDEPENDS_dbus_class-nativesdk = ""
 
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 2/3 kmod-native: Only use O_CLOEXEC if it is defined

From: Ting Liu <[email protected]>

O_CLOEXEC is not available on some distro, such as centos 5.x

---
 meta/recipes-kernel/kmod/kmod-native_git.bb        |    1 +
 .../kmod/Only-use-O_CLOEXEC-if-it-is-defined.patch |  138 ++++++++++++++++++++
 2 files changed, 139 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-kernel/kmod/kmod/Only-use-O_CLOEXEC-if-it-is-defined.patch
meta/recipes-kernel/kmod/kmod-native_git.bb +1 -0
index f0e274e..a8312ef 100644
@@ -8,6 +8,7 @@ DEPENDS += "zlib-native"
 inherit native
 
 SRC_URI += "file://Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch \
+           file://Only-use-O_CLOEXEC-if-it-is-defined.patch \
            "
 
 do_install_append (){
meta/recipes-kernel/kmod/kmod/Only-use-O_CLOEXEC-if-it-is-defined.patch new file +138 -0

138 lines not on this page · raw message

Signature · 1 line
1.7.3.4
#4 lore raw

PATCH 3/3 wayland-native: disable macro checks not used for scanner

In reply to [email protected]

From: Ting Liu <[email protected]>

We only build wayland-native for the scanner, so disable the bits we don't actually need. This avoid build issue on older distro such as Centos 5.x:

| error: 'O_CLOEXEC' undeclared (first use in this function)
| error: sys/timerfd.h: No such file or directory
| error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
| error: 'TFD_CLOEXEC' undeclared (first use in this function)
| error: 'SFD_CLOEXEC' undeclared (first use in this function)
---
 ...disable-macro-checks-not-used-for-scanner.patch |   52 ++++++++++++++++++++
 meta/recipes-graphics/wayland/wayland_1.3.0.bb     |    5 ++-
 2 files changed, 56 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch
meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch new file +52 -0
new file mode 100644
index 0000000..8a22079
@@ -0,0 +1,52 @@
+From 0af87a0382ffa4f1f6c81960d5f2ff07d3726529 Mon Sep 17 00:00:00 2001
+From: Ting Liu <[email protected]>
+Date: Mon, 13 Jan 2014 16:49:45 +0800
+Subject: [PATCH] disable macro checks not used for scanner
+
+We only build wayland-native for the scanner, so disable the bits we don't
+actually need. This avoid build issue on older distro such as Centos 5.x:
+| error: 'O_CLOEXEC' undeclared (first use in this function)
+| error: sys/timerfd.h: No such file or directory
+| error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
+| error: 'TFD_CLOEXEC' undeclared (first use in this function)
+| error: 'SFD_CLOEXEC' undeclared (first use in this function)
+
+Signed-off-by: Ting Liu <[email protected]>
+---
+ configure.ac | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index fa924ae..bf1b85a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -41,16 +41,16 @@ AC_SUBST(GCC_CFLAGS)
+ 
+ AC_CHECK_FUNCS([accept4 mkostemp])
+ 
+-AC_CHECK_DECL(SFD_CLOEXEC,[],
+-	      [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland")],
+-	      [[#include <sys/signalfd.h>]])
+-AC_CHECK_DECL(TFD_CLOEXEC,[],
+-	      [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland")],
+-	      [[#include <sys/timerfd.h>]])
+-AC_CHECK_DECL(CLOCK_MONOTONIC,[],
+-	      [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland")],
+-	      [[#include <time.h>]])
+-AC_CHECK_HEADERS([execinfo.h])
++##AC_CHECK_DECL(SFD_CLOEXEC,[],
++#	      [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland")],
++#	      [[#include <sys/signalfd.h>]])
++#AC_CHECK_DECL(TFD_CLOEXEC,[],
++#	      [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland")],
++#	      [[#include <sys/timerfd.h>]])
++#AC_CHECK_DECL(CLOCK_MONOTONIC,[],
++#	      [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland")],
++#	      [[#include <time.h>]])
++#AC_CHECK_HEADERS([execinfo.h])
+ 
+ AC_ARG_ENABLE([scanner],
+               [AC_HELP_STRING([--disable-scanner],
+-- 
+1.8.3.2
+
meta/recipes-graphics/wayland/wayland_1.3.0.bb +4 -1
index 212e08a..a60d02a 100644
@@ -14,7 +14,10 @@ SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz"
 SRC_URI[md5sum] = "d16d27081e0871de82d08840c2f133fc"
 SRC_URI[sha256sum] = "2e817685f68a26acd19964d69ddbc4549ba5412114ad95e1a9f5934cce470d6e"
 
-SRC_URI_append_class-native = " file://just-scanner.patch"
+SRC_URI_append_class-native = " \
+    file://just-scanner.patch \
+    file://disable-macro-checks-not-used-for-scanner.patch \
+"
 
 inherit autotools pkgconfig
 
Signature · 1 line
1.7.3.4
#2 lore raw

Re: [PATCH 2/3] kmod-native: Only use O_CLOEXEC if it is defined

In reply to [email protected]
Quoted 4 lines · On 01/14/2014 05:49 PM, [email protected] wrote:

From: Ting Liu <[email protected]>

O_CLOEXEC is not available on some distro, such as centos 5.x

Hi Ting,

Missing the Upstream-Status here, and for the O_CLOEXEC, how about:

#ifdef O_CLOEXEC
#define O_RDONLY_O_CLOEXEC O_RDONLY|O_CLOEXEC
#else
#define O_RDONLY_O_CLOEXEC O_RDONLY
#endif

or something like this, so you don't have to use the "#ifdef" everywhere.

// Robert

Quoted 164 lines
---
  meta/recipes-kernel/kmod/kmod-native_git.bb        |    1 +
  .../kmod/Only-use-O_CLOEXEC-if-it-is-defined.patch |  138 ++++++++++++++++++++
  2 files changed, 139 insertions(+), 0 deletions(-)

create mode 100644 meta/recipes-kernel/kmod/kmod/Only-use-O_CLOEXEC-if-it-is-defined.patch

meta/recipes-kernel/kmod/kmod-native_git.bb +1 -0
index f0e274e..a8312ef 100644
@@ -8,6 +8,7 @@ DEPENDS += "zlib-native"
  inherit native
 
  SRC_URI += "file://Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch \
+           file://Only-use-O_CLOEXEC-if-it-is-defined.patch \
             "
 
  do_install_append (){
meta/recipes-kernel/kmod/kmod/Only-use-O_CLOEXEC-if-it-is-defined.patch new file +138 -0
new file mode 100644
index 0000000..0c35615
@@ -0,0 +1,138 @@
+From 8dc835c57caa5ca2eae9c4ebc8e2bc6dcff94bc3 Mon Sep 17 00:00:00 2001
+From: Ting Liu <[email protected]>
+Date: Mon, 13 Jan 2014 11:11:28 +0800
+Subject: [PATCH] Only use O_CLOEXEC if it is defined
+
+O_CLOEXEC is not available on some distro, such as centos 5.x
+
+Signed-off-by: Ting Liu <[email protected]>
+---
+ libkmod/libkmod-config.c | 10 +++++++++-
+ libkmod/libkmod-file.c   |  4 ++++
+ libkmod/libkmod-index.c  |  7 +++++++
+ libkmod/libkmod-module.c | 17 +++++++++++++++++
+ 4 files changed, 37 insertions(+), 1 deletion(-)
+
+diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
+index 32adb8b..def805d 100644
+--- a/libkmod/libkmod-config.c
++++ b/libkmod/libkmod-config.c
+@@ -525,7 +525,11 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
+ 	int fd, err;
+ 	char *p, *modname,  *param = NULL, *value = NULL;
+
++#ifdef O_CLOEXEC
+ 	fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC);
++#else
++	fd = open("/proc/cmdline", O_RDONLY);
++#endif
+ 	if (fd < 0) {
+ 		err = -errno;
+ 		DBG(config->ctx, "could not open '/proc/cmdline' for reading: %m\n");
+@@ -889,7 +893,11 @@ int kmod_config_new(struct kmod_ctx *ctx, struct kmod_config **p_config,
+ 			snprintf(fn, sizeof(fn),"%s/%s", cf->path,
+ 					cf->name);
+
+-		fd = open(fn, O_RDONLY|O_CLOEXEC);
++#ifdef O_CLOEXEC
++	fd = open(fn, O_RDONLY|O_CLOEXEC);
++#else
++	fd = open(fn, O_RDONLY);
++#endif
+ 		DBG(ctx, "parsing file '%s' fd=%d\n", fn, fd);
+
+ 		if (fd >= 0)
+diff --git a/libkmod/libkmod-file.c b/libkmod/libkmod-file.c
+index feb4a15..d659765 100644
+--- a/libkmod/libkmod-file.c
++++ b/libkmod/libkmod-file.c
+@@ -292,7 +292,11 @@ struct kmod_file *kmod_file_open(const struct kmod_ctx *ctx,
+ 	if (file == NULL)
+ 		return NULL;
+
++#ifdef O_CLOEXEC
+ 	file->fd = open(filename, O_RDONLY|O_CLOEXEC);
++#else
++	file->fd = open(filename, O_RDONLY);
++#endif
+ 	if (file->fd < 0) {
+ 		err = -errno;
+ 		goto error;
+diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c
+index fa7db41..4b113ed 100644
+--- a/libkmod/libkmod-index.c
++++ b/libkmod/libkmod-index.c
+@@ -795,10 +795,17 @@ struct index_mm *index_mm_open(struct kmod_ctx *ctx, const char *filename,
+ 		return NULL;
+ 	}
+
++#ifdef O_CLOEXEC
+ 	if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) < 0) {
+ 		DBG(ctx, "open(%s, O_RDONLY|O_CLOEXEC): %m\n", filename);
+ 		goto fail_open;
+ 	}
++#else
++	if ((fd = open(filename, O_RDONLY) < 0)) {
++		DBG(ctx, "open(%s, O_RDONLY): %m\n", filename);
++		goto fail_open;
++	}
++#endif
+
+ 	fstat(fd, &st);
+ 	if ((size_t) st.st_size < sizeof(hdr))
+diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
+index 2f92e16..a911dfe 100644
+--- a/libkmod/libkmod-module.c
++++ b/libkmod/libkmod-module.c
+@@ -1692,7 +1692,11 @@ KMOD_EXPORT int kmod_module_get_initstate(const struct kmod_module *mod)
+
+ 	pathlen = snprintf(path, sizeof(path),
+ 				"/sys/module/%s/initstate", mod->name);
++#ifdef O_CLOEXEC
+ 	fd = open(path, O_RDONLY|O_CLOEXEC);
++#else
++	fd = open(path, O_RDONLY);
++#endif
+ 	if (fd < 0) {
+ 		err = -errno;
+
+@@ -1762,7 +1766,11 @@ KMOD_EXPORT long kmod_module_get_size(const struct kmod_module *mod)
+ 		return -errno;
+
+ 	/* available as of linux 3.3.x */
++#ifdef O_CLOEXEC
+ 	cfd = openat(dfd, "coresize", O_RDONLY|O_CLOEXEC);
++#else
++	cfd = openat(dfd, "coresize", O_RDONLY);
++#endif
+ 	if (cfd >= 0) {
+ 		if (read_str_long(cfd, &size, 10) < 0)
+ 			ERR(mod->ctx, "failed to read coresize from %s\n", line);
+@@ -1830,7 +1838,11 @@ KMOD_EXPORT int kmod_module_get_refcnt(const struct kmod_module *mod)
+ 		return -ENOENT;
+
+ 	snprintf(path, sizeof(path), "/sys/module/%s/refcnt", mod->name);
++#ifdef O_CLOEXEC
+ 	fd = open(path, O_RDONLY|O_CLOEXEC);
++#else
++	fd = open(path, O_RDONLY);
++#endif
+ 	if (fd < 0) {
+ 		err = -errno;
+ 		DBG(mod->ctx, "could not open '%s': %s\n",
+@@ -1973,7 +1985,12 @@ KMOD_EXPORT struct kmod_list *kmod_module_get_sections(const struct kmod_module
+ 				continue;
+ 		}
+
++#ifdef O_CLOEXEC
+ 		fd = openat(dfd, dent->d_name, O_RDONLY|O_CLOEXEC);
++#else
++		fd = openat(dfd, dent->d_name, O_RDONLY);
++
++#endif
+ 		if (fd < 0) {
+ 			ERR(mod->ctx, "could not open '%s/%s': %m\n",
+ 							dname, dent->d_name);
+--
+1.8.3.2
+
#3 lore raw

Re: [PATCH 2/3] kmod-native: Only use O_CLOEXEC if it is defined

Quoted 12 lines · Robert Yang
Quoted 5 lines · On 01/14/2014 05:49 PM, [email protected] wrote:

From: Ting Liu <[email protected]>

O_CLOEXEC is not available on some distro, such as centos 5.x

Hi Ting,

Missing the Upstream-Status here, and for the O_CLOEXEC, how about:

Quoted 7 lines

#ifdef O_CLOEXEC
#define O_RDONLY_O_CLOEXEC O_RDONLY|O_CLOEXEC
#else
#define O_RDONLY_O_CLOEXEC O_RDONLY
#endif

or something like this, so you don't have to use the "#ifdef" everywhere.

Or to be even less invasive:

#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif

Have you verified that it's safe to drop O_CLOEXEC and it doesn't need to be replaced with fnctl(FD_CLOEXEC) calls?

Ross

#5 lore raw

Re: [PATCH 3/3] wayland-native: disable macro checks not used for scanner

In reply to [email protected]
Quoted 27 lines · On 01/14/2014 01:49 AM, [email protected] wrote:

From: Ting Liu <[email protected]>

We only build wayland-native for the scanner, so disable the bits we don't actually need. This avoid build issue on older distro such as Centos 5.x:

| error: 'O_CLOEXEC' undeclared (first use in this function)
| error: sys/timerfd.h: No such file or directory
| error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
| error: 'TFD_CLOEXEC' undeclared (first use in this function)
| error: 'SFD_CLOEXEC' undeclared (first use in this function)
---
  ...disable-macro-checks-not-used-for-scanner.patch |   52 ++++++++++++++++++++
  meta/recipes-graphics/wayland/wayland_1.3.0.bb     |    5 ++-
  2 files changed, 56 insertions(+), 1 deletions(-)

create mode 100644 meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch

meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch new file +3 -0
new file mode 100644
index 0000000..8a22079
@@ -0,0 +1,52 @@
+From 0af87a0382ffa4f1f6c81960d5f2ff07d3726529 Mon Sep 17 00:00:00 2001
+From: Ting Liu <[email protected]>
+Date: Mon, 13 Jan 2014 16:49:45 +0800

meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch line 13

Quoted 10 lines
meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch new file +10 -0
+Subject: [PATCH] disable macro checks not used for scanner
+
+We only build wayland-native for the scanner, so disable the bits we don't
+actually need. This avoid build issue on older distro such as Centos 5.x:
+| error: 'O_CLOEXEC' undeclared (first use in this function)
+| error: sys/timerfd.h: No such file or directory
+| error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
+| error: 'TFD_CLOEXEC' undeclared (first use in this function)
+| error: 'SFD_CLOEXEC' undeclared (first use in this function)
+

Missing the Upstream-Status: Tag

Quoted 56 lines
meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch new file +39 -0
+Signed-off-by: Ting Liu <[email protected]>
+---
+ configure.ac | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index fa924ae..bf1b85a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -41,16 +41,16 @@ AC_SUBST(GCC_CFLAGS)
+
+ AC_CHECK_FUNCS([accept4 mkostemp])
+
+-AC_CHECK_DECL(SFD_CLOEXEC,[],
+-	      [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland")],
+-	      [[#include <sys/signalfd.h>]])
+-AC_CHECK_DECL(TFD_CLOEXEC,[],
+-	      [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland")],
+-	      [[#include <sys/timerfd.h>]])
+-AC_CHECK_DECL(CLOCK_MONOTONIC,[],
+-	      [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland")],
+-	      [[#include <time.h>]])
+-AC_CHECK_HEADERS([execinfo.h])
++##AC_CHECK_DECL(SFD_CLOEXEC,[],
++#	      [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland")],
++#	      [[#include <sys/signalfd.h>]])
++#AC_CHECK_DECL(TFD_CLOEXEC,[],
++#	      [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland")],
++#	      [[#include <sys/timerfd.h>]])
++#AC_CHECK_DECL(CLOCK_MONOTONIC,[],
++#	      [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland")],
++#	      [[#include <time.h>]])
++#AC_CHECK_HEADERS([execinfo.h])
+
+ AC_ARG_ENABLE([scanner],
+               [AC_HELP_STRING([--disable-scanner],
+--
+1.8.3.2
+
meta/recipes-graphics/wayland/wayland_1.3.0.bb +4 -1
index 212e08a..a60d02a 100644
@@ -14,7 +14,10 @@ SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz"
  SRC_URI[md5sum] = "d16d27081e0871de82d08840c2f133fc"
  SRC_URI[sha256sum] = "2e817685f68a26acd19964d69ddbc4549ba5412114ad95e1a9f5934cce470d6e"
 
-SRC_URI_append_class-native = " file://just-scanner.patch"
+SRC_URI_append_class-native = " \
+    file://just-scanner.patch \
+    file://disable-macro-checks-not-used-for-scanner.patch \
+"
 
  inherit autotools pkgconfig