Skip to contentSkip to conversation

udev 018 release

ANNOUNCE Greg KH 9 participants 28 messages Feb 19, 2004 – Feb 24, 2004

lore
Share & tools
lore

Greg KH

author
#0 lore raw

I've released the 018 version of udev. It can be found at:
kernel.org/pub/linux/utils/kernel/hotplug/udev-018.tar.gz

rpms built against Red Hat FC2-test1 are available at:

	kernel.org/pub/linux/utils/kernel/hotplug/udev-018-1.i386.rpm

with the source rpm at:
kernel.org/pub/linux/utils/kernel/hotplug/udev-018-1.src.rpm

udev allows users to have a dynamic /dev and provides the ability to have persistent device names. It uses sysfs and /sbin/hotplug and runs entirely in userspace. It requires a 2.6 kernel with CONFIG_HOTPLUG enabled to run. Please see the udev FAQ for any questions about it:
kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ

For any udev vs devfs questions anyone might have, please see:
kernel.org/pub/linux/utils/kernel/hotplug/udev_vs_devfs

Major changes from the 017 version:
- We now handle the ability to generate all partitions for a device to allow removable devices to work in a sane manner. This has been requested by a lot of people.
- there's a new %s{} modifier available for people to use
- the SYSFS_ style rule has changed to SYSFS{}. The old style is still supported for now, but you have been warned
- %c1 style modifiers has been changed to %c{1}. Again, the old style format still works.
- scsi_id is built by default now in the rpm and is available in the pre-built rpm package. This should get it a wider range of testing.
- lots of bug fixes and other cleanups.

In all, there is nothing hugely major in this release, but any current users of udev will want this version for all of the bugfixes if for nothing else.

Thanks to everyone who has send me patches for this release, a full list of everyone, and their changes is below.

udev development is done in a BitKeeper repository located at:
bk://linuxusb.bkbits.net/udev

Daily snapshots of udev from the BitKeeper tree can be found at:
http://www.codemonkey.org.uk/projects/bitkeeper/udev/
If anyone ever wants a tarball of the current bk tree, just email me.

thanks,

greg k-h

Summary of changes from v017 to v018
======================

<ext.devoteam.varoqui:sncf.fr>:
o [PATCH] symlink dm-[0-9]* rule
o update extras/multipath

<john-hotplug:fjellstad.org>:
o init.d debian patch

Kay Sievers:
o udev - TODO update
o udev - add %s{filename} to man page
o udev - udevd/udevsend man page
o udev - switch callout part selector to {attribute}
o udev - switch SYSFS_file to SYSFS{file}
o udev - create all partitions of blockdevice
o allow SYSFS{file}
o Adding '%s' format specifier to NAME and SYMLINK

Greg Kroah-Hartman:
o added some scsi_id files to the bk ignore file
o added scsi_id and some more documentation to the udev.spec file
o update udev.rules.gentoo with new config file format
o Update the Gentoo udev.rules and udev.permissions files
o Create a udev.rules.examples file to hold odd udev.rules
o add udevd priority issue to the TODO list
o more HOWTO cleanups
o add HOWTO detailing how to use udev to manage /dev
o mv libsysfs/libsysfs.h to libsysfs/sysfs/libsysfs.h to make it easier to use
o add start_udev init script
o add support for UDEV_NO_SLEEP env variable so Gentoo people will be happy
o start up udevd ourselves in the init script to give it some good priorities
o update the red hat init script to handle nodes that are not present
o add a "old style" SYSFS_attribute test to udev-test.pl
o Have udevsend report more info in debug mode
o Have udevd report it's version in debug mode
o fix up bug created for udevtest in previous partition creation patch
o update the udev.spec to add udevtest and make some more Red Hat suggested changes
o add ability to install udevtest to Makefile
o 017_bk mark
o Add another test to udev-test.pl and fix a bug when only running 1 test
o Fix bug where we did not use the "converted" kernel name if we had no rule
o v017 release TAG: v017

Patrick Mansfield:
o udev use new libsysfs header file location
o udev add some ID tests

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#1 lore raw
Quoted 2 lines · Greg KH

I've released the 018 version of udev. It can be found at:
kernel.org/pub/linux/utils/kernel/hotplug/udev-018.tar.gz

As of this release, I've been running with udev managing my /dev for me exclusively on my main email and development machine. This is a major milestone for udev and it proves that it is a viable solution.

I'd like to say thanks to everyone who has made this possible to do:
- Pat Mochel for creating sysfs and listening to my crazy ideas about how we could create a userspace devfs all those years ago.
- Dan Stekloff for prodding me to actually implement this crazy idea and who came up with a solid initial design document, without which this project would have never left the dream stage.
- Kay Sievers for almost single-handedly taking over the whole udev TODO list and converting udev from a small "proof of concept" toy into a powerful and useful tool.
- Pat Mansfield for creating the scsi_id tool and enabling udev to call external programs, which instantly made udev a real tool in the fine Unix tradition.
- All of the Gentoo developers who integrated udev into their distro and showed me that it can actually run a machine.
- everyone who has sent in udev patches, bug reports, and feature requests. Without these udev would only work for me, and not the rest of the world. A community is very important.
- the distros for picking up udev without me having to beg :)
- everyone else who I know I've forgotten...

udev development isn't done, but for anyone who has not checked it out yet, I suggest you do so. I'll post a small HOWTO that shows how to configure udev to manage your /dev without any problems or legacy issues (the 2.4 kernel will still work just fine on the same box.)

If anyone has any suggestions for things that are lacking in udev, please let me and the linux-hotplug-devel mailing list. This especially goes for any distro developers who are trying to integrate it into their systems.

thanks again,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 7 lines · you
Quoted 2 lines · Greg KH

I've released the 018 version of udev. It can be found at:
kernel.org/pub/linux/utils/kernel/hotplug/udev-018.tar.gz

As of this release, I've been running with udev managing my /dev for me exclusively on my main email and development machine. This is a major milestone for udev and it proves that it is a viable solution.

I'm running udev for some time now on my main development machine and it works (almost) great.
Thanks Greg and all the others who made it possible!

But I've a little issue left. My parallel port doesn't show up in /udev. I guess it's because of missing sysfs support? I'm running linux-2.6.3.
I did not find an entry for the parallel port in sysfs. If I create the device node manually I can access lp.

- --
Regards Michael Buesch [ http://www.tuxsoft.de.vu ]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFANgIcFGK1OIvVOP4RAlMNAJ4zv/qII8xajnelmmgCw7efVJqjTwCfVs4D /7k2jBdxoXYwSIHn+iSreYA=/yKw
-----END PGP SIGNATURE-----

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#3 lore raw
Quoted 5 lines · Michael Buesch

But I've a little issue left. My parallel port doesn't show up in /udev. I guess it's because of missing sysfs support? I'm running linux-2.6.3.
I did not find an entry for the parallel port in sysfs. If I create the device node manually I can access lp.

Yes, that driver has not been converted to use sysfs yet. It's on the list of drivers to convert, only 162 more to go... :(

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#4 lore raw

HOWTO use udev to manage /dev

In reply to Greg KH

Here's a small document that I've added to the udev tarball that explains how I managed to get udev to manage my /dev tree on a Red Hat Fedora based machine. All you Gentoo developers can just laugh as it's already integrated into your distro.

Any users of other distros, feel free to send me updates to this to show how to do it for yours. Any distro maintainers, feel free to just integrate udev into your system so this kind of tweaking isn't necessary :)

thanks,

greg k-

---------------------------------------

HOWTO use udev to manage /dev

This document describes one way to get udev working on a Fedora-development machine to manage /dev. This procedure may be used to get udev to manage /dev on other distros, if you modify some of the steps.

This will only work if you use a 2.6 based kernel, preferably the most recent one. This does not prevent your machine from using a 2.4 kernel, if you boot into one, udev will not run and your old /dev will be present with no changes needed.

NOTE NOTE NOTE NOTE NOTE NOTE NOTE
This is completely unsupported. Attempting to do this may cause your machine to be unable to boot properly. USE AT YOUR OWN RISK. Always have a rescue disk or CD handy to allow you to fix up any errors that may occur.
NOTE NOTE NOTE NOTE NOTE NOTE NOTE

- Build and install udev as specified in the README that comes with udev. I recommend using the following build options to get the smallest possible binaries:
make USE_KLIBC=true USE_LOGúlse DEBUGúlse

- disable udev from the boot process by running:
chkconfig udev off
or
chkconfig --del udev
as root.

- place the start_udev script somewhere that is accessible by your initscripts. I placed it into /etc/rc.d with the following command:
copy extras/start_udev /etc/rc.d/

- modify the rc.sysinit script to call the start_udev script as one of the first things that it does, but after /proc and /sys are mounted. I did this with the latest Fedora startup scripts with the patch at the end of this file.

- make sure the /etc/udev/udev.conf file lists the udev_root as /dev. It should contain the following line in order to work properly.

	udev_root="/dev/"

- reboot into a 2.6 kernel and watch udev create all of the initial device nodes in /dev

If anyone has any problems with this, please let me, and the [email protected] mailing list know.

A big thanks go out to the Gentoo developers for showing me that this is possible to do.

Greg Kroah-Hartman
<[email protected]>

----------------------------------
Patch to modify rc.sysinit to call udev at the beginning of the boot process:

etc/rc.sysinit renamed from etc/rc.sysinit.orig +3 -0
@@ -32,6 +32,9 @@
 
 . /etc/init.d/functions
 
+# start udev to populate /dev
+/etc/rc.d/start_udev
+
 if [ "$HOSTTYPE" != "s390" -a "$HOSTTYPE" != "s390x" ]; then
   last=0
   for i in `LC_ALL=C grep '^[0-9].*respawn:/sbin/mingetty' /etc/inittab | sed 's/^.* tty\([0-9][0-9]*\).*/\1/g'`; do

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw

Re: HOWTO use udev to manage /dev

Here is a question for you. Presently both the serial ttys and VT ttys share the same major number. Minor number 1 to 63 is allocated to the VTs and 64 and above to serial ttys. One of the great limitations for my home system is that I can have only 63 VTs. Can udev work around this limitation?

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#6 lore raw

Re: HOWTO use udev to manage /dev

Quoted 6 lines · James Simmons

Here is a question for you. Presently both the serial ttys and VT ttys share the same major number. Minor number 1 to 63 is allocated to the VTs and 64 and above to serial ttys. One of the great limitations for my home system is that I can have only 63 VTs. Can udev work around this limitation?

udev can create different /dev nodes for these devices. But as udev does not modify the kernel code at all, it can not "solve" the duplication of numbers in the kernel at all. Nor is it meant to.

Hope this helps,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#7 lore raw

Re: HOWTO use udev to manage /dev

Quoted 4 lines

udev can create different /dev nodes for these devices. But as udev does not modify the kernel code at all, it can not "solve" the duplication of numbers in the kernel at all. Nor is it meant to.

Okay. If I change the major number of serial ttys inside the kernel of course udev would properly handle this. Now the question is would this break userland applications using the serial port?

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#8 lore raw

Re: HOWTO use udev to manage /dev

Quoted 8 lines · James Simmons
Quoted 4 lines

udev can create different /dev nodes for these devices. But as udev does not modify the kernel code at all, it can not "solve" the duplication of numbers in the kernel at all. Nor is it meant to.

Okay. If I change the major number of serial ttys inside the kernel of course udev would properly handle this. Now the question is would this break userland applications using the serial port?

Userland apps use /dev names, not major:minor number pairs, right? So userspace should be just fine as long as you tell it the proper /dev name to use.

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#9 lore raw

Re: HOWTO use udev to manage /dev

Quoted 8 lines
Quoted 4 lines

Okay. If I change the major number of serial ttys inside the kernel of course udev would properly handle this. Now the question is would this break userland applications using the serial port?

Userland apps use /dev names, not major:minor number pairs, right? So userspace should be just fine as long as you tell it the proper /dev name to use.

Just want to make sure.

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#10 lore raw

Re: HOWTO use udev to manage /dev

In reply to James Simmons
Quoted 3 lines · James Simmons

Okay. If I change the major number of serial ttys inside the kernel of course udev would properly handle this. Now the question is would this break userland applications using the serial port?

Yes, a few of them.
Ordinarily, userland software uses pathnames in /dev. But some software knows too much.

In dietlibc-0.20 one can read:

char *ttyname(int fd) {
...

  if (S_ISCHR(s.st_mode)) {
    n=minor(s.st_rdev);
    switch (major(s.st_rdev)) {
    case 4:
...
    case 2:
...
    case 136:
    case 137:
    case 138:
    case 139:

...
}

This code knows about the actual values of majors. There are lots of examples like this.

For stable use of Linux one must preserve the 16-bit legacy area.

On the other hand, if the goal is to find and eradicate all such ugly uses of explicit device numbers, Linus' idea to make it all random will certainly help.
(But a big grep for st_rdev might be more efficient.)

Andries

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#11 lore raw

Re: HOWTO use udev to manage /dev

Quoted 25 lines · Andries Brouwer
Quoted 3 lines · James Simmons

Okay. If I change the major number of serial ttys inside the kernel of course udev would properly handle this. Now the question is would this break userland applications using the serial port?

Yes, a few of them.
Ordinarily, userland software uses pathnames in /dev. But some software knows too much.

In dietlibc-0.20 one can read:

char *ttyname(int fd) {
...

  if (S_ISCHR(s.st_mode)) {
    n=minor(s.st_rdev);
    switch (major(s.st_rdev)) {
    case 4:
...
    case 2:
...
    case 136:
    case 137:
    case 138:
    case 139:
Quoted 5 lines

...
}

This code knows about the actual values of majors. There are lots of examples like this.

dietlibc actually uses readlink from /proc/sef/fd/. The code you quote is used only if one #undef SLASH_PROC_OK in dietfeatures.h. Few people will use this, and those that do probably have a good reason.

Johannes

author
#12 lore raw

Re: HOWTO use udev to manage /dev

In reply to Andries Brouwer
Quoted 4 lines · Andries Brouwer

On the other hand, if the goal is to find and eradicate all such ugly uses of explicit device numbers, Linus' idea to make it all random will certainly help.
(But a big grep for st_rdev might be more efficient.)

That will be one goal of 2.7 :)

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#13 lore raw

Re: HOWTO use udev to manage /dev

In reply to Greg KH
Quoted 7 lines · Greg KH

- modify the rc.sysinit script to call the start_udev script as one of the first things that it does, but after /proc and /sys are mounted. I did this with the latest Fedora startup scripts with the patch at the end of this file.

- make sure the /etc/udev/udev.conf file lists the udev_root as /dev. It should contain the following line in order to work properly.

Quoted 8 lines
	udev_root="/dev/"

- reboot into a 2.6 kernel and watch udev create all of the initial device nodes in /dev

If anyone has any problems with this, please let me, and the [email protected] mailing list know.

Unless I'm missing something, it doesn't seem to work if you don't have /dev/null before it gets mounted.

I got

Creating initial udev device nodes:
/etc/rc.d/start_udev: line 90: cannot redirect standard input from /dev/null: No such file or directory.

and it didn't boot.

My first rc.S lines have:

mount -vn -t proc proc /proc # Needed for LABEL= in /etc/fstab

mount -vn -t sysfs sysfs /sys

/etc/rc.d/start_udev

Signature · 12 lines
http://www.pervalidus.net/contact.html


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#14 lore raw

Re: HOWTO use udev to manage /dev

Quoted 10 lines · Frédéric L. W. Meunier

Unless I'm missing something, it doesn't seem to work if you don't have /dev/null before it gets mounted.

I got

Creating initial udev device nodes:
/etc/rc.d/start_udev: line 90: cannot redirect standard input from /dev/null: No such file or directory.

and it didn't boot.

Quoted 7 lines

My first rc.S lines have:

mount -vn -t proc proc /proc # Needed for LABEL= in /etc/fstab

mount -vn -t sysfs sysfs /sys

/etc/rc.d/start_udev

Sorry, forgot to mention that line 90 is
$udevd &

since I added a
mknod /dev/fb0 c 29 0

just before
run_udev

Is it the right procedure until udev created the frame buffer devices ?

Signature · 12 lines
http://www.pervalidus.net/contact.html


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
author
#15 lore raw

Re: HOWTO use udev to manage /dev

In reply to Frédéric L. W. Meunier
Quoted 15 lines · Frédéric L. W. Meunier
Quoted 13 lines · Greg KH

- modify the rc.sysinit script to call the start_udev script as one of the first things that it does, but after /proc and /sys are mounted. I did this with the latest Fedora startup scripts with the patch at the end of this file.

- make sure the /etc/udev/udev.conf file lists the udev_root as /dev. It should contain the following line in order to work properly.

	udev_root="/dev/"

- reboot into a 2.6 kernel and watch udev create all of the initial device nodes in /dev

Quoted 5 lines
Quoted 2 lines

If anyone has any problems with this, please let me, and the [email protected] mailing list know.

Unless I'm missing something, it doesn't seem to work if you don't have /dev/null before it gets mounted.

Did you build udev using glibc or klibc? I used klibc and it worked just fine, as udev and udevd does not need /dev/null to work, unlike programs built against glibc.

As for needing the fb nodes, you should probably just add them to the start_udev script in the section that we add the other needed symlinks to /dev until the kernel starts exporting those sysfs entries (hopefully any day now...)

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#16 lore raw

Re: HOWTO use udev to manage /dev

Quoted 19 lines · Greg KH
Quoted 18 lines · Frédéric L. W. Meunier
Quoted 15 lines · Greg KH

- modify the rc.sysinit script to call the start_udev script as one of the first things that it does, but after /proc and /sys are mounted. I did this with the latest Fedora startup scripts with the patch at the end of this file.

- make sure the /etc/udev/udev.conf file lists the udev_root as /dev. It should contain the following line in order to work properly.

	udev_root="/dev/"

- reboot into a 2.6 kernel and watch udev create all of the initial device nodes in /dev

If anyone has any problems with this, please let me, and the [email protected] mailing list know.

Quoted 6 lines
Quoted 2 lines

Unless I'm missing something, it doesn't seem to work if you don't have /dev/null before it gets mounted.

Did you build udev using glibc or klibc? I used klibc and it worked just fine, as udev and udevd does not need /dev/null to work, unlike programs built against glibc.

I used your instructions, so klibc.

# ldd /sbin/udev*

/sbin/udev:
not a dynamic executable
/sbin/udevd:
not a dynamic executable
/sbin/udevinfo:
not a dynamic executable
/sbin/udevsend:
not a dynamic executable
/sbin/udevtest:
not a dynamic executable

It doesn't complain if I mount in /udev after I boot with devfs, probably because it can find /dev/null etc. But I want to boot with devfs=nomount and use it in /dev.

I changed /etc/rc.d/rc.S to:

[ -e /dev/.devfsd -a -x /sbin/devfsd ] && devfsd /dev

mount -vn -t proc proc /proc # Needed for LABEL= in /etc/fstab

mount -vn -t sysfs sysfs /sys

[ ! -e /dev/.devfsd -a -d /sys/block ] && /etc/rc.d/start_udev

but it shouldn't make any difference. It's just to not use both at the same time or try to run the script in 2.4.

Signature · 12 lines
http://www.pervalidus.net/contact.html


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
author
#17 lore raw

Re: HOWTO use udev to manage /dev

Quoted 43 lines · Frédéric L. W. Meunier
Quoted 19 lines · Greg KH
Quoted 18 lines · Frédéric L. W. Meunier
Quoted 15 lines · Greg KH

- modify the rc.sysinit script to call the start_udev script as one of the first things that it does, but after /proc and /sys are mounted. I did this with the latest Fedora startup scripts with the patch at the end of this file.

- make sure the /etc/udev/udev.conf file lists the udev_root as /dev. It should contain the following line in order to work properly.

	udev_root="/dev/"

- reboot into a 2.6 kernel and watch udev create all of the initial device nodes in /dev

If anyone has any problems with this, please let me, and the [email protected] mailing list know.

Quoted 6 lines
Quoted 2 lines

Unless I'm missing something, it doesn't seem to work if you don't have /dev/null before it gets mounted.

Did you build udev using glibc or klibc? I used klibc and it worked just fine, as udev and udevd does not need /dev/null to work, unlike programs built against glibc.

I used your instructions, so klibc.

# ldd /sbin/udev*

/sbin/udev:
not a dynamic executable
/sbin/udevd:
not a dynamic executable
/sbin/udevinfo:
not a dynamic executable
/sbin/udevsend:
not a dynamic executable
/sbin/udevtest:
not a dynamic executable

Quoted 3 lines

It doesn't complain if I mount in /udev after I boot with devfs, probably because it can find /dev/null etc. But I want to boot with devfs=nomount and use it in /dev.

I agree, that would be the best.

So if you take out the line about starting udevd, does it work for you?

How about changing the #!/bin/bash to #!/bin/sash in the first line for the start_udev script?

What distro is this?

Can you run strace on the start_udev script after boot to see who is needing access to /dev/null?

Oh, and if you create the /dev/null node as the first thing in the start_udev script does that work?

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#18 lore raw

Re: HOWTO use udev to manage /dev

Quoted 2 lines · Greg KH

So if you take out the line about starting udevd, does it work for you?

No.

Quoted 2 lines

How about changing the #!/bin/bash to #!/bin/sash in the first line for the start_udev script?

I didn't have it, but compiled and changed. Yes, it works.

Quoted 1 line

What distro is this?

Slackware, with a cute rc.S. /bin/bash was also recompiled, shared:

$ ldd /bin/bash
        libreadline.so.4 => /usr/lib/libreadline.so.4 (0x4001c000)
        libhistory.so.4 => /usr/lib/libhistory.so.4 (0x40049000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x40050000)
        libdl.so.2 => /lib/libdl.so.2 (0x4008f000)
        libc.so.6 => /lib/libc.so.6 (0x40092000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Maybe the problem ? Does yours differ ?

bash from Slackware:

        libtermcap.so.2 => /lib/libtermcap.so.2 (0x4001c000)
        libdl.so.2 => /lib/libdl.so.2 (0x4005c000)
        libc.so.6 => /lib/libc.so.6 (0x4005f000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

OK, I'll later boot with it and see if it works. If it does, I'll run strace with the other.

Quoted 2 lines

Can you run strace on the start_udev script after boot to see who is needing access to /dev/null?

I forgot to run it, but noticed there was a /dev/null, but a text file (0644). And I didn't create it anywhere.

Quoted 2 lines

Oh, and if you create the /dev/null node as the first thing in the start_udev script does that work?

No.

Signature · 12 lines
http://www.pervalidus.net/contact.html


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#19 lore raw

Re: HOWTO use udev to manage /dev

Quoted 18 lines · Frédéric L. W. Meunier
Quoted 1 line · Greg KH

What distro is this?

Slackware, with a cute rc.S. /bin/bash was also recompiled, shared:

$ ldd /bin/bash
        libreadline.so.4 => /usr/lib/libreadline.so.4 (0x4001c000)
        libhistory.so.4 => /usr/lib/libhistory.so.4 (0x40049000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x40050000)
        libdl.so.2 => /lib/libdl.so.2 (0x4008f000)
        libc.so.6 => /lib/libc.so.6 (0x40092000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Maybe the problem ? Does yours differ ?

bash from Slackware:

Quoted 7 lines
        libtermcap.so.2 => /lib/libtermcap.so.2 (0x4001c000)
        libdl.so.2 => /lib/libdl.so.2 (0x4005c000)
        libc.so.6 => /lib/libc.so.6 (0x4005f000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

OK, I'll later boot with it and see if it works. If it does, I'll run strace with the other.

No, it also fails. Does it only work with a static bash ?

Signature · 12 lines
http://www.pervalidus.net/contact.html


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
author
#20 lore raw

Re: HOWTO use udev to manage /dev

In reply to Frédéric L. W. Meunier
Quoted 24 lines · Frédéric L. W. Meunier
Quoted 2 lines · Greg KH

So if you take out the line about starting udevd, does it work for you?

No.

Quoted 2 lines

How about changing the #!/bin/bash to #!/bin/sash in the first line for the start_udev script?

I didn't have it, but compiled and changed. Yes, it works.

Quoted 1 line

What distro is this?

Slackware, with a cute rc.S. /bin/bash was also recompiled, shared:

$ ldd /bin/bash
        libreadline.so.4 => /usr/lib/libreadline.so.4 (0x4001c000)
        libhistory.so.4 => /usr/lib/libhistory.so.4 (0x40049000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x40050000)
        libdl.so.2 => /lib/libdl.so.2 (0x4008f000)
        libc.so.6 => /lib/libc.so.6 (0x40092000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
Quoted 1 line

Maybe the problem ? Does yours differ ?

Mine does differ, but it is dynamic:

$ ldd /bin/bash
        linux-gate.so.1 =>  (0xffffe000)
        libtermcap.so.2 => /lib/libtermcap.so.2 (0x4d5b5000)
        libdl.so.2 => /lib/libdl.so.2 (0x4d3b4000)
        libc.so.6 => /lib/tls/libc.so.6 (0x4d254000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x4d238000)
Quoted 9 lines

bash from Slackware:

        libtermcap.so.2 => /lib/libtermcap.so.2 (0x4001c000)
        libdl.so.2 => /lib/libdl.so.2 (0x4005c000)
        libc.so.6 => /lib/libc.so.6 (0x4005f000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

OK, I'll later boot with it and see if it works. If it does, I'll run strace with the other.

How about using sash? That is statically linked.

Quoted 5 lines
Quoted 2 lines

Can you run strace on the start_udev script after boot to see who is needing access to /dev/null?

I forgot to run it, but noticed there was a /dev/null, but a text file (0644). And I didn't create it anywhere.

That sounds like some program is trying to write to it.

Hm, there is a patch in the Red Hat version of udev that basically makes udev do the start_udev logic, in the .c file because they do not have a shell in their initrd. If you can dig it out of there, that might be a solution for you to use.

Other than that, how about running strace on start_udev when your rc.S script calls it? That might help out.

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#21 lore raw

Re: HOWTO use udev to manage /dev

Quoted 6 lines · Greg KH
Quoted 5 lines · Frédéric L. W. Meunier
Quoted 2 lines · Greg KH

How about changing the #!/bin/bash to #!/bin/sash in the first line for the start_udev script?

Quoted 6 lines
Quoted 4 lines

I didn't have it, but compiled and changed. Yes, it works.

OK, I'll later boot with it and see if it works. If it does, I'll run strace with the other.

How about using sash? That is statically linked.

As I reported, it works with it.

Quoted 4 lines
Quoted 2 lines

I forgot to run it, but noticed there was a /dev/null, but a text file (0644). And I didn't create it anywhere.

That sounds like some program is trying to write to it.

I bet it was fsck. It was the last to run before sulogin.

Quoted 4 lines

Hm, there is a patch in the Red Hat version of udev that basically makes udev do the start_udev logic, in the .c file because they do not have a shell in their initrd. If you can dig it out of there, that might be a solution for you to use.

Sounds good to get rid of the script. I'll see.

Quoted 2 lines

Other than that, how about running strace on start_udev when your rc.S script calls it? That might help out.

I did it, and guess what, it worked.

-[ ! -e /dev/.devfsd -a -d /sys/block ] && /etc/rc.d/start_udev
+[ ! -e /dev/.devfsd -a -d /sys/block ] && strace -o /tmp/udev.txt /etc/rc.d/start_udev

Signature · 12 lines
http://www.pervalidus.net/contact.html


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#22 lore raw

Re: HOWTO use udev to manage /dev

I noticed I had a lot of devices created by udev in the disk (in /dev), including /dev/null, so I removed all, but it obviously didn't work anymore because without /dev/console init complains, doesn't start, and reboots.

I guess it isn't that easy to use devfs without any devices in the disk ?

I'll readd /dev/console.

Signature · 12 lines
http://www.pervalidus.net/contact.html


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#23 lore raw

Re: HOWTO use udev to manage /dev

In reply to Greg KH
Quoted 3 lines · Greg KH

Did you build udev using glibc or klibc? I used klibc and it worked just fine, as udev and udevd does not need /dev/null to work, unlike programs built against glibc.

Downside is that when klibc is used, udev cannot link with DBUS libraries
linked with glibc.

Signature · 2 lines
Tomasz Torcz               "Never underestimate the bandwidth of a station 
[email protected]    wagon filled with backup tapes." -- Jim Gray 
#24 lore raw

Re: HOWTO use udev to manage /dev

In reply to Greg KH
Quoted 3 lines · Greg KH
Quoted 2 lines

I forgot to run it, but noticed there was a /dev/null, but a text file (0644). And I didn't create it anywhere.

That sounds like some program is trying to write to it.

It's the shell (both bash and dash), when "&" is used.
For the debian package I choose to create /dev/null with mknod before starting udevd.

Quoted 1 line

Hm, there is a patch in the Red Hat version of udev that basically makes

BTW, where can I find this red hat SRPMS?

Signature · 13 lines
ciao, |
Marco | [4692 giUNXjrsFD.2k]


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#25 lore raw

Re: HOWTO use udev to manage /dev

In reply to Greg KH
Quoted 8 lines · Marco d'Itri
Quoted 3 lines · Greg KH
Quoted 2 lines

I forgot to run it, but noticed there was a /dev/null, but a text file (0644). And I didn't create it anywhere.

That sounds like some program is trying to write to it.

It's the shell (both bash and dash), when "&" is used.
For the debian package I choose to create /dev/null with mknod before starting udevd.

dash ? If it's sash, it worked fine here. The same with bash when I used

[ ! -e /dev/.devfsd -a -d /sys/block ] && strace -o /tmp/udev.txt /etc/rc.d/start_udev

instead of

[ ! -e /dev/.devfsd -a -d /sys/block ] && /etc/rc.d/start_udev

Quoted 2 lines
Quoted 1 line

Hm, there is a patch in the Red Hat version of udev that basically makes

BTW, where can I find this red hat SRPMS?

I too can't find it.
http://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/udev-016-2.src.rpm
doesn't contain any such changes.

Signature · 12 lines
http://www.pervalidus.net/contact.html


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#26 lore raw
In reply to Greg KH

Hi Greg,

could it be that udev 018 deosn't compile against 2.6.3 kernel headers? I am not sure if this is the case or if the gentoo ebuild or archive has some trouble:
In Datei, eingefügt von /var/tmp/portage/udev-018/work/udev-018/libsysfs/sysfs_bus.c:23:
/var/tmp/portage/udev-018/work/udev-018/libsysfs/sysfs/libsysfs.h:27:19:
dlist.h: Datei oder Verzeichnis nicht gefunden
/

And then a hunk of errors. (Above states that libsysfs.h cannot find dlist.h.)

bye,

Prakash

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#27 lore raw
Quoted 11 lines · Prakash K. Cheemplavam

Hi Greg,

could it be that udev 018 deosn't compile against 2.6.3 kernel headers? I am not sure if this is the case or if the gentoo ebuild or archive has some trouble:
In Datei, eingefügt von /var/tmp/portage/udev-018/work/udev-018/libsysfs/sysfs_bus.c:23:
/var/tmp/portage/udev-018/work/udev-018/libsysfs/sysfs/libsysfs.h:27:19:
dlist.h: Datei oder Verzeichnis nicht gefunden
/

Quoted 2 lines

And then a hunk of errors. (Above states that libsysfs.h cannot find dlist.h.)

It's a build error. I've fixed this in the udev tree, and a patch to fix this can be found at:
http://bugs.gentoo.org/attachment.cgi?id&204&action=view

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel