@@ -0,0 +1,13 @@
|
||||
[service]
|
||||
display-name = "Linux Device Daemon"
|
||||
description = "Discovery and management service of Linux devices, compatible with udev interface"
|
||||
|
||||
[exec]
|
||||
start = "lxdeviced"
|
||||
|
||||
[env]
|
||||
clear_vars = true
|
||||
working_dir = "/"
|
||||
|
||||
[env.vars]
|
||||
PATH = "/usr/bin"
|
||||
@@ -0,0 +1,129 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
# run a command on remove events
|
||||
ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}"
|
||||
ACTION=="remove", GOTO="default_end"
|
||||
|
||||
# The md driver increments diskseq *after* emitting 'change' uevent.
|
||||
# Drop the line below if it is fixed on the kernel side.
|
||||
SUBSYSTEM=="block", KERNEL=="md*", ENV{ID_IGNORE_DISKSEQ}="1"
|
||||
|
||||
SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}"
|
||||
|
||||
SUBSYSTEM=="rtc", GROUP="clock", MODE="0660"
|
||||
# select "system RTC" or just use the first one
|
||||
SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc"
|
||||
SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"
|
||||
|
||||
SUBSYSTEM=="hidraw", IMPORT{builtin}="hwdb"
|
||||
|
||||
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
|
||||
ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"
|
||||
|
||||
# Before c43ff248f94266cfc93e300a2d3d163ed805e55b, the following line in
|
||||
# 60-drm.rules also sets ID_PATH for all pci, usb, and platform devices:
|
||||
####
|
||||
# ACTION!="remove", SUBSYSTEM=="drm", SUBSYSTEMS=="pci|usb|platform", IMPORT{builtin}="path_id"
|
||||
####
|
||||
# Unfortunately, some existing rules already rely on the unexpected behavior.
|
||||
# To keep the backward compatibility, let's set ID_PATH for them.
|
||||
SUBSYSTEM=="pci|usb|platform", IMPORT{builtin}="path_id"
|
||||
|
||||
SUBSYSTEM=="net", IMPORT{builtin}="net_driver"
|
||||
|
||||
SUBSYSTEM=="ptp", GROUP="clock", MODE="0664"
|
||||
SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK+="ptp_kvm"
|
||||
SUBSYSTEM=="ptp", ATTR{clock_name}=="hyperv", SYMLINK+="ptp_hyperv"
|
||||
SUBSYSTEM=="ptp", ATTR{clock_name}=="ptp_vmw", SYMLINK+="ptp_vmware"
|
||||
SUBSYSTEM=="ptp", ATTR{clock_name}=="s390 Physical Clock", SYMLINK+="ptp_s390_physical"
|
||||
SUBSYSTEM=="ptp", ATTR{clock_name}=="s390 STCKE Clock", SYMLINK+="ptp_s390_stcke"
|
||||
|
||||
ACTION!="add", GOTO="default_end"
|
||||
|
||||
SUBSYSTEM=="mem", KERNEL=="null", GROUP="root", MODE="0666"
|
||||
|
||||
SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666"
|
||||
SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666"
|
||||
SUBSYSTEM=="tty", KERNEL=="tty[0-9]*|hvc[0-9]*|sclp_line[0-9]*|ttysclp[0-9]*|3270/tty[0-9]*", GROUP="tty", MODE="{{TTY_MODE}}"
|
||||
SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty"
|
||||
KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"
|
||||
|
||||
SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640"
|
||||
|
||||
SUBSYSTEM=="input", GROUP="input"
|
||||
SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0664"
|
||||
|
||||
SUBSYSTEM=="video4linux", GROUP="video"
|
||||
SUBSYSTEM=="graphics", GROUP="video"
|
||||
SUBSYSTEM=="drm", KERNEL!="renderD*", GROUP="video"
|
||||
SUBSYSTEM=="dvb", GROUP="video"
|
||||
SUBSYSTEM=="media", GROUP="video"
|
||||
SUBSYSTEM=="cec", GROUP="video"
|
||||
|
||||
SUBSYSTEM=="drm", KERNEL=="renderD*", GROUP="render", MODE="{{GROUP_RENDER_MODE}}"
|
||||
SUBSYSTEM=="kfd", GROUP="render", MODE="{{GROUP_RENDER_MODE}}"
|
||||
SUBSYSTEM=="accel", GROUP="render", MODE="{{GROUP_RENDER_MODE}}"
|
||||
|
||||
SUBSYSTEM=="misc", KERNEL=="sgx_enclave", GROUP="sgx", MODE="0660"
|
||||
SUBSYSTEM=="misc", KERNEL=="sgx_vepc", GROUP="sgx", MODE="0660"
|
||||
|
||||
# When using static_node= with non-default permissions, also update
|
||||
# tmpfiles.d/static-nodes-permissions.conf.in to keep permissions synchronized.
|
||||
|
||||
SUBSYSTEM=="sound", GROUP="audio", \
|
||||
OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer"
|
||||
|
||||
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"
|
||||
|
||||
SUBSYSTEM=="firewire", TEST=="units", TEST=="model", \
|
||||
IMPORT{builtin}="hwdb 'ieee1394:node:ven$attr{vendor}mo$attr{model}units$attr{units}'"
|
||||
|
||||
SUBSYSTEM=="firewire", TEST=="units", TEST!="model", \
|
||||
IMPORT{builtin}="hwdb 'ieee1394:node:ven$attr{vendor}units$attr{units}'"
|
||||
|
||||
SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_MIDI}=="1", GROUP="audio"
|
||||
SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_AUDIO}=="1", GROUP="audio"
|
||||
SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_VIDEO}=="1", GROUP="video"
|
||||
|
||||
KERNEL=="parport[0-9]*", GROUP="lp"
|
||||
SUBSYSTEM=="printer", KERNEL=="lp*", GROUP="lp"
|
||||
SUBSYSTEM=="ppdev", GROUP="lp"
|
||||
KERNEL=="lp[0-9]*", GROUP="lp"
|
||||
KERNEL=="irlpt[0-9]*", GROUP="lp"
|
||||
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp"
|
||||
|
||||
SUBSYSTEM=="block", GROUP="disk"
|
||||
SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="cdrom"
|
||||
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
|
||||
KERNEL=="sch[0-9]*", GROUP="cdrom"
|
||||
KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
|
||||
KERNEL=="pktcdvd", GROUP="cdrom"
|
||||
|
||||
SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape"
|
||||
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk"
|
||||
KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk"
|
||||
KERNEL=="loop-control", GROUP="disk", OPTIONS+="static_node=loop-control"
|
||||
KERNEL=="btrfs-control", GROUP="disk"
|
||||
KERNEL=="rawctl", GROUP="disk"
|
||||
SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", GROUP="disk"
|
||||
SUBSYSTEM=="aoe", GROUP="disk", MODE="0220"
|
||||
SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
|
||||
|
||||
KERNEL=="rfkill", MODE="0664"
|
||||
KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"
|
||||
|
||||
KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"
|
||||
|
||||
# The static_node is required on s390x and ppc (they are using MODULE_ALIAS)
|
||||
KERNEL=="kvm", GROUP="kvm", MODE="{{DEV_KVM_MODE}}", OPTIONS+="static_node=kvm"
|
||||
|
||||
KERNEL=="vfio", MODE="0666", OPTIONS+="static_node=vfio/vfio"
|
||||
|
||||
KERNEL=="vsock", MODE="0666"
|
||||
KERNEL=="vhost-vsock", GROUP="kvm", MODE="{{DEV_KVM_MODE}}", OPTIONS+="static_node=vhost-vsock"
|
||||
|
||||
KERNEL=="vhost-net", GROUP="kvm", MODE="{{DEV_KVM_MODE}}", OPTIONS+="static_node=vhost-net"
|
||||
|
||||
KERNEL=="udmabuf", GROUP="kvm"
|
||||
|
||||
LABEL="default_end"
|
||||
@@ -0,0 +1,22 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION!="add", GOTO="autosuspend_end"
|
||||
|
||||
# I2C rules
|
||||
SUBSYSTEM=="i2c", ATTR{name}=="cyapa", \
|
||||
ATTR{power/control}="on", GOTO="autosuspend_end"
|
||||
|
||||
# Enable autosuspend if hwdb says so. Here we are relying on
|
||||
# the hwdb import done earlier based on MODALIAS.
|
||||
ENV{ID_AUTOSUSPEND}=="1", TEST=="power/control", \
|
||||
ATTR{power/control}="auto"
|
||||
|
||||
# Disable USB persist if hwdb says so.
|
||||
ENV{ID_PERSIST}=="0", TEST=="power/persist", \
|
||||
ATTR{power/persist}="0"
|
||||
|
||||
# Set up an autosuspend delay if hwdb say so
|
||||
ENV{ID_AUTOSUSPEND_DELAY_MS}!="", TEST=="power/control", \
|
||||
ATTR{power/autosuspend_delay_ms}="$env{ID_AUTOSUSPEND_DELAY_MS}"
|
||||
|
||||
LABEL="autosuspend_end"
|
||||
@@ -0,0 +1,24 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
# 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"
|
||||
|
||||
# forward scsi device event to corresponding block device
|
||||
ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change"
|
||||
|
||||
# watch metadata changes, caused by tools closing the device node which was opened for writing
|
||||
ACTION!="remove", SUBSYSTEM=="block", \
|
||||
KERNEL=="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|ubi*|scm*|pmem*|nbd*|zd*|rbd*|zram*|ublkb*", \
|
||||
OPTIONS+="watch"
|
||||
|
||||
# Reset access rights to each loopback device once it gets detached.
|
||||
ACTION=="change", SUBSYSTEM=="block", KERNEL=="loop*", ENV{DISK_MEDIA_CHANGE}=="1", TEST!="loop/backing_file", GROUP="disk", MODE="660"
|
||||
|
||||
# Provide a somewhat cleaned up field indicating the subsystem various
|
||||
# 'virtual' block devices belong to, in order to avoid replicating name based
|
||||
# pattern matching in every consumer
|
||||
ACTION!="remove", SUBSYSTEM=="block", KERNEL=="dm-*", ENV{ID_BLOCK_SUBSYSTEM}="dm"
|
||||
ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*", ENV{ID_BLOCK_SUBSYSTEM}="loop"
|
||||
ACTION!="remove", SUBSYSTEM=="block", KERNEL=="md*", ENV{ID_BLOCK_SUBSYSTEM}="md"
|
||||
ACTION!="remove", SUBSYSTEM=="block", KERNEL=="zram*", ENV{ID_BLOCK_SUBSYSTEM}="zram"
|
||||
@@ -0,0 +1,29 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="cdrom_end"
|
||||
SUBSYSTEM!="block", GOTO="cdrom_end"
|
||||
KERNEL!="sr[0-9]*|vdisk*|xvd*", GOTO="cdrom_end"
|
||||
ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
|
||||
|
||||
# unconditionally tag device as CDROM
|
||||
KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1"
|
||||
|
||||
# stop automatically any mount units bound to the device if the media eject
|
||||
# button is pressed.
|
||||
ENV{ID_CDROM}=="1", ENV{SYSTEMD_MOUNT_DEVICE_BOUND}="1"
|
||||
|
||||
# media eject button pressed
|
||||
ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $devnode", GOTO="cdrom_end"
|
||||
|
||||
# import device and media properties and lock tray to
|
||||
# enable the receiving of media eject button events
|
||||
IMPORT{program}="cdrom_id --lock-media $devnode"
|
||||
|
||||
# ejecting a CD does not remove the device node, so mark the systemd device
|
||||
# unit as inactive while there is no medium; this automatically cleans up of
|
||||
# stale mounts after ejecting
|
||||
ENV{DISK_MEDIA_CHANGE}=="?*", ENV{ID_CDROM_MEDIA}!="?*", ENV{SYSTEMD_READY}="0"
|
||||
|
||||
KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"
|
||||
|
||||
LABEL="cdrom_end"
|
||||
@@ -0,0 +1,29 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="dmi_end"
|
||||
SUBSYSTEM!="dmi", GOTO="dmi_end"
|
||||
KERNEL!="id", GOTO="dmi_end"
|
||||
|
||||
ENV{ID_SYS_VENDOR_IS_RUBBISH}!="1", ENV{ID_VENDOR}="$attr{sys_vendor}"
|
||||
ENV{ID_SYSFS_ATTRIBUTE_MODEL}=="", ENV{ID_PRODUCT_NAME_IS_RUBBISH}!="1", ENV{ID_MODEL}="$attr{product_name}"
|
||||
ENV{ID_SYSFS_ATTRIBUTE_MODEL}=="product_name", ENV{ID_MODEL}="$attr{product_name}"
|
||||
ENV{ID_SYSFS_ATTRIBUTE_MODEL}=="product_version", ENV{ID_MODEL}="$attr{product_version}"
|
||||
# Fallback to board information
|
||||
ENV{ID_VENDOR}=="", ENV{ID_VENDOR}="$attr{board_vendor}"
|
||||
ENV{ID_MODEL}=="", ENV{ID_MODEL}="$attr{board_name}"
|
||||
|
||||
# Stock keeping unit
|
||||
ENV{ID_PRODUCT_SKU_IS_RUBBISH}!="1", ENV{ID_SKU}="$attr{product_sku}"
|
||||
|
||||
# Hardware version
|
||||
ENV{ID_PRODUCT_VERSION_IS_RUBBISH}!="1", ENV{ID_HARDWARE_VERSION}="$attr{product_version}"
|
||||
ENV{ID_HARDWARE_VERSION}=="", ENV{ID_BOARD_VERSION_IS_RUBBISH}!="1", ENV{ID_HARDWARE_VERSION}="$attr{board_version}"
|
||||
|
||||
# Chassis asset tag
|
||||
ENV{MODALIAS}!="", ATTR{chassis_asset_tag}!="", IMPORT{builtin}="hwdb '$attr{modalias}cat$attr{chassis_asset_tag}:'"
|
||||
ENV{ID_CHASSIS_ASSET_TAG_IS_RUBBISH}!="1", ENV{ID_CHASSIS_ASSET_TAG}="$attr{chassis_asset_tag}"
|
||||
|
||||
# Allow units to be ordered after the DMI device
|
||||
TAG+="systemd"
|
||||
|
||||
LABEL="dmi_end"
|
||||
@@ -0,0 +1,11 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION!="remove", SUBSYSTEM=="drm", SUBSYSTEMS=="pci|usb|platform", IMPORT{builtin}="path_id"
|
||||
|
||||
# by-path
|
||||
KERNEL=="card*", ENV{ID_PATH}=="?*", SYMLINK+="dri/by-path/$env{ID_PATH}-card"
|
||||
KERNEL=="card*", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="dri/by-path/$env{ID_PATH_WITH_USB_REVISION}-card"
|
||||
KERNEL=="controlD*", ENV{ID_PATH}=="?*", SYMLINK+="dri/by-path/$env{ID_PATH}-control"
|
||||
KERNEL=="controlD*", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="dri/by-path/$env{ID_PATH_WITH_USB_REVISION}-control"
|
||||
KERNEL=="renderD*", ENV{ID_PATH}=="?*", SYMLINK+="dri/by-path/$env{ID_PATH}-render"
|
||||
KERNEL=="renderD*", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="dri/by-path/$env{ID_PATH_WITH_USB_REVISION}-render"
|
||||
@@ -0,0 +1,30 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="evdev_end"
|
||||
KERNEL!="event*", GOTO="evdev_end"
|
||||
|
||||
# Execute the match patterns below, from least-to-most specific.
|
||||
|
||||
# Device matching the modalias string (bustype, vendor, product, version, other properties)
|
||||
IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=evdev:", \
|
||||
ENV{.HAVE_HWDB_PROPERTIES}="1"
|
||||
|
||||
# AT keyboard matching by the machine's DMI data
|
||||
DRIVERS=="atkbd", \
|
||||
IMPORT{builtin}="hwdb 'evdev:atkbd:$attr{[dmi/id]modalias}'", \
|
||||
ENV{.HAVE_HWDB_PROPERTIES}="1"
|
||||
|
||||
# Device matching the input device name and the machine's DMI data
|
||||
KERNELS=="input*", \
|
||||
IMPORT{builtin}="hwdb 'evdev:name:$attr{name}:$attr{[dmi/id]modalias}'", \
|
||||
ENV{.HAVE_HWDB_PROPERTIES}="1"
|
||||
|
||||
# Device matching the input device name + properties + the machine's DMI data
|
||||
KERNELS=="input*", \
|
||||
IMPORT{builtin}="hwdb 'evdev:name:$attr{name}:phys:$attr{phys}:ev:$attr{capabilities/ev}:$attr{[dmi/id]modalias}'", \
|
||||
ENV{.HAVE_HWDB_PROPERTIES}="1"
|
||||
|
||||
ENV{.HAVE_HWDB_PROPERTIES}=="1", \
|
||||
IMPORT{builtin}="keyboard"
|
||||
|
||||
LABEL="evdev_end"
|
||||
@@ -0,0 +1,14 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="fido_id_end"
|
||||
|
||||
SUBSYSTEM=="hidraw", IMPORT{program}="fido_id"
|
||||
|
||||
# Tag any form of security token as such
|
||||
ENV{ID_SECURITY_TOKEN}=="1", TAG+="security-device"
|
||||
|
||||
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0b????:*", ENV{ID_SMARTCARD_READER}="1"
|
||||
# Tag any CCID device (i.e. Smartcard Reader) as security token
|
||||
ENV{ID_SMARTCARD_READER}=="1", TAG+="security-device"
|
||||
|
||||
LABEL="fido_id_end"
|
||||
@@ -0,0 +1,17 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="gpiochip_end"
|
||||
SUBSYSTEM!="gpio", GOTO="gpiochip_end"
|
||||
|
||||
KERNEL!="gpiochip[0-9]*", GOTO="gpiochip_end"
|
||||
|
||||
IMPORT{builtin}="path_id"
|
||||
ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="gpio/by-path/$env{ID_PATH_WITH_USB_REVISION}"
|
||||
|
||||
SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
|
||||
ENV{ID_BUS}=="", GOTO="gpiochip_end"
|
||||
ENV{ID_SERIAL}=="", GOTO="gpiochip_end"
|
||||
ENV{ID_USB_INTERFACE_NUM}=="", GOTO="gpiochip_end"
|
||||
SYMLINK+="gpio/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_USB_INTERFACE_NUM}"
|
||||
|
||||
LABEL="gpiochip_end"
|
||||
@@ -0,0 +1,12 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="infiniband_end"
|
||||
SUBSYSTEM!="infiniband_verbs", GOTO="infiniband_end"
|
||||
KERNEL!="uverbs*", GOTO="infiniband_end"
|
||||
|
||||
IMPORT{builtin}="path_id"
|
||||
|
||||
ENV{ID_PATH}=="?*", SYMLINK+="infiniband/by-path/$env{ID_PATH}"
|
||||
ATTR{ibdev}=="?*", SYMLINK+="infiniband/by-ibdev/uverbs-$attr{ibdev}"
|
||||
|
||||
LABEL="infiniband_end"
|
||||
@@ -0,0 +1,19 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="id_input_end"
|
||||
|
||||
SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id"
|
||||
SUBSYSTEM=="input", IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=id-input:modalias:"
|
||||
|
||||
# id-input:<bus>:v<vid>p<pid>:name:<name>:*
|
||||
KERNELS=="input*", ATTRS{id/bustype}=="0003", \
|
||||
IMPORT{builtin}="hwdb 'id-input:usb:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
|
||||
GOTO="id_input_end"
|
||||
KERNELS=="input*", ATTRS{id/bustype}=="0005", \
|
||||
IMPORT{builtin}="hwdb 'id-input:bluetooth:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
|
||||
GOTO="id_input_end"
|
||||
KERNELS=="input*", ATTRS{id/bustype}=="0018", \
|
||||
IMPORT{builtin}="hwdb 'id-input:i2c:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
|
||||
GOTO="id_input_end"
|
||||
|
||||
LABEL="id_input_end"
|
||||
@@ -0,0 +1,15 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="persistent_alsa_end"
|
||||
SUBSYSTEM!="sound", GOTO="persistent_alsa_end"
|
||||
KERNEL!="controlC[0-9]*", GOTO="persistent_alsa_end"
|
||||
|
||||
SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{builtin}="usb_id"
|
||||
ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="?*", SYMLINK+="snd/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_USB_INTERFACE_NUM}"
|
||||
ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="", SYMLINK+="snd/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
|
||||
|
||||
IMPORT{builtin}="path_id"
|
||||
ENV{ID_PATH}=="?*", SYMLINK+="snd/by-path/$env{ID_PATH}"
|
||||
ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="snd/by-path/$env{ID_PATH_WITH_USB_REVISION}"
|
||||
|
||||
LABEL="persistent_alsa_end"
|
||||
@@ -0,0 +1,26 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="persistent_hidraw_end"
|
||||
SUBSYSTEM!="hidraw", GOTO="persistent_hidraw_end"
|
||||
KERNEL!="hidraw*", GOTO="persistent_hidraw_end"
|
||||
|
||||
SUBSYSTEMS=="usb", ENV{ID_BUS}=="", IMPORT{builtin}="usb_id"
|
||||
SUBSYSTEMS=="usb", IMPORT{builtin}="path_id"
|
||||
|
||||
ENV{ID_BUS}=="", GOTO="persistent_hidraw_bus_end"
|
||||
|
||||
# by-id links
|
||||
ATTRS{bInterfaceNumber}=="|00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-hidraw"
|
||||
ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-hidraw"
|
||||
|
||||
# add a more readable 'fido' link for devices with ID_FIDO_TOKEN==1
|
||||
ENV{ID_FIDO_TOKEN}=="?*", ATTRS{bInterfaceNumber}=="|00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-fido"
|
||||
ENV{ID_FIDO_TOKEN}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-fido"
|
||||
|
||||
LABEL="persistent_hidraw_bus_end"
|
||||
|
||||
# by-path
|
||||
ENV{ID_PATH}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-hidraw"
|
||||
ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="input/by-path/$env{ID_PATH_WITH_USB_REVISION}-hidraw"
|
||||
|
||||
LABEL="persistent_hidraw_end"
|
||||
@@ -0,0 +1,55 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="persistent_input_end"
|
||||
SUBSYSTEM!="input", GOTO="persistent_input_end"
|
||||
SUBSYSTEMS=="bluetooth", ENV{ID_BUS}="bluetooth", GOTO="persistent_input_end"
|
||||
# Bluetooth devices don't always have the bluetooth subsystem
|
||||
ATTRS{id/bustype}=="0005", ENV{ID_BUS}="bluetooth", GOTO="persistent_input_end"
|
||||
SUBSYSTEMS=="acpi", ENV{ID_BUS}="acpi"
|
||||
# platform must be before serio as serio can be child
|
||||
SUBSYSTEMS=="platform", ENV{ID_BUS}="platform"
|
||||
SUBSYSTEMS=="i2c", ENV{ID_BUS}="i2c"
|
||||
SUBSYSTEMS=="rmi4", ENV{ID_BUS}="rmi"
|
||||
SUBSYSTEMS=="serio", ENV{ID_BUS}="i8042"
|
||||
SUBSYSTEMS=="spi", ENV{ID_BUS}="spi"
|
||||
|
||||
SUBSYSTEMS=="usb", ENV{ID_BUS}=="", IMPORT{builtin}="usb_id"
|
||||
|
||||
# subsystems before (usb, platform, i2c) can be under pci so only set them if we still have no ID_BUS.
|
||||
# we could set this the first but will break the ENV{ID_BUS}=="" condition for usb.
|
||||
SUBSYSTEMS=="pci", ENV{ID_BUS}=="", ENV{ID_BUS}="pci"
|
||||
|
||||
# determine class name for persistent symlinks
|
||||
ENV{ID_INPUT_KEYBOARD}=="?*", ENV{.INPUT_CLASS}="kbd"
|
||||
ENV{ID_INPUT_MOUSE}=="?*", ENV{.INPUT_CLASS}="mouse"
|
||||
ENV{ID_INPUT_TOUCHPAD}=="?*", ENV{.INPUT_CLASS}="mouse"
|
||||
ENV{ID_INPUT_TABLET}=="?*", ENV{.INPUT_CLASS}="mouse"
|
||||
ENV{ID_INPUT_JOYSTICK}=="?*", ENV{.INPUT_CLASS}="joystick"
|
||||
DRIVERS=="pcspkr", ENV{.INPUT_CLASS}="spkr"
|
||||
ATTRS{name}=="*dvb*|*DVB*|* IR *", ENV{.INPUT_CLASS}="ir"
|
||||
|
||||
# fill empty serial number
|
||||
ENV{.INPUT_CLASS}=="?*", ENV{ID_SERIAL}=="", ENV{ID_SERIAL}="noserial"
|
||||
|
||||
# by-id links
|
||||
KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="|00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{.INPUT_CLASS}"
|
||||
KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-$env{.INPUT_CLASS}"
|
||||
KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="|00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-$env{.INPUT_CLASS}"
|
||||
KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-event-$env{.INPUT_CLASS}"
|
||||
# allow empty class for USB devices, by appending the interface number
|
||||
SUBSYSTEMS=="usb", ENV{ID_BUS}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", ATTRS{bInterfaceNumber}=="?*", \
|
||||
SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-if$attr{bInterfaceNumber}"
|
||||
|
||||
# by-path
|
||||
SUBSYSTEMS=="pci|usb|platform|acpi", IMPORT{builtin}="path_id"
|
||||
ENV{.INPUT_CLASS}=="?*", KERNEL=="mouse*|js*", ENV{ID_PATH}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{.INPUT_CLASS}"
|
||||
ENV{.INPUT_CLASS}=="?*", KERNEL=="mouse*|js*", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="input/by-path/$env{ID_PATH_WITH_USB_REVISION}-$env{.INPUT_CLASS}"
|
||||
ENV{.INPUT_CLASS}=="?*", KERNEL=="event*", ENV{ID_PATH}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{.INPUT_CLASS}"
|
||||
ENV{.INPUT_CLASS}=="?*", KERNEL=="event*", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="input/by-path/$env{ID_PATH_WITH_USB_REVISION}-event-$env{.INPUT_CLASS}"
|
||||
# allow empty class for platform, usb and i2c devices; platform supports only a single interface that way
|
||||
SUBSYSTEMS=="usb|platform|i2c", KERNEL=="event*", ENV{.INPUT_CLASS}=="", ENV{ID_PATH}=="?*", \
|
||||
SYMLINK+="input/by-path/$env{ID_PATH}-event"
|
||||
SUBSYSTEMS=="usb|platform|i2c", KERNEL=="event*", ENV{.INPUT_CLASS}=="", ENV{ID_PATH_WITH_USB_REVISION}=="?*", \
|
||||
SYMLINK+="input/by-path/$env{ID_PATH_WITH_USB_REVISION}-event"
|
||||
|
||||
LABEL="persistent_input_end"
|
||||
@@ -0,0 +1,13 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
# Media controller rules
|
||||
|
||||
ACTION=="remove", GOTO="persistent_media_ctl_end"
|
||||
SUBSYSTEM!="media", GOTO="persistent_media_ctl_end"
|
||||
ENV{MAJOR}=="", GOTO="persistent_media_ctl_end"
|
||||
|
||||
IMPORT{builtin}="path_id"
|
||||
KERNEL=="media*", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="media/by-path/$env{ID_PATH_WITH_USB_REVISION}-media-controller"
|
||||
KERNEL=="media*", ENV{ID_PATH_WITH_USB_REVISION}=="", ENV{ID_PATH}=="?*", SYMLINK+="media/by-path/$env{ID_PATH}-media-controller"
|
||||
|
||||
LABEL="persistent_media_ctl_end"
|
||||
@@ -0,0 +1,12 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
# persistent storage links: /dev/mtd/by-name
|
||||
|
||||
ACTION=="remove", GOTO="persistent_storage_mtd_end"
|
||||
SUBSYSTEM!="mtd", GOTO="persistent_storage_mtd_end"
|
||||
KERNEL!="mtd[0-9]*", GOTO="persistent_storage_mtd_end"
|
||||
KERNEL=="mtd[0-9]*ro", GOTO="persistent_storage_mtd_end"
|
||||
|
||||
ATTR{name}=="?*", SYMLINK+="mtd/by-name/$attr{name}"
|
||||
|
||||
LABEL="persistent_storage_mtd_end"
|
||||
@@ -0,0 +1,45 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
# persistent storage links: /dev/tape/{by-id,by-path}
|
||||
|
||||
ACTION=="remove", GOTO="persistent_storage_tape_end"
|
||||
ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_tape_end"
|
||||
|
||||
# type 8 devices are "Medium Changers"
|
||||
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", GOTO="medium_changer_begin"
|
||||
GOTO="medium_changer_end"
|
||||
|
||||
LABEL="medium_changer_begin"
|
||||
|
||||
IMPORT{program}="scsi_id --sg-version=3 --export --allowlisted -d $devnode"
|
||||
ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL} tape/by-id/scsi-$env{ID_SERIAL}-changer"
|
||||
|
||||
# iSCSI devices from the same host have all the same ID_SERIAL,
|
||||
# but additionally a property named ID_SCSI_SERIAL.
|
||||
ENV{ID_SCSI_SERIAL}=="?*", SYMLINK+="tape/by-id/scsi-$env{ID_SCSI_SERIAL}"
|
||||
|
||||
IMPORT{builtin}="path_id"
|
||||
ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}-changer"
|
||||
ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH_WITH_USB_REVISION}-changer"
|
||||
|
||||
LABEL="medium_changer_end"
|
||||
|
||||
SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end"
|
||||
|
||||
KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
|
||||
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}!="?*", IMPORT{program}="scsi_id --allowlisted --export --device=$env{.BSG_DEV}", ENV{ID_BUS}="scsi"
|
||||
KERNEL=="st*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}", OPTIONS+="link_priority=10"
|
||||
KERNEL=="st*[0-9]", ENV{ID_SCSI_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SCSI_SERIAL}"
|
||||
KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst"
|
||||
KERNEL=="nst*[0-9]", ENV{ID_SCSI_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SCSI_SERIAL}-nst"
|
||||
|
||||
# by-path (parent device path)
|
||||
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=="st*[0-9]", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH_WITH_USB_REVISION}"
|
||||
KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}-nst"
|
||||
KERNEL=="nst*[0-9]", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH_WITH_USB_REVISION}-nst"
|
||||
|
||||
LABEL="persistent_storage_tape_end"
|
||||
@@ -0,0 +1,177 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
# persistent storage links: /dev/disk/{by-id,by-uuid,by-label,by-path}
|
||||
# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <[email protected]>
|
||||
|
||||
ACTION=="remove", GOTO="persistent_storage_end"
|
||||
ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end"
|
||||
|
||||
SUBSYSTEM!="block|ubi", GOTO="persistent_storage_end"
|
||||
KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|ubi*|scm*|pmem*|nbd*|zd*|rbd*|zram*|ublkb*", GOTO="persistent_storage_end"
|
||||
|
||||
# ignore partitions that span the entire disk
|
||||
TEST=="whole_disk", GOTO="persistent_storage_end"
|
||||
|
||||
# For partitions import parent disk ID_* information, except ID_FS_*.
|
||||
#
|
||||
# This is particularly important on media where a filesystem superblock and
|
||||
# partition table are found on the same level, e.g. common Linux distro ISO
|
||||
# installation media.
|
||||
#
|
||||
# In the case where a partition device points to the same filesystem that
|
||||
# was detected on the parent disk, the ID_FS_* information is already
|
||||
# present on the partition devices as well as the parent, so no need to
|
||||
# propagate it. In the case where the partition device points to a different
|
||||
# filesystem, merging the parent ID_FS_ properties would lead to
|
||||
# inconsistencies, so we avoid doing so.
|
||||
ENV{DEVTYPE}=="partition", \
|
||||
IMPORT{parent}="ID_[!F]*", IMPORT{parent}="ID_", \
|
||||
IMPORT{parent}="ID_F[!S]*", IMPORT{parent}="ID_F", \
|
||||
IMPORT{parent}="ID_FS[!_]*", IMPORT{parent}="ID_FS"
|
||||
|
||||
ENV{DEVTYPE}=="partition", ENV{.PART_SUFFIX}="-part%n"
|
||||
ENV{DEVTYPE}!="partition", ENV{.PART_SUFFIX}=""
|
||||
|
||||
# NVMe
|
||||
KERNEL!="nvme*[0-9]n*[0-9]|nvme*[0-9]n*[0-9]p*[0-9]", GOTO="nvme_end"
|
||||
|
||||
ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}"
|
||||
ATTRS{wwid}=="?*", ENV{ID_WWN}="$attr{wwid}"
|
||||
ATTRS{model}=="?*", ENV{ID_MODEL}="$attr{model}"
|
||||
ATTRS{firmware_rev}=="?*", ENV{ID_REVISION}="$attr{firmware_rev}"
|
||||
ATTRS{nsid}=="?*", ENV{ID_NSID}="$attr{nsid}"
|
||||
|
||||
ENV{ID_WWN}=="?*", SYMLINK+="disk/by-id/nvme-$env{ID_WWN}$env{.PART_SUFFIX}"
|
||||
|
||||
# obsolete symlink with non-escaped characters, kept for backward compatibility
|
||||
ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_MODEL}!="*/*", ENV{ID_SERIAL_SHORT}!="*/*", \
|
||||
ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", ENV{ID_NSID}=="1", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}$env{.PART_SUFFIX}"
|
||||
# obsolete symlink that might get overridden on adding a new nvme controller, kept for backward compatibility
|
||||
ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_NSID}=="1", OPTIONS="string_escape=replace", \
|
||||
ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}$env{.PART_SUFFIX}"
|
||||
ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_NSID}=="?*", OPTIONS="string_escape=replace", \
|
||||
ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}_$env{ID_NSID}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}$env{.PART_SUFFIX}"
|
||||
|
||||
LABEL="nvme_end"
|
||||
|
||||
# virtio-blk
|
||||
KERNEL=="vd*", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}$env{.PART_SUFFIX}"
|
||||
|
||||
# ATA
|
||||
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $devnode"
|
||||
KERNEL=="sd*[!0-9]|sr*", ENV{ID_BUS}=="ata", ENV{ID_ATA_PERIPHERAL_DEVICE_TYPE}=="20", PROGRAM="scsi_id -u -g $devnode", \
|
||||
SYMLINK+="disk/by-id/scsi-$result$env{.PART_SUFFIX}"
|
||||
|
||||
# ATAPI devices (SPC-3 or later)
|
||||
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", IMPORT{program}="ata_id --export $devnode"
|
||||
|
||||
# Run ata_id on non-removable USB Mass Storage (SATA/PATA disks in enclosures)
|
||||
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", ATTR{removable}=="0", SUBSYSTEMS=="usb", IMPORT{program}="ata_id --export $devnode"
|
||||
|
||||
# Also import properties from usb_id for USB devices
|
||||
KERNEL=="sd*[!0-9]|sr*", SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
|
||||
|
||||
# SCSI devices
|
||||
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --allowlisted -d $devnode", ENV{ID_BUS}="scsi"
|
||||
KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --allowlisted -d $devnode", ENV{ID_BUS}="cciss"
|
||||
|
||||
KERNEL=="sd*|sr*|cciss*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}$env{.PART_SUFFIX}"
|
||||
# Previously, ata_id in the above might not be able to retrieve attributes correctly,
|
||||
# and properties from usb_id were used as a fallback. See issue #24921 and PR #24923.
|
||||
# To keep backward compatibility, still we need to create symlinks based on USB serial.
|
||||
# See issue #25179.
|
||||
KERNEL=="sd*|sr*|cciss*", ENV{ID_USB_SERIAL}=="?*", SYMLINK+="disk/by-id/usb-$env{ID_USB_SERIAL}$env{.PART_SUFFIX}"
|
||||
|
||||
# PMEM devices
|
||||
KERNEL=="pmem*", ATTRS{uuid}=="?*", SYMLINK+="disk/by-id/pmem-$attr{uuid}$env{.PART_SUFFIX}"
|
||||
|
||||
# FireWire
|
||||
KERNEL=="sd*|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}$env{.PART_SUFFIX}"
|
||||
|
||||
# MMC
|
||||
KERNEL=="mmcblk[0-9]|mmcblk[0-9]p[0-9]*", SUBSYSTEMS=="mmc", GOTO="mmc_start"
|
||||
GOTO="mmc_end"
|
||||
LABEL="mmc_start"
|
||||
ATTRS{name}=="?*", ENV{ID_NAME}="$attr{name}"
|
||||
ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}"
|
||||
ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}$env{.PART_SUFFIX}"
|
||||
LABEL="mmc_end"
|
||||
|
||||
# Memstick
|
||||
KERNEL=="msblk[0-9]|mspblk[0-9]|msblk[0-9]p[0-9]|mspblk[0-9]p[0-9]", SUBSYSTEMS=="memstick", GOTO="memstick_start"
|
||||
GOTO="memstick_end"
|
||||
LABEL="memstick_start"
|
||||
ATTRS{name}=="?*", ENV{ID_NAME}="$attr{name}"
|
||||
ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}"
|
||||
ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}$env{.PART_SUFFIX}"
|
||||
LABEL="memstick_end"
|
||||
|
||||
# by-path
|
||||
ENV{DEVTYPE}=="disk", DEVPATH!="*/virtual/*", IMPORT{builtin}="path_id"
|
||||
ENV{DEVTYPE}=="disk", SUBSYSTEMS=="nvme-subsystem", IMPORT{builtin}="path_id"
|
||||
KERNEL=="mmcblk[0-9]boot[0-9]", ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-boot%n"
|
||||
KERNEL=="mmcblk[0-9]boot[0-9]", ENV{DEVTYPE}=="disk", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH_WITH_USB_REVISION}-boot%n"
|
||||
KERNEL!="mmcblk[0-9]boot[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}$env{.PART_SUFFIX}"
|
||||
KERNEL!="mmcblk[0-9]boot[0-9]", ENV{ID_PATH_ATA_COMPAT}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH_ATA_COMPAT}$env{.PART_SUFFIX}"
|
||||
KERNEL!="mmcblk[0-9]boot[0-9]", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH_WITH_USB_REVISION}$env{.PART_SUFFIX}"
|
||||
|
||||
# legacy virtio-pci by-path links (deprecated)
|
||||
KERNEL=="vd*", ENV{ID_PATH}=="pci-*", SYMLINK+="disk/by-path/virtio-$env{ID_PATH}$env{.PART_SUFFIX}"
|
||||
KERNEL=="vd*", ENV{ID_PATH_WITH_USB_REVISION}=="pci-*", SYMLINK+="disk/by-path/virtio-$env{ID_PATH_WITH_USB_REVISION}$env{.PART_SUFFIX}"
|
||||
|
||||
{% if HAVE_BLKID %}
|
||||
# allow admin to disable probing the filesystem for slow devices like floppy disk drives
|
||||
ENV{UDEV_DISABLE_PERSISTENT_STORAGE_BLKID_FLAG}=="1", GOTO="persistent_storage_blkid_probe_end"
|
||||
|
||||
# probe filesystem metadata of optical drives which have a media inserted
|
||||
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", \
|
||||
IMPORT{builtin}="blkid --hint=session_offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}"
|
||||
# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
|
||||
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \
|
||||
IMPORT{builtin}="blkid --noraid"
|
||||
|
||||
# probe filesystem metadata of disks
|
||||
KERNEL!="sr*|mmcblk[0-9]boot[0-9]", IMPORT{builtin}="blkid"
|
||||
|
||||
LABEL="persistent_storage_blkid_probe_end"
|
||||
{% endif %}
|
||||
|
||||
# by-label/by-uuid links (filesystem metadata)
|
||||
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
|
||||
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
|
||||
|
||||
# by-id (World Wide Name)
|
||||
ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}$env{.PART_SUFFIX}"
|
||||
|
||||
# by-partlabel/by-partuuid links (partition metadata)
|
||||
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/<path>/by-* links (path + partition/filesystem metadata)
|
||||
ENV{ID_PATH}=="", GOTO="persistent_storage_by-path_parts_end"
|
||||
ENV{DEVTYPE}!="partition", GOTO="persistent_storage_by-path_parts_end"
|
||||
|
||||
SYMLINK+="disk/by-path/$env{ID_PATH}-part/by-partnum/%n"
|
||||
ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part/by-partuuid/$env{ID_PART_ENTRY_UUID}"
|
||||
ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part/by-partlabel/$env{ID_PART_ENTRY_NAME}"
|
||||
|
||||
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part/by-uuid/$env{ID_FS_UUID_ENC}"
|
||||
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part/by-label/$env{ID_FS_LABEL_ENC}"
|
||||
|
||||
LABEL="persistent_storage_by-path_parts_end"
|
||||
|
||||
# by-diskseq link (if an app is told to open a path like this, they may parse
|
||||
# the diskseq number from the path, then issue BLKGETDISKSEQ to verify they really got
|
||||
# the right device, to access specific disks in a race-free fashion)
|
||||
ENV{DISKSEQ}=="?*", ENV{ID_IGNORE_DISKSEQ}!="1", SYMLINK+="disk/by-diskseq/$env{DISKSEQ}$env{.PART_SUFFIX}"
|
||||
|
||||
# Create symlinks that allow referencing loopback devices by their backing file's inode number
|
||||
ENV{ID_LOOP_BACKING_DEVICE}!="", ENV{ID_LOOP_BACKING_INODE}!="", SYMLINK+="disk/by-loop-inode/$env{ID_LOOP_BACKING_DEVICE}-$env{ID_LOOP_BACKING_INODE}$env{.PART_SUFFIX}"
|
||||
|
||||
# Similar, but uses the .lo_file_name field of the loopback device (note that
|
||||
# this is basically just a free-form string passed from userspace to the kernel
|
||||
# when the device is created, it is not necessarily a file system path like the
|
||||
# "loop/backing_file" sysfs attribute, which is always an absolute path)
|
||||
ENV{ID_LOOP_BACKING_FILENAME_ENC}!="", SYMLINK+="disk/by-loop-ref/$env{ID_LOOP_BACKING_FILENAME_ENC}$env{.PART_SUFFIX}"
|
||||
|
||||
LABEL="persistent_storage_end"
|
||||
@@ -0,0 +1,22 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="persistent_v4l_end"
|
||||
SUBSYSTEM!="video4linux", GOTO="persistent_v4l_end"
|
||||
ENV{MAJOR}=="", GOTO="persistent_v4l_end"
|
||||
|
||||
IMPORT{program}="v4l_id $devnode"
|
||||
|
||||
SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
|
||||
KERNEL=="video*", ENV{ID_SERIAL}=="?*", SYMLINK+="v4l/by-id/$env{ID_BUS}-$env{ID_SERIAL}-video-index$attr{index}"
|
||||
|
||||
# check for valid "index" number
|
||||
TEST!="index", GOTO="persistent_v4l_end"
|
||||
ATTR{index}!="?*", GOTO="persistent_v4l_end"
|
||||
|
||||
IMPORT{builtin}="path_id"
|
||||
KERNEL=="video*|vbi*", ENV{ID_PATH}=="?*", SYMLINK+="v4l/by-path/$env{ID_PATH}-video-index$attr{index}"
|
||||
KERNEL=="video*|vbi*", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="v4l/by-path/$env{ID_PATH_WITH_USB_REVISION}-video-index$attr{index}"
|
||||
KERNEL=="audio*", ENV{ID_PATH}=="?*", SYMLINK+="v4l/by-path/$env{ID_PATH}-audio-index$attr{index}"
|
||||
KERNEL=="audio*", ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="v4l/by-path/$env{ID_PATH_WITH_USB_REVISION}-audio-index$attr{index}"
|
||||
|
||||
LABEL="persistent_v4l_end"
|
||||
@@ -0,0 +1,34 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="sensor_end"
|
||||
|
||||
# device matching the sensor's label, name and the machine's DMI data for IIO devices
|
||||
SUBSYSTEM=="iio", KERNEL=="iio*", SUBSYSTEMS=="usb|i2c|platform", ATTR{label}!="", \
|
||||
IMPORT{builtin}="hwdb 'sensor:$attr{label}:modalias:$attr{modalias}:$attr{[dmi/id]modalias}'", \
|
||||
GOTO="sensor_end"
|
||||
|
||||
# Before Linux v6.0, cros-ec-accel used a non-standard 'location' sysfs file
|
||||
SUBSYSTEM=="iio", KERNEL=="iio*", SUBSYSTEMS=="platform", \
|
||||
ATTR{name}=="cros-ec-accel|cros-ec-accel-legacy", ATTR{location}=="base", \
|
||||
IMPORT{builtin}="hwdb 'sensor:accel-base:modalias:$attr{modalias}:$attr{[dmi/id]modalias}'", \
|
||||
GOTO="sensor_end"
|
||||
|
||||
SUBSYSTEM=="iio", KERNEL=="iio*", SUBSYSTEMS=="platform", \
|
||||
ATTR{name}=="cros-ec-accel|cros-ec-accel-legacy", ATTR{location}=="lid", \
|
||||
IMPORT{builtin}="hwdb 'sensor:accel-display:modalias:$attr{modalias}:$attr{[dmi/id]modalias}'", \
|
||||
GOTO="sensor_end"
|
||||
|
||||
# device matching the sensor's name and the machine's DMI data for IIO devices
|
||||
SUBSYSTEM=="iio", KERNEL=="iio*", SUBSYSTEMS=="usb|i2c|platform", \
|
||||
IMPORT{builtin}="hwdb 'sensor:modalias:$attr{modalias}:$attr{[dmi/id]modalias}'", \
|
||||
GOTO="sensor_end"
|
||||
|
||||
SUBSYSTEM=="input", ENV{ID_INPUT_ACCELEROMETER}=="1", SUBSYSTEMS=="acpi", \
|
||||
IMPORT{builtin}="hwdb 'sensor:modalias:acpi:$attr{hid}:$attr{[dmi/id]modalias}'", \
|
||||
GOTO="sensor_end"
|
||||
|
||||
SUBSYSTEM=="input", ENV{ID_INPUT_ACCELEROMETER}=="1", SUBSYSTEMS=="platform", \
|
||||
IMPORT{builtin}="hwdb 'sensor:modalias:platform:$id:$attr{[dmi/id]modalias}'", \
|
||||
GOTO="sensor_end"
|
||||
|
||||
LABEL="sensor_end"
|
||||
@@ -0,0 +1,28 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="serial_end"
|
||||
SUBSYSTEM!="tty", GOTO="serial_end"
|
||||
|
||||
SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
|
||||
SUBSYSTEMS=="pci", ENV{ID_BUS}=="", ENV{ID_BUS}="pci", \
|
||||
ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}", \
|
||||
IMPORT{builtin}="hwdb --subsystem=pci"
|
||||
|
||||
# /dev/serial/by-path/, /dev/serial/by-id/ for USB devices
|
||||
KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="serial_end"
|
||||
|
||||
SUBSYSTEMS=="usb-serial", ENV{.ID_PORT}="$attr{port_number}"
|
||||
|
||||
IMPORT{builtin}="path_id"
|
||||
ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="", SYMLINK+="serial/by-path/$env{ID_PATH}"
|
||||
ENV{ID_PATH_WITH_USB_REVISION}=="?*", ENV{.ID_PORT}=="", SYMLINK+="serial/by-path/$env{ID_PATH_WITH_USB_REVISION}"
|
||||
ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-path/$env{ID_PATH}-port$env{.ID_PORT}"
|
||||
ENV{ID_PATH_WITH_USB_REVISION}=="?*", ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-path/$env{ID_PATH_WITH_USB_REVISION}-port$env{.ID_PORT}"
|
||||
|
||||
ENV{ID_BUS}=="", GOTO="serial_end"
|
||||
ENV{ID_SERIAL}=="", GOTO="serial_end"
|
||||
ENV{ID_USB_INTERFACE_NUM}=="", GOTO="serial_end"
|
||||
ENV{.ID_PORT}=="", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_USB_INTERFACE_NUM}"
|
||||
ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_USB_INTERFACE_NUM}-port$env{.ID_PORT}"
|
||||
|
||||
LABEL="serial_end"
|
||||
@@ -0,0 +1,10 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="tpm2_id_end"
|
||||
SUBSYSTEM!="tpmrm", GOTO="tpm2_id_end"
|
||||
KERNEL!="tpmrm[0-9]*", GOTO="tpm2_id_end"
|
||||
|
||||
IMPORT{program}="tpm2_id identify"
|
||||
ENV{ID_TPM2_MODALIAS}!="", IMPORT{builtin}="hwdb 'tpm2:$env{ID_TPM2_MODALIAS}'"
|
||||
|
||||
LABEL="tpm2_id_end"
|
||||
@@ -0,0 +1,17 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
SUBSYSTEM!="block", GOTO="btrfs_end"
|
||||
ACTION=="remove", GOTO="btrfs_end"
|
||||
ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end"
|
||||
ENV{SYSTEMD_READY}=="0", GOTO="btrfs_end"
|
||||
|
||||
# let the kernel know about this btrfs filesystem, and check if it is complete
|
||||
IMPORT{builtin}="btrfs ready $devnode"
|
||||
|
||||
# mark the device as not ready to be used by the system
|
||||
ENV{ID_BTRFS_READY}=="0", ENV{SYSTEMD_READY}="0"
|
||||
|
||||
# reconsider pending devices in case when multidevice volume awaits
|
||||
ENV{ID_BTRFS_READY}=="1", RUN+="{{BINDIR}}/udevadm trigger -s block -p ID_BTRFS_READY=0"
|
||||
|
||||
LABEL="btrfs_end"
|
||||
@@ -0,0 +1,27 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
# ID_INTEGRATION variable tells us if a device is internal (inherent part of the system) or external otherwise.
|
||||
# This must be loaded after 60-persistent-*.rules to have ID_BUS.
|
||||
|
||||
ACTION=="remove", GOTO="integration_end"
|
||||
ENV{ID_BUS}=="", GOTO="integration_end"
|
||||
|
||||
# ACPI, platform, PS/2, I2C, RMI, SPI and PCI devices: Internal by default.
|
||||
ENV{ID_BUS}=="acpi|platform|i8042|i2c|rmi|spi|pci", ENV{ID_INTEGRATION}="internal", GOTO="libinput_integration_compat"
|
||||
|
||||
# Bluetooth devices: External by default.
|
||||
ENV{ID_BUS}=="bluetooth", ENV{ID_INTEGRATION}="external", GOTO="libinput_integration_compat"
|
||||
|
||||
# USB devices: Internal if it's connected to a fixed port, external to a removable and if it's unknown we use the main parent device attribute.
|
||||
ENV{ID_BUS}!="usb", GOTO="usb_integration_end"
|
||||
DRIVERS=="usb", ATTRS{maxchild}=="0", ATTRS{removable}=="fixed", ENV{ID_INTEGRATION}="internal", GOTO="libinput_integration_compat"
|
||||
DRIVERS=="usb", ATTRS{maxchild}=="0", ATTRS{removable}=="removable", ENV{ID_INTEGRATION}="external", GOTO="libinput_integration_compat"
|
||||
DRIVERS=="usb", ATTRS{devpath}!="0", ATTRS{removable}=="fixed", ENV{ID_INTEGRATION}="internal", GOTO="libinput_integration_compat"
|
||||
DRIVERS=="usb", ATTRS{devpath}!="0", ATTRS{removable}=="removable|unknown", ENV{ID_INTEGRATION}="external", GOTO="libinput_integration_compat"
|
||||
LABEL="usb_integration_end"
|
||||
|
||||
# libinput compatibility, must be loaded before 70-touchpad.rules to allow hwdb quirks to override.
|
||||
LABEL="libinput_integration_compat"
|
||||
ENV{ID_INPUT_TOUCHPAD}=="1", ENV{ID_INPUT_TOUCHPAD_INTEGRATION}="$env{ID_INTEGRATION}"
|
||||
|
||||
LABEL="integration_end"
|
||||
@@ -0,0 +1,9 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="camera_end"
|
||||
|
||||
SUBSYSTEM=="video4linux", ENV{ID_BUS}=="usb", \
|
||||
IMPORT{builtin}="hwdb 'camera:usb:v$env{ID_VENDOR_ID}p$env{ID_MODEL_ID}:name:$attr{name}:'", \
|
||||
GOTO="camera_end"
|
||||
|
||||
LABEL="camera_end"
|
||||
@@ -0,0 +1,11 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="joystick_end"
|
||||
ENV{ID_INPUT_JOYSTICK}=="", GOTO="joystick_end"
|
||||
KERNEL!="event*", GOTO="joystick_end"
|
||||
|
||||
# joystick:<bustype>:v<vid>p<pid>:name:<name>:*
|
||||
KERNELS=="input*", ENV{ID_BUS}!="", \
|
||||
IMPORT{builtin}="hwdb 'joystick:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'"
|
||||
|
||||
LABEL="joystick_end"
|
||||
@@ -0,0 +1,8 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="memory_end"
|
||||
SUBSYSTEM!="dmi", GOTO="memory_end"
|
||||
|
||||
IMPORT{program}="dmi_memory_id"
|
||||
|
||||
LABEL="memory_end"
|
||||
@@ -0,0 +1,18 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="mouse_end"
|
||||
KERNEL!="event*", GOTO="mouse_end"
|
||||
ENV{ID_INPUT_MOUSE}=="", GOTO="mouse_end"
|
||||
|
||||
# mouse:<subsystem>:v<vid>p<pid>:name:<name>:*
|
||||
KERNELS=="input*", ENV{ID_BUS}=="usb", \
|
||||
IMPORT{builtin}="hwdb 'mouse:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
|
||||
GOTO="mouse_end"
|
||||
KERNELS=="input*", ENV{ID_BUS}=="bluetooth", \
|
||||
IMPORT{builtin}="hwdb 'mouse:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
|
||||
GOTO="mouse_end"
|
||||
DRIVERS=="psmouse", SUBSYSTEMS=="serio", \
|
||||
IMPORT{builtin}="hwdb 'mouse:ps2::name:$attr{device/name}:'", \
|
||||
GOTO="mouse_end"
|
||||
|
||||
LABEL="mouse_end"
|
||||
@@ -0,0 +1,15 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#
|
||||
# This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
ACTION=="remove", GOTO="power_switch_end"
|
||||
|
||||
SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_INPUT_SWITCH}=="1", TAG+="power-switch"
|
||||
SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_INPUT_KEY}=="1", TAG+="power-switch"
|
||||
|
||||
LABEL="power_switch_end"
|
||||
@@ -0,0 +1,16 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="touchpad_end"
|
||||
ENV{ID_INPUT_TOUCHPAD}=="", GOTO="touchpad_end"
|
||||
KERNEL!="event*", GOTO="touchpad_end"
|
||||
|
||||
# touchpad:<subsystem>:v<vid>p<pid>:name:<name>:*
|
||||
KERNELS=="input*", ENV{ID_BUS}!="", \
|
||||
IMPORT{builtin}="hwdb 'touchpad:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'"
|
||||
|
||||
# Spread the hwdb override to ID_INTEGRATION, in the future we could remove the
|
||||
# touchpad hwdb entirely or retain it using the generic ID_INTEGRATION instead
|
||||
# specific ID_INPUT_TOUCHPAD_INTEGRATION.
|
||||
ENV{ID_INPUT_TOUCHPAD_INTEGRATION}!="", ENV{ID_INTEGRATION}="$env{ID_INPUT_TOUCHPAD_INTEGRATION}"
|
||||
|
||||
LABEL="touchpad_end"
|
||||
@@ -0,0 +1,136 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#
|
||||
# This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
ACTION=="remove", GOTO="uaccess_end"
|
||||
ENV{MAJOR}=="", GOTO="uaccess_end"
|
||||
|
||||
# PTP/MTP protocol devices, cameras, portable media players
|
||||
SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG+="uaccess"
|
||||
|
||||
# Digicams with proprietary protocol
|
||||
ENV{ID_GPHOTO2}=="?*", TAG+="uaccess"
|
||||
|
||||
# SCSI and USB scanners
|
||||
ENV{libsane_matched}=="yes", TAG+="uaccess"
|
||||
|
||||
# HPLIP devices (necessary for ink level check and HP tool maintenance)
|
||||
ENV{ID_HPLIP}=="1", TAG+="uaccess"
|
||||
|
||||
# optical drives
|
||||
SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG+="uaccess"
|
||||
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", TAG+="uaccess"
|
||||
|
||||
# Sound devices
|
||||
SUBSYSTEM=="sound", TAG+="uaccess", \
|
||||
OPTIONS+="static_node=snd/timer", OPTIONS+="static_node=snd/seq"
|
||||
|
||||
# Webcams, frame grabber, TV cards
|
||||
SUBSYSTEM=="video4linux", TAG+="uaccess"
|
||||
SUBSYSTEM=="dvb", TAG+="uaccess"
|
||||
SUBSYSTEM=="media", TAG+="uaccess"
|
||||
# libcamera software ISP used with some cams requires udmabuf access
|
||||
KERNEL=="udmabuf", TAG+="uaccess"
|
||||
|
||||
# industrial cameras, some webcams, camcorders, set-top boxes, TV sets, audio devices, and more
|
||||
SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_MIDI}=="1", TAG+="uaccess"
|
||||
SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_AUDIO}=="1", TAG+="uaccess"
|
||||
SUBSYSTEM=="firewire", TEST=="units", ENV{IEEE1394_UNIT_FUNCTION_VIDEO}=="1", TAG+="uaccess"
|
||||
|
||||
# DRI video devices
|
||||
SUBSYSTEM=="drm", KERNEL=="card*", TAG+="uaccess"
|
||||
{% if GROUP_RENDER_UACCESS %}
|
||||
# DRI render nodes
|
||||
SUBSYSTEM=="drm", KERNEL=="renderD*", TAG+="uaccess", TAG+="xaccess-render"
|
||||
# DRI accel nodes
|
||||
SUBSYSTEM=="accel", KERNEL=="accel*", TAG+="uaccess", TAG+="xaccess-accel"
|
||||
# AMD KFD nodes
|
||||
SUBSYSTEM=="kfd", KERNEL=="kfd", TAG+="uaccess", TAG+="xaccess-render"
|
||||
{% endif %}
|
||||
{% if DEV_KVM_UACCESS %}
|
||||
# KVM
|
||||
SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="uaccess"
|
||||
{% endif %}
|
||||
|
||||
# smart-card readers
|
||||
ENV{ID_SMARTCARD_READER}=="?*", TAG+="uaccess"
|
||||
|
||||
# (USB) authentication devices
|
||||
ENV{ID_SECURITY_TOKEN}=="?*", TAG+="uaccess"
|
||||
|
||||
# PDA devices
|
||||
ENV{ID_PDA}=="?*", TAG+="uaccess"
|
||||
|
||||
# Programmable remote control
|
||||
ENV{ID_REMOTE_CONTROL}=="1", TAG+="uaccess"
|
||||
|
||||
# joysticks
|
||||
SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="uaccess"
|
||||
|
||||
# color measurement devices
|
||||
ENV{COLOR_MEASUREMENT_DEVICE}=="?*", TAG+="uaccess"
|
||||
|
||||
# DDC/CI device, usually high-end monitors such as the DreamColor
|
||||
ENV{DDC_DEVICE}=="?*", TAG+="uaccess"
|
||||
|
||||
# media player raw devices (for user-mode drivers, Android SDK, etc.)
|
||||
SUBSYSTEM=="usb", ENV{ID_MEDIA_PLAYER}=="?*", TAG+="uaccess"
|
||||
|
||||
# Android devices (ADB DbC, ADB, Fastboot)
|
||||
# Used to interact with devices over Android Debug Bridge and Fastboot protocols, see:
|
||||
# * https://developer.android.com/tools/adb
|
||||
# * https://source.android.com/docs/setup/test/running
|
||||
# * https://source.android.com/docs/setup/test/flash
|
||||
#
|
||||
# The bInterfaceClass and bInterfaceSubClass used are documented in source code here:
|
||||
# * https://android.googlesource.com/platform/packages/modules/adb/+/d0db47dcdf941673f405e1095e6ffb5e565902e5/adb.h#199
|
||||
# * https://android.googlesource.com/platform/system/core/+/7199051aaf0ddfa2849650933119307327d8669c/fastboot/fastboot.cpp#244
|
||||
#
|
||||
# Since it's using a generic vendor specific interface class, this can potentially result
|
||||
# in a rare case where non-ADB/Fastboot device ends up with an ID_DEBUG_APPLIANCE="android".
|
||||
SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:dc0201:*|*:ff4201:*|*:ff4203:*", ENV{ID_DEBUG_APPLIANCE}="android"
|
||||
|
||||
# software-defined radio communication devices
|
||||
ENV{ID_SOFTWARE_RADIO}=="?*", TAG+="uaccess"
|
||||
|
||||
# 3D printers, CNC machines, laser cutters, 3D scanners, etc.
|
||||
ENV{ID_MAKER_TOOL}=="?*", TAG+="uaccess"
|
||||
|
||||
# Protocol analyzers
|
||||
ENV{ID_SIGNAL_ANALYZER}=="?*", ENV{DEVTYPE}=="usb_device", TAG+="uaccess"
|
||||
ENV{ID_SIGNAL_ANALYZER}=="?*", KERNEL=="ttyACM[0-9]*", TAG+="uaccess"
|
||||
|
||||
# rfkill / radio killswitches
|
||||
KERNEL=="rfkill", SUBSYSTEM=="misc", TAG+="uaccess"
|
||||
|
||||
# AV production controllers
|
||||
# Most of these devices use HID for the knobs, faders, buttons, encoders, and jog wheels.
|
||||
SUBSYSTEM=="hidraw", ENV{ID_AV_PRODUCTION_CONTROLLER}=="1", TAG+="uaccess"
|
||||
|
||||
# Some devices use vendor defined protocols on USB Bulk endpoints for controllers.
|
||||
# Other devices transfer graphics to screens on the device through USB Bulk endpoints.
|
||||
# This also allows accessing HID devices with the libusb backend of hidapi.
|
||||
SUBSYSTEM=="usb", ENV{ID_AV_PRODUCTION_CONTROLLER}=="1", TAG+="uaccess"
|
||||
|
||||
# USB and Bluetooth controllable lights
|
||||
SUBSYSTEM=="hidraw", ENV{ID_AV_LIGHTS}=="1", TAG+="uaccess"
|
||||
SUBSYSTEM=="usb", ENV{ID_AV_LIGHTS}=="1", TAG+="uaccess"
|
||||
|
||||
# Hardware wallets
|
||||
SUBSYSTEM=="usb", ENV{ID_HARDWARE_WALLET}=="1", TAG+="uaccess"
|
||||
SUBSYSTEM=="hidraw", ENV{ID_HARDWARE_WALLET}=="1", TAG+="uaccess"
|
||||
|
||||
# 3D mice
|
||||
# As defined in https://en.wikipedia.org/wiki/3Dconnexion
|
||||
SUBSYSTEM=="hidraw", ENV{ID_INPUT_3D_MOUSE}=="1", TAG+="uaccess"
|
||||
|
||||
# Debug interfaces (e.g. Android Debug Bridge)
|
||||
# Made available via xaccess additionally to support scenarios like headless testing machines.
|
||||
ENV{ID_DEBUG_APPLIANCE}=="?*", TAG+="uaccess", TAG+="xaccess-debug-appliance"
|
||||
|
||||
LABEL="uaccess_end"
|
||||
@@ -0,0 +1,82 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#
|
||||
# This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
ACTION=="remove", GOTO="seat_end"
|
||||
|
||||
TAG=="uaccess", SUBSYSTEM!="sound", TAG+="seat"
|
||||
SUBSYSTEM=="sound", KERNEL=="card*", TAG+="seat"
|
||||
SUBSYSTEM=="input", KERNEL=="input*", TAG+="seat"
|
||||
SUBSYSTEM=="hidraw", KERNEL=="hidraw*", TAG+="seat"
|
||||
SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", TAG+="seat"
|
||||
|
||||
# Assign keyboard and LCD backlights to the seat
|
||||
SUBSYSTEM=="leds", TAG+="seat"
|
||||
SUBSYSTEM=="backlight", TAG+="seat"
|
||||
|
||||
# Allow efifb / uvesafb to be a master if KMS is disabled
|
||||
SUBSYSTEM=="graphics", KERNEL=="fb[0-9]", IMPORT{cmdline}="nomodeset", TAG+="master-of-seat"
|
||||
|
||||
# Allow any PCI graphics device to be a master and synthesize a seat if KMS
|
||||
# is disabled and the kernel doesn't have a driver that would work with this device.
|
||||
SUBSYSTEM=="pci", ENV{ID_PCI_CLASS_FROM_DATABASE}=="Display controller", \
|
||||
ENV{DRIVER}=="", IMPORT{cmdline}="nomodeset", TAG+="seat", TAG+="master-of-seat"
|
||||
|
||||
# Synthesize a seat for graphic devices without DRM and that fall back to fb
|
||||
# device instead. Such HWs are listed in hwdb.
|
||||
SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", ATTRS{modalias}=="?*", IMPORT{builtin}="hwdb fb:$attr{modalias}"
|
||||
ENV{ID_TAG_MASTER_OF_SEAT}=="1", TAG+="master-of-seat"
|
||||
|
||||
SUBSYSTEM=="drm", KERNEL=="card[0-9]*", TAG+="seat", TAG+="master-of-seat"
|
||||
|
||||
# Allow individual USB ports to be assigned to a seat
|
||||
SUBSYSTEM=="usb", ATTR{bDeviceClass}=="00", TAG+="seat"
|
||||
|
||||
# Allow USB hubs (and all downstream ports) to be assigned to a seat
|
||||
SUBSYSTEM=="usb", ATTR{bDeviceClass}=="09", TAG+="seat"
|
||||
|
||||
# 'Plugable' USB hub, sound, network, graphics adapter
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="2230", ATTR{idProduct}=="000[13]", ENV{ID_AUTOSEAT}="1"
|
||||
|
||||
# qemu (version 2.4+) has a PCI-PCI bridge (-device pci-bridge-seat) to group
|
||||
# devices belonging to one seat. See:
|
||||
# http://git.qemu.org/?p=qemu.git;a=blob;f=docs/multiseat.txt
|
||||
SUBSYSTEM=="pci", ATTR{vendor}=="0x1b36", ATTR{device}=="0x000a", TAG+="seat", ENV{ID_AUTOSEAT}="1"
|
||||
|
||||
# Mimo 720, with integrated USB hub, displaylink graphics, and e2i
|
||||
# touchscreen. This device carries no proper VID/PID in the USB hub,
|
||||
# but it does carry good ID data in the graphics component, hence we
|
||||
# check it from the parent. There's a bit of a race here however,
|
||||
# given that the child devices might not exist yet at the time this
|
||||
# rule is executed. To work around this we'll trigger the parent from
|
||||
# the child if we notice that the parent wasn't recognized yet.
|
||||
|
||||
# Match parent
|
||||
{% raw -%}
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="058f", ATTR{idProduct}=="6254", \
|
||||
ATTR{%k.2/idVendor}=="17e9", ATTR{%k.2/idProduct}=="401a", ATTR{%k.2/product}=="mimo inc", \
|
||||
ENV{ID_AUTOSEAT}="1", ENV{ID_AVOID_LOOP}="1"
|
||||
{% endraw %}
|
||||
|
||||
# Match child, look for parent's ID_AVOID_LOOP
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="17e9", ATTR{idProduct}=="401a", ATTR{product}=="mimo inc", \
|
||||
ATTR{../idVendor}=="058f", ATTR{../idProduct}=="6254", \
|
||||
IMPORT{parent}="ID_AVOID_LOOP"
|
||||
|
||||
# Match child, retrigger parent
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="17e9", ATTR{idProduct}=="401a", ATTR{product}=="mimo inc", \
|
||||
ATTR{../idVendor}=="058f", ATTR{../idProduct}=="6254", \
|
||||
ENV{ID_AVOID_LOOP}=="", \
|
||||
RUN+="{{BINDIR}}/udevadm trigger --parent-match=%p/.."
|
||||
|
||||
TAG=="seat", ENV{ID_PATH}=="", IMPORT{builtin}="path_id"
|
||||
TAG=="seat", ENV{ID_FOR_SEAT}=="", ENV{ID_PATH_TAG}!="", ENV{ID_FOR_SEAT}="$env{SUBSYSTEM}-$env{ID_PATH_TAG}"
|
||||
|
||||
SUBSYSTEM=="input", ATTR{name}=="Wiebetech LLC Wiebetech", RUN+="{{BINDIR}}/loginctl lock-sessions"
|
||||
|
||||
LABEL="seat_end"
|
||||
@@ -0,0 +1,20 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#
|
||||
# This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
ACTION=="remove", GOTO="seat_late_end"
|
||||
|
||||
ENV{ID_SEAT}=="", ENV{ID_AUTOSEAT}=="1", ENV{ID_FOR_SEAT}!="", ENV{ID_SEAT}="seat-$env{ID_FOR_SEAT}"
|
||||
ENV{ID_SEAT}=="", IMPORT{parent}="ID_SEAT"
|
||||
|
||||
ENV{ID_SEAT}!="", TAG+="$env{ID_SEAT}"
|
||||
{% if HAVE_ACL %}
|
||||
TAG=="uaccess|xaccess-*", ENV{MAJOR}!="", RUN{builtin}+="uaccess"
|
||||
{% endif %}
|
||||
|
||||
LABEL="seat_late_end"
|
||||
@@ -0,0 +1,17 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="net_end"
|
||||
SUBSYSTEM!="net", GOTO="net_end"
|
||||
|
||||
IMPORT{builtin}="hwdb 'net:naming:dr$env{ID_NET_DRIVER}:'"
|
||||
|
||||
SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
|
||||
SUBSYSTEMS=="usb", GOTO="import_net_id"
|
||||
|
||||
SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}"
|
||||
SUBSYSTEMS=="pci", IMPORT{builtin}="hwdb --subsystem=pci"
|
||||
|
||||
LABEL="import_net_id"
|
||||
IMPORT{builtin}="net_id"
|
||||
|
||||
LABEL="net_end"
|
||||
@@ -0,0 +1,7 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION!="add", GOTO="mtd_probe_end"
|
||||
|
||||
KERNEL=="mtd*ro", IMPORT{program}="mtd_probe $devnode"
|
||||
|
||||
LABEL="mtd_probe_end"
|
||||
@@ -0,0 +1,96 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
SUBSYSTEM!="sound", GOTO="sound_end"
|
||||
|
||||
ACTION=="add|change", KERNEL=="controlC*", ATTR{../uevent}="change"
|
||||
ACTION!="change", GOTO="sound_end"
|
||||
|
||||
# Ok, we probably need a little explanation here for what the two lines above
|
||||
# are good for.
|
||||
#
|
||||
# The story goes like this: when ALSA registers a new sound card it emits a
|
||||
# series of 'add' events to userspace, for the main card device and for all the
|
||||
# child device nodes that belong to it. udev relays those to applications,
|
||||
# however only maintains the order between father and child, but not between
|
||||
# the siblings. The control device node creation can be used as synchronization
|
||||
# point. All other devices that belong to a card are created in the kernel
|
||||
# before it. However unfortunately due to the fact that siblings are forwarded
|
||||
# out of order by udev this fact is lost to applications.
|
||||
#
|
||||
# OTOH before an application can open a device it needs to make sure that all
|
||||
# its device nodes are completely created and set up.
|
||||
#
|
||||
# As a workaround for this issue we have added the udev rule above which will
|
||||
# generate a 'change' event on the main card device from the 'add' event of the
|
||||
# card's control device. Due to the ordering semantics of udev this event will
|
||||
# only be relayed after all child devices have finished processing properly.
|
||||
# When an application needs to listen for appearing devices it can hence look
|
||||
# for 'change' events only, and ignore the actual 'add' events.
|
||||
#
|
||||
# When the application is initialized at the same time as a device is plugged
|
||||
# in it may need to figure out if the 'change' event has already been triggered
|
||||
# or not for a card. To find that out we store the flag environment variable
|
||||
# SOUND_INITIALIZED on the device which simply tells us if the card 'change'
|
||||
# event has already been processed.
|
||||
|
||||
KERNEL!="card*", GOTO="sound_end"
|
||||
|
||||
ENV{SOUND_INITIALIZED}="1"
|
||||
|
||||
IMPORT{builtin}="hwdb"
|
||||
SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
|
||||
SUBSYSTEMS=="usb", GOTO="skip_pci"
|
||||
|
||||
SUBSYSTEMS=="firewire", ATTRS{guid}=="?*", \
|
||||
ENV{ID_BUS}="firewire", ENV{ID_SERIAL}="$attr{guid}", ENV{ID_SERIAL_SHORT}="$attr{guid}", \
|
||||
ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{model}", \
|
||||
ENV{ID_VENDOR}="$attr{vendor_name}", ENV{ID_MODEL}="$attr{model_name}"
|
||||
SUBSYSTEMS=="firewire", GOTO="skip_pci"
|
||||
|
||||
SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}"
|
||||
SUBSYSTEMS=="pci", GOTO="skip_pci"
|
||||
|
||||
# If we reach here, the device nor any of its parents are USB/PCI/firewire bus devices.
|
||||
# If we now find a parent that is a platform device, assume that we're working with
|
||||
# an internal sound card.
|
||||
SUBSYSTEMS=="platform", ENV{SOUND_FORM_FACTOR}="internal", GOTO="sound_end"
|
||||
|
||||
LABEL="skip_pci"
|
||||
|
||||
# Define ID_ID if ID_BUS and ID_SERIAL are set. This will work for both
|
||||
# USB and firewire.
|
||||
ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="?*", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_USB_INTERFACE_NUM}"
|
||||
ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}"
|
||||
|
||||
IMPORT{builtin}="path_id"
|
||||
|
||||
# The values used here for $SOUND_FORM_FACTOR and $SOUND_CLASS should be kept
|
||||
# in sync with those defined for PulseAudio's src/pulse/proplist.h
|
||||
# PA_PROP_DEVICE_FORM_FACTOR, PA_PROP_DEVICE_CLASS properties.
|
||||
|
||||
# If the first PCM device of this card has the pcm class 'modem', then the card is a modem
|
||||
ATTR{pcmC%nD0p/pcm_class}=="modem", ENV{SOUND_CLASS}="modem", GOTO="sound_end"
|
||||
|
||||
# Identify cards on the internal PCI bus as internal
|
||||
SUBSYSTEMS=="pci", DEVPATH=="*/0000:00:??.?/sound/*", ENV{SOUND_FORM_FACTOR}="internal", GOTO="sound_end"
|
||||
|
||||
# Devices that also support Image/Video interfaces are most likely webcams
|
||||
SUBSYSTEMS=="usb", ENV{ID_USB_INTERFACES}=="*:0e????:*", ENV{SOUND_FORM_FACTOR}="webcam", GOTO="sound_end"
|
||||
|
||||
# Matching on the model strings is a bit ugly, I admit
|
||||
ENV{ID_MODEL}=="*[Ss]peaker*", ENV{SOUND_FORM_FACTOR}="speaker", GOTO="sound_end"
|
||||
ENV{ID_MODEL_FROM_DATABASE}=="*[Ss]peaker*", ENV{SOUND_FORM_FACTOR}="speaker", GOTO="sound_end"
|
||||
|
||||
ENV{ID_MODEL}=="*[Hh]eadphone*", ENV{SOUND_FORM_FACTOR}="headphone", GOTO="sound_end"
|
||||
ENV{ID_MODEL_FROM_DATABASE}=="*[Hh]eadphone*", ENV{SOUND_FORM_FACTOR}="headphone", GOTO="sound_end"
|
||||
|
||||
ENV{ID_MODEL}=="*[Hh]eadset*", ENV{SOUND_FORM_FACTOR}="headset", GOTO="sound_end"
|
||||
ENV{ID_MODEL_FROM_DATABASE}=="*[Hh]eadset*", ENV{SOUND_FORM_FACTOR}="headset", GOTO="sound_end"
|
||||
|
||||
ENV{ID_MODEL}=="*[Hh]andset*", ENV{SOUND_FORM_FACTOR}="handset", GOTO="sound_end"
|
||||
ENV{ID_MODEL_FROM_DATABASE}=="*[Hh]andset*", ENV{SOUND_FORM_FACTOR}="handset", GOTO="sound_end"
|
||||
|
||||
ENV{ID_MODEL}=="*[Mm]icrophone*", ENV{SOUND_FORM_FACTOR}="microphone", GOTO="sound_end"
|
||||
ENV{ID_MODEL_FROM_DATABASE}=="*[Mm]icrophone*", ENV{SOUND_FORM_FACTOR}="microphone", GOTO="sound_end"
|
||||
|
||||
LABEL="sound_end"
|
||||
@@ -0,0 +1,13 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION!="add", GOTO="drivers_end"
|
||||
|
||||
ENV{MODALIAS}=="?*", RUN{builtin}+="kmod load"
|
||||
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN{builtin}+="kmod load tifm_sd"
|
||||
SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN{builtin}+="kmod load tifm_ms"
|
||||
SUBSYSTEM=="memstick", RUN{builtin}+="kmod load ms_block mspro_block"
|
||||
SUBSYSTEM=="i2o", RUN{builtin}+="kmod load i2o_block"
|
||||
SUBSYSTEM=="module", KERNEL=="parport_pc", RUN{builtin}+="kmod load ppdev"
|
||||
KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN{builtin}+="kmod load sm_ftl"
|
||||
|
||||
LABEL="drivers_end"
|
||||
@@ -0,0 +1,13 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
SUBSYSTEM!="net", GOTO="net_setup_link_end"
|
||||
|
||||
IMPORT{builtin}="path_id"
|
||||
|
||||
ACTION=="remove", GOTO="net_setup_link_end"
|
||||
|
||||
IMPORT{builtin}="net_setup_link"
|
||||
|
||||
NAME=="", ENV{ID_NET_NAME}!="", NAME="$env{ID_NET_NAME}"
|
||||
|
||||
LABEL="net_setup_link_end"
|
||||
@@ -0,0 +1,16 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="net_bridge_end"
|
||||
SUBSYSTEM!="net", GOTO="net_bridge_end"
|
||||
|
||||
# Some devices require the port to be up before joining the bridge.
|
||||
# In such cases, set ID_NET_BRING_UP_BEFORE_JOINING_BRIDGE to "1".
|
||||
|
||||
# Texas Instruments Ethernet device with switchdev mode:
|
||||
# https://docs.kernel.org/networking/device_drivers/ethernet/ti/am65_nuss_cpsw_switchdev.html#enabling-switch
|
||||
ENV{ID_NET_DRIVER}=="am65-cpsw-nuss", SUBSYSTEMS=="platform", DRIVERS=="am65-cpsw-nuss", \
|
||||
PROGRAM="/usr/sbin/devlink dev param show platform/%b name switch_mode", \
|
||||
RESULT=="*cmode runtime value true*", \
|
||||
ENV{ID_NET_BRING_UP_BEFORE_JOINING_BRIDGE}="1"
|
||||
|
||||
LABEL="net_bridge_end"
|
||||
@@ -0,0 +1,14 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="net_dhcp_end"
|
||||
SUBSYSTEM!="net", GOTO="net_dhcp_end"
|
||||
|
||||
# Network interfaces requiring DHCPOFFER messages to be broadcast
|
||||
# must set ID_NET_DHCP_BROADCAST to "1". This property will be
|
||||
# checked by the networkd DHCP4 client to set the DHCP option
|
||||
|
||||
# s390 ccwgroup interfaces in layer3 mode need broadcast DHCPOFFER
|
||||
# using the link driver to detect this condition
|
||||
ENV{ID_NET_DRIVER}=="qeth_l3", ENV{ID_NET_DHCP_BROADCAST}="1"
|
||||
|
||||
LABEL="net_dhcp_end"
|
||||
@@ -0,0 +1,15 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION=="remove", GOTO="net_link_local_end"
|
||||
SUBSYSTEM!="net", GOTO="net_link_local_end"
|
||||
|
||||
# Network interfaces for which only Link-Local communication (i.e. IPv4LL, …)
|
||||
# makes sense, because they almost certainly will point to another host, not an
|
||||
# internet router.
|
||||
|
||||
# (Note: matches against VID/PID go into 82-net-auto-link-local.hwdb instead)
|
||||
|
||||
# Thunderbolt host-to-host connections
|
||||
DRIVERS=="thunderbolt-net", ENV{ID_NET_AUTO_LINK_LOCAL_ONLY}="1"
|
||||
|
||||
LABEL="net_link_local_end"
|
||||
@@ -0,0 +1,56 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#
|
||||
# This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
ACTION=="remove", GOTO="image_dissect_end"
|
||||
SUBSYSTEM!="block", GOTO="image_dissect_end"
|
||||
|
||||
# Add symlink to GPT root disk – in two flavours: one which takes the factory
|
||||
# reset state into account, and one which does not. The former is useful for
|
||||
# wipe-rootfs-on-factory-reset scenarios where we should not be tempted to use
|
||||
# the root fs before factory reset is complete. The latter is useful for
|
||||
# wipe-only-/var-on-factory-reset where we should use it (because that's where
|
||||
# repart.d/ definitions are placed which tell us what to wipe).
|
||||
ENV{ID_PART_GPT_AUTO_ROOT}!="1", GOTO="gpt_auto_root_end"
|
||||
IMPORT{builtin}="factory_reset status"
|
||||
ENV{ID_FS_TYPE}!="crypto_LUKS", ENV{ID_FACTORY_RESET}!="on", SYMLINK+="gpt-auto-root"
|
||||
ENV{ID_FS_TYPE}!="crypto_LUKS", ENV{ID_FACTORY_RESET}=="on|complete", SYMLINK+="gpt-auto-root-ignore-factory-reset"
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", ENV{ID_FACTORY_RESET}!="on", SYMLINK+="gpt-auto-root-luks"
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", ENV{ID_FACTORY_RESET}=="on|complete", SYMLINK+="gpt-auto-root-luks-ignore-factory-reset"
|
||||
LABEL="gpt_auto_root_end"
|
||||
|
||||
# Note we don't need to condition the gpt-auto-root LUKS symlink for
|
||||
# auto-discovered LUKS devices, because it's sufficient if we do this for the
|
||||
# underlying partition block device, which is covered by the above.
|
||||
ENV{DM_UUID}=="CRYPT-*", ENV{DM_NAME}=="root", IMPORT{builtin}="factory_reset status", SYMLINK+="gpt-auto-root"
|
||||
ENV{DM_UUID}=="CRYPT-*", ENV{DM_NAME}=="root", ENV{ID_FACTORY_RESET}=="on|complete", SYMLINK+="gpt-auto-root-ignore-factory-reset"
|
||||
|
||||
# If this is the whole disk that we booted from, then dissect it
|
||||
ENV{DEVTYPE}=="disk", ENV{ID_PART_GPT_AUTO_ROOT_DISK}=="1", IMPORT{builtin}="dissect_image probe"
|
||||
ENV{DEVTYPE}=="disk", ENV{ID_PART_GPT_AUTO_ROOT_DISK}=="1", ENV{ID_FACTORY_RESET}=="", IMPORT{builtin}="factory_reset status"
|
||||
|
||||
# If this is a partition, and we found something on the parent, then copy the
|
||||
# right properties from the parent, and rename them
|
||||
ENV{DEVTYPE}=="partition", ENV{ID_DISSECT_IMAGE}!="", IMPORT{builtin}="dissect_image copy"
|
||||
|
||||
# Create symlinks based on the designator for the partitions themselves. If we detect LUKS or Verity, suffix them with "-luks" or "-vdata"
|
||||
ENV{DEVTYPE}!="partition", GOTO="dissect_partition_symlinks_end"
|
||||
ENV{ID_DISSECT_PART_DESIGNATOR}=="", GOTO="dissect_partition_symlinks_end"
|
||||
ENV{ID_FS_TYPE}!="crypto_LUKS", ENV{ID_DISSECT_PART_HAS_VERITY}!="1", ENV{ID_FACTORY_RESET}!="on", SYMLINK+="disk/by-designator/$env{ID_DISSECT_PART_DESIGNATOR}"
|
||||
ENV{ID_FS_TYPE}!="crypto_LUKS", ENV{ID_DISSECT_PART_HAS_VERITY}!="1", ENV{ID_FACTORY_RESET}=="on|complete", SYMLINK+="disk/by-designator/$env{ID_DISSECT_PART_DESIGNATOR}-ignore-factory-reset"
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", ENV{ID_FACTORY_RESET}!="on", SYMLINK+="disk/by-designator/$env{ID_DISSECT_PART_DESIGNATOR}-luks"
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", ENV{ID_FACTORY_RESET}=="on|complete", SYMLINK+="disk/by-designator/$env{ID_DISSECT_PART_DESIGNATOR}-luks-ignore-factory-reset"
|
||||
ENV{ID_FS_TYPE}!="crypto_LUKS", ENV{ID_DISSECT_PART_HAS_VERITY}=="1", ENV{ID_FACTORY_RESET}!="on", SYMLINK+="disk/by-designator/$env{ID_DISSECT_PART_DESIGNATOR}-verity-data"
|
||||
ENV{ID_FS_TYPE}!="crypto_LUKS", ENV{ID_DISSECT_PART_HAS_VERITY}=="1", ENV{ID_FACTORY_RESET}=="on|complete", SYMLINK+="disk/by-designator/$env{ID_DISSECT_PART_DESIGNATOR}-verity-data-ignore-factory-reset"
|
||||
LABEL="dissect_partition_symlinks_end"
|
||||
|
||||
# For LUKS or Verity partitions we rely on the selected volume name
|
||||
ENV{DM_UUID}=="CRYPT-*", ENV{DM_NAME}=="root|usr|home|srv|swap|tmp|var", IMPORT{builtin}="factory_reset status", SYMLINK+="disk/by-designator/$env{DM_NAME}"
|
||||
ENV{DM_UUID}=="CRYPT-*", ENV{DM_NAME}=="root|usr|home|srv|swap|tmp|var", ENV{ID_FACTORY_RESET}=="on|complete", SYMLINK+="disk/by-designator/$env{DM_NAME}-ignore-factory-reset"
|
||||
|
||||
LABEL="image_dissect_end"
|
||||
@@ -0,0 +1,22 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#
|
||||
# This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
SUBSYSTEM!="block", GOTO="iocost_end"
|
||||
ENV{DEVTYPE}!="disk", GOTO="iocost_end"
|
||||
ACTION=="remove", GOTO="iocost_end"
|
||||
|
||||
ENV{.MODEL}=""
|
||||
ENV{ID_MODEL}!="", ENV{.MODEL}="$env{ID_MODEL}"
|
||||
ENV{ID_MODEL_FROM_DATABASE}!="", ENV{.MODEL}="$env{ID_MODEL_FROM_DATABASE}"
|
||||
|
||||
ENV{.MODEL}!="", IMPORT{builtin}="hwdb 'block::name:$env{.MODEL}:fwrev:$env{ID_REVISION}:'"
|
||||
|
||||
ENV{IOCOST_SOLUTIONS}!="", RUN+="iocost apply $env{DEVNAME}"
|
||||
|
||||
LABEL="iocost_end"
|
||||
@@ -0,0 +1,12 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#
|
||||
# This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# Each vtcon keeps its own state of fonts.
|
||||
#
|
||||
ACTION=="add", SUBSYSTEM=="vtconsole", KERNEL=="vtcon*", RUN+="{{SYSTEMCTL_BINARY_PATH}} --no-block restart systemd-vconsole-setup.service"
|
||||
@@ -0,0 +1,502 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
Reference in New Issue
Block a user