udev-builtin-path_id.c revision dc4ebc0787a299f064553e6d28a7f35574ce1c2a
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * compose persistent device path
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * Copyright (C) 2009-2011 Kay Sievers <kay@vrfy.org>
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * Logic based on Hannes Reinecke's shell script.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * This program is free software: you can redistribute it and/or modify
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * it under the terms of the GNU General Public License as published by
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * the Free Software Foundation, either version 2 of the License, or
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * (at your option) any later version.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * This program is distributed in the hope that it will be useful,
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * but WITHOUT ANY WARRANTY; without even the implied warranty of
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * GNU General Public License for more details.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * You should have received a copy of the GNU General Public License
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * along with this program. If not, see <http://www.gnu.org/licenses/>.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringstatic int path_prepend(char **path, const char *fmt, ...) {
785890acf6d629ff881a1f065f431df1b7fc8c7aLennart Poettering err = asprintf(&new, "%s-%s", pre, *path);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering** Linux only supports 32 bit luns.
e56056e93d33619a3acf13e483900b4f8938228fThomas Hindoe Paaboel Andersen** See drivers/scsi/scsi_scan.c::scsilun_to_int() for more details.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringstatic int format_lun_number(struct udev_device *dev, char **path) {
d21ed1ead18d16d35c30299a69d3366847f8a039Lennart Poettering unsigned long lun = strtoul(udev_device_get_sysnum(dev), NULL, 10);
785890acf6d629ff881a1f065f431df1b7fc8c7aLennart Poettering /* address method 0, peripheral device addressing with bus id of zero */
d8f52ed25a9edce75fda5251c977b7898e33887eLennart Poettering return path_prepend(path, "lun-%lu", lun);
acf97e213e69a97e63ab8f7fad7ecd53608c757aLennart Poettering /* handle all other lun addressing methods by using a variant of the original lun format */
8b0cc9a36c8f92f010f2e8465942d2cd7c580d78Lennart Poettering return path_prepend(path, "lun-0x%04lx%04lx00000000", lun & 0xffff, (lun >> 16) & 0xffff);
6e18cc9fa078d2a967251017ddb5baefb104b720Lennart Poetteringstatic struct udev_device *skip_subsystem(struct udev_device *dev, const char *subsys) {
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering subsystem = udev_device_get_subsystem(parent);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering if (subsystem == NULL || !streq(subsystem, subsys))
acf97e213e69a97e63ab8f7fad7ecd53608c757aLennart Poetteringstatic struct udev_device *handle_scsi_fibre_channel(struct udev_device *parent, char **path) {
acf97e213e69a97e63ab8f7fad7ecd53608c757aLennart Poettering struct udev *udev = udev_device_get_udev(parent);
8b0cc9a36c8f92f010f2e8465942d2cd7c580d78Lennart Poettering targetdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_target");
8b0cc9a36c8f92f010f2e8465942d2cd7c580d78Lennart Poettering fcdev = udev_device_new_from_subsystem_sysname(udev, "fc_transport", udev_device_get_sysname(targetdev));
8b0cc9a36c8f92f010f2e8465942d2cd7c580d78Lennart Poettering port = udev_device_get_sysattr_value(fcdev, "port_name");
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poettering path_prepend(path, "fc-%s-%s", port, lun);
56159e0d918e9a9be07988133bb2847779325de0Lennart Poetteringstatic struct udev_device *handle_scsi_sas_wide_port(struct udev_device *parent, char **path) {
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poettering struct udev *udev = udev_device_get_udev(parent);
56159e0d918e9a9be07988133bb2847779325de0Lennart Poettering targetdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_target");
a1da85830bfaa77b9eb9c54693e5573559c97e50Tom Gundersen target_parent = udev_device_get_parent(targetdev);
a1da85830bfaa77b9eb9c54693e5573559c97e50Tom Gundersen sasdev = udev_device_new_from_subsystem_sysname(udev, "sas_device",
a1da85830bfaa77b9eb9c54693e5573559c97e50Tom Gundersen sas_address = udev_device_get_sysattr_value(sasdev, "sas_address");
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering path_prepend(path, "sas-%s-%s", sas_address, lun);
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poetteringstatic struct udev_device *handle_scsi_sas(struct udev_device *parent, char **path)
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering struct udev *udev = udev_device_get_udev(parent);
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poettering struct udev_device *target_sasdev = NULL;
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poettering struct udev_device *expander_sasdev = NULL;
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poettering targetdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_target");
5b30bef856e89a571df57b7b953e9a1409d9acedLennart Poettering target_parent = udev_device_get_parent(targetdev);
5b30bef856e89a571df57b7b953e9a1409d9acedLennart Poettering /* Get sas device */
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering target_sasdev = udev_device_new_from_subsystem_sysname(udev,
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poettering "sas_device", udev_device_get_sysname(target_parent));
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poettering /* The next parent is sas port */
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poettering port = udev_device_get_parent(target_parent);
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poettering /* Get port device */
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poettering port_sasdev = udev_device_new_from_subsystem_sysname(udev,
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poettering "sas_port", udev_device_get_sysname(port));
0b63e2789f984e84f40bf6e49f5da15c87298cedLennart Poettering phy_count = udev_device_get_sysattr_value(port_sasdev, "num_phys");
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering /* Check if we are simple disk */
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering parent = handle_scsi_sas_wide_port(parent, path);
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering /* Get connected phy */
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering phy_id = udev_device_get_sysattr_value(target_sasdev, "phy_identifier");
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering /* The port's parent is either hba or expander */
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering /* Get expander device */
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering expander_sasdev = udev_device_new_from_subsystem_sysname(udev,
56159e0d918e9a9be07988133bb2847779325de0Lennart Poettering "sas_device", udev_device_get_sysname(expander));
10f9c75519671e7c7ab8993b54fe22da7c2d0c38Lennart Poettering /* Get expander's address */
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering sas_address = udev_device_get_sysattr_value(expander_sasdev,
56159e0d918e9a9be07988133bb2847779325de0Lennart Poettering "sas_address");
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering path_prepend(path, "sas-exp%s-phy%s-%s", sas_address, phy_id, lun);
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering path_prepend(path, "sas-phy%s-%s", phy_id, lun);
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poetteringstatic struct udev_device *handle_scsi_iscsi(struct udev_device *parent, char **path) {
b6b1849830f5e4a6065c3b0c993668e500c954d3Lennart Poettering struct udev *udev = udev_device_get_udev(parent);
10f9c75519671e7c7ab8993b54fe22da7c2d0c38Lennart Poettering /* find iscsi session */
10f9c75519671e7c7ab8993b54fe22da7c2d0c38Lennart Poettering transportdev = udev_device_get_parent(transportdev);
10f9c75519671e7c7ab8993b54fe22da7c2d0c38Lennart Poettering if (startswith(udev_device_get_sysname(transportdev), "session"))
10f9c75519671e7c7ab8993b54fe22da7c2d0c38Lennart Poettering /* find iscsi session device */
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering sessiondev = udev_device_new_from_subsystem_sysname(udev, "iscsi_session", udev_device_get_sysname(transportdev));
10f9c75519671e7c7ab8993b54fe22da7c2d0c38Lennart Poettering target = udev_device_get_sysattr_value(sessiondev, "targetname");
10f9c75519671e7c7ab8993b54fe22da7c2d0c38Lennart Poettering if (asprintf(&connname, "connection%s:0", udev_device_get_sysnum(transportdev)) < 0) {
b6b1849830f5e4a6065c3b0c993668e500c954d3Lennart Poettering conndev = udev_device_new_from_subsystem_sysname(udev, "iscsi_connection", connname);
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering addr = udev_device_get_sysattr_value(conndev, "persistent_address");
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering port = udev_device_get_sysattr_value(conndev, "persistent_port");
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering path_prepend(path, "ip-%s:%s-iscsi-%s-%s", addr, port, target, lun);
c19de71113f956809995fc68817e055e9f61f607Lennart Poetteringstatic struct udev_device *handle_scsi_default(struct udev_device *parent, char **path) {
b6b1849830f5e4a6065c3b0c993668e500c954d3Lennart Poettering hostdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_host");
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering if (sscanf(name, "%d:%d:%d:%d", &host, &bus, &target, &lun) != 4)
89f7c8465cd1ab37347dd0c15920bce31e8225dfLennart Poettering * Rebase host offset to get the local relative number
a1da85830bfaa77b9eb9c54693e5573559c97e50Tom Gundersen * Note: This is by definition racy, unreliable and too simple.
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering * Please do not copy this model anywhere. It's just a left-over
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering * from the time we had no idea how things should look like in
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering * Making assumptions about a global in-kernel counter and use
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering * that to calculate a local offset is a very broken concept. It
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering * can only work as long as things are in strict order.
d21ed1ead18d16d35c30299a69d3366847f8a039Lennart Poettering * The kernel needs to export the instance/port number of a
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering * controller directly, without the need for rebase magic like
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering * this. Manual driver unbind/bind, parallel hotplug/unplug will
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering * get into the way of this "I hope it works" logic.
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering base = strdup(udev_device_get_syspath(hostdev));
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
9d12709626bccc0cae677a7035f62efe6aabb4abLennart Poettering if (dent->d_type != DT_DIR && dent->d_type != DT_LNK)
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering i = strtoul(&dent->d_name[4], &rest, 10);
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering * find the smallest number; the host really needs to export its
8b0cc9a36c8f92f010f2e8465942d2cd7c580d78Lennart Poettering * own instance number per parent device; relying on the global host
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering * enumeration and plainly rebasing the numbers sounds unreliable
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering path_prepend(path, "scsi-%u:%u:%u:%u", host, bus, target, lun);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringstatic struct udev_device *handle_scsi_hyperv(struct udev_device *parent, char **path) {
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering hostdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_host");
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering vmbusdev = udev_device_get_parent(hostdev);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering guid_str = udev_device_get_sysattr_value(vmbusdev, "device_id");
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering if (strlen(guid_str) < 37 || guid_str[0] != '{' || guid_str[36] != '}')
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering path_prepend(path, "vmbus-%s-%s", guid, lun);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringstatic struct udev_device *handle_scsi(struct udev_device *parent, char **path, bool *supported_parent) {
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering devtype = udev_device_get_devtype(parent);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering if (devtype == NULL || !streq(devtype, "scsi_device"))
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering /* firewire */
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering id = udev_device_get_sysattr_value(parent, "ieee1394_id");
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering /* scsi sysfs does not have a "subsystem" for the transport */
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering parent = handle_scsi_fibre_channel(parent, path);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering if (strstr(name, "/end_device-") != NULL) {
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering parent = handle_scsi_iscsi(parent, path);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering * We do not support the ATA transport class, it uses global counters
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering * to name the ata devices which numbers spread across multiple
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering * controllers.
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering * The real link numbers are not exported. Also, possible chains of ports
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering * behind port multipliers cannot be composed that way.
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering * Until all that is solved at the kernel level, there are no by-path/
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering * links for ATA devices.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering parent = handle_scsi_hyperv(parent, path);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering parent = handle_scsi_default(parent, path);
e7e55dbdc38f929805ab2407fbd50886043a9e7cDavid Herrmannstatic struct udev_device *handle_cciss(struct udev_device *parent, char **path) {
e7e55dbdc38f929805ab2407fbd50886043a9e7cDavid Herrmann if (sscanf(str, "c%ud%u%*s", &controller, &disk) != 2)
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poetteringstatic void handle_scsi_tape(struct udev_device *dev, char **path) {
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering /* must be the last device in the syspath */
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering if (startswith(name, "nst") && strchr("lma", name[3]) != NULL)
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering else if (startswith(name, "st") && strchr("lma", name[2]) != NULL)
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringstatic struct udev_device *handle_usb(struct udev_device *parent, char **path) {
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering devtype = udev_device_get_devtype(parent);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering if (!streq(devtype, "usb_interface") && !streq(devtype, "usb_device"))
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringstatic struct udev_device *handle_bcma(struct udev_device *parent, char **path) {
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering sysname = udev_device_get_sysname(parent);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering if (sscanf(sysname, "bcma%*u:%u", &core) != 1)
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poetteringstatic struct udev_device *handle_ccw(struct udev_device *parent, struct udev_device *dev, char **path) {
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering scsi_dev = udev_device_get_parent_with_subsystem_devtype(dev, "scsi", "scsi_device");
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering hba_id = udev_device_get_sysattr_value(scsi_dev, "hba_id");
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering wwpn = udev_device_get_sysattr_value(scsi_dev, "wwpn");
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering lun = udev_device_get_sysattr_value(scsi_dev, "fcp_lun");
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering if (hba_id != NULL && lun != NULL && wwpn != NULL) {
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering path_prepend(path, "ccw-%s-zfcp-%s:%s", hba_id, wwpn, lun);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering path_prepend(path, "ccw-%s", udev_device_get_sysname(parent));
8b0cc9a36c8f92f010f2e8465942d2cd7c580d78Lennart Poetteringstatic int builtin_path_id(struct udev_device *dev, int argc, char *argv[], bool test) {
8b0cc9a36c8f92f010f2e8465942d2cd7c580d78Lennart Poettering /* S390 ccw bus */
8b0cc9a36c8f92f010f2e8465942d2cd7c580d78Lennart Poettering parent = udev_device_get_parent_with_subsystem_devtype(dev, "ccw", NULL);
8b0cc9a36c8f92f010f2e8465942d2cd7c580d78Lennart Poettering /* walk up the chain of devices and compose path */
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering subsys = udev_device_get_subsystem(parent);
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering parent = handle_scsi(parent, &path, &supported_parent);
e7e9b6bb0b0bc5b1eb256a44f8afec6b634f26efZbigniew Jędrzejewski-Szmek parent = handle_cciss(parent, &path);
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering path_prepend(&path, "serio-%s", udev_device_get_sysnum(parent));
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering parent = skip_subsystem(parent, "serio");
a6c616024db23fef34152c1432892824a07799ccLennart Poettering path_prepend(&path, "pci-%s", udev_device_get_sysname(parent));
8b0cc9a36c8f92f010f2e8465942d2cd7c580d78Lennart Poettering path_prepend(&path, "platform-%s", udev_device_get_sysname(parent));
8b0cc9a36c8f92f010f2e8465942d2cd7c580d78Lennart Poettering parent = skip_subsystem(parent, "platform");
8b0cc9a36c8f92f010f2e8465942d2cd7c580d78Lennart Poettering path_prepend(&path, "acpi-%s", udev_device_get_sysname(parent));
9f6eb1cd58f2ddf2eb6ba0e4de056e13d938af75Kay Sievers path_prepend(&path, "xen-%s", udev_device_get_sysname(parent));
a1da85830bfaa77b9eb9c54693e5573559c97e50Tom Gundersen path_prepend(&path, "scm-%s", udev_device_get_sysname(parent));
f647962d64e844689f3e2acfce6102fc47e76df2Michal Schmidt * Do not return devices with an unknown parent device type. They
f647962d64e844689f3e2acfce6102fc47e76df2Michal Schmidt * might produce conflicting IDs if the parent does not provide a
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * unique and predictable name.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering * Do not return block devices without a well-known transport. Some
9f6eb1cd58f2ddf2eb6ba0e4de056e13d938af75Kay Sievers * devices do not expose their buses and do not provide a unique
9f6eb1cd58f2ddf2eb6ba0e4de056e13d938af75Kay Sievers * and predictable name that way.
fefdc04b38725457a91651218feb7000f6ccc1f4Lennart Poettering if (streq(udev_device_get_subsystem(dev), "block") && !supported_transport)
9f6eb1cd58f2ddf2eb6ba0e4de056e13d938af75Kay Sievers const char *p;
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering /* compose valid udev tag name */
9f6eb1cd58f2ddf2eb6ba0e4de056e13d938af75Kay Sievers for (p = path, i = 0; *p; p++) {
fefdc04b38725457a91651218feb7000f6ccc1f4Lennart Poettering /* skip all leading '_' */
9f6eb1cd58f2ddf2eb6ba0e4de056e13d938af75Kay Sievers /* avoid second '_' */
56159e0d918e9a9be07988133bb2847779325de0Lennart Poettering /* strip trailing '_' */
a1da85830bfaa77b9eb9c54693e5573559c97e50Tom Gundersen udev_builtin_add_property(dev, test, "ID_PATH", path);
9f6eb1cd58f2ddf2eb6ba0e4de056e13d938af75Kay Sievers udev_builtin_add_property(dev, test, "ID_PATH_TAG", tag);