Datasheet
“main” (Installation and Administration) — 2004/6/25 — 13:29 — page 327 — #353
i
i
i
i
i
i
i
i
15
Dynamic Device Nodes with udev
SYSFS{vendor}=" "
SYSFS{model}="USB 2.0M DSC "
SYSFS{rev}="1.00"
SYSFS{online}="1"
From the output information, look for suitable keys that will not change.
Remember that you cannot normally use keys from different directories.
15.5 Consistent Names for Mass
Storage Devices
SUSE LINUX comes with scripts that help always assign the same des-
ignations to hard disks and other storage devices. /sbin/udev.get_
persistent_device_name.sh is a wrapper script. First it calls /sbin/
udev.get_unique_hardware_path.sh, which ascertains the hardware
path for a specified device. /sbin/udev.get_unique_drive_id.sh
also retrieves the serial number. Both outputs are then passed to udev,
which creates the symbolic link to the device node under /dev. The wrap-
per can be used directly in the udev rules. Here is an example for SCSI,
which can also be generalized to USB or IDE (write it as one line):
BUS="scsi",
PROGRAM="/sbin/udev.get_persistent_device_name.sh",
NAME="%k", SYMLINK="%c{1+}"
As soon as a driver has been loaded for a mass storage device, it registers
with all the available hard disks with the kernel. Each of them triggers a
hotplug block event that calls udev. First, udev reads the rules to ascertain
whether a symlink needs to be created.
If the driver is loaded via initrd, the hotplug events are lost. However,
all the information is stored in sysfs. The udevstart utility finds all the
device files under /sys/block and /sys/class and starts udev.
There is also a start script boot.udev, which recreates all the device
nodes during the boot process. However, the start script must be acti-
vated through the YaST runlevel editor or with the command insserv
boot.udev.
327SUSE LINUX Enterprise Server










