This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Eudev

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page Eudev and the translation is 100% complete.

Warning: Display title "eudev/es" overrides earlier display title "Eudev".

Resources

Para la configuraciones que no utilicen systemd, eudev es el gestor de ficheros de dispositivo para el núcleo Linux.[1] gestiona los nodos de dispositivo en /dev y maneja todas las acciones del espacio de usuario cuando se añadan o eliminen dispositivos. Es una bifurcación del udev de systemd con el objetivo de obtener mayor compatibilidad con el software existente como OpenRC, Upstart, núcleos antigus, varias cadenas de herramientas y cualquier otro programa requerido[2] por (sin embargo no muy bien documentado) udev. Las configuraciones que utilicen systemd no deberían usarlo.

The goal of eudev is to obtain better compatibility with existing software such as OpenRC, Upstart, older kernels, various toolchains, and anything else required[3] by (but not well supported through) udev. Configurations utilizing systemd should not use it.

El directorio /dev

Most Linux users understand that /dev/sda1 is just a fast way of referring to the first partition on the first disk that the kernel found. That's pretty easy, right?

But consider hotpluggable devices like USB, IEEE 1394, hot-swappable PCI, etc. What is the first device for each of these? And for how long? What will the other devices be named when the first one disappears? How will that affect ongoing transactions? Wouldn't it be fun if a printing job were suddenly moved from a high-end laser printer to an almost-dead matrix printer just because someone decided to pull the plug on the laser printer (which just happened to be the first printer)?

Enter the device manager. A modern device manager (including udev and eudev) must:

  • Run in userspace;
  • Dynamically create and remove device files;
  • Provide consistent device naming;
  • Provide a userspace application program interface (API).

Every time a change happens within the device structure, the kernel emits a uevent which gets picked up by the device manager. The device manager then follows the rules declared in the /etc/udev/rules.d, /run/udev/rules.d and /lib/udev/rules.d directories. Based on the information contained within the uevent, it finds the rule or rules it needs to trigger and performs the required actions. These actions may involve the creation or deletion of device files, and may also trigger the loading of particular firmware files into kernel memory.

Instalación

Ajustes USE

Algunos paquetes soportan el ajuste USE udev para habilitar la integración de virtual/udev.

Cannot load package information. Is the atom sys-fs/eudev correct?

Emerge

Para evitar el registro en el conjunto world, se debe utilizar la opción oneshot.

root #emerge --ask --oneshot sys-fs/eudev

Configuración

Servicio RC

El nombre RC es udev no eudev. Se necesita registrar en el nivel de ejecución sysinit.

root #rc-update add udev sysinit
 * rc-update: udev already installed in runlevel `sysinit'; skipping

A partir de la versión 29 del paquete sys-fs/udev-init-scripts se debe añadir udev-trigger al nivel de ejecución sysinit.

Migrar desde udev a eudev

La migración desde udev 216 a eudev 1.10-r2 (Marzo de 2015) es simple y directo:

root #emerge --ask --oneshot sys-fs/eudev

En caso de que el sistema utilice multilib y, por ejemplo, tenga el ajuste USE abi_x86_32 activo en el anterior paquete udev, no olvide cambiarlo también:

ARCHIVO /etc/portage/package.useCambiar de udev a eudev en package.use
# sys-fs/udev abi_x86_32
sys-fs/eudev abi_x86_32

Mantener el nombrado clásico 'eth0'

Los nombres de dispositivos de red eth0, eth1, etc. tal y como los suministra el núcleo podrían cambiar en el arranque (ver dmesg) por la regla udev /lib/udev/rules.d/80-net-name-slot.rules.

Para mantener el nombrado clásico, se puede sobrescribir esta regla con un fichero vacío con el mismo nombre en el directorio /etc/udev/rules.d:

root #touch /etc/udev/rules.d/80-net-name-slot.rules

De forma alternativa, añadir net.ifnames=0 a la línea de órdenes cambia la directriz por defecto o crea una personalizada.

Un recurso interesante ligado al nombrado de la red es No me gusta esto, cómo lo deshabilito en el wiki de Freedesktop.

Utilizar el nuevo nombrado 'predecible'

La nueva convención en el nombrado de interfaces ha cambiado, por lo que se deben reenlazar las interfaces. Utilice /etc/init.d/net.lo como objetivo del enlace para cualquier nombre de interfaz que necesite añadir. Asegúrese de reemplazar <nombre_de_interfaz> en las órdenes de abajo por los nombre de la interfaz Ethernet presentes en el sistema. Es posible descubrir las interfaces existentes lanzando la orden ifconfig:

user $ifconfig

Crear enlaces simbólicos para las interfaces existentes en los directorios /etc/init.d/ y /etc/conf.d/:

root #ln -s /etc/init.d/net.lo /etc/init.d/net.<nombre_de_interfaz>
root #ln -s /etc/conf.d/net.lo /etc/conf.d/net.<nombre_de_interfaz>

Añadir el guión o guiones al nivel de ejecución por defecto para arrancar el o los interfaces de forma automática:

root #rc-update add net.<nombre_de_interfaz> default

Resolución de problemas

Usar udevadm

Lanzar udevadm monitor y comprobar que sucede:

user $udevadm monitor

Obtener información del dispositivo medianteudevadm info seguido de la ruta al dispositivo:

user $udevadm info -p /devices/pci0000:00/0000:00:1d.7

Obtener la ruta al dispositivo utilizando su nombre:

user $udevadm info -q path -n input/mouse1
/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3.4/1-3.4:1.0/0003:046D:C404.0006/input/input24/mouse1

Comprobar que un evento se ejecuta utilizando udevadm test seguido de la ruta al dispositivo del que se quiere probar el evento:

user $udevadm test /devices/pci0000:00/0000:00:1d.7

Para obtener una lista de todas las órdenes udevadm:

user $udevadm -h

Migrar desde versiones anteriores

Desde udev 171-r10 hasta eudev 1.2-r1

Leer este hilo en los foros de Gentoo.

Sistema roto cuando se cambia de udev a eudev

Leer este hilo en los foros de Gentoo.

Véase también

Recursos externos

Referencias

  1. Bug 575718 - Request for council decision RE virtual/udev default provider, Página principal del sistema Bugzilla de Gentoo, (Última modificación) 27 de febrero de 2016. Recuperado el 1 de marzo de 2016.
  2. Project:Eudev, Gentoo Wiki, (Última modificación) el 12 de noviembre de 2015. Recuperado el 11 de marzo de 2016.
  3. Project:Eudev, Gentoo Wiki, (Last modified) November 12th, 2015. Retrieved on March 11th, 2016.