[OpenWrt-Devel] [RFC 2/3] udev: Update udev from 106 to 139

2009-03-12 Thread Geoff Levand
From: Geoff Levand geoffrey.lev...@am.sony.com

Update the udev package from udev-106 to udev-139.

The udev package no longer provides separate udev utilities
like udevtrigger and udevsettle.  These have been incorporated
into the udev admin program udevadm. The init scripts have
been updated to use udevadm where appropriate.

The udevtrigger sub package has been replaced with a
udevadm package.

The udevextras sub package has been replaced with
config options to the udev package.

Udev now recommends using the directory '/lib/udev/devices'
to initialize the '/dev' directory at startup.  I setup
the preinit script to check for '/lib/udev/devices', and
copy it to '/dev/ if it is found, then to conditionally
setup /dev the old way with mknod etc.

Signed-off-by: Geoff Levand geoffrey.lev...@am.sony.com
---
I put my name there as the udev package maintainer.  If anyone
would like to take that role, please let me know.

 package/base-files/files/etc/preinit |   12 -
 package/udev/Makefile|  171 +++
 package/udev/files/20-input-grouping.rules   |9 -
 package/udev/patches/001-no_debug.patch  |   22 --
 package/udev/patches/002-udevtrigger_no_config.patch |   12 -
 package/udev/patches/003-portability.patch   |   51 -
 package/udev/patches/010-udev-commit-2236dda.diff|   27 +++
 package/udev/udev-config.in  |   77 
 package/udev/udevextras-config.in|   57 --
 9 files changed, 212 insertions(+), 226 deletions(-)

--- a/package/base-files/files/etc/preinit
+++ b/package/base-files/files/etc/preinit
@@ -40,15 +40,19 @@ elif [ -x /sbin/hotplug2 ]; then
 
 elif [ -x /sbin/udevd ]; then
mount -n -t tmpfs -o mode=0755 udev /dev
-   /sbin/udevd --daemon
-   /sbin/udevtrigger
-   /sbin/udevsettle
+   [ -d /lib/udev/devices ]  cp -af /lib/udev/devices/* /dev/
+   [ -c /dev/console ] || mknod -m 0600 /dev/console c 5 1
+   [ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3
+   /sbin/udevd --daemon --resolve-names=never
+   /sbin/udevadm trigger
+   /sbin/udevadm settle
M0=/dev/pty/ptmx
M1=/dev/pty/ptmx
HOTPLUG=
 fi
 
-mkdir -p /dev/pts /dev/shm
+[ -d /dev/pts ] || mkdir -p /dev/pts
+[ -d /dev/shm ] || mkdir -p /dev/shm
 mount devpts /dev/pts -t devpts
 
 # the shell really doesn't like having stdin/out closed
--- a/package/udev/Makefile
+++ b/package/udev/Makefile
@@ -1,101 +1,130 @@
-# 
+#
 # Copyright (C) 2006-2008 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
-# $Id$
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=udev
-PKG_VERSION:=106
+PKG_VERSION:=139
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=...@kernel/linux/utils/kernel/hotplug/
-PKG_MD5SUM:=320ccd2d0f4540d10e021bafa14f8985
+PKG_MD5SUM:=7e705e237d29734c77bc26f6ccbc4594
 
 include $(INCLUDE_DIR)/package.mk
 
+PKG_INSTALL=1
+
 define Package/udev
-  SECTION:=utils
-  CATEGORY:=Utilities
-  DEPENDS:=...@linux_2_6
-  TITLE:=Dynamic device management subsystem
-  URL:=http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
+   SECTION:=base
+   CATEGORY:=Base system
+   TITLE:=Dynamic device management subsystem
+   URL:=http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
+   DEPENDS:=+udevadm
 endef
 
 define Package/udev/description
- udev provides a dynamic device directory containing only the files for 
- actually present devices. It creates or removes device node files in 
- the /dev directory, or it renames network interfaces.
-endef
-
-define Package/udevtrigger
-$(call Package/udev)
-  SECTION:=base
-  CATEGORY:=Base system
-  TITLE:=Small utility to request kernel devices events for coldplug
-endef
-
-define Package/udevextras
-$(call Package/udev)
-  TITLE:=Utilities for udev scripts, for general device discovery
-  MENU:=1
-endef
-
-define Package/udevextras/config
-  source $(SOURCE)/udevextras-config.in
-endef
-
-UDEV_ALL_EXTRAS=ata_id cdrom_id dasd_id edd_id scsi_id path_id usb_id volume_id
-UDEV_EXTRAS=$(strip $(foreach e, $(UDEV_ALL_EXTRAS), \
-   $(if $(CONFIG_UDEVEXTRAS_$(e)),extras/$(e
-
-define Build/Compile
-   $(MAKE) -C $(PKG_BUILD_DIR) \
-   CROSS_COMPILE=$(TARGET_CROSS) \
-   STRIP=/bin/true \
-   OPTFLAGS=$(TARGET_CFLAGS) \
-   DESTDIR=$(PKG_INSTALL_DIR) \
-   INSTALL=install -c \
-   EXTRAS=$(UDEV_EXTRAS) \
-   VOLUME_ID_STATIC=true \
-   all install
+   udev allows Linux users to have a dynamic /dev directory and it
+   provides the ability to have persistent device names.
 endef
 
-define Package/udev/install
-   install -d -m0775 $(1)/etc/udev
-   $(CP) $(PKG_INSTALL_DIR)/etc/udev/* $(1)/etc/udev/
-   install -d -m0775 

[OpenWrt-Devel] [RFC 1/3] uclibc: Fix ppoll 5th arg

2009-03-12 Thread Geoff Levand
From: Geoff Levand geoffrey.lev...@am.sony.com

This is a backport from uclibc-0.9.31.
Add the missing 5th arg to the ppoll syscall.
Fixes the uclibc error that ppoll returns -EINVAL.

Signed-off-by: Geoff Levand geoffrey.lev...@am.sony.com
---
 toolchain/uClibc/patches/300-fix-ppoll.diff |   39 
 1 file changed, 39 insertions(+)

--- /dev/null
+++ b/toolchain/uClibc/patches/300-fix-ppoll.diff
@@ -0,0 +1,39 @@
+
+It will match kernel's sigset_t starting from 0.9.31.
+
+Please try attached patch.
+-- 
+vda
+
+diff -d -urpN uClibc.0/libc/sysdeps/linux/common/ppoll.c 
uClibc.1/libc/sysdeps/linux/common/ppoll.c
+--- uClibc.0/libc/sysdeps/linux/common/ppoll.c
 uClibc.1/libc/sysdeps/linux/common/ppoll.c
+@@ -17,6 +17,7 @@
+Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.  */
+ 
++#include signal.h
+ #include sys/syscall.h
+ #include sys/poll.h
+ 
+@@ -26,9 +27,9 @@
+ 
+ # define __NR___libc_ppoll __NR_ppoll
+ static inline
+-_syscall4(int, __libc_ppoll, struct pollfd *, fds,
++_syscall5(int, __libc_ppoll, struct pollfd *, fds,
+   nfds_t, nfds, const struct timespec *, timeout,
+-  const __sigset_t *, sigmask);
++  const __sigset_t *, sigmask, size_t, sigsetsize)
+ 
+ int
+ ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
+@@ -43,7 +44,7 @@
+   timeout = tval;
+ }
+ 
+-  return __libc_ppoll(fds, nfds, timeout, sigmask);
++  return __libc_ppoll(fds, nfds, timeout, sigmask, _NSIG / 8);
+ }
+ libc_hidden_def(ppoll)
+ 

-- 

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC 3/3] hotplug2: Update hotplug2-0.9 to use udev-139

2009-03-12 Thread Geoff Levand
From: Geoff Levand geoffrey.lev...@am.sony.com

The udev package no longer provides a seperate udevtrigger
utility.  Add a hotplug2 patch '130-update-for-udev-139.patch'
that makes hotplug2-0.9 use 'udevadm trigger'.

Also, move the hotplug2 dependency on udevadm from
the top level target.mk to the hotplug2 Makefile.

Signed-off-by: Geoff Levand geoffrey.lev...@am.sony.com
---
 include/target.mk  |2 
 package/hotplug2/Makefile  |3 -
 package/hotplug2/patches/130-update-for-udev-139.patch |   37 +
 3 files changed, 40 insertions(+), 2 deletions(-)

--- a/include/target.mk
+++ b/include/target.mk
@@ -18,7 +18,7 @@ DEFAULT_PACKAGES.router:=dnsmasq iptable
 
 # Additional packages for Linux 2.6
 ifneq ($(KERNEL),2.4)
-  DEFAULT_PACKAGES += udevtrigger hotplug2
+  DEFAULT_PACKAGES += hotplug2
 endif
 
 # Add device specific packages
--- a/package/hotplug2/Makefile
+++ b/package/hotplug2/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hotplug2
 PKG_VERSION:=0.9
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://isteve.bofh.cz/~isteve/hotplug2
@@ -24,6 +24,7 @@ define Package/hotplug2
   VERSION:=0.9+r102-$(PKG_RELEASE)
   TITLE:=Dynamic device management subsystem for embedded systems
   URL:=http://isteve.bofh.cz/~isteve/hotplug2/
+  DEPENDS:=+udevadm
 endef
 
 define Package/hotplug2/description
--- /dev/null
+++ b/package/hotplug2/patches/130-update-for-udev-139.patch
@@ -0,0 +1,37 @@
+The udev package no longer provides a seperate udevtrigger utility.
+Patch hotplug2 to use 'udevadm trigger'.
+
+--- a/hotplug2.c
 b/hotplug2.c
+@@ -504,8 +504,6 @@ end_rules:
+   signal(SIGCHLD, sighandler);
+   
+   if (coldplug) {
+-  if (coldplug_command == NULL)
+-  coldplug_command = UDEVTRIGGER_COMMAND;
+   coldplug_p = fork();
+   switch (coldplug_p) {
+   case FORK_ERROR:
+@@ -514,7 +512,10 @@ end_rules:
+   goto exit;
+   break;
+   case 0:
+-  execlp(coldplug_command, coldplug_command, 
NULL);
++  if (!coldplug_command)
++  execlp(UDEVTRIGGER_COMMAND, 
UDEVTRIGGER_COMMAND, trigger, NULL);
++  else
++  execlp(coldplug_command, 
coldplug_command, NULL);
+   ERROR(coldplug,Coldplug exec ('%s') failed: 
%s., coldplug_command, strerror(errno));
+   goto exit;
+   break;
+--- a/hotplug2.h
 b/hotplug2.h
+@@ -54,7 +54,7 @@
+ #define ACTION_REMOVE 1
+ #define ACTION_UNKNOWN-1
+ 
+-#define UDEVTRIGGER_COMMAND   /sbin/udevtrigger, /sbin/udevtrigger
++#define UDEVTRIGGER_COMMAND   /sbin/udevadm
+ 
+ #define FORK_CHILD0
+ #define FORK_ERROR-1

-- 

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel