Commit c114f9af authored by Martin Pitt's avatar Martin Pitt
Browse files

Drop our Debian specific 60-persistent-storage{,-tape}.rules

Move to using the upstream rules. They are compatible and do a superset of the
functionality.

In our 60-persistent-storage.rules:
- hd* rules are obsolete (only using PATA drivers these days with SCSI)
- id_dasd is obsolete (not in any package on any arch in any release)
- id_edd in Debian seems to not exist. Dell's edd package ships these rules by
  itself
- ID_SCSI_COMPAT isn't set by id_scsi any more, thus rules are obsolete
parent 9ba58586
......@@ -22,6 +22,9 @@ systemd (204-9) UNRELEASED; urgency=medium
pt_chown (not available on all architectures). Thanks Adam Conrad.
* Add new block of Windows Azure ethernet hardware address to
75-persistent-net-generator.rules. (LP: #1274348)
* Drop our Debian specific 60-persistent-storage{,-tape}.rules and use the
upstream rules. They are compatible and do a superset of the
functionality.
-- Michael Biebl <biebl@debian.org> Sat, 26 Apr 2014 10:41:18 +0200
......
# This file contains the rules needed to create persistent device names.
# we are only interested in add and change actions for block devices
ACTION=="remove", GOTO="persistent_storage_tape_end"
# "Medium Changers"
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", \
IMPORT{program}="scsi_id --export --sg-version=3 --whitelisted --device=$tempnode"
KERNEL=="sg[0-9]*", ATTRS{type}=="8", ENV{ID_SERIAL}=="?*", \
SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}"
SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end"
KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", \
ENV{ID_BUS}="ieee1394", ENV{ID_SERIAL}="$attr{ieee1394_id}"
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \
SUBSYSTEMS=="usb", \
IMPORT{builtin}="usb_id"
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \
SUBSYSTEMS=="scsi", KERNELS=="[0-9]*:*[0-9]", \
ENV{.BSG_DEV}="$root/bsg/$id"
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \
WAIT_FOR="$env{.BSG_DEV}", \
ENV{ID_BUS}="scsi", \
IMPORT{program}="scsi_id --export --device=$env{.BSG_DEV}"
KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}=="?*", \
SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="st*[0-9]|nst*[0-9]", \
IMPORT{builtin}="path_id"
KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", \
SYMLINK+="tape/by-path/$env{ID_PATH}"
KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", \
SYMLINK+="tape/by-path/$env{ID_PATH}-nst"
# end of processing
LABEL="persistent_storage_tape_end"
# This file contains the rules needed to create persistent device names.
# forward scsi device events to the corresponding block device
ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", \
TEST=="block", ATTR{block/*/uevent}="change"
ACTION=="remove", GOTO="persistent_storage_end"
# enable in-kernel media-presence polling
ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", \
ATTR{parameters/events_dfl_poll_msecs}=="0", \
ATTR{parameters/events_dfl_poll_msecs}="2000"
SUBSYSTEM!="block", GOTO="persistent_storage_end"
# and we can safely ignore these kinds of devices
KERNEL=="fd[0-9]*|mtd[0-9]*|mtdblock[0-9]*|nbd[0-9]*|gnbd[0-9]*|dm-[0-9]*|md[0-9]*|btibm[0-9]*", \
GOTO="persistent_storage_end"
# skip removable ide devices, because open(2) on them causes an events loop
KERNEL=="hd*[!0-9]", ATTR{removable}=="1", \
SUBSYSTEMS=="ide", ATTRS{media}=="disk|floppy", \
GOTO="persistent_storage_end"
KERNEL=="hd*[0-9]", ATTRS{removable}=="1", \
GOTO="persistent_storage_end"
# ignore partitions that span the entire disk
TEST=="whole_disk", GOTO="persistent_storage_end"
# partitions do not have hardware identificators
ENV{DEVTYPE}!="disk", GOTO="persistent_storage_not_a_disk"
# look for different kinds of unique identificators
KERNEL=="hd*", \
IMPORT{program}="ata_id --export $tempnode"
KERNEL=="mmcblk[0-9]", ATTRS{name}=="?*", ATTRS{serial}=="?*", \
ENV{ID_BUS}="memstick", ENV{ID_SERIAL}="$attr{name}_$attr{serial}"
KERNEL=="mspblk[0-9]", ATTRS{name}=="?*", ATTRS{serial}=="?*", \
ENV{ID_BUS}="mmc", ENV{ID_SERIAL}="$attr{name}_$attr{serial}"
KERNEL=="sd*|sr*", ATTRS{ieee1394_id}=="?*", \
ENV{ID_BUS}="ieee1394", ENV{ID_SERIAL}="$attr{ieee1394_id}"
KERNEL=="vd*", ATTRS{serial}=="?*", \
ENV{ID_BUS}="virtio", ENV{ID_SERIAL}="$attr{serial}"
# ATA devices with their own "ata" kernel subsystem
KERNEL=="sd*|sr*", ENV{ID_SERIAL}!="?*", \
SUBSYSTEMS=="ata", \
IMPORT{program}="ata_id --export $tempnode"
# ATA devices using the "scsi" subsystem
KERNEL=="sd*|sr*", ENV{ID_SERIAL}!="?*", \
SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", \
IMPORT{program}="ata_id --export $tempnode"
# ATA/ATAPI devices (SPC-3 or later) using the "scsi" subsystem
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", \
SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", \
IMPORT{program}="ata_id --export $tempnode"
# Run ata_id on non-removable USB Mass Storage (SATA/PATA disks in enclosures)
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", \
SUBSYSTEMS=="usb", ATTR{removable}=="0", \
IMPORT{program}="ata_id --export $tempnode"
# Otherwise fall back to using usb_id for USB devices
KERNEL=="sd*|sr*", ENV{ID_SERIAL}!="?*", \
SUBSYSTEMS=="usb", \
IMPORT{builtin}="usb_id"
# scsi devices
KERNEL=="sd*|sr*", ENV{ID_SERIAL}!="?*", \
ENV{ID_BUS}="scsi", \
IMPORT{program}="scsi_id --export --whitelisted --device=$tempnode"
KERNEL=="cciss*", ENV{ID_SERIAL}!="?*", \
ENV{ID_BUS}="cciss", \
IMPORT{program}="scsi_id --export --whitelisted --device=$tempnode"
KERNEL=="dasd*", \
IMPORT{program}="dasd_id --export $tempnode"
# scsi compat links for ATA devices
KERNEL=="sd*", ENV{ID_BUS}=="ata", \
PROGRAM="scsi_id --whitelisted --replace-whitespace -p0x80 -d$tempnode", \
RESULT=="?*", ENV{ID_SCSI_COMPAT}="$result"
# find the physical path of the device
ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", \
IMPORT{builtin}="path_id"
LABEL="persistent_storage_not_a_disk"
# import the variables of partitions from the parent disks
ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"
# by-id (hardware serial number)
KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", \
SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}"
KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", \
SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}-part%n"
KERNEL=="sd*[!0-9]", ENV{ID_SCSI_COMPAT}=="?*", \
SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}"
KERNEL=="sd*[0-9]", ENV{ID_SCSI_COMPAT}=="?*", \
SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}-part%n"
ENV{DEVTYPE}=="disk", ENV{ID_BUS}=="?*", ENV{ID_SERIAL}=="?*", \
SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
ENV{DEVTYPE}=="partition", ENV{ID_BUS}=="?*", ENV{ID_SERIAL}=="?*", \
SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
ENV{DEVTYPE}=="disk", ENV{ID_EDD}=="?*", \
SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
ENV{DEVTYPE}=="partition", ENV{ID_EDD}=="?*", \
SYMLINK+="disk/by-id/edd-$env{ID_EDD}-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"
# by-partlabel/by-partuuid links (partition metadata)
ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_UUID}=="?*", \
SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}"
ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", \
SYMLINK+="disk/by-partlabel/$env{ID_PART_ENTRY_NAME}"
# by-path (parent device path)
ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", \
SYMLINK+="disk/by-path/$env{ID_PATH}"
ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", \
SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
# skip unpartitioned removable media devices from drivers which do not send
# "change" events
ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", \
GOTO="persistent_storage_end"
# probe filesystem metadata of optical drives which have a media inserted
KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", \
ENV{DISK_EJECT_REQUEST}!="?*", \
ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", \
IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", \
ENV{DISK_EJECT_REQUEST}!="?*", \
ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \
IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
# probe filesystem metadata of disks
KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
# watch metadata changes by tools closing the device after writing
KERNEL!="sr*", OPTIONS+="watch"
# by-label/by-uuid links (filesystem metadata)
ENV{ID_FS_UUID_ENC}=="?*", ENV{ID_FS_USAGE}=="filesystem|other|crypto", \
SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
ENV{ID_FS_LABEL_ENC}=="?*", ENV{ID_FS_USAGE}=="filesystem|other", \
SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
LABEL="persistent_storage_end"
......@@ -98,7 +98,6 @@ override_dh_install:
mkdir -p debian/udev-udeb/lib/udev/rules.d/
install -D --mode=644 \
debian/extra/rules/50-udev-default.rules \
debian/extra/rules/60-persistent-storage.rules \
debian/extra/rules/75-cd-aliases-generator.rules \
debian/extra/rules/75-persistent-net-generator.rules \
debian/extra/rules/80-drivers.rules \
......
......@@ -6,5 +6,6 @@ lib/udev/cdrom_id
lib/udev/rules.d/50-firmware.rules
lib/udev/rules.d/60-cdrom_id.rules
lib/udev/rules.d/60-persistent-input.rules
lib/udev/rules.d/60-persistent-storage.rules
lib/udev/rules.d/64-btrfs.rules
lib/udev/rules.d/75-probe_mtd.rules
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment