Ignore:
Timestamp:
May 14, 2014, 1:21:04 AM (10 years ago)
Author:
Chris Staub <chris@…>
Branches:
clfs-3.0.0-sysvinit, sysvinit
Children:
056e32f4
Parents:
db71344
Message:

Created sysvinit branch

File:
1 moved

Legend:

Unmodified
Added
Removed
  • BOOK/bootscripts/common/eudev.xml

    rdb71344 r82fc053  
    66]>
    77
    8 <sect1 id="ch-scripts-udev">
    9   <?dbhtml filename="udev.html"?>
     8<sect1 id="ch-scripts-eudev">
     9  <?dbhtml filename="eudev.html"?>
    1010
    1111  <title>Device and Module Handling on a CLFS System</title>
    1212
    13   <indexterm zone="ch-scripts-udev">
    14     <primary sortas="a-systemd">Systemd</primary>
    15     <secondary>udev usage</secondary>
     13  <indexterm zone="ch-scripts-eudev">
     14    <primary sortas="a-Eudev">Eudev</primary>
     15    <secondary>usage</secondary>
    1616  </indexterm>
    1717
    18   <para>In <xref linkend="chapter-building-system"/>, we installed systemd,
    19   which contains systemd-udevd, previously known as Udev. Before we go into
    20   the details regarding how this works, a brief history of previous methods of
    21   handling devices is in order.</para>
     18  <para>In <xref linkend="chapter-building-system"/>, we installed the Eudev
     19  package. Before we go into the details regarding how this works,
     20  a brief history of previous methods of handling devices is in
     21  order.</para>
    2222
    2323  <para>Linux systems in general traditionally use a static device creation
     
    3030  the world.</para>
    3131
    32   <para>Using the Udev method, only those devices which are detected by the
     32  <para>Using the Eudev method, only those devices which are detected by the
    3333  kernel get device nodes created for them. Because these device nodes will be
    3434  created each time the system boots, they will be stored on a <systemitem
     
    7171
    7272  <sect2>
    73     <title>Udev Implementation</title>
     73    <title>Eudev Implementation</title>
    7474
    7575    <sect3>
     
    9393
    9494    <sect3>
     95      <title>Eudev Bootscript</title>
     96
     97      <para>The <command>S10udev</command> initscript takes care of creating
     98      device nodes when Linux is booted. The script unsets the uevent handler
     99      from the default of <command>/sbin/hotplug</command>.  This is done
     100      because the kernel no longer needs to call out to an external binary.
     101      Instead <command>udevd</command> will listen on a netlink socket for
     102      uevents that the kernel raises. Next, the bootscript copies any static
     103      device nodes that exist in <filename
     104      class="directory">/lib/udev/devices</filename> to <filename
     105      class="directory">/dev</filename>. This is necessary because some devices,
     106      directories, and symlinks are needed before the dynamic device handling
     107      processes are available during the early stages of booting a system.
     108      Creating static device nodes in <filename
     109      class="directory">/lib/udev/devices</filename> also provides an easy
     110      workaround for devices that are not supported by the dynamic device
     111      handling infrastructure. The bootscript then starts the Eudev daemon,
     112      <command>udevd</command>, which will act on any uevents it receives.
     113      Finally, the bootscript forces the kernel to replay uevents for any
     114      devices that have already been registered and then waits for
     115      <command>udevd</command> to handle them.</para>
     116
     117    </sect3>
     118
     119    <sect3>
    95120      <title>Device Node Creation</title>
    96121
    97       <para>To obtain the right major and minor number for a device, Udev relies
     122      <para>To obtain the right major and minor number for a device, Eudev relies
    98123      on the information provided by <systemitem
    99124      class="filesystem">sysfs</systemitem> in <filename
     
    104129      <emphasis>0</emphasis>. The names and permissions of the nodes created
    105130      under the <filename class="directory">/dev</filename> directory are
    106       determined by rules specified in the files within the
    107       <filename class="directory">/lib/udev/rules.d</filename> and <filename
    108       class="directory">/etc/udev/rules.d/</filename> directories. These files
    109       have names that start with numbers, and are evaluated in numerical order.
    110       If <command>udevd</command> can't find a rule for the device it is
    111       creating, it will default permissions to <emphasis>660</emphasis> and
    112       ownership to <emphasis>root:root</emphasis>. </para>
     131      determined by rules specified in the files within the <filename
     132      class="directory">/etc/udev/rules.d/</filename> directory. These are
     133      numbered in a similar fashion to the CLFS-Bootscripts package. If
     134      <command>udevd</command> can't find a rule for the device it is creating,
     135      it will default permissions to <emphasis>660</emphasis> and ownership to
     136      <emphasis>root:root</emphasis>. Documentation on the syntax of the Eudev
     137      rules configuration files is available in
     138      <filename>/usr/share/doc/udev/writing_udev_rules/index.html</filename></para>
    113139
    114140    </sect3>
     
    129155      might contain the string
    130156      <quote>pci:v00001319d00000801sv00001319sd00001319bc04sc01i00</quote>.
    131       The default rules provided by Udev will cause <command>udevd</command>
     157      The default rules provided by Eudev will cause <command>udevd</command>
    132158      to call out to <command>/sbin/modprobe</command> with the contents of the
    133159      <envar>MODALIAS</envar> uevent environment variable (that should be the
     
    168194      <title>A kernel module is not loaded automatically</title>
    169195
    170       <para>Udev will only load a module if it has a bus-specific alias and the
     196      <para>Eudev will only load a module if it has a bus-specific alias and the
    171197      bus driver properly exports the necessary aliases to <systemitem
    172198      class="filesystem">sysfs</systemitem>. In other cases, one should
    173       arrange module loading by other means. With Linux-&linux-version;, Udev is
     199      arrange module loading by other means. With Linux-&linux-version;, Eudev is
    174200      known to load properly-written drivers for INPUT, IDE, PCI, USB, SCSI,
    175201      SERIO and FireWire devices.</para>
    176202
    177203      <para>To determine if the device driver you require has the necessary
    178       support for Udev, run <command>modinfo</command> with the module name as
     204      support for Eudev, run <command>modinfo</command> with the module name as
    179205      the argument.  Now try locating the device directory under
    180206      <filename class="directory">/sys/bus</filename> and check whether there is
     
    184210      class="filesystem">sysfs</systemitem>, the driver supports the device and
    185211      can talk to it directly, but doesn't have the alias, it is a bug in the
    186       driver. Load the driver without the help from Udev and expect the issue
     212      driver. Load the driver without the help from Eudev and expect the issue
    187213      to be fixed later.</para>
    188214
     
    193219      busses. Expect this issue to be fixed in later kernel versions.</para>
    194220
    195       <para>Udev is not intended to load <quote>wrapper</quote> drivers such as
     221      <para>Eudev is not intended to load <quote>wrapper</quote> drivers such as
    196222      <emphasis>snd-pcm-oss</emphasis> and non-hardware drivers such as
    197223      <emphasis>loop</emphasis> at all.</para>
     
    200226
    201227    <sect3>
    202       <title>A kernel module is not loaded automatically, and Udev is not
     228      <title>A kernel module is not loaded automatically, and Eudev is not
    203229      intended to load it</title>
    204230
     
    207233      enhances the functionality of <emphasis>snd-pcm</emphasis> by making the
    208234      sound cards available to OSS applications), configure
    209       <command>modprobe</command> to load the wrapper after Udev loads the
    210       wrapped module. To do this, add an <quote>install</quote> line to a file
    211       in <filename>/etc/modprobe.d</filename>. For example:</para>
     235      <command>modprobe</command> to load the wrapper after Eudev loads the
     236      wrapped module. To do this, add an <quote>install</quote> line in
     237      <filename>/etc/modprobe.conf</filename>. For example:</para>
    212238
    213239<screen role="nodump"><literal>install snd-pcm /sbin/modprobe -i snd-pcm ; \
    214240    /sbin/modprobe snd-pcm-oss ; true</literal></screen>
    215241
    216     </sect3>
    217 
    218     <sect3>
    219       <title>Udev loads some unwanted module</title>
     242      <para>If the module in question is not a wrapper and is useful by itself,
     243      configure the <command>S05modules</command> bootscript to load this
     244      module on system boot. To do this, add the module name to the
     245      <filename>/etc/sysconfig/modules</filename> file on a separate line.
     246      This works for wrapper modules too, but is suboptimal in that case.</para>
     247
     248    </sect3>
     249
     250    <sect3>
     251      <title>Eudev loads some unwanted module</title>
    220252
    221253      <para>Either don't build the module, or blacklist it in
    222       <filename>/etc/modprobe.d</filename> file as done with the
     254      <filename>/etc/modprobe.conf</filename> file as done with the
    223255      <emphasis>forte</emphasis> module in the example below:</para>
    224256
     
    231263
    232264    <sect3>
    233       <title>Udev creates a device incorrectly, or makes a wrong symlink</title>
     265      <title>Eudev creates a device incorrectly, or makes a wrong symlink</title>
    234266
    235267      <para>This usually happens if a rule unexpectedly matches a device. For
     
    242274
    243275    <sect3>
    244       <title>Udev rule works unreliably</title>
     276      <title>Eudev rule works unreliably</title>
    245277
    246278      <para>This may be another manifestation of the previous problem. If not,
     
    256288
    257289    <sect3>
    258       <title>Udev does not create a device</title>
     290      <title>Eudev does not create a device</title>
    259291
    260292      <para>Further text assumes that the driver is built statically into the
    261293      kernel or already loaded as a module, and that you have already checked
    262       that Udev doesn't create a misnamed device.</para>
    263 
    264       <para>Udev has no information needed to create a device node if a kernel
     294      that Eudev doesn't create a misnamed device.</para>
     295
     296      <para>Eudev has no information needed to create a device node if a kernel
    265297      driver does not export its data to <systemitem
    266298      class="filesystem">sysfs</systemitem>.
     
    279311      <title>Device naming order changes randomly after rebooting</title>
    280312
    281       <para>This is due to the fact that Udev, by design, handles uevents and
     313      <para>This is due to the fact that Eudev, by design, handles uevents and
    282314      loads modules in parallel, and thus in an unpredictable order. This will
    283315      never be <quote>fixed</quote>. You should not rely upon the kernel device
    284316      names being stable. Instead, create your own rules that make symlinks with
    285317      stable names based on some stable attributes of the device, such as a
    286       serial number or the output of various *_id utilities installed by Udev.
     318      serial number or the output of various *_id utilities installed by Eudev.
    287319      See <xref linkend="ch-scripts-symlinks"/> and
    288320      <xref linkend="chapter-network"/> for examples.</para>
Note: See TracChangeset for help on using the changeset viewer.