Skip to contentSkip to conversation

introducing udev 177

PATCH New yegorslists at googlemail.com 2 participants 4 messages Jan 20, 2012

lore
Share & tools
lore
#0 lore raw

cover introducing udev 177

This patch series introduces udev 177. A lot of things has been changed since 173:

- udev rules generator was deisabled by default
- udev doesn't create any /dev/ devices any more and relies on devtmpfs
- kmod was introduced to manage kernel modules
- /run directory
- etc.

Changes:
v2: fix dependencies and make verbose commit message (Arnout Vandecappelle)

#1 lore raw

PATCH v2 1/2 Introduce /run directory

From: Yegor Yefremov <[email protected]>

---
 fs/skeleton/run |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 120000 fs/skeleton/run
fs/skeleton/run new file +1 -0
new file mode 120000
index 0000000..1c2f433
@@ -0,0 +1 @@
+tmp
\ No newline at end of file
Signature · 1 line
1.7.1.1
#2 lore raw

PATCH v2 2/2 udev: bump to 177

In reply to yegorslists at googlemail.com

From: Yegor Yefremov <[email protected]>

Changes:
- Linux kernel requirement: 2.6.34 and above (devtmpfs is mandatory)
- usbutils, hwdata are now mandatory, so that
usb.ids and pci.ids paths are provided by default
- persistant rules generator is disabled by default, so option is introduced to enable this option if desired
- new dependencies: kmod and e2fsprogs

---
 package/udev/Config.in |   15 ++++++++++-----
 package/udev/S10udev   |    2 +-
 package/udev/udev.mk   |   16 ++++++++++------
 3 files changed, 21 insertions(+), 12 deletions(-)
package/udev/Config.in +10 -5
index 391c718..8588aa0 100644
@@ -1,6 +1,10 @@
 config BR2_PACKAGE_UDEV
 	bool "udev"
 	depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
+	select BR2_PACKAGE_E2FSPROGS
+	select BR2_PACKAGE_USBUTILS
+	select BR2_PACKAGE_HWDATA
+	select BR2_PACKAGE_KMOD
 	help
 	  Userspace device daemon.
 
@@ -8,19 +12,20 @@ config BR2_PACKAGE_UDEV
 
 if BR2_PACKAGE_UDEV
 
+config BR2_PACKAGE_UDEV_RULES_GEN
+	bool "enable rules generator"
+	help
+	  Enable persistant rules generator
+
 config BR2_PACKAGE_UDEV_ALL_EXTRAS
 	bool "enable all extras"
 	depends on BR2_LARGEFILE # acl
 	depends on BR2_USE_WCHAR # libglib2
 	select BR2_PACKAGE_ACL
-	select BR2_PACKAGE_LIBUSB
-	select BR2_PACKAGE_LIBUSB_COMPAT
-	select BR2_PACKAGE_USBUTILS
-	select BR2_PACKAGE_HWDATA
 	select BR2_PACKAGE_LIBGLIB2
 	help
 	  Enable all extras with external dependencies like
-	  libacl, libusb, libusb-compat, usbutils, hwdata
+	  libacl and libglib2
 
 comment "udev extras requires a toolchain with LARGEFILE + WCHAR support"
 	depends on !(BR2_LARGEFILE && BR2_USE_WCHAR)
package/udev/S10udev +1 -1
index 29eb107..928c7b6 100755
@@ -17,7 +17,7 @@
 #
 
 # Check for missing binaries
-UDEV_BIN=/sbin/udevd
+UDEV_BIN=/lib/udev/udev/udevd
 test -x $UDEV_BIN || exit 5
 
 # Check for config file and read it
package/udev/udev.mk +10 -6
index 1825396..03d1d22 100644
@@ -3,7 +3,7 @@
 # udev
 #
 #############################################################
-UDEV_VERSION = 173
+UDEV_VERSION = 177
 UDEV_SOURCE = udev-$(UDEV_VERSION).tar.bz2
 UDEV_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/kernel/hotplug/
 UDEV_INSTALL_STAGING = YES
@@ -12,19 +12,23 @@ UDEV_CONF_OPT =			\
 	--sbindir=/sbin		\
 	--with-rootlibdir=/lib	\
 	--libexecdir=/lib/udev	\
+	--with-usb-ids-path=$(TARGET_DIR)/usr/share/hwdata/usb.ids	\
+	--with-pci-ids-path=$(TARGET_DIR)/usr/share/hwdata/pci.ids	\
+	--with-firmware-path=/lib/firmware				\
 	--disable-introspection
 
-UDEV_DEPENDENCIES = host-gperf host-pkg-config
+UDEV_DEPENDENCIES = host-gperf host-pkg-config e2fsprogs kmod usbutils hwdata
+
+ifeq ($(BR2_PACKAGE_UDEV_RULES_GEN),y)
+UDEV_CONF_OPT += --enable-rule_generator
+endif
 
 ifeq ($(BR2_PACKAGE_UDEV_ALL_EXTRAS),y)
-UDEV_DEPENDENCIES += libusb libusb-compat acl usbutils hwdata libglib2
+UDEV_DEPENDENCIES += acl libglib2
 UDEV_CONF_OPT +=							\
-	--with-pci-ids-path=$(TARGET_DIR)/usr/share/hwdata/pci.ids	\
-	--with-usb-ids-path=$(TARGET_DIR)/usr/share/hwdata/usb.ids	\
 	--enable-udev_acl
 else
 UDEV_CONF_OPT +=		\
-	--disable-hwdb		\
 	--disable-gudev
 endif
 
Signature · 1 line
1.7.1.1
#3 lore raw

PATCH v2 2/2 udev: bump to 177

Silly me, I hadn't noticed that you had sent a new patch and I replied to
your original reaction... I'll repeat the comments from my previous mail here so it's all in one place. Sorry for the noise. There are also some new comments below. If you've read my previous mail and just want to see the new things: I've marked them with a *.

Since things are getting a bit complex, I'll update and send the v3 patch
myself. Yegor, feel free to review it, ignore it or take it over again.

Quoted 4 lines · On Friday 20 January 2012 11:30:14 yegorslists at googlemail.com wrote:

From: Yegor Yefremov <[email protected]>

Changes:
- Linux kernel requirement: 2.6.34 and above (devtmpfs is mandatory)

* Maybe add this requirement to the udev help text.

Quoted 2 lines

- usbutils, hwdata are now mandatory, so that
usb.ids and pci.ids paths are provided by default

* Actually it's not. The paths aren't verified at compile time, and a
missing file is handled gracefully. So we can compile in the path to the hwdata even if it is missing.

Quoted 3 lines

- persistant rules generator is disabled by default, so option is introduced to enable this option if desired
- new dependencies: kmod and e2fsprogs

e2fsprogs -> util-linux

Quoted 13 lines
---
 package/udev/Config.in |   15 ++++++++++-----
 package/udev/S10udev   |    2 +-
 package/udev/udev.mk   |   16 ++++++++++------
 3 files changed, 21 insertions(+), 12 deletions(-)
package/udev/Config.in +0 -0
index 391c718..8588aa0 100644

package/udev/Config.in line 4

Quoted 4 lines
package/udev/Config.in +1 -0
@@ -1,6 +1,10 @@
 config BR2_PACKAGE_UDEV
 	bool "udev"
 	depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
+	select BR2_PACKAGE_E2FSPROGS

UTIL_LINUX and UTIL_LINUX_BLKID instead of E2FSPROGS

Because of UTIL_LINUX, there is also a dependency on LARGEFILE and WCHAR.

package/udev/Config.in line 6

Quoted 2 lines
package/udev/Config.in +2 -0
+	select BR2_PACKAGE_USBUTILS
+	select BR2_PACKAGE_HWDATA

USBUTILS and HWDATA are optional (like they were).

Quoted 10 lines
package/udev/Config.in +3 -0
+	select BR2_PACKAGE_KMOD
 	help
 	  Userspace device daemon.
 
@@ -8,19 +12,20 @@ config BR2_PACKAGE_UDEV
 
 if BR2_PACKAGE_UDEV
 
+config BR2_PACKAGE_UDEV_RULES_GEN
+	bool "enable rules generator"

package/udev/Config.in config BR2_PACKAGE_UDEV · line 17

Quoted 10 lines
package/udev/Config.in +3 -2
+	help
+	  Enable persistant rules generator
+
 config BR2_PACKAGE_UDEV_ALL_EXTRAS
 	bool "enable all extras"
 	depends on BR2_LARGEFILE # acl
 	depends on BR2_USE_WCHAR # libglib2
 	select BR2_PACKAGE_ACL
-	select BR2_PACKAGE_LIBUSB
-	select BR2_PACKAGE_LIBUSB_COMPAT

These are indeed redundant.

package/udev/Config.in config BR2_PACKAGE_UDEV · line 19

Quoted 2 lines
package/udev/Config.in +0 -2
-	select BR2_PACKAGE_USBUTILS
-	select BR2_PACKAGE_HWDATA

These should stay in the extras.

Quoted 13 lines
package/udev/Config.in +1 -1
 	select BR2_PACKAGE_LIBGLIB2
 	help
 	  Enable all extras with external dependencies like
-	  libacl, libusb, libusb-compat, usbutils, hwdata
+	  libacl and libglib2
 
 comment "udev extras requires a toolchain with LARGEFILE + WCHAR support"
 	depends on !(BR2_LARGEFILE && BR2_USE_WCHAR)
package/udev/S10udev +0 -0
index 29eb107..928c7b6 100755

package/udev/S10udev line 20

Quoted 5 lines
package/udev/S10udev +1 -1
@@ -17,7 +17,7 @@
 #
 
 # Check for missing binaries
-UDEV_BIN=/sbin/udevd
+UDEV_BIN=/lib/udev/udev/udevd

It makes more sense to put it in /lib/udev/ than /lib/udev/udev/

Quoted 17 lines
package/udev/S10udev +0 -0
 test -x $UDEV_BIN || exit 5
 
 # Check for config file and read it
package/udev/udev.mk +1 -1
index 1825396..03d1d22 100644
@@ -3,7 +3,7 @@
 # udev
 #
 #############################################################
-UDEV_VERSION = 173
+UDEV_VERSION = 177
 UDEV_SOURCE = udev-$(UDEV_VERSION).tar.bz2
 UDEV_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/kernel/hotplug/
 UDEV_INSTALL_STAGING = YES

package/udev/udev.mk UDEV_CONF_OPT = \ · line 16

Quoted 5 lines
package/udev/udev.mk +2 -0
@@ -12,19 +12,23 @@ UDEV_CONF_OPT =			\
 	--sbindir=/sbin		\
 	--with-rootlibdir=/lib	\
 	--libexecdir=/lib/udev	\
+	--with-usb-ids-path=$(TARGET_DIR)/usr/share/hwdata/usb.ids	\
+	--with-pci-ids-path=$(TARGET_DIR)/usr/share/hwdata/pci.ids	\

Should be without $(TARGET_DIR), otherwise the path to the buildroot
environment is linked into the udevd executable.

* I just noticed an annoying thing: the hwdata package installs it in
/usr/share/hwdata/usb.ids, while usbutils puts it in /usr/share/usb.ids. Totally unrelated to udev, though :-)

package/udev/udev.mk UDEV_CONF_OPT = \ · line 27

Quoted 13 lines
package/udev/udev.mk +7 -2
+	--with-firmware-path=/lib/firmware				\
 	--disable-introspection
 
-UDEV_DEPENDENCIES = host-gperf host-pkg-config
+UDEV_DEPENDENCIES = host-gperf host-pkg-config e2fsprogs kmod usbutils hwdata
+
+ifeq ($(BR2_PACKAGE_UDEV_RULES_GEN),y)
+UDEV_CONF_OPT += --enable-rule_generator
+endif
 
 ifeq ($(BR2_PACKAGE_UDEV_ALL_EXTRAS),y)
-UDEV_DEPENDENCIES += libusb libusb-compat acl usbutils hwdata libglib2
+UDEV_DEPENDENCIES += acl libglib2

Dependencies should stay as original, except the redundant libusb*

package/udev/udev.mk UDEV_CONF_OPT = \ · line 33

Quoted 9 lines
package/udev/udev.mk +0 -3
 UDEV_CONF_OPT +=							\
-	--with-pci-ids-path=$(TARGET_DIR)/usr/share/hwdata/pci.ids	\
-	--with-usb-ids-path=$(TARGET_DIR)/usr/share/hwdata/usb.ids	\
 	--enable-udev_acl
 else
 UDEV_CONF_OPT +=		\
-	--disable-hwdb		\
 	--disable-gudev
 endif

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F