udev_151: Make it work with uclibc.
authorKhem Raj <raj.khem@gmail.com>
Sat, 5 Jun 2010 01:02:20 +0000 (18:02 -0700)
committerKhem Raj <raj.khem@gmail.com>
Sat, 5 Jun 2010 13:52:42 +0000 (06:52 -0700)
* This only works with uclibc-git version at the moment.
  These two patch should not be needed as well once uclibc
  patches which adds lutimes and defines le16toh are
  committed.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
recipes/udev/udev-151/udev-replace-le16toh.patch [new file with mode: 0644]
recipes/udev/udev-151/udev-replace-lutimes.patch [new file with mode: 0644]
recipes/udev/udev_151.bb

diff --git a/recipes/udev/udev-151/udev-replace-le16toh.patch b/recipes/udev/udev-151/udev-replace-le16toh.patch
new file mode 100644 (file)
index 0000000..7776c9a
--- /dev/null
@@ -0,0 +1,21 @@
+This patch is needed on uclibc.
+
+-Khem
+
+Index: udev-151/extras/ata_id/ata_id.c
+===================================================================
+--- udev-151.orig/extras/ata_id/ata_id.c       2010-06-04 14:08:41.912730501 -0700
++++ udev-151/extras/ata_id/ata_id.c    2010-06-04 14:09:31.492734527 -0700
+@@ -168,7 +168,11 @@ static void disk_identify_fixup_uint16 (
+       uint16_t *p;
+       p = (uint16_t *) identify;
+-      p[offset_words] = le16toh (p[offset_words]);
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++      p[offset_words] = p[offset_words];
++#else
++      p[offset_words] = __bswap_16 (p[offset_words]);
++#endif
+ }
+ /**
diff --git a/recipes/udev/udev-151/udev-replace-lutimes.patch b/recipes/udev/udev-151/udev-replace-lutimes.patch
new file mode 100644 (file)
index 0000000..dd77897
--- /dev/null
@@ -0,0 +1,25 @@
+This patch is needed on uclibc
+
+-Khem
+Index: udev-151/udev/udev-node.c
+===================================================================
+--- udev-151.orig/udev/udev-node.c     2010-06-04 14:18:59.082727182 -0700
++++ udev-151/udev/udev-node.c  2010-06-04 14:20:27.485282812 -0700
+@@ -57,7 +57,7 @@ int udev_node_mknod(struct udev_device *
+                       preserve = 1;
+                       udev_selinux_lsetfilecon(udev, file, mode);
+                       /* update time stamp when we re-use the node, like on media change events */
+-                      utimes(file, NULL);
++                      utimensat(AT_FDCWD, file, NULL, 0);
+               } else {
+                       char file_tmp[UTIL_PATH_SIZE + sizeof(TMP_FILE_EXT)];
+@@ -178,7 +178,7 @@ static int node_symlink(struct udev *ude
+                                       info(udev, "preserve already existing symlink '%s' to '%s'\n",
+                                            slink, target);
+                                       udev_selinux_lsetfilecon(udev, slink, S_IFLNK);
+-                                      lutimes(slink, NULL);
++                                      utimensat(AT_FDCWD, slink, NULL, AT_SYMLINK_NOFOLLOW);
+                                       goto exit;
+                               }
+                       }
index 9bf0872..13f3a02 100644 (file)
@@ -3,7 +3,7 @@ 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."
 LICENSE = "GPLv2+"
 
-PR = "r11"
+PR = "r12"
 
 # Untested
 DEFAULT_PREFERENCE = "-1"
@@ -13,6 +13,8 @@ DEPENDS = "gperf-native usbutils acl glib-2.0"
 RDEPENDS_${PN} += "module-init-tools-depmod udev-utils"
 
 SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
+          file://udev-replace-le16toh.patch \
+          file://udev-replace-lutimes.patch \
           file://mount.blacklist \
           file://run.rules \
           "