linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev and hotplug
@ 2006-03-19 20:12 Andreas Jellinghaus
  2006-03-20  0:49 ` Kay Sievers
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Andreas Jellinghaus @ 2006-03-19 20:12 UTC (permalink / raw)
  To: linux-hotplug

as far as I know the current recommendation is to
disable /proc/sys/kernel/hotplug and let udevd
handle everything via user space events. right?

and is the hotplug package still needed, required, used?
or does udev and hotplug even conflict?

here are some sources that might need an update:

udev README:
  - From kernel version 2.6.15 on, the hotplug helper /sbin/hotplug should
    be disabled with an init script before actions like loading kernel
    modules are taken, which may cause a lot of events.

http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html

Requirements
 It requires a 2.6 Linux kernel with CONFIG_HOTPLUG enabled to run. It is
  recommended that you also have the Linux Hotplug scripts installed, but it
  is not necessary for it to work properly.

http://www.gentoo.org/doc/en/udev-guide.xml
  udev
  Every time the kernel notices an update in the device structure, it calls 
  the /sbin/hotplug program. Hotplug runs the applications linked in the
  /etc/hotplug.d/default directory where you will also find a symlink to the
  udev application. Hotplug directs the information given by the kernel to
   the udev application which performs the necessary actions on the /dev
   structure (creating or deleting device files).

http://fedora.redhat.com/docs/udev/
  udev gets called by hotplug, if a module is loaded, and a device is added
  or removed. udev looks in /sys/, if the driver provides a "dev" file,
  which contains the major and minor number for a device node to communicate
  with the driver. After looking in the udev rules (in
  the /etc/udev/rules.d/ directory), which specify the device node filename
   and symlinks, a device node is created in /dev/ with the permissions,
   which are specified in /etc/udev/permissions.d/.

I use none of those distributions, but maybe these people are on the list?

Regards, Andreas



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: udev and hotplug
  2006-03-19 20:12 udev and hotplug Andreas Jellinghaus
@ 2006-03-20  0:49 ` Kay Sievers
  2006-10-11  9:21 ` Raj Kumar Yadav
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kay Sievers @ 2006-03-20  0:49 UTC (permalink / raw)
  To: linux-hotplug

On Sun, Mar 19, 2006 at 09:12:14PM +0100, Andreas Jellinghaus wrote:
> as far as I know the current recommendation is to
> disable /proc/sys/kernel/hotplug and let udevd
> handle everything via user space events. right?

Yes, especially if you want to be able to handle a large number of
devices (1000's) which does not work with /sbin/hotplug, cause you
run into OOM situations by the kernel initiated fork bomb /sbin/hotplug.
But there is no hard requirement on this, you can still use it, even
when it does not make sense anymore.

> and is the hotplug package still needed, required, used?
> or does udev and hotplug even conflict?

The hotplug package's stuff can be called from udev if asked for, but it
is pretty useless in most cases cause udev rules and kernel provided
$MODALIAS passed to modprobe and the "uevent" trigger in sysfs can replace
it entirely.

> here are some sources that might need an update:
> 
> udev README:
>   - From kernel version 2.6.15 on, the hotplug helper /sbin/hotplug should
>     be disabled with an init script before actions like loading kernel
>     modules are taken, which may cause a lot of events.
> 
> http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html

This is recommendend, yes.

> Requirements
>  It requires a 2.6 Linux kernel with CONFIG_HOTPLUG enabled to run. It is
>   recommended that you also have the Linux Hotplug scripts installed, but it
>   is not necessary for it to work properly.
> 
> http://www.gentoo.org/doc/en/udev-guide.xml

I can't speak for Gentoo, but I can't see where the scripts would be useful
when a recent kernel is used. Older kernels will need it, sure.

>   udev
>   Every time the kernel notices an update in the device structure, it calls 
>   the /sbin/hotplug program. Hotplug runs the applications linked in the
>   /etc/hotplug.d/default directory where you will also find a symlink to the
>   udev application. Hotplug directs the information given by the kernel to
>    the udev application which performs the necessary actions on the /dev
>    structure (creating or deleting device files).

Most of the recent distro releases don't even have /etc/hotplug.d/. You
can still plug it into the udev event handling with a special program
provided by the udev package, but better get rid of that stuff entirely.

> http://fedora.redhat.com/docs/udev/
>   udev gets called by hotplug, if a module is loaded, and a device is added
>   or removed. udev looks in /sys/, if the driver provides a "dev" file,
>   which contains the major and minor number for a device node to communicate
>   with the driver. After looking in the udev rules (in
>   the /etc/udev/rules.d/ directory), which specify the device node filename
>    and symlinks, a device node is created in /dev/ with the permissions,
>    which are specified in /etc/udev/permissions.d/.

That is almost correct besides that the udev daemon connecs directly to the
kernel and there is no "hotplug" which could "call" anymore these days, and
udevd relies on the event environment and not the "dev" file to get the
major/minor for the node.

> I use none of those distributions, but maybe these people are on the list?

Kay


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* udev and hotplug
  2006-03-19 20:12 udev and hotplug Andreas Jellinghaus
  2006-03-20  0:49 ` Kay Sievers
@ 2006-10-11  9:21 ` Raj Kumar Yadav
  2006-10-11  9:28 ` Kay Sievers
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Raj Kumar Yadav @ 2006-10-11  9:21 UTC (permalink / raw)
  To: linux-hotplug

Hi,
    I am using udev-100 on linux-2.6.14.
    To make udev work, the kernel built options are following.

    Device Drivers  --->
     Generic Driver Options  --->
        <*> Hotplug firmware loading support

    File systems  --->
     [*] Inotify file change notification support

    During the bootup, one time initialization of the /dev using "udevstart"
    and afterwards running the "udevd" as daemon. The udev rules are working
      as expected on every insertion/removal of devices.

    However, would like to clarify some minor doubts.

    1. Why do I need to enable "Hotplug firmware loading support"
option, when
        it seems that the "inotify" is passing all needed information to udevd.

       "cat /proc/sys/kernel/hotplug" shows "/sbin/hotplug". But there is no
         file as "/sbin/hotplug".

       According to the link hotplug is redundant now, but then why do I need to
         enable the hotplug configuration in kernel 2.6.14.
       http://vrfy.org/log/recent-state-of-udev.html

    2. As it seems udev is providing all required functionality, Do one really
       need to implement "hal" to exploit udev functionality.

    3. Is it necessary to run "udevstart" to populate the /dev directory, should
         it not be populated by the udevd internally. Please correct me, If I am
       mixing two unrelated components.


Thanks All,
Raj Kumar Yadav

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: udev and hotplug
  2006-03-19 20:12 udev and hotplug Andreas Jellinghaus
  2006-03-20  0:49 ` Kay Sievers
  2006-10-11  9:21 ` Raj Kumar Yadav
@ 2006-10-11  9:28 ` Kay Sievers
  2006-10-11 11:06 ` Gioele Barabucci
  2006-10-12 12:48 ` Kay Sievers
  4 siblings, 0 replies; 6+ messages in thread
From: Kay Sievers @ 2006-10-11  9:28 UTC (permalink / raw)
  To: linux-hotplug

On Wed, 2006-10-11 at 14:39 +0530, Raj Kumar Yadav wrote:
>     I am using udev-100 on linux-2.6.14.
>     To make udev work, the kernel built options are following.
> 
>     Device Drivers  --->
>      Generic Driver Options  --->
>         <*> Hotplug firmware loading support
> 
>     File systems  --->
>      [*] Inotify file change notification support
> 
>     During the bootup, one time initialization of the /dev using "udevstart"
>     and afterwards running the "udevd" as daemon. The udev rules are working
>       as expected on every insertion/removal of devices.
> 
>     However, would like to clarify some minor doubts.
> 
>     1. Why do I need to enable "Hotplug firmware loading support" option, when
>         it seems that the "inotify" is passing all needed information to udevd.

Inotify sends you events if something in the filesystem changes, it has
absolutely nothing to do with a firmware-file loaded into a device. 

Udevd uses inotify to watch changing udev rules files and reloads its
config on demand.

>        "cat /proc/sys/kernel/hotplug" shows "/sbin/hotplug". But there is no
>          file as "/sbin/hotplug".

That's good not to have /sbin/hotplug. Even when there is no program to
fork anymore, you should disable the forking by the kernel, by setting
it to "".

>        According to the link hotplug is redundant now, but then why do I need to
>          enable the hotplug configuration in kernel 2.6.14.
>        http://vrfy.org/log/recent-state-of-udev.html

"hotplug" is the kernels ability to adapt to a changing device
environment, it's not the old userspace "hotplug" crap.

>     2. As it seems udev is providing all required functionality, Do one really
>        need to implement "hal" to exploit udev functionality.

It's functionality udev does not provide, like classification of
devices, device permission granting for "local" users, polling for media
changes. HAL is the foundation for all Desktop device handling. None of
its features will ever be implemented in udev, but if you don't miss
them, you probably don't need HAL.

>     3. Is it necessary to run "udevstart" to populate the /dev directory, should
>          it not be populated by the udevd internally. Please correct me, If I am
>        mixing two unrelated components.

Udevstart will be removed from a future udev version, it's not installed
by default. Kernel 2.6.15 has a way to re-request all events by
udevtrigger, which does not need udevstart. You just start the daemon,
run udevtrigger and all events are handled by the daemon, which will
populate /dev.

Kay


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: udev and hotplug
  2006-03-19 20:12 udev and hotplug Andreas Jellinghaus
                   ` (2 preceding siblings ...)
  2006-10-11  9:28 ` Kay Sievers
@ 2006-10-11 11:06 ` Gioele Barabucci
  2006-10-12 12:48 ` Kay Sievers
  4 siblings, 0 replies; 6+ messages in thread
From: Gioele Barabucci @ 2006-10-11 11:06 UTC (permalink / raw)
  To: linux-hotplug

On Wednesday 11 October 2006 19:28, Kay Sievers wrote:
> >        "cat /proc/sys/kernel/hotplug" shows "/sbin/hotplug". But there is
> > no file as "/sbin/hotplug".
>
> That's good not to have /sbin/hotplug. Even when there is no program to
> fork anymore, you should disable the forking by the kernel, by setting
> it to "".
Will there be a kernel option to disable the creation 
of /proc/sys/kernel/hotplug altogether?

--
Gioele Barabucci <dev@gioelebarabucci.com>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: udev and hotplug
  2006-03-19 20:12 udev and hotplug Andreas Jellinghaus
                   ` (3 preceding siblings ...)
  2006-10-11 11:06 ` Gioele Barabucci
@ 2006-10-12 12:48 ` Kay Sievers
  4 siblings, 0 replies; 6+ messages in thread
From: Kay Sievers @ 2006-10-12 12:48 UTC (permalink / raw)
  To: linux-hotplug

On Wed, 2006-10-11 at 21:06 +1000, Gioele Barabucci wrote:
> On Wednesday 11 October 2006 19:28, Kay Sievers wrote:
> > >        "cat /proc/sys/kernel/hotplug" shows "/sbin/hotplug". But there is
> > > no file as "/sbin/hotplug".
> >
> > That's good not to have /sbin/hotplug. Even when there is no program to
> > fork anymore, you should disable the forking by the kernel, by setting
> > it to "".
> Will there be a kernel option to disable the creation 
> of /proc/sys/kernel/hotplug altogether?

There is nothing planned. We could have an option that allows us to set
the default value in the kernel config, which could be an empty string
instead of /sbin/hotplug then. For now, we just do:
  echo > /sys/kernel/uevent_helper

Kay


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-10-12 12:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-19 20:12 udev and hotplug Andreas Jellinghaus
2006-03-20  0:49 ` Kay Sievers
2006-10-11  9:21 ` Raj Kumar Yadav
2006-10-11  9:28 ` Kay Sievers
2006-10-11 11:06 ` Gioele Barabucci
2006-10-12 12:48 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).