Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

device_rename(9) [centos man page]

DEVICE_RENAME(9)					   Device drivers infrastructure					  DEVICE_RENAME(9)

device_rename - renames a device SYNOPSIS
int device_rename(struct device * dev, const char * new_name); ARGUMENTS
dev the pointer to the struct device to be renamed new_name the new name of the device DESCRIPTION
It is the responsibility of the caller to provide mutual exclusion between two different calls of device_rename on the same device to ensure that new_name is valid and won't conflict with other devices. NOTE
Don't call this function. Currently, the networking layer calls this function, but that will change. The following text from Kay Sievers offers SOME INSIGHT
Renaming devices is racy at many levels, symlinks and other stuff are not replaced atomically, and you get a "move" uevent, but it's not easy to connect the event to the old and new device. Device nodes are not renamed at all, there isn't even support for that in the kernel now. In the meantime, during renaming, your target name might be taken by another driver, creating conflicts. Or the old name is taken directly after you renamed it -- then you get events for the same DEVPATH, before you even see the "move" event. It's just a mess, and nothing new should ever rely on kernel device renaming. Besides that, it's not even implemented now for other things than (driver-core wise very simple) network devices. We are currently about to change network renaming in udev to completely disallow renaming of devices in the same namespace as the kernel uses, because we can't solve the problems properly, that arise with swapping names of multiple interfaces without races. Means, renaming of eth[0-9]* will only be allowed to some other name than eth[0-9]*, for the aforementioned reasons. Make up a "real" name in the driver before you register anything, or add some other attributes for userspace to find the device, or use udev to add symlinks -- but never rename kernel devices later, it's a complete mess. We don't even want to get into that and try to implement the missing pieces in the core. We really have other pieces to fix in the driver core mess. :) COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 DEVICE_RENAME(9)

Check Out this Related Man Page

SYSTEMD.DEVICE(5)						  systemd.device						 SYSTEMD.DEVICE(5)

systemd.device - systemd device configuration files SYNOPSIS
systemd.device DESCRIPTION
A unit configuration file whose name ends in .device encodes information about a device unit as exposed in the sysfs/udev(7) device tree. This unit type has no specific options. See systemd.unit(5) for the common options of all unit configuration files. The common configuration items are configured in the generic [Unit] and [Install] sections. A separate [Device] section does not exist, since no device-specific options may be configured. systemd will automatically create dynamic device units for all kernel devices that are marked with the "systemd" udev tag (by default all block and network devices, and a few others). This may be used to define dependencies between devices and other units. Device units are named after the /sys and /dev paths they control. Example: the device /dev/sda5 is exposed in systemd as dev-sda5.device. For details about the escaping logic used to convert a file system path to a unit name see systemd.unit(5). THE UDEV DATABASE
The settings of device units may either be configured via unit files, or directly from the udev database (which is recommended). The following udev properties are understood by systemd: SYSTEMD_WANTS= Adds dependencies of type Wants from this unit to all listed units. This may be used to activate arbitrary units, when a specific device becomes available. Note that this and the other tags are not taken into account unless the device is tagged with the "systemd" string in the udev database, because otherwise the device is not exposed as systemd unit. SYSTEMD_ALIAS= Adds an additional alias name to the device unit. This must be an absolute path that is automatically transformed into a unit name. (See above.) SYSTEMD_READY= If set to 0 systemd will consider this device unplugged even if it shows up in the udev tree. If this property is unset or set to 1 the device will be considered plugged the moment it shows up in the udev tree. This property has no influence on the behaviour when a device disappears from the udev tree. This option is useful to support devices that initially show up in an uninitialized state in the tree, and for which a changed event is generated the moment they are fully set up. ID_MODEL_FROM_DATABASE=, ID_MODEL= If set, this property is used as description string for the device unit. SEE ALSO
systemd(1), systemctl(8), systemd.unit(5), udev(7) AUTHOR
Lennart Poettering <> Developer systemd 10/07/2013 SYSTEMD.DEVICE(5)
Man Page

Featured Tech Videos