[oe-commits] Koen Kooi : udev 141: fix fragile symlinking by moving it to a smarter postinst

git version control git at git.openembedded.org
Wed Dec 2 18:57:24 UTC 2009


Module: openembedded.git
Branch: martin_jansa/srcpv
Commit: 1dcfb1e77ff379ce8fd0bccaad698ad81c9175f8
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=1dcfb1e77ff379ce8fd0bccaad698ad81c9175f8

Author: Koen Kooi <koen at openembedded.org>
Date:   Wed Dec  2 19:50:19 2009 +0100

udev 141: fix fragile symlinking by moving it to a smarter postinst

---

 recipes/udev/udev_141.bb |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/recipes/udev/udev_141.bb b/recipes/udev/udev_141.bb
index b54b059..e07150d 100644
--- a/recipes/udev/udev_141.bb
+++ b/recipes/udev/udev_141.bb
@@ -6,7 +6,7 @@ LICENSE = "GPL"
 # Untested
 DEFAULT_PREFERENCE = "-1"
 
-PR = "r15"
+PR = "r18"
 
 # needed for init.d script
 RDEPENDS_${PN} += "udev-utils"
@@ -70,7 +70,6 @@ do_install () {
 	# This is hardcoded to $(udev_prefix)/lib/udev/rules.d in the
 	# Makefile, even if libdir is lib64.
 	mv ${D}/lib/udev/rules.d ${D}${sysconfdir}/udev/
-	ln -sf ${sysconfdir}/udev/rules.d ${D}/lib/udev/
 
  	cp ${S}/rules/rules.d/* ${D}${sysconfdir}/udev/rules.d/
 	cp ${S}/rules/packages/* ${D}${sysconfdir}/udev/rules.d/
@@ -99,6 +98,14 @@ do_install_append_h2200() {
 	install -m 0644 ${WORKDIR}/50-hostap_cs.rules         ${D}${sysconfdir}/udev/rules.d/50-hostap_cs.rules
 }
 
+pkg_postinst_${PN}_append() {
+if [ -d $D/lib/udev/rules.d ] ; then
+	echo "$D/lib/udev/rules.d is not a symlink, fixing that"
+	mv $D/lib/udev/rules.d/* $D${sysconfdir}/udev/rules.d/
+	rm -rf $D/lib/udev/rules.d
+	ln -sf ${sysconfdir}/udev/rules.d $D/lib/udev/
+fi
+}
 
 do_stage_append() {
         install -m 0644 ${S}/extras/volume_id/lib/libvolume_id.h ${STAGING_INCDIR}





More information about the Openembedded-commits mailing list