eudev-project / eudev

Repository for eudev development
GNU General Public License v2.0
529 stars 144 forks source link

SYMLINK -= support #289

Open FiloSottile opened 2 weeks ago

FiloSottile commented 2 weeks ago

Would it be possible to sync systemd/systemd#26081 from upstream, to support SYMLINK-= actions?

It would allow creating a rules file like

ENV{DEVTYPE}=="disk", ATTR{wwid}=="?*", SYMLINK-="disk/by-id/nvme-$attr{wwid}"
ENV{DEVTYPE}=="partition", ATTRS{wwid}=="?*", SYMLINK-="disk/by-id/nvme-$attr{wwid}-part%n"
ENV{DEVTYPE}=="disk", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK-="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}"
ENV{DEVTYPE}=="partition", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK-="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}-part%n"

to drop the WWN by-id symlinks, instead of having to fork the entire upstream 60-persistent-storage.rules. (The reason to remove them is that they are less useful as ZFS labels, and get randomly picked up by zpool import -d /dev/disk/by-id.)