All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denys Dmytriyenko <denis@denix.org>
To: openembedded-devel@lists.openembedded.org
Subject: [RFC] Fix udev pulling in libvolume-id-dev
Date: Thu, 15 Jan 2009 01:14:18 -0500	[thread overview]
Message-ID: <20090115061418.GA13352@denix.org> (raw)

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

Hi,

I was debugging the strange behavior of one of my boxes pulling in libc6-dev 
into the filesystem image and it happened to be because udev pulled in 
libvolume-id-dev instead of libvolume-id0... It worked as expected on the 
other box, though.

Several people on IRC have seen this lingering bug before, but no fix was 
available. Koen mentioned it got fixed for him by rebuilding udev...

After some investigation I found out that both libvolume-id packages (-dev and 
regular) are registered to provide libvolume_id.so.0 and the one appearing 
last in os.walk() gets pulled in by udev. The order of files provided by 
os.walk() depends on parallel builds and phase of the Moon.

libvolume-id-dev does not provide the actual .so library, but it contains a 
symlink in /usr/lib, which points to /lib/libvolume.so.0 (the host one!) 
instead of ../../lib/ one...

The first patch attached fixes this in udev and should be a no brainer. Unless 
someone objects, I'll push it in in a day or two.

Since I was debugging the code which actually does this shlib magic in 
package.bbclass, I thought it might be useful to prevent this kind of issues 
in the future by skipping symlinks while looking for SONAME/NEEDED in the 
objdump - please see the second patch attached and provide feedback.

-- 
Denys

[-- Attachment #2: udev-124-libvolume-id-soname.patch --]
[-- Type: text/plain, Size: 1690 bytes --]

diff --git a/packages/udev/udev-124/libvolume-id-soname.patch b/packages/udev/udev-124/libvolume-id-soname.patch
new file mode 100644
index 0000000..56365a4
--- /dev/null
+++ b/packages/udev/udev-124/libvolume-id-soname.patch
@@ -0,0 +1,12 @@
+diff -uNr udev-124-orig/extras/volume_id/lib/Makefile udev-124/extras/volume_id/lib/Makefile
+--- udev-124-orig/extras/volume_id/lib/Makefile	2008-06-12 01:24:30.000000000 -0400
++++ udev-124/extras/volume_id/lib/Makefile	2009-01-14 23:32:42.000000000 -0500
+@@ -113,7 +113,7 @@
+ ifeq ($(libdir),$(usrlibdir))
+ 	ln -sf $(SHLIB) $(DESTDIR)$(usrlibdir)/libvolume_id.so
+ else
+-	ln -sf $(libdir)/$(SHLIB) $(DESTDIR)$(usrlibdir)/libvolume_id.so
++	ln -sf ../..$(libdir)/$(SHLIB) $(DESTDIR)$(usrlibdir)/libvolume_id.so
+ endif
+ 	$(INSTALL) -d $(DESTDIR)$(usrlibdir)/pkgconfig
+ 	$(INSTALL_DATA) libvolume_id.pc $(DESTDIR)$(usrlibdir)/pkgconfig/libvolume_id.pc
diff --git a/packages/udev/udev_124.bb b/packages/udev/udev_124.bb
index 515debe..aa156a1 100644
--- a/packages/udev/udev_124.bb
+++ b/packages/udev/udev_124.bb
@@ -3,13 +3,14 @@ DESCRIPTION = "udev is a daemon which dynamically creates and removes device nod
 the hotplug package and requires a kernel not older than 2.6.12."
 RPROVIDES_${PN} = "hotplug"
 
-PR = "r11"
+PR = "r12"
 
 SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
 	   file://noasmlinkage.patch;patch=1 \
 	   file://flags.patch;patch=1 \
 	   file://vol_id_ld.patch;patch=1 \
 	   file://udevtrigger_add_devname_filtering.patch;patch=1 \
+	   file://libvolume-id-soname.patch;patch=1 \
 	   file://mount.blacklist \
 	   file://run.rules \
 	   "

[-- Attachment #3: package_bbclass-do_shlibs-skip-symlinks.patch --]
[-- Type: text/plain, Size: 606 bytes --]

diff --git a/classes/package.bbclass b/classes/package.bbclass
index 8b7d649..a7cdb5f 100644
--- a/classes/package.bbclass
+++ b/classes/package.bbclass
@@ -615,7 +615,7 @@ python package_do_shlibs() {
 			for file in files:
 				soname = None
 				path = os.path.join(root, file)
-				if os.access(path, os.X_OK) or lib_re.match(file):
+				if (os.access(path, os.X_OK) or lib_re.match(file)) and not os.path.islink(path):
 					cmd = bb.data.getVar('OBJDUMP', d, 1) + " -p " + path + " 2>/dev/null"
 					cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', d, 1), cmd)
 					fd = os.popen(cmd)

             reply	other threads:[~2009-01-15  6:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15  6:14 Denys Dmytriyenko [this message]
2009-01-15  6:56 ` [RFC] Fix udev pulling in libvolume-id-dev Koen Kooi
2009-01-15  7:41   ` Khem Raj
2009-01-15 11:10     ` Koen Kooi
2009-01-15 18:53       ` Khem Raj
2009-01-15 18:57         ` Koen Kooi
2009-03-14  1:08           ` Denys Dmytriyenko
2009-01-15 19:20         ` Tom Rini
2009-01-15 19:41           ` Koen Kooi
2009-01-15 15:58   ` Denys Dmytriyenko
2009-01-15  7:37 ` Khem Raj
2009-01-15 15:51   ` Denys Dmytriyenko
2009-01-18  4:18     ` Denys Dmytriyenko
2009-01-19  0:56       ` 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=20090115061418.GA13352@denix.org \
    --to=denis@denix.org \
    --cc=openembedded-devel@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.