mirror of
https://github.com/Poltern/lfs-ru.git
synced 2024-10-18 11:50:21 +03:00
Translated page udev
This commit is contained in:
parent
23d3f0bd4d
commit
c2e8c53d13
@ -36,7 +36,7 @@
|
|||||||
<?dbhtml dir="scripts"?>
|
<?dbhtml dir="scripts"?>
|
||||||
<?dbhtml filename="scripts.html"?>
|
<?dbhtml filename="scripts.html"?>
|
||||||
|
|
||||||
<title>Версия скриптов загрузки и настройки системы-&lfs-bootscripts-version;</title>
|
<title>Скрипты загрузки и настройки системы-&lfs-bootscripts-version;</title>
|
||||||
|
|
||||||
<para>Скрипты в приложении перечислены с указанием каталога, в котором они обычно находятся.
|
<para>Скрипты в приложении перечислены с указанием каталога, в котором они обычно находятся.
|
||||||
Порядок такой: <filename
|
Порядок такой: <filename
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<sect1 id="ch-config-profile" revision="sysv">
|
<sect1 id="ch-config-profile" revision="sysv">
|
||||||
<?dbhtml filename="profile.html"?>
|
<?dbhtml filename="profile.html"?>
|
||||||
|
|
||||||
<title>The Bash Shell Startup Files</title>
|
<title>Файлы запуска оболочки Bash</title>
|
||||||
|
|
||||||
<indexterm zone="ch-config-profile">
|
<indexterm zone="ch-config-profile">
|
||||||
<primary sortas="e-/etc/profile">/etc/profile</primary>
|
<primary sortas="e-/etc/profile">/etc/profile</primary>
|
||||||
|
@ -8,323 +8,304 @@
|
|||||||
<sect1 id="ch-config-udev">
|
<sect1 id="ch-config-udev">
|
||||||
<?dbhtml filename="udev.html"?>
|
<?dbhtml filename="udev.html"?>
|
||||||
|
|
||||||
<title>Overview of Device and Module Handling</title>
|
<title>Взаимодействие с устройствами и модулями</title>
|
||||||
|
|
||||||
<indexterm zone="ch-config-udev">
|
<indexterm zone="ch-config-udev">
|
||||||
<primary sortas="a-Udev">Udev</primary>
|
<primary sortas="a-Udev">Udev</primary>
|
||||||
<secondary>usage</secondary>
|
<secondary>usage</secondary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
<para>In <xref linkend="chapter-building-system"/>, we installed the udev
|
<para>В <xref linkend="chapter-building-system"/>, мы установили пакет udev
|
||||||
package when <phrase revision="sysv">eudev</phrase>
|
во время сборки <phrase revision="sysv">eudev</phrase>
|
||||||
<phrase revision="systemd">systemd</phrase> was built. Before we go into the
|
<phrase revision="systemd">systemd</phrase>. Прежде чем мы углубимся в детали того, как
|
||||||
details regarding how this works, a brief history of previous methods of
|
это работает, необходимо кратко рассказать о предыдущих методах взаимодействия с устройствами.</para>
|
||||||
handling devices is in order.</para>
|
|
||||||
|
|
||||||
<para>Linux systems in general traditionally used a static device creation
|
<para>Системы Linux традиционно использовали метод статического создания устройств, при котором
|
||||||
method, whereby a great many device nodes were created under <filename
|
огромное количество узлов устройств(иногда буквально тысячи узлов) создавалось в
|
||||||
class="directory">/dev</filename> (sometimes literally thousands of nodes),
|
<filename class="directory">/dev</filename>, независимо от того, существовали ли соответствующие
|
||||||
regardless of whether the corresponding hardware devices actually existed. This
|
аппаратные устройства на самом деле. Обычно это делалось с помощью скрипта <command>MAKEDEV</command>,
|
||||||
was typically done via a <command>MAKEDEV</command> script, which contains a
|
который содержал команды вызова программы <command>mknod</command> с нужным количеством устройств
|
||||||
number of calls to the <command>mknod</command> program with the relevant
|
для всех возможных вариантов, которые только могут существовать в мире.</para>
|
||||||
major and minor device numbers for every possible device that might exist in
|
|
||||||
the world.</para>
|
|
||||||
|
|
||||||
<para>Using the udev method, only those devices which are detected by the
|
<para>Используя метод udev, только те устройства, которые были обнаружены ядром,
|
||||||
kernel get device nodes created for them. Because these device nodes will be
|
получают свой узел. Поскольку эти узлы будут создаваться каждый раз, при загрузке
|
||||||
created each time the system boots, they will be stored on a <systemitem
|
системы, они будут располагаться в каталоге файловой
|
||||||
class="filesystem">devtmpfs</systemitem> file system (a virtual file system
|
системы <systemitem class="filesystem">devtmpfs</systemitem> (виртуальная файловая
|
||||||
that resides entirely in system memory). Device nodes do not require much
|
система, которая полностью находится в оперативной памяти). Узлы не занимают много
|
||||||
space, so the memory that is used is negligible.</para>
|
места в памяти и их общий размер незначителен.</para>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>History</title>
|
<title>История</title>
|
||||||
|
|
||||||
<para>In February 2000, a new filesystem called <systemitem
|
<para>В феврале 2000 года, новая файловая система <systemitem
|
||||||
class="filesystem">devfs</systemitem> was merged into the 2.3.46 kernel
|
class="filesystem">devfs</systemitem> была принята в ветку ядра 2.3.46 и была
|
||||||
and was made available during the 2.4 series of stable kernels. Although
|
доступна на протяжении выпуска стабильных релизов ветки 2.4. Хотя она и
|
||||||
it was present in the kernel source itself, this method of creating devices
|
присутствовала в ядре, такой способ динамического создания устройств никогда не
|
||||||
dynamically never received overwhelming support from the core kernel
|
получал поддержки от разработчиков ядра.</para>
|
||||||
developers.</para>
|
|
||||||
|
|
||||||
<para>The main problem with the approach adopted by <systemitem
|
<para>Основная проблема с подходом, принятым <systemitem class="filesystem">devfs</systemitem>
|
||||||
class="filesystem">devfs</systemitem> was the way it handled device
|
была связана с обработкой обнаружения, создания и назначения имен устройствам. Проблема
|
||||||
detection, creation, and naming. The latter issue, that of device node
|
связанная с именованием узлов была самой важной. Как правило, если имена
|
||||||
naming, was perhaps the most critical. It is generally accepted that if
|
устройствам можно настраивать, то политика назначения имён должна быть установлена
|
||||||
device names are allowed to be configurable, then the device naming policy
|
системным администратором, а не навязываться каким-либо разработчиком. Файловая
|
||||||
should be up to a system administrator, not imposed on them by any
|
система <systemitem class="filesystem">devfs</systemitem> также страдала от состояния гонки,
|
||||||
particular developer(s). The <systemitem
|
которое было присуще ее дизайну и не могло быть исправлено без существенной переработки
|
||||||
class="filesystem">devfs</systemitem> file system also suffered from race
|
самого ядра. В конечном счёте, эта файловая система была помечена как устаревшая на протяжении
|
||||||
conditions that were inherent in its design and could not be fixed without a
|
достаточно долгого периода времени, по причине отсутствия её ненадлежащей поддержки, и была
|
||||||
substantial revision to the kernel. It was marked as deprecated for a long
|
удалена из ветки ядра в июне 2006 года.</para>
|
||||||
period – due to a lack of maintenance – and was finally removed
|
|
||||||
from the kernel in June, 2006.</para>
|
|
||||||
|
|
||||||
<para>With the development of the unstable 2.5 kernel tree, later released
|
<para>При разработке нестабильной ветки ядра 2.5, позднее, выпущенной как стабильный
|
||||||
as the 2.6 series of stable kernels, a new virtual filesystem called
|
релиз 2.6, появилась новая виртуальная файловая система
|
||||||
<systemitem class="filesystem">sysfs</systemitem> came to be. The job of
|
<systemitem class="filesystem">sysfs</systemitem>. Задача этой файловой системы
|
||||||
<systemitem class="filesystem">sysfs</systemitem> is to export a view of
|
заключалась в экспорте представления об аппаратной конфигурации системы в процессы
|
||||||
the system's hardware configuration to userspace processes. With this
|
пользовательского пространства. С помощью этого представления, видимого в пользовательском
|
||||||
userspace-visible representation, the possibility of developing a userspace
|
пространстве, разработка замены для <systemitem class="filesystem">devfs</systemitem>
|
||||||
replacement for <systemitem class="filesystem">devfs</systemitem> became
|
стала гораздо реалистичнее.</para>
|
||||||
much more realistic.</para>
|
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Udev Implementation</title>
|
<title>Реализация Udev</title>
|
||||||
|
|
||||||
<sect3>
|
<sect3>
|
||||||
<title>Sysfs</title>
|
<title>Sysfs</title>
|
||||||
|
|
||||||
<para>The <systemitem class="filesystem">sysfs</systemitem> filesystem
|
<para>Краткое описание файловой системы <systemitem class="filesystem">sysfs</systemitem> было
|
||||||
was mentioned briefly above. One may wonder how <systemitem
|
представлено выше. Можно задаться вопросом, как <systemitem class="filesystem">sysfs</systemitem>
|
||||||
class="filesystem">sysfs</systemitem> knows about the devices present on
|
получает информацию об устройствах в системе, и о том, какие номера устройств должны использоваться
|
||||||
a system and what device numbers should be used for them. Drivers that
|
для них. Драйверы, скомпилированные в ядро, напрямую регистрируют объекты с помощью
|
||||||
have been compiled into the kernel directly register their objects with a
|
<systemitem class="filesystem">sysfs</systemitem> (внутри <systemitem class="filesystem">devtmpfs</systemitem>),
|
||||||
<systemitem class="filesystem">sysfs</systemitem> (devtmpfs internally)
|
по мере обнаружения ядром. Для драйверов, которые скомпилированы в виде модулей, регистрация будет
|
||||||
as they are detected by the kernel. For drivers compiled as modules, this
|
происходить при его загрузке. После того, как файловая система
|
||||||
registration will happen when the module is loaded. Once the <systemitem
|
<systemitem class="filesystem">sysfs</systemitem> будет примонтирована в каталог
|
||||||
class="filesystem">sysfs</systemitem> filesystem is mounted (on /sys),
|
<filename class="directory">/sys</filename>, данные, которые регистрируются драйверами, в
|
||||||
data which the drivers register with <systemitem
|
<systemitem class="filesystem">sysfs</systemitem>, станут доступны для пользовательского окружения
|
||||||
class="filesystem">sysfs</systemitem> are available to userspace
|
и udevd для обработки (включая изменения узлов устройств).</para>
|
||||||
processes and to udevd for processing (including modifications to device
|
|
||||||
nodes).</para>
|
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
<sect3>
|
<sect3>
|
||||||
<title>Device Node Creation</title>
|
<title>Создание узла устройства</title>
|
||||||
|
|
||||||
<para>Device files are created by the kernel by the <systemitem
|
<para>Файлы устройств создаются ядром при помощи файловой
|
||||||
class="filesystem">devtmpfs</systemitem> filesystem. Any driver that
|
системы <systemitem class="filesystem">devtmpfs</systemitem>. Любой драйвер,
|
||||||
wishes to register a device node will go through the <systemitem
|
которому необходимо зарегистрировать узел устройства, будет проходить через
|
||||||
class="filesystem">devtmpfs</systemitem> (via the driver core) to do it.
|
файловую систему <systemitem class="filesystem">devtmpfs</systemitem> (через
|
||||||
When a <systemitem class="filesystem">devtmpfs</systemitem> instance is
|
системный драйвер ядра). Когда экземпляр
|
||||||
mounted on <filename class="directory">/dev</filename>, the device node
|
<systemitem class="filesystem">devtmpfs</systemitem> монтируется в каталог
|
||||||
will initially be created with a fixed name, permissions, and
|
<filename class="directory">/dev</filename>, узел устройства будет создан с
|
||||||
owner.</para>
|
фиксированным именем, соответствующими разрешениями и владельцем.</para>
|
||||||
|
|
||||||
<para>A short time later, the kernel will send a uevent to <command>
|
<para>Через некоторое время, ядро отправит uevent в <command>udevd</command>.
|
||||||
udevd</command>. Based on the rules specified in the files within the
|
На основе правил, которые указанны в файлах в каталогах
|
||||||
<filename class="directory">/etc/udev/rules.d</filename>, <filename
|
<filename class="directory">/etc/udev/rules.d</filename>, <filename
|
||||||
class="directory">/usr/lib/udev/rules.d</filename>, and <filename
|
class="directory">/lib/udev/rules.d</filename>, и <filename
|
||||||
class="directory">/run/udev/rules.d</filename> directories, <command>
|
class="directory">/run/udev/rules.d</filename>, <command>
|
||||||
udevd</command> will create additional symlinks to the device node, or
|
udevd</command> создаст дополнительные символические ссылки на узлы устройств,
|
||||||
change its permissions, owner, or group, or modify the internal
|
или сменит разрешения, владельца или группу, или изменит запись (имя) во внутренней
|
||||||
<command>udevd</command> database entry (name) for that object.</para>
|
базе данных <command>udevd</command> для этого объекта.</para>
|
||||||
|
|
||||||
<para>The rules in these three directories are numbered and all three
|
<para>Правила в этих трёх каталогах пронумерованы и используются совместно. Если
|
||||||
directories are merged together. If <command>udevd</command> can't find a
|
<command>udevd</command> не может найти правило для устройства, он оставит права
|
||||||
rule for the device it is creating, it will leave the permissions and
|
доступа и владельца на <systemitem class="filesystem">devtmpfs</systemitem>, которые
|
||||||
ownership at whatever <systemitem
|
были установлены изначально.</para> </sect3>
|
||||||
class="filesystem">devtmpfs</systemitem> used initially.</para> </sect3>
|
|
||||||
|
|
||||||
<sect3 id="module-loading">
|
<sect3 id="module-loading">
|
||||||
<title>Module Loading</title>
|
<title>Загрузка модуля</title>
|
||||||
|
|
||||||
<para>Device drivers compiled as modules may have aliases built into them.
|
<para>Драйверы устройств, скомпилированные в виде модулей ядра могут содержать
|
||||||
Aliases are visible in the output of the <command>modinfo</command>
|
встроенные псевдонимы. Псевдонимы можно увидеть просмотрев вывод программы
|
||||||
program and are usually related to the bus-specific identifiers of devices
|
<command>modinfo</command>, обычно они связаны со специфичными для шины идентификаторами
|
||||||
supported by a module. For example, the <emphasis>snd-fm801</emphasis>
|
устройств, которые поддерживается модулем. Например, драйвер <emphasis>snd-fm801</emphasis>
|
||||||
driver supports PCI devices with vendor ID 0x1319 and device ID 0x0801,
|
подерживает PCI устройства с идентификатором поставщика 0x1319 и идентификатором
|
||||||
and has an alias of <quote>pci:v00001319d00000801sv*sd*bc04sc01i*</quote>.
|
устройства 0x0801, и имеет псевдоним <quote>pci:v00001319d00000801sv*sd*bc04sc01i*</quote>.
|
||||||
For most devices, the bus driver exports the alias of the driver that
|
Для большинства устройств, драйвер шины экспортирует псевдонимы драйвера, которые
|
||||||
would handle the device via <systemitem
|
будет обрабатывать устройство через <systemitem class="filesystem">sysfs</systemitem>. Например,
|
||||||
class="filesystem">sysfs</systemitem>. E.g., the
|
файл <filename>/sys/bus/pci/devices/0000:00:0d.0/modalias</filename> может
|
||||||
<filename>/sys/bus/pci/devices/0000:00:0d.0/modalias</filename> file
|
содержать строку <quote>pci:v00001319d00000801sv00001319sd00001319bc04sc01i00</quote>.
|
||||||
might contain the string
|
Правила по умолчанию, которые предоставлены Udev, заставят <command>udevd</command>
|
||||||
<quote>pci:v00001319d00000801sv00001319sd00001319bc04sc01i00</quote>.
|
вызвать <command>/sbin/modprobe</command> с содержимым, которое находится в значении
|
||||||
The default rules provided with udev will cause <command>udevd</command>
|
переменной окружения <envar>MODALIAS</envar> uevent (которое должно совпадать с
|
||||||
to call out to <command>/sbin/modprobe</command> with the contents of the
|
содержимым файла <filename>modalias</filename> в sysfs), тем самым загружая все
|
||||||
<envar>MODALIAS</envar> uevent environment variable (which should be the
|
модули, чьи псевдонимы совпадают в строке после расширение подстановочных
|
||||||
same as the contents of the <filename>modalias</filename> file in sysfs),
|
знаков</para>
|
||||||
thus loading all modules whose aliases match this string after wildcard
|
|
||||||
expansion.</para>
|
|
||||||
|
|
||||||
<para>In this example, this means that, in addition to
|
<para>В указанном примере, это означает, что в дополнение к <emphasis>snd-fm801</emphasis>
|
||||||
<emphasis>snd-fm801</emphasis>, the obsolete (and unwanted)
|
будет загружен устаревший (и нежелательный) драйвер <emphasis>forte</emphasis>, если он
|
||||||
<emphasis>forte</emphasis> driver will be loaded if it is
|
будет доступен. Ниже приведены способы, как можно предотвратить загрузку нежелательных
|
||||||
available. See below for ways in which the loading of unwanted drivers can
|
драйверов.</para>
|
||||||
be prevented.</para>
|
|
||||||
|
|
||||||
<para>The kernel itself is also able to load modules for network
|
<para>Само ядро также способно загружать модули для сетевых протоколов, файловых систем
|
||||||
protocols, filesystems, and NLS support on demand.</para>
|
и поддержки NLS по запросу.</para>
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
<sect3>
|
<sect3>
|
||||||
<title>Handling Hotpluggable/Dynamic Devices</title>
|
<title>Работа с устройствами с горячей заменой или динамическими устройствами</title>
|
||||||
|
|
||||||
<para>When you plug in a device, such as a Universal Serial Bus (USB) MP3
|
<para>При подключении устройства, например, MP3-плеер, к универсальной последовательной
|
||||||
player, the kernel recognizes that the device is now connected and
|
шине (USB), ядро распознает, что устройство подключено, и генерирует событие
|
||||||
generates a uevent. This uevent is then handled by
|
uevent. Затем это событие обрабатывается <command>udevd</command>, как было описано выше.</para>
|
||||||
<command>udevd</command> as described above.</para>
|
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Problems with Loading Modules and Creating Devices</title>
|
<title>Проблемы с загрузкой модулей и созданием устройств</title>
|
||||||
|
|
||||||
<para>There are a few possible problems when it comes to automatically
|
<para>Существует несколько возможных проблем, связанных с автоматическим созданием узлов
|
||||||
creating device nodes.</para>
|
устройств.</para>
|
||||||
|
|
||||||
<sect3>
|
<sect3>
|
||||||
<title>A kernel module is not loaded automatically</title>
|
<title>Модуль ядра не загружается автоматически</title>
|
||||||
|
|
||||||
<para>Udev will only load a module if it has a bus-specific alias and the
|
<para>Udev загрузит модуль только в том случае, если у него есть псевдоним, специфичный
|
||||||
bus driver properly exports the necessary aliases to <systemitem
|
для шины, и драйвер шины правильно экспортирует необходимые псевдонимы в <systemitem
|
||||||
class="filesystem">sysfs</systemitem>. In other cases, one should
|
class="filesystem">sysfs</systemitem>. В других
|
||||||
arrange module loading by other means. With Linux-&linux-version;, udev is
|
случаях следует организовать загрузку модуля иными способами. Известно, что, начиная
|
||||||
known to load properly-written drivers for INPUT, IDE, PCI, USB, SCSI,
|
с версии Linux-&linux-version;, udev, выполняет загрузку правильно написанных
|
||||||
SERIO, and FireWire devices.</para>
|
драйверов для INPUT, IDE, PCI, USB, SCSI, SERIO, и FireWire устройств.</para>
|
||||||
|
|
||||||
<para>To determine if the device driver you require has the necessary
|
<para>Чтобы определить, имеет ли требуемый драйвер устройства необходимую поддержку
|
||||||
support for udev, run <command>modinfo</command> with the module name as
|
Udev, запустите <command>modinfo</command> с именем модуля в качестве аргумента.
|
||||||
the argument. Now try locating the device directory under
|
Далее, попробуйте найти каталог устройства в
|
||||||
<filename class="directory">/sys/bus</filename> and check whether there is
|
<filename class="directory">/sys/bus</filename> и проверьте, есть ли там
|
||||||
a <filename>modalias</filename> file there.</para>
|
файл <filename>modalias</filename>.</para>
|
||||||
|
|
||||||
<para>If the <filename>modalias</filename> file exists in <systemitem
|
<para>Если файл <filename>modalias</filename> существует в
|
||||||
class="filesystem">sysfs</systemitem>, the driver supports the device and
|
<systemitem class="filesystem">sysfs</systemitem>, то драйвер, который поддерживает
|
||||||
can talk to it directly, but doesn't have the alias, it is a bug in the
|
устройство, может обращаться к нему напрямую, но не имеет псевдонима, это ошибка
|
||||||
driver. Load the driver without the help from udev and expect the issue
|
в драйвере. Загрузите драйвер без помощи Udev и ожидайте, что проблема будет
|
||||||
to be fixed later.</para>
|
исправлена позднее.</para>
|
||||||
|
|
||||||
<para>If there is no <filename>modalias</filename> file in the relevant
|
<para>Если же в каталоге <filename class="directory">/sys/bus</filename> нет
|
||||||
directory under <filename class="directory">/sys/bus</filename>, this
|
файла <filename>modalias</filename>, это означает, что разработчики ядра еще не
|
||||||
means that the kernel developers have not yet added modalias support to
|
добавили поддержку <filename>modalias</filename> к этому типу шины.
|
||||||
this bus type. With Linux-&linux-version;, this is the case with ISA
|
В Linux-&linux-version; это относится к шиной ISA. Ожидайте, что эта проблема
|
||||||
busses. Expect this issue to be fixed in later kernel versions.</para>
|
будет исправлена в более поздних версиях ядра.</para>
|
||||||
|
|
||||||
<para>Udev is not intended to load <quote>wrapper</quote> drivers such as
|
<para>Udev не предназначен для загрузки драйверов <quote>обёрток</quote>, таких как
|
||||||
<emphasis>snd-pcm-oss</emphasis> and non-hardware drivers such as
|
<emphasis>snd-pcm-oss</emphasis>и неаппаратных драйверов, например,
|
||||||
<emphasis>loop</emphasis> at all.</para>
|
<emphasis>loop</emphasis>.</para>
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
<sect3>
|
<sect3>
|
||||||
<title>A kernel module is not loaded automatically, and udev is not
|
<title>Модуль ядра не загружается автоматически, и Udev не предназначен для его
|
||||||
intended to load it</title>
|
загрузки</title>
|
||||||
|
|
||||||
<para>If the <quote>wrapper</quote> module only enhances the
|
<para>Если модуль <quote>обёртка</quote> только расширяет функциональность,
|
||||||
functionality provided by some other module (e.g.,
|
предоставляемую каким-либо другим модулем (например модуль
|
||||||
<emphasis>snd-pcm-oss</emphasis> enhances the functionality of
|
<emphasis>snd-pcm-oss</emphasis> расширяет функциональность модуля
|
||||||
<emphasis>snd-pcm</emphasis> by making the sound cards available to OSS
|
<emphasis>snd-pcm</emphasis>, давая возможность звуковым картам быть доступными
|
||||||
applications), configure <command>modprobe</command> to load the wrapper
|
для OSS приложений), настройте <command>modprobe</command> для загрузки оболочки
|
||||||
after udev loads the wrapped module. To do this, add a
|
после того, как Udev загрузит обернутый модуль. Для этого добавьте строку
|
||||||
<quote>softdep</quote> line to the corresponding
|
<quote>softdep</quote> в файл, который находится в каталоге
|
||||||
<filename>/etc/modprobe.d/<replaceable><filename></replaceable>.conf</filename>
|
<filename>/etc/modprobe.d/<replaceable><filename></replaceable>.conf</filename>. Например:</para>
|
||||||
file. For example:</para>
|
|
||||||
|
|
||||||
<screen role="nodump"><literal>softdep snd-pcm post: snd-pcm-oss</literal></screen>
|
<screen role="nodump"><literal>softdep snd-pcm post: snd-pcm-oss</literal></screen>
|
||||||
|
|
||||||
<para>Note that the <quote>softdep</quote> command also allows
|
<para>Обратите внимание, что команда <quote>softdep</quote> разрешает добавлять
|
||||||
<literal>pre:</literal> dependencies, or a mixture of both
|
<literal>pre:</literal> зависимости, или одновременно
|
||||||
<literal>pre:</literal> and <literal>post:</literal> dependencies. See
|
<literal>pre:</literal> и <literal>post:</literal> зависимости. Обратитесь к документации
|
||||||
the <filename>modprobe.d(5)</filename> manual page for more information
|
<filename>modprobe.d(5)</filename> для изучения синтаксиса и возможностей
|
||||||
on <quote>softdep</quote> syntax and capabilities.</para>
|
<quote>softdep</quote>.</para>
|
||||||
|
|
||||||
<para revision="sysv">If the module in question is not a wrapper and is
|
<para revision="sysv">Если рассматриваемый модуль не является обёрткой, и полезен сам по
|
||||||
useful by itself, configure the <command>modules</command> bootscript to
|
себе, настройте загрузочный скрипт <command>modules</command>, чтобы он инициализировался
|
||||||
load this module on system boot. To do this, add the module name to the
|
при загрузке системы. Для этого добавьте имя модуля в файл <filename>/etc/sysconfig/modules</filename>
|
||||||
<filename>/etc/sysconfig/modules</filename> file on a separate line.
|
в отдельной строке. Этот способ сработает и для модулей-обёрток,но не является оптимальным.</para>
|
||||||
This works for wrapper modules too, but is suboptimal in that case.</para>
|
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
<sect3>
|
<sect3>
|
||||||
<title>Udev loads some unwanted module</title>
|
<title>Udev загружает какой-то нежелательный модуль</title>
|
||||||
|
|
||||||
<para>Either don't build the module, or blacklist it in a
|
<para>Либо не создавайте модуль, либо занесите его в черный список в файле
|
||||||
<filename>/etc/modprobe.d/blacklist.conf</filename> file as done with the
|
<filename>/etc/modprobe.d/blacklist.conf</filename>, как это сделано с
|
||||||
<emphasis>forte</emphasis> module in the example below:</para>
|
модулем <emphasis>forte</emphasis> в примере ниже:</para>
|
||||||
|
|
||||||
<screen role="nodump"><literal>blacklist forte</literal></screen>
|
<screen role="nodump"><literal>blacklist forte</literal></screen>
|
||||||
|
|
||||||
<para>Blacklisted modules can still be loaded manually with the
|
<para>Модули, занесенные в черный список, можно загрузить вручную с помощью явной команды
|
||||||
explicit <command>modprobe</command> command.</para>
|
<command>modprobe</command>.</para>
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
<sect3>
|
<sect3>
|
||||||
<title>Udev creates a device incorrectly, or makes a wrong symlink</title>
|
<title>Udev неправильно создает устройство или делает неправильную символическую ссылку</title>
|
||||||
|
|
||||||
<para>This usually happens if a rule unexpectedly matches a device. For
|
<para>Это обычно происходит, если правило неожиданно совпадает с другим устройством.
|
||||||
example, a poorly-written rule can match both a SCSI disk (as desired)
|
Например, плохо написанное правило может соответствовать как диску SCSI
|
||||||
and the corresponding SCSI generic device (incorrectly) by vendor.
|
(искомое устройство), так и универсальному устройству SCSI (неправильно)
|
||||||
Find the offending rule and make it more specific, with the help of the
|
указанному поставщиком. Найдите ошибочное правило и исправьте его с помощью
|
||||||
<command>udevadm info</command> command.</para>
|
команды <command>udevadm info</command>.</para>
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
<sect3>
|
<sect3>
|
||||||
<title>Udev rule works unreliably</title>
|
<title>Правило Udev работает ненадежно</title>
|
||||||
|
|
||||||
<para>This may be another manifestation of the previous problem. If not,
|
<para>Это может быть проявлением предыдущей проблемы. В ином случае, если
|
||||||
and your rule uses <systemitem class="filesystem">sysfs</systemitem>
|
правило использует атрибуты файловой системы
|
||||||
attributes, it may be a kernel timing issue, to be fixed in later kernels.
|
<systemitem class="filesystem">sysfs</systemitem>, то это может быть
|
||||||
For now, you can work around it by creating a rule that waits for the used
|
проблемой синхронизации ядра, которая будет исправлена в более поздних
|
||||||
<systemitem class="filesystem">sysfs</systemitem> attribute and appending
|
версиях ядра. Но вы можете обойти проблему, создав правило, которое
|
||||||
it to the <filename>/etc/udev/rules.d/10-wait_for_sysfs.rules</filename>
|
ожидает используемый атрибут <systemitem class="filesystem">sysfs</systemitem>
|
||||||
file (create this file if it does not exist). Please notify the LFS
|
и добавляет его к файлу правил <filename>/etc/udev/rules.d/10-wait_for_sysfs.rules</filename>
|
||||||
Development list if you do so and it helps.</para>
|
(создайте его, если файл не существует). Пожалуйста, сообщите в списке
|
||||||
|
рассылки разработчиков LFS, если это решение вам поможет.</para>
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
<sect3>
|
<sect3>
|
||||||
<title>Udev does not create a device</title>
|
<title>Udev не создаёт устройство</title>
|
||||||
|
|
||||||
<para>Further text assumes that the driver is built statically into the
|
<para>Дальнейший текст предполагает, что драйвер статически встроен в ядро или уже загружен
|
||||||
kernel or already loaded as a module, and that you have already checked
|
как модуль, и что вы уже проверили, что Udev не создает устройство с неправильным именем.</para>
|
||||||
that udev doesn't create a misnamed device.</para>
|
|
||||||
|
|
||||||
<para>Udev has no information needed to create a device node if a kernel
|
<para>Udev не обладает информацией, необходимой для создания узла устройства,
|
||||||
driver does not export its data to
|
если драйвер ядра не экспортирует свои данные в
|
||||||
<systemitem class="filesystem">sysfs</systemitem>. This is most common
|
<systemitem class="filesystem">sysfs</systemitem>. Как правило, такое происходит
|
||||||
with third party drivers from outside the kernel tree. Create a static
|
с внешними драйверами, которых нет в дереве исходного кода ядра. Создайте
|
||||||
device node in <filename>/usr/lib/udev/devices</filename> with the
|
статический узел в каталоге <filename>/usr/lib/udev/devices</filename> с
|
||||||
appropriate major/minor numbers (see the file
|
соответствующими первичными и второстепенными номерами (смотрите файл devices.txt
|
||||||
<filename>devices.txt</filename> inside the kernel documentation or the
|
в документации по ядру или документации, предоставленной сторонним поставщиком
|
||||||
documentation provided by the third party driver vendor). The static
|
драйвера). Статический узел будет скопирован в
|
||||||
device node will be copied to <filename class="directory">/dev</filename>
|
<filename class="directory">/dev</filename> с помощью <command>udev</command>.</para>
|
||||||
by <command>udev</command>.</para>
|
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
<sect3>
|
<sect3>
|
||||||
<title>Device naming order changes randomly after rebooting</title>
|
<title>Порядок присвоения имен устройствам меняется случайным образом после перезагрузки</title>
|
||||||
|
|
||||||
<para>This is due to the fact that udev, by design, handles uevents and
|
<para>Это связано с тем, что udev обрабатывает события uevents и загружает модули
|
||||||
loads modules in parallel, and thus in an unpredictable order. This will
|
параллельно, а значит в непредсказуемом порядке. Это никогда не будет <quote>исправлено</quote>.
|
||||||
never be <quote>fixed</quote>. You should not rely upon the kernel device
|
Вы не должны полагаться на то что имена устройств ядра стабильны. Вместо этого создайте
|
||||||
names being stable. Instead, create your own rules that make symlinks with
|
свои собственные правила, которые делают символические ссылки со стабильными именами на
|
||||||
stable names based on some stable attributes of the device, such as a
|
основе некоторых неизменяемых атрибутов устройства, таких как серийный номер или вывод
|
||||||
serial number or the output of various *_id utilities installed by udev.
|
различных утилит *_id, установленных Udev. Смотрите <xref linkend="ch-config-symlinks"/> и
|
||||||
See <xref linkend="ch-config-symlinks"/> and
|
<xref linkend="ch-config-network"/> для примера.</para>
|
||||||
<xref linkend="ch-config-network"/> for examples.</para>
|
|
||||||
|
|
||||||
</sect3>
|
</sect3>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Useful Reading</title>
|
<title>Полезная информация</title>
|
||||||
|
|
||||||
<para>Additional helpful documentation is available at the following
|
<para>Дополнительную документацию можно получить на следующих сайтах:</para>
|
||||||
sites:</para>
|
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>A Userspace Implementation of <systemitem class="filesystem">devfs</systemitem>
|
<para>Реализация пользовательского пространства в <systemitem class="filesystem">devfs</systemitem>
|
||||||
<ulink url="http://www.kroah.com/linux/talks/ols_2003_udev_paper/Reprint-Kroah-Hartman-OLS2003.pdf"/></para>
|
<ulink url="http://www.kroah.com/linux/talks/ols_2003_udev_paper/Reprint-Kroah-Hartman-OLS2003.pdf"/></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The <systemitem class="filesystem">sysfs</systemitem> Filesystem
|
<para>Файловая система <systemitem class="filesystem">sysfs</systemitem>
|
||||||
<ulink url="https://www.kernel.org/pub/linux/kernel/people/mochel/doc/papers/ols-2005/mochel.pdf"/></para>
|
<ulink url="https://www.kernel.org/pub/linux/kernel/people/mochel/doc/papers/ols-2005/mochel.pdf"/></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user