diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/install_devmaster.sh" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/install_devmaster.sh" index d9bed1ab67144d8b29f3c025c66888ce99c0c6e5..49ce206810412b2296ac8d90b6c3c58ba43f4728 100644 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/install_devmaster.sh" +++ "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/install_devmaster.sh" @@ -9,12 +9,13 @@ tools=(ata_id) run_with_devmaster=${0%/*} service_dir=${run_with_devmaster}/service -lib_rules_dir=${run_with_devmaster}/rules.d etc_dir=exts/devmaster/config etc_rules_dir=${etc_dir}/rules.d etc_netconf_dir=${etc_dir}/network.d +dracut_modules=exts/devmaster/dracut_modules/95devmaster + etc_conf_install_dir=/etc/devmaster etc_netconf_install_dir=${etc_conf_install_dir}/network.d etc_rules_install_dir=${etc_conf_install_dir}/rules.d @@ -39,9 +40,6 @@ install -Dm0640 -t ${etc_conf_install_dir} ${etc_dir}/config.toml || exit 1 install -Dm0640 -t ${etc_netconf_install_dir} ${etc_netconf_dir}/*.link || exit 1 install -Dm0640 -t ${etc_rules_install_dir} ${etc_rules_dir}/*.rules || exit 1 -# Install rules under /lib/devmaster. -install -Dm0640 -t ${lib_rules_install_dir} ${lib_rules_dir}/*.rules || exit 1 - # Install services. install -Dm0640 -t ${service_install_dir} ${service_dir}/*.service || exit 1 @@ -52,4 +50,7 @@ ln -sf ${service_install_dir}/devctl-trigger.service ${multi_user_target_dir}/de test -f ${sysinit_target_dir}/udevd.service && unlink ${sysinit_target_dir}/udevd.service test -f ${multi_user_target_dir}/udev-trigger.service && unlink ${multi_user_target_dir}/udev-trigger.service +# Install dracut module of devmaster +install -Dm0755 -t /lib/dracut/modules.d/95devmaster ${dracut_modules}/* || exit 1 + sync diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/readme.md" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/readme.md" index 319a4121def9d25ebbca3d2a96ef5ea462447a2a..6e171e40947a364030e81882d401e1b6a11493e2 100644 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/readme.md" +++ "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/readme.md" @@ -17,8 +17,6 @@ Linux localhost.localdomain 5.10.0-60.18.0.50.oe2203.x86_64 #1 SMP Wed Mar 30 03:12:24 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux ``` -- `devmaster`的规则直接取自虚拟机环境中的`udev`规则,在此基础上对`sysmaster`环境中不支持的规则进行了适配。引用的规则以及适配情况见`规则清单`和`适配差异`。 - ## 安装方法 1. 参考[`sysmaster`虚拟机启动方案]()搭建启动环境。 @@ -31,166 +29,10 @@ Linux localhost.localdomain 5.10.0-60.18.0.50.oe2203.x86_64 #1 SMP Wed Mar 30 03 3. 重启系统,选择`sysmaster`启动项。进入主系统后检查`devmaster`服务状态和网络连通情况。 -## 规则清单 - -|编号 | 规则 | 包 | 是否需要适配 | -| ---------------- | --- |-|-| -|1 | 01-md-raid-creating.rules | mdadm-4.1-5.oe2203.x86_64 | | -|2 | 10-dm.rules | device-mapper-1.02.181-4.oe2203.x86_64 | | -|3 | 11-dm-lvm.rules | lvm2-2.03.14-4.oe2203.x86_64 | | -|4 | 11-dm-mpath.rules | multipath-tools-0.8.7-2.oe2203.x86_64 | | -|5 | 11-dm-parts.rules | kpartx-0.8.7-2.oe2203.x86_64 | | -|6 | 13-dm-disk.rules | device-mapper-1.02.181-4.oe2203.x86_64 | | -|7 | 40-elevator.rules | systemd-udev-249-16.oe2203.x86_64 | | -|8 | 40-openEuler.rules | systemd-udev-249-16.oe2203.x86_64 | 是 | -|9 | 50-udev-default.rules | systemd-udev-249-16.oe2203.x86_64 | | -|10 | 60-autosuspend.rules | systemd-udev-249-16.oe2203.x86_64 | | -|11 | 60-block.rules | systemd-udev-249-16.oe2203.x86_64 | | -|12 | 60-cdrom_id.rules | systemd-udev-249-16.oe2203.x86_64 | | -|13 | 60-drm.rules | systemd-udev-249-16.oe2203.x86_64 | | -|14 | 60-evdev.rules | systemd-udev-249-16.oe2203.x86_64 | | -|15 | 60-fido-id.rules | systemd-udev-249-16.oe2203.x86_64 | | -|16 | 60-infiniband.rules | none package | | -|17 | 60-input-id.rules | systemd-udev-249-16.oe2203.x86_64 | | -|18 | 60-net.rules | initscripts-10.12-1.oe2203.x86_64 | | -|19 | 60-persistent-alsa.rules | systemd-udev-249-16.oe2203.x86_64 | | -|20 | 60-persistent-input.rules | systemd-udev-249-16.oe2203.x86_64 | | -|21 | 60-persistent-storage.rules | systemd-udev-249-16.oe2203.x86_64 | | -|22 | 60-persistent-storage-tape.rules | systemd-udev-249-16.oe2203.x86_64 | | -|23 | 60-persistent-v4l.rules | systemd-udev-249-16.oe2203.x86_64 | | -|24 | 60-raw.rules | util-linux-2.37.2-5.oe2203.x86_64 | | -|25 | 60-rdma-ndd.rules | rdma-core-35.1-2.oe2203.x86_64 | | -|26 | 60-rdma-persistent-naming.rules | rdma-core-35.1-2.oe2203.x86_64 | | -|27 | 60-sensor.rules | systemd-udev-249-16.oe2203.x86_64 | | -|28 | 60-serial.rules | systemd-udev-249-16.oe2203.x86_64 | | -|29 | 60-srp_daemon.rules | rdma-core-35.1-2.oe2203.x86_64 | 是 | -|30 | 62-multipath.rules | multipath-tools-0.8.7-2.oe2203.x86_64 | 是 | -|31 | 63-md-raid-arrays.rules | mdadm-4.1-5.oe2203.x86_64 | | -|32 | 64-btrfs-dm.rules | btrfs-progs-5.15-1.oe2203.x86_64 | | -|33 | 64-btrfs.rules | systemd-udev-249-16.oe2203.x86_64 | | -|34 | 64-md-raid-assembly.rules | mdadm-4.1-5.oe2203.x86_64 | | -|35 | 66-kpartx.rules | kpartx-0.8.7-2.oe2203.x86_64 | | -|36 | 68-del-part-nodes.rules | kpartx-0.8.7-2.oe2203.x86_64 | | -|37 | 69-dm-lvm.rules | lvm2-2.03.14-4.oe2203.x86_64 | 是 | -|38 | 69-md-clustered-confirm-device.rules | mdadm-4.1-5.oe2203.x86_64 | | -|39 | 70-camera.rules | none package | | -|40 | 70-joystick.rules | systemd-udev-249-16.oe2203.x86_64 | | -|41 | 70-memory.rules | systemd-249-16.oe2203.x86_64 | | -|42 | 70-mouse.rules | systemd-udev-249-16.oe2203.x86_64 | | -|43 | 70-power-switch.rules | systemd-udev-249-16.oe2203.x86_64 | | -|44 | 70-touchpad.rules | systemd-udev-249-16.oe2203.x86_64 | | -|45 | 70-uaccess.rules | systemd-udev-249-16.oe2203.x86_64 | | -|46 | 71-seat.rules | systemd-udev-249-16.oe2203.x86_64 | | -|47 | 73-idrac.rules | systemd-udev-249-16.oe2203.x86_64 | | -|48 | 73-seat-late.rules | systemd-udev-249-16.oe2203.x86_64 | | -|49 | 75-net-description.rules | systemd-udev-249-16.oe2203.x86_64 | | -|50 | 75-probe_mtd.rules | systemd-udev-249-16.oe2203.x86_64 | | -|51 | 75-rdma-description.rules | rdma-core-35.1-2.oe2203.x86_64 | | -|52 | 78-sound-card.rules | systemd-udev-249-16.oe2203.x86_64 | | -|53 | 80-drivers.rules | systemd-udev-249-16.oe2203.x86_64 | | -|54 | 80-net-setup-link.rules | systemd-udev-249-16.oe2203.x86_64 | | -|55 | 80-tpm-udev.rules | tpm2-tss-3.1.0-1.oe2203.x86_64 | | -|56 | 80-udisks2.rules | udisks2-2.9.4-2.oe2203.x86_64 | | -|57 | 81-net-dhcp.rules | systemd-249-16.oe2203.x86_64 | | -|58 | 84-nm-drivers.rules | NetworkManager-1.32.12-8.oe2203.x86_64 | | -|59 | 85-nm-unmanaged.rules | NetworkManager-1.32.12-8.oe2203.x86_64 | | -|60 | 90-iprutils.rules | iprutils-2.4.19-1.oe2203.x86_64 | | -|61 | 90-iwpmd.rules | rdma-core-35.1-2.oe2203.x86_64 | | -|62 | 90-nm-thunderbolt.rules | NetworkManager-1.32.12-8.oe2203.x86_64 | | -|63 | 90-rdma-hw-modules.rules | rdma-core-35.1-2.oe2203.x86_64 | | -|64 | 90-rdma-ulp-modules.rules | rdma-core-35.1-2.oe2203.x86_64 | | -|65 | 90-rdma-umad.rules | rdma-core-35.1-2.oe2203.x86_64 | | -|66 | 90-vconsole.rules | systemd-udev-249-16.oe2203.x86_64 | 是 | -|67 | 91-drm-modeset.rules | libdrm-2.4.109-2.oe2203.x86_64 | | -|68 | 95-dm-notify.rules | device-mapper-1.02.181-4.oe2203.x86_64 | | -|69 | 96-e2scrub.rules | e2fsprogs-1.46.4-7.oe2203.x86_64 | | -|70 | 98-kexec.rules | kexec-tools-2.0.23-4.oe2203.x86_64 | 是 | -|71 | 99-systemd.rules | systemd-udev-249-16.oe2203.x86_64 | 是 | - -**`systemd`相关命令无法在`sysmaster`启动环境中使用,使用到这些命令的规则需要进行适配。部分适配动作会对功能造成影响,比如注释某条规则。某些适配动作不影响功能,但会产生行为差异,比如规则中调用`systemd-run `命令会生成一个`systemd`的服务并执行`cmd`命令,适配后会去除`systemd-run`前缀,直接由`devmaster`创建子进程来执行`cmd`。另外清理了规则中的一些语法告警,比如`IMPORT{}`类规则使用了赋值操作符等,此类修改不影响规则执行结果。** - -## 规则适配差异 - -### 40-openEuler.rules - -```shell -# diff tools/run_with_devmaster/rules.d/40-openEuler.rules /lib/udev/rules.d/40-openEuler.rules -17c17 -< # ACTION=="add", SUBSYSTEM=="module", KERNEL=="bridge", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/bridge" ---- -> ACTION=="add", SUBSYSTEM=="module", KERNEL=="bridge", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/bridge" -``` - -### 60-srp_daemon.rules - -```shell -# diff 60-srp_daemon.rules /lib/udev/rules.d/60-srp_daemon.rules -1c1 -< #SUBSYSTEM=="infiniband_mad", KERNEL=="*umad*", PROGRAM=="/bin/systemctl show srp_daemon -p ActiveState", RESULT=="ActiveState=active", ENV{SYSTEMD_WANTS}+="srp_daemon_port@$attr{ibdev}:$attr{port}.service" ---- -> SUBSYSTEM=="infiniband_mad", KERNEL=="*umad*", PROGRAM=="/bin/systemctl show srp_daemon -p ActiveState", RESULT=="ActiveState=active", ENV{SYSTEMD_WANTS}+="srp_daemon_port@$attr{ibdev}:$attr{port}.service" -``` - -### 62-multipath.rules +## 替换initrd中的udev -```shell -# diff 62-multipath.rules /lib/udev/rules.d/62-multipath.rules -74,75c74 -< # RUN+="/usr/bin/systemd-run --unit=cancel-multipath-wait-$kernel --description 'cancel waiting for multipath siblings of $kernel' --no-block --timer-property DefaultDependencies=no --timer-property Conflicts=shutdown.target --timer-property Before=shutdown.target --timer-property AccuracySec=500ms --property DefaultDependencies=no --property Conflicts=shutdown.target --property Before=shutdown.target --property Wants=multipathd.service --property After=multipathd.service --on-active=$env{FIND_MULTIPATHS_WAIT_UNTIL} /usr/bin/udevadm trigger --action=add $sys$devpath" -< RUN+="/usr/bin/devctl trigger --action=add $sys$devpath" ---- -> RUN+="/usr/bin/systemd-run --unit=cancel-multipath-wait-$kernel --description 'cancel waiting for multipath siblings of $kernel' --no-block --timer-property DefaultDependencies=no --timer-property Conflicts=shutdown.target --timer-property Before=shutdown.target --timer-property AccuracySec=500ms --property DefaultDependencies=no --property Conflicts=shutdown.target --property Before=shutdown.target --property Wants=multipathd.service --property After=multipathd.service --on-active=$env{FIND_MULTIPATHS_WAIT_UNTIL} /usr/bin/udevadm trigger --action=add $sys$devpath" -85,90c84,89 -< IMPORT{db}=="FIND_MULTIPATHS_WAIT_CANCELLED" -< # ENV{FIND_MULTIPATHS_WAIT_CANCELLED}!="?*", \ -< # ENV{FIND_MULTIPATHS_WAIT_UNTIL}=="?*", \ -< # ENV{FIND_MULTIPATHS_WAIT_UNTIL}!="0", \ -< # ENV{FIND_MULTIPATHS_WAIT_CANCELLED}="1", \ -< # RUN+="/usr/bin/systemctl stop cancel-multipath-wait-$kernel.timer" ---- -> IMPORT{db}="FIND_MULTIPATHS_WAIT_CANCELLED" -> ENV{FIND_MULTIPATHS_WAIT_CANCELLED}!="?*", \ -> ENV{FIND_MULTIPATHS_WAIT_UNTIL}=="?*", \ -> ENV{FIND_MULTIPATHS_WAIT_UNTIL}!="0", \ -> ENV{FIND_MULTIPATHS_WAIT_CANCELLED}="1", \ -> RUN+="/usr/bin/systemctl stop cancel-multipath-wait-$kernel.timer" -``` - -### 69-dm-lvm.rules - -```shell -# diff 69-dm-lvm.rules /lib/udev/rules.d/69-dm-lvm.rules -82,84c82,83 -< IMPORT{program}=="/usr/sbin/lvm pvscan --cache --listvg --checkcomplete --vgonline --udevoutput --journal=output $env{DEVNAME}" -< # ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} lvm vgchange -aay --nohints $env{LVM_VG_NAME_COMPLETE}" -< ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/sbin/lvm vgchange -aay --nohints $env{LVM_VG_NAME_COMPLETE}" ---- -> IMPORT{program}="/usr/sbin/lvm pvscan --cache --listvg --checkcomplete --vgonline --udevoutput --journal=output $env{DEVNAME}" -> ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} lvm vgchange -aay --nohints $env{LVM_VG_NAME_COMPLETE}" -``` - -### 98-kexec.rules +devmaster提供了dracut模块,用于制作initramfs时替换默认的udev组件。安装devmaster后,执行以下命令制作initramfs: ```shell -# diff 98-kexec.rules /lib/udev/rules.d/98-kexec.rules -14,16c14 -< #RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; /usr/bin/systemd-run --quiet --no-block /usr/lib/udev/kdump-udev-throttler'" -< -< RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; /usr/lib/udev/kdump-udev-throttler'" ---- -> RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; /usr/bin/systemd-run --quiet --no-block /usr/lib/udev/kdump-udev-throttler'" +# dracut -f --omit "systemd systemd-initrd systemd-networkd dracut-systemd rngd dbus-daemon dbus network-manager rngd plymouth" --add "devmaster" ``` - -### 90-vconsole.rules - -```shell -# diff tools/run_with_devmaster/rules.d/90-vconsole.rules /lib/udev/rules.d/90-vconsole.rules -3c12 -< # ACTION=="add", SUBSYSTEM=="vtconsole", KERNEL=="vtcon*", RUN+="/usr/lib/systemd/systemd-vconsole-setup" ---- -> ACTION=="add", SUBSYSTEM=="vtconsole", KERNEL=="vtcon*", RUN+="/usr/lib/systemd/systemd-vconsole-setup" -``` - -### 99-systemd.rules - -`99-systemd.rules`规则中的所有内容均被注释。 diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/01-md-raid-creating.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/01-md-raid-creating.rules" deleted file mode 100644 index 9bef8d1103f5a561228397a3f38dd77e92beba48..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/01-md-raid-creating.rules" +++ /dev/null @@ -1,7 +0,0 @@ -# do not edit this file, it will be overwritten on update -# While mdadm is creating an array, it creates a file -# /run/mdadm/creating-mdXXX. If that file exists, then -# the array is not "ready" and we should make sure the -# content is ignored. - -KERNEL=="md*", TEST=="/run/mdadm/creating-$kernel", ENV{SYSTEMD_READY}="0" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/10-dm.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/10-dm.rules" deleted file mode 100644 index 367bfd980bc4a784ab959efdb4556fdbf3232dc6..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/10-dm.rules" +++ /dev/null @@ -1,146 +0,0 @@ -# Udev rules for device-mapper devices. -# -# These rules create a DM control node in /dev/mapper directory. -# The rules also create nodes named dm-x (x is a number) in /dev -# directory and symlinks to these nodes with names given by -# the actual DM names. Some udev environment variables are set -# for use in later rules: -# DM_NAME - actual DM device's name -# DM_UUID - UUID set for DM device (blank if not specified) -# DM_SUSPENDED - suspended state of DM device (0 or 1) -# DM_UDEV_RULES_VSN - DM udev rules version -# -# These rules cover only basic device-mapper functionality in udev. -# -# Various DM subsystems may contain further subsystem-specific rules -# in 11-dm-.rules which should be installed together -# with the DM subsystem and which extend these basic rules. -# For example: -# 11-dm-lvm.rules for LVM subsystem -# 11-dm-mpath.rules for multipath subsystem (since version 0.6.0, recommended!) -# -# Even more specific rules may be required by subsystems so always -# check subsystem's upstream repository for recent set of rules. -# Also, keep in mind that recent rules may also require recent -# subsystem-specific binaries. - -KERNEL=="device-mapper", NAME="mapper/control" - -SUBSYSTEM!="block", GOTO="dm_end" -KERNEL!="dm-[0-9]*", GOTO="dm_end" - - -# Device created, major and minor number assigned - "add" event generated. -# Table loaded - no event generated. -# Device resumed (or renamed) - "change" event generated. -# Device removed - "remove" event generated. -# -# The dm-X nodes are always created, even on "add" event, we can't suppress -# that (the node is created even earlier with devtmpfs). All the symlinks -# (e.g. /dev/mapper) are created in right time after a device has its table -# loaded and is properly resumed. For this reason, direct use of dm-X nodes -# is not recommended. -ACTION!="add|change", GOTO="dm_end" - -# Decode udev control flags and set environment variables appropriately. -# These flags are encoded in DM_COOKIE variable that was introduced in -# kernel version 2.6.31. Therefore, we can use this feature with -# kernels >= 2.6.31 only. Cookie is not decoded for remove event. -ENV{DM_COOKIE}=="?*", IMPORT{program}=="/usr/sbin/dmsetup udevflags $env{DM_COOKIE}" - -# Rule out easy-to-detect inappropriate events first. -ENV{DISK_RO}=="1", GOTO="dm_disable" - -# There is no cookie set nor any flags encoded in events not originating -# in libdevmapper so we need to detect this and try to behave correctly. -# For such spurious events, regenerate all flags from current udev database content -# (this information would normally be inaccessible for spurious ADD and CHANGE events). -ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", ENV{DM_ACTIVATION}="1", GOTO="dm_flags_done" -IMPORT{db}=="DM_UDEV_DISABLE_DM_RULES_FLAG" -IMPORT{db}=="DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG" -IMPORT{db}=="DM_UDEV_DISABLE_DISK_RULES_FLAG" -IMPORT{db}=="DM_UDEV_DISABLE_OTHER_RULES_FLAG" -IMPORT{db}=="DM_UDEV_LOW_PRIORITY_FLAG" -IMPORT{db}=="DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG" -IMPORT{db}=="DM_UDEV_PRIMARY_SOURCE_FLAG" -IMPORT{db}=="DM_UDEV_FLAG7" -IMPORT{db}=="DM_UDEV_RULES_VSN" -LABEL="dm_flags_done" - -# Normally, we operate on "change" events. But when coldplugging, there's an -# "add" event present. We have to recognize this and do our actions in this -# particular situation, too. Also, we don't want the nodes to be created -# prematurely on "add" events while not coldplugging. We check -# DM_UDEV_PRIMARY_SOURCE_FLAG to see if the device was activated correctly -# before and if not, we ignore the "add" event totally. This way we can support -# udev triggers generating "add" events (e.g. "udevadm trigger --action=add" or -# "echo add > /sys/block//uevent"). The trigger with "add" event is -# also used at boot to reevaluate udev rules for all existing devices activated -# before (e.g. in initrd). If udev is used in initrd, we require the udev init -# script to not remove the existing udev database so we can reuse the information -# stored at the time of device activation in the initrd. -ACTION!="add", GOTO="dm_no_coldplug" -ENV{DM_UDEV_RULES_VSN}!="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="dm_disable" -ENV{DM_ACTIVATION}="1" -LABEL="dm_no_coldplug" - -# Putting it together, following table is used to recognize genuine and spurious events. -# N.B. Spurious events are generated based on use of the WATCH udev -# rule or by triggering an event manually by "udevadm trigger" call -# or by "echo > /sys/block/dm-X/uevent". -# -# EVENT DM_UDEV_PRIMARY_SOURCE_FLAG DM_ACTIVATION -# ====================================================================== -# add event (genuine) 0 0 -# change event (genuine) 1 1 -# add event (spurious) -# |_ dev still not active 0 0 -# \_ dev already active 1 1 -# change event (spurious) -# |_ dev still not active 0 0 -# \_ dev already active 1 0 - -# "dm" sysfs subdirectory is available in newer versions of DM -# only (kernels >= 2.6.29). We have to check for its existence -# and use dmsetup tool instead to get the DM name, uuid and -# suspended state if the "dm" subdirectory is not present. -# The "suspended" item was added even later (kernels >= 2.6.31), -# so we also have to call dmsetup if the kernel version used -# is in between these releases. -TEST=="dm", ENV{DM_NAME}="$attr{dm/name}", ENV{DM_UUID}="$attr{dm/uuid}", ENV{DM_SUSPENDED}="$attr{dm/suspended}" -TEST!="dm", IMPORT{program}=="/usr/sbin/dmsetup info -j %M -m %m -c --nameprefixes --noheadings --rows -o name,uuid,suspended" -ENV{DM_SUSPENDED}!="?*", IMPORT{program}=="/usr/sbin/dmsetup info -j %M -m %m -c --nameprefixes --noheadings --rows -o suspended" - -# dmsetup tool provides suspended state information in textual -# form with values "Suspended"/"Active". We translate it to -# 0/1 respectively to be consistent with sysfs values. -ENV{DM_SUSPENDED}=="Active", ENV{DM_SUSPENDED}="0" -ENV{DM_SUSPENDED}=="Suspended", ENV{DM_SUSPENDED}="1" - -# This variable provides a reliable way to check that device-mapper -# rules were installed. It means that all needed variables are set -# by these rules directly so there's no need to acquire them again -# later. Other rules can alternate the functionality based on this -# fact (e.g. fallback to rules that behave correctly even without -# these rules installed). It also provides versioning for any -# possible future changes. -# VSN 1 - original rules -# VSN 2 - add support for synthesized events -ENV{DM_UDEV_RULES_VSN}="2" - -ENV{DM_UDEV_DISABLE_DM_RULES_FLAG}!="1", ENV{DM_NAME}=="?*", SYMLINK+="mapper/$env{DM_NAME}" - -# Avoid processing and scanning a DM device in the other (foreign) -# rules if it is in suspended state. However, we still keep 'disk' -# and 'DM subsystem' related rules enabled in this case. -ENV{DM_SUSPENDED}=="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" - -GOTO="dm_end" - -LABEL="dm_disable" -ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}="1" -ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="1" -ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" -OPTIONS:="nowatch" - -LABEL="dm_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/11-dm-lvm.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/11-dm-lvm.rules" deleted file mode 100644 index f6b26ac6c7dc616957e5f7273c92dc6be138d7a3..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/11-dm-lvm.rules" +++ /dev/null @@ -1,48 +0,0 @@ -# Udev rules for LVM. -# -# These rules create symlinks for LVM logical volumes in -# /dev/VG directory (VG is an actual VG name). Some udev -# environment variables are set (they can be used in later -# rules as well): -# DM_LV_NAME - logical volume name -# DM_VG_NAME - volume group name -# DM_LV_LAYER - logical volume layer (blank if not set) - -# "add" event is processed on coldplug only! -ACTION!="add|change", GOTO="lvm_end" -ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="lvm_end" -ENV{DM_UUID}!="LVM-?*", GOTO="lvm_end" - -# Use DM name and split it up into its VG/LV/layer constituents. -IMPORT{program}=="/usr/sbin/dmsetup splitname --nameprefixes --noheadings --rows $env{DM_NAME}" - -# DM_SUBSYSTEM_UDEV_FLAG0 is the 'NOSCAN' flag for LVM subsystem. -# This flag is used to temporarily disable selected rules to prevent any -# processing or scanning done on the LVM volume before LVM has any chance -# to zero any stale metadata found within the LV data area. Such stale -# metadata could cause false claim of the LV device, keeping it open etc. -# -# If the NOSCAN flag is present, backup selected existing flags used to -# disable rules, then set them firmly so those selected rules are surely skipped. -# Restore these flags once the NOSCAN flag is dropped (which is normally any -# uevent that follows for this LV, even an artificially generated one). -ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", ENV{DM_NOSCAN}="1", ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" -ENV{DM_SUBSYSTEM_UDEV_FLAG0}!="1", IMPORT{db}=="DM_NOSCAN", IMPORT{db}=="DM_DISABLE_OTHER_RULES_FLAG_OLD" -ENV{DM_SUBSYSTEM_UDEV_FLAG0}!="1", ENV{DM_NOSCAN}=="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="$env{DM_DISABLE_OTHER_RULES_FLAG_OLD}", \ - ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="", ENV{DM_NOSCAN}="" - -ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}=="1", GOTO="lvm_end" - -# Do not create symlinks for inappropriate subdevices. -ENV{DM_LV_NAME}=="pvmove?*|?*_vorigin", GOTO="lvm_disable" -ENV{DM_LV_LAYER}=="?*", GOTO="lvm_disable" - -# Create symlinks for top-level devices only. -ENV{DM_VG_NAME}=="?*", ENV{DM_LV_NAME}=="?*", SYMLINK+="$env{DM_VG_NAME}/$env{DM_LV_NAME}", GOTO="lvm_end" - -LABEL="lvm_disable" -ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="1" -ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" -OPTIONS:="nowatch" - -LABEL="lvm_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/11-dm-mpath.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/11-dm-mpath.rules" deleted file mode 100644 index b35cc9ecdebb704587ac178022fbfe98c512112e..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/11-dm-mpath.rules" +++ /dev/null @@ -1,111 +0,0 @@ -ACTION!="add|change", GOTO="mpath_end" -ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="mpath_end" -ENV{DM_UUID}!="mpath-?*", GOTO="mpath_end" - -IMPORT{db}=="DM_DISABLE_OTHER_RULES_FLAG_OLD" -IMPORT{db}=="MPATH_DEVICE_READY" - -# If this uevent didn't come from dm, don't try to update the -# device state -ENV{DM_COOKIE}!="?*", ENV{DM_ACTION}!="PATH_*", IMPORT{db}=="DM_UDEV_DISABLE_OTHER_RULES_FLAG", IMPORT{db}=="DM_NOSCAN", GOTO="scan_import" - -ENV{.MPATH_DEVICE_READY_OLD}="$env{MPATH_DEVICE_READY}" - -# multipath sets DM_SUBSYSTEM_UDEV_FLAG2 when it reloads a -# table with no active devices. If this happens, mark the -# device not ready -ENV{DM_SUBSYSTEM_UDEV_FLAG2}=="1", ENV{MPATH_DEVICE_READY}="0",\ - GOTO="mpath_action" - -# If the last path has failed mark the device not ready -# Note that DM_NR_VALID_PATHS is only set for PATH_FAILED|PATH_REINSTATED -# events. -# This may not be reliable, as events aren't necessarily received in order. -ENV{DM_NR_VALID_PATHS}=="0", ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action" - -ENV{MPATH_SBIN_PATH}="/sbin" -TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin" - -# Don't run multipath -U during "coldplug" after switching root, -# because paths are just being added to the udev db. -ACTION=="add", ENV{.MPATH_DEVICE_READY_OLD}=="1", GOTO="paths_ok" - -# Check the map state directly with multipath -U. -# This doesn't attempt I/O on the device. -PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -U -v1 %k", GOTO="paths_ok" -ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action" -LABEL="paths_ok" - -# Don't mark a device ready on a PATH_FAILED event. even if -# DM_NR_VALID_PATHS is greater than 0. Just keep the existing -# value -ENV{DM_ACTION}=="PATH_FAILED", GOTO="mpath_action" - -# This event is either a PATH_REINSTATED or a table reload where -# there are active paths. Mark the device ready -ENV{MPATH_DEVICE_READY}="1" - -LABEL="mpath_action" -# DM_SUBSYSTEM_UDEV_FLAG0 is the "RELOAD" flag for multipath subsystem. -# Drop the DM_ACTIVATION flag here as mpath reloads tables if any of its -# paths are lost/recovered. For any stack above the mpath device, this is not -# something that should be reacted upon since it would be useless extra work. -# It's exactly mpath's job to provide *seamless* device access to any of the -# paths that are available underneath. -ENV{DM_SUBSYSTEM_UDEV_FLAG0}=="1", \ - ENV{DM_ACTIVATION}="0", ENV{MPATH_UNCHANGED}="1" - -# For path failed or reinstated events, unset DM_ACTIVATION. -# This is similar to the DM_SUBSYSTEM_UDEV_FLAG0 case above. -ENV{DM_ACTION}=="PATH_FAILED|PATH_REINSTATED", \ - ENV{DM_ACTIVATION}="0", ENV{MPATH_UNCHANGED}="1" - -# Do not initiate scanning if no path is available, -# otherwise there would be a hang or IO error on access. -# We'd like to avoid this, especially within udev processing. -ENV{MPATH_DEVICE_READY}=="0", ENV{DM_NOSCAN}="1" - -# Also skip all foreign rules if no path is available. -# Remember the original value of DM_DISABLE_OTHER_RULES_FLAG -# and restore it back once we have at least one path available. -ENV{MPATH_DEVICE_READY}=="0", ENV{.MPATH_DEVICE_READY_OLD}=="1",\ - ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}=="",\ - ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="$env{DM_UDEV_DISABLE_OTHER_RULES_FLAG}" -ENV{MPATH_DEVICE_READY}=="0", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" -ENV{MPATH_DEVICE_READY}!="0", ENV{.MPATH_DEVICE_READY_OLD}=="0",\ - ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="$env{DM_DISABLE_OTHER_RULES_FLAG_OLD}",\ - ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="",\ - ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0" - -# The code to check multipath state ends here. We need to set -# properties and symlinks regardless whether the map is usable or -# not. If symlinks get lost, systemd may auto-unmount file systems. - -LABEL="scan_import" -ENV{DM_NOSCAN}!="1", GOTO="import_end" -IMPORT{db}=="ID_FS_TYPE" -IMPORT{db}=="ID_FS_USAGE" -IMPORT{db}=="ID_FS_UUID" -IMPORT{db}=="ID_FS_UUID_ENC" -IMPORT{db}=="ID_FS_LABEL" -IMPORT{db}=="ID_FS_LABEL_ENC" -IMPORT{db}=="ID_FS_VERSION" - -LABEL="import_end" - -# Multipath maps should take precedence over their members. -ENV{DM_UDEV_LOW_PRIORITY_FLAG}!="1", OPTIONS+="link_priority=50" - -# Set some additional symlinks that typically exist for mpath -# path members, too, and should be overridden. - -# kpartx_id is very robust, it works for suspended maps and maps -# with 0 dependencies. It sets DM_TYPE, DM_PART, DM_WWN -TEST=="/usr/lib/udev/kpartx_id", \ - IMPORT{program}=="kpartx_id %M %m $env{DM_UUID}" - -ENV{DM_TYPE}=="?*", ENV{DM_SERIAL}=="?*", \ - SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_SERIAL}" -ENV{DM_WWN}=="?*", SYMLINK+="disk/by-id/wwn-$env{DM_WWN}" - -LABEL="mpath_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/11-dm-parts.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/11-dm-parts.rules" deleted file mode 100644 index 8a0821701ed0a8e926b9c710d29d0b825be865e2..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/11-dm-parts.rules" +++ /dev/null @@ -1,39 +0,0 @@ -# Rules for partitions created by kpartx - -KERNEL!="dm-*", GOTO="dm_parts_end" -ACTION!="add|change", GOTO="dm_parts_end" -ENV{DM_UUID}!="part[0-9]*", GOTO="dm_parts_end" - -# We must take care that symlinks don't get lost, -# even if blkid fails in 13-dm-disk.rules later. -# -# Fixme: we have currently no way to avoid calling blkid on -# partitions of broken mpath maps such as DM_NOSCAN. -# But when partition devices appear, kpartx has likely read -# the partition table shortly before, so odds are not bad -# that blkid will also succeed. - -IMPORT{db}=="ID_FS_USAGE" -IMPORT{db}=="ID_FS_UUID_ENC" -IMPORT{db}=="ID_FS_LABEL_ENC" -IMPORT{db}=="ID_PART_ENTRY_NAME" -IMPORT{db}=="ID_PART_ENTRY_UUID" -IMPORT{db}=="ID_PART_ENTRY_SCHEME" - -# Maps should take precedence over their members. -ENV{DM_UDEV_LOW_PRIORITY_FLAG}!="1", OPTIONS+="link_priority=50" - -# Set some additional symlinks that typically exist for mpath -# path members, too, and should be overridden. -# -# kpartx_id is very robust, it works for suspended maps and maps -# with 0 dependencies. It sets DM_TYPE, DM_PART, DM_WWN -IMPORT{program}=="kpartx_id %M %m $env{DM_UUID}" - -# DM_TYPE only has a reasonable value for partitions on multipath. -ENV{DM_UUID}=="*-mpath-*", ENV{DM_TYPE}=="?*", ENV{DM_SERIAL}=="?*" \ - SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_SERIAL}-part$env{DM_PART}" -ENV{DM_WWN}=="?*", ENV{DM_PART}=="?*", \ - SYMLINK+="disk/by-id/wwn-$env{DM_WWN}-part$env{DM_PART}" - -LABEL="dm_parts_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/13-dm-disk.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/13-dm-disk.rules" deleted file mode 100644 index 98d4f433bb6914d95892c27dcb0aee65d2f46a89..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/13-dm-disk.rules" +++ /dev/null @@ -1,38 +0,0 @@ -# Udev rules for device-mapper devices. -# -# These rules create symlinks in /dev/disk directory. -# Symlinks that depend on probing filesystem type, -# label and uuid are created only if the device is not -# suspended. - -# "add" event is processed on coldplug only! -ACTION!="add|change", GOTO="dm_end" -ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_end" -ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="dm_end" - -ENV{DM_NAME}=="?*", SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}" -ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}" - -ENV{DM_SUSPENDED}=="1", GOTO="dm_end" -ENV{DM_NOSCAN}=="1", GOTO="dm_watch" - -IMPORT{builtin}=="blkid" -ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100" -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", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -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}" -ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_GPT_AUTO_ROOT}=="1", SYMLINK+="gpt-auto-root" - -# Add inotify watch to track changes on this device. -# Using the watch rule is not optimal - it generates a lot of spurious -# and useless events whenever the device opened for read-write is closed. -# The best would be to generate the event directly in the tool changing -# relevant information so only relevant events will be processed -# (like creating a filesystem, changing filesystem label etc.). -# -# But let's use this until we have something better... -LABEL="dm_watch" -OPTIONS+="watch" - -LABEL="dm_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/40-elevator.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/40-elevator.rules" deleted file mode 100644 index 9503f25b6db9d7a9a9ecadc47910642c304e3001..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/40-elevator.rules" +++ /dev/null @@ -1,20 +0,0 @@ -# We aren't adding devices skip the elevator check -ACTION!="add", GOTO="sched_out" - -SUBSYSTEM!="block", GOTO="sched_out" -ENV{DEVTYPE}!="disk", GOTO="sched_out" - -# Technically, dm-multipath can be configured to use an I/O scheduler. -# However, there are races between the 'add' uevent and the linking in -# of the queue/scheduler sysfs file. For now, just skip dm- devices. -KERNEL=="dm-*|md*", GOTO="sched_out" - -# Skip bio-based devices, which don't support an I/O scheduler. -ATTR{queue/scheduler}=="none", GOTO="sched_out" - -# If elevator= is specified on the kernel command line, change the -# scheduler to the one specified. -IMPORT{cmdline}=="elevator" -ENV{elevator}!="", ATTR{queue/scheduler}="$env{elevator}" - -LABEL="sched_out" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/40-openEuler.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/40-openEuler.rules" deleted file mode 100644 index 9b3f88d755723260f831d86cc807ea3f2715c80e..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/40-openEuler.rules" +++ /dev/null @@ -1,45 +0,0 @@ -# do not edit this file, it will be overwritten on update - -# CPU hotadd request -SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", ATTR{online}="1" - -# Memory hotadd request -SUBSYSTEM!="memory", GOTO="memory_hotplug_end" -ACTION!="add", GOTO="memory_hotplug_end" -PROGRAM="/bin/uname -p", RESULT=="s390*", GOTO="memory_hotplug_end" - -ENV{.state}="online" -ATTR{state}=="offline", ATTR{state}="$env{.state}" - -LABEL="memory_hotplug_end" - -# reload sysctl.conf / sysctl.conf.d settings when the bridge module is loaded -# ACTION=="add", SUBSYSTEM=="module", KERNEL=="bridge", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/bridge" - -# load SCSI generic (sg) driver -SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/sbin/modprobe -bv sg" -SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_target", TEST!="[module/sg]", RUN+="/sbin/modprobe -bv sg" - -# Rule for prandom character device node permissions -KERNEL=="prandom", MODE="0644" - - -# Rules for creating the ID_PATH for SCSI devices based on the CCW bus -# using the form: ccw--zfcp-: -# -ACTION=="remove", GOTO="zfcp_scsi_device_end" - -# -# Set environment variable "ID_ZFCP_BUS" to "1" if the devices -# (both disk and partition) are SCSI devices based on FCP devices -# -KERNEL=="sd*", SUBSYSTEMS=="ccw", DRIVERS=="zfcp", ENV{.ID_ZFCP_BUS}="1" - -# For SCSI disks -KERNEL=="sd*[!0-9]", SUBSYSTEMS=="scsi", ENV{.ID_ZFCP_BUS}=="1", ENV{DEVTYPE}=="disk", SYMLINK+="disk/by-path/ccw-$attr{hba_id}-zfcp-$attr{wwpn}:$attr{fcp_lun}" - - -# For partitions on a SCSI disk -KERNEL=="sd*[0-9]", SUBSYSTEMS=="scsi", ENV{.ID_ZFCP_BUS}=="1", ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-path/ccw-$attr{hba_id}-zfcp-$attr{wwpn}:$attr{fcp_lun}-part%n" - -LABEL="zfcp_scsi_device_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/50-udev-default.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/50-udev-default.rules" deleted file mode 100644 index 08026b72ca89136ab26614fcbbd0f68bffa9d45e..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/50-udev-default.rules" +++ /dev/null @@ -1,122 +0,0 @@ -# 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}" - -# 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=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}=="usb_id", IMPORT{builtin}=="hwdb --subsystem=usb" -ENV{MODALIAS}!="", IMPORT{builtin}=="hwdb --subsystem=$env{SUBSYSTEM}" - -ACTION!="add", GOTO="default_end" - -SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666" -SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666" -SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620" -SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620" -SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620" -SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620" -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="0666" -SUBSYSTEM=="kfd", GROUP="render", MODE="0666" - -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="0666", OPTIONS+="static_node=kvm" - -KERNEL=="vfio", MODE="0666", OPTIONS+="static_node=vfio/vfio" - -KERNEL=="vsock", MODE="0666" -KERNEL=="vhost-vsock", GROUP="kvm", MODE="0666", OPTIONS+="static_node=vhost-vsock" - -KERNEL=="vhost-net", GROUP="kvm", MODE="0666", OPTIONS+="static_node=vhost-net" - -KERNEL=="udmabuf", GROUP="kvm" - -SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK += "ptp_kvm" - -SUBSYSTEM=="ptp", ATTR{clock_name}=="hyperv", SYMLINK += "ptp_hyperv" - -SUBSYSTEM!="dmi", 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}" -LABEL="dmi_end" - -LABEL="default_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-autosuspend.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-autosuspend.rules" deleted file mode 100644 index ce31a920edbb300c7d556064b6b624dd6a2c4d36..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-autosuspend.rules" +++ /dev/null @@ -1,22 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-block.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-block.rules" deleted file mode 100644 index 3134ab995ecef2c098eaa88cd8e8b8d99b74f134..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-block.rules" +++ /dev/null @@ -1,13 +0,0 @@ -# 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*", \ - OPTIONS+="watch" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-cdrom_id.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-cdrom_id.rules" deleted file mode 100644 index 829c4d80fafae326106b8b32c451547a9271e021..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-cdrom_id.rules" +++ /dev/null @@ -1,29 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-drm.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-drm.rules" deleted file mode 100644 index a81bf351bdeee8ae812ae96ee95148db848c3c43..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-drm.rules" +++ /dev/null @@ -1,8 +0,0 @@ -# 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 -ENV{ID_PATH}=="?*", KERNEL=="card*", SYMLINK+="dri/by-path/$env{ID_PATH}-card" -ENV{ID_PATH}=="?*", KERNEL=="controlD*", SYMLINK+="dri/by-path/$env{ID_PATH}-control" -ENV{ID_PATH}=="?*", KERNEL=="renderD*", SYMLINK+="dri/by-path/$env{ID_PATH}-render" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-evdev.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-evdev.rules" deleted file mode 100644 index dfd16a47109f2122227f4602547bdde27e9f3934..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-evdev.rules" +++ /dev/null @@ -1,30 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-fido-id.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-fido-id.rules" deleted file mode 100644 index a82f82bb6f2ad00c15198e2d992c1b5cafbf76cd..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-fido-id.rules" +++ /dev/null @@ -1,14 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-infiniband.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-infiniband.rules" deleted file mode 100644 index e0c81d895aaa834d1f01d10cae0fb0140518a5c6..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-infiniband.rules" +++ /dev/null @@ -1,12 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-input-id.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-input-id.rules" deleted file mode 100644 index ad20a5813f3e18ba8a8789d573b4d5db574c05da..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-input-id.rules" +++ /dev/null @@ -1,8 +0,0 @@ -# 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:" - -LABEL="id_input_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-net.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-net.rules" deleted file mode 100644 index 41875017d42a5b24e39f3a52b992a7dbd0983048..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-net.rules" +++ /dev/null @@ -1 +0,0 @@ -ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="1", PROGRAM="/lib/udev/rename_device", RESULT=="?*", NAME="$result" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-alsa.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-alsa.rules" deleted file mode 100644 index 044f22b77b7f3058fbc56d7fe68729619ef2ed8c..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-alsa.rules" +++ /dev/null @@ -1,14 +0,0 @@ -# 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}" - -LABEL="persistent_alsa_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-input.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-input.rules" deleted file mode 100644 index baa68dd293017fd34bf38b9844e31a4a95b89c31..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-input.rules" +++ /dev/null @@ -1,42 +0,0 @@ -# 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=="rmi4", ENV{ID_BUS}="rmi" -SUBSYSTEMS=="serio", ENV{ID_BUS}="i8042" - -SUBSYSTEMS=="usb", ENV{ID_BUS}=="", IMPORT{builtin}=="usb_id" - -# 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{ID_PATH}=="?*", KERNEL=="mouse*|js*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{.INPUT_CLASS}" -ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-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", ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", \ - SYMLINK+="input/by-path/$env{ID_PATH}-event" - -LABEL="persistent_input_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-storage-tape.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-storage-tape.rules" deleted file mode 100644 index 1858df5475096dcecb9ed7c973961d309a4a9225..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-storage-tape.rules" +++ /dev/null @@ -1,36 +0,0 @@ -# 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", IMPORT{program}=="scsi_id --sg-version=3 --export --whitelisted -d $devnode", \ - 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. -SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SCSI_SERIAL}=="?*", \ - SYMLINK+="tape/by-id/scsi-$env{ID_SCSI_SERIAL}" - -SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{builtin}=="path_id", \ - SYMLINK+="tape/by-path/$env{ID_PATH}-changer" - -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 --whitelisted --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=="nst*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}-nst" - -LABEL="persistent_storage_tape_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-storage.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-storage.rules" deleted file mode 100644 index be29bdabe4cd80aa5f43b064186870ef11fe2e85..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-storage.rules" +++ /dev/null @@ -1,142 +0,0 @@ -# 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 - -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*", 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" - -# NVMe -KERNEL=="nvme*[0-9]n*[0-9]", ATTR{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}" -KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}-part%n" - -KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}" -KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{wwid}=="?*", ENV{ID_WWN}="$attr{wwid}" -KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{model}=="?*", ENV{ID_MODEL}="$attr{model}" -KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{firmware_rev}=="?*", ENV{ID_REVISION}="$attr{firmware_rev}" -KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", \ - OPTIONS="string_escape=replace", ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}" - -KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}" -KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{model}=="?*", ENV{ID_MODEL}="$attr{model}" -KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{firmware_rev}=="?*", ENV{ID_REVISION}="$attr{firmware_rev}" -KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", \ - OPTIONS="string_escape=replace", ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}-part%n" - -# virtio-blk -KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}" -KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n" - -# ATA -KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}=="ata_id --export $devnode" - -# 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 --whitelisted -d $devnode", ENV{ID_BUS}="scsi" -KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}=="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="cciss" -KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" -KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" -# 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{DEVTYPE}=="disk", ENV{ID_USB_SERIAL}=="?*", SYMLINK+="disk/by-id/usb-$env{ID_USB_SERIAL}" -KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_USB_SERIAL}=="?*", SYMLINK+="disk/by-id/usb-$env{ID_USB_SERIAL}-part%n" - -# PMEM devices -KERNEL=="pmem*", ENV{DEVTYPE}=="disk", ATTRS{uuid}=="?*", SYMLINK+="disk/by-id/pmem-$attr{uuid}" - -# FireWire -KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}" -KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n" - -# MMC -KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}" -KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{name}=="?*", ENV{ID_NAME}="$attr{name}" -KERNEL=="mmcblk[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}" -KERNEL=="mmcblk[0-9]p[0-9]*", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n" - -# Memstick -KERNEL=="msblk[0-9]|mspblk[0-9]", SUBSYSTEMS=="memstick", ATTRS{name}=="?*", ATTRS{serial}=="?*", \ - ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}" -KERNEL=="msblk[0-9]p[0-9]|mspblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}-part%n" - -# 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}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -# compatible links for ATA devices -KERNEL!="mmcblk[0-9]boot[0-9]", ENV{DEVTYPE}=="disk", ENV{ID_PATH_ATA_COMPAT}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH_ATA_COMPAT}" -ENV{DEVTYPE}=="partition", ENV{ID_PATH_ATA_COMPAT}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH_ATA_COMPAT}-part%n" - -# legacy virtio-pci by-path links (deprecated) -KERNEL=="vd*[!0-9]", ENV{ID_PATH}=="pci-*", SYMLINK+="disk/by-path/virtio-$env{ID_PATH}" -KERNEL=="vd*[0-9]", ENV{ID_PATH}=="pci-*", SYMLINK+="disk/by-path/virtio-$env{ID_PATH}-part%n" - -# 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" - -# 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{DEVTYPE}=="disk", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}" -ENV{DEVTYPE}=="partition", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}-part%n" - -# by-partlabel/by-partuuid links (partition metadata) -ENV{ID_PART_ENTRY_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-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{DEVTYPE}!="partition", ENV{ID_IGNORE_DISKSEQ}!="1", SYMLINK+="disk/by-diskseq/$env{DISKSEQ}" -ENV{DISKSEQ}=="?*", ENV{DEVTYPE}=="partition", ENV{ID_IGNORE_DISKSEQ}!="1", SYMLINK+="disk/by-diskseq/$env{DISKSEQ}-part%n" - -LABEL="persistent_storage_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-v4l.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-v4l.rules" deleted file mode 100644 index ea26b23c160fee946bf56247e16fec818787ff2e..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-persistent-v4l.rules" +++ /dev/null @@ -1,20 +0,0 @@ -# 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" -ENV{ID_PATH}=="?*", KERNEL=="video*|vbi*", SYMLINK+="v4l/by-path/$env{ID_PATH}-video-index$attr{index}" -ENV{ID_PATH}=="?*", KERNEL=="audio*", SYMLINK+="v4l/by-path/$env{ID_PATH}-audio-index$attr{index}" - -LABEL="persistent_v4l_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-raw.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-raw.rules" deleted file mode 100644 index 547687d92c6c10d54a37a75a6a277ccce56a310e..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-raw.rules" +++ /dev/null @@ -1 +0,0 @@ -# Enter raw device bindings here. diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-rdma-ndd.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-rdma-ndd.rules" deleted file mode 100644 index ef7768e0669345fb2f46bfcc60d8ff4e6ed16011..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-rdma-ndd.rules" +++ /dev/null @@ -1,3 +0,0 @@ -# If an InfiniBand/RDMA device is installed with a writable node_description -# sysfs then start rdma-ndd to keep it up to date -SUBSYSTEM=="infiniband", TAG+="systemd", ATTRS{node_desc}=="*", ENV{SYSTEMD_WANTS}+="rdma-ndd.service" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-rdma-persistent-naming.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-rdma-persistent-naming.rules" deleted file mode 100644 index fcb6c784e6033338f9f156a88b0e0b7f522450f7..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-rdma-persistent-naming.rules" +++ /dev/null @@ -1,32 +0,0 @@ -# Rename modes: -# NAME_FALLBACK - Try to name devices in the following order: -# by-pci -> by-guid -> kernel -# NAME_KERNEL - leave name as kernel provided -# NAME_PCI - based on PCI/slot/function location -# NAME_GUID - based on system image GUID -# NAME_FIXED - rename the device to the fixed named in the next argument -# -# The stable names are combination of device type technology and rename mode. -# Infiniband - ib* -# RoCE - roce* -# iWARP - iw* -# OPA - opa* -# Default (unknown protocol) - rdma* -# -# Example: -# * NAME_PCI -# pci = 0000:00:0c.4 -# Device type = IB -# mlx5_0 -> ibp0s12f4 -# * NAME_GUID -# GUID = 5254:00c0:fe12:3455 -# Device type = RoCE -# mlx5_0 -> rocex525400c0fe123455 -# -ACTION=="add", SUBSYSTEM=="infiniband", PROGRAM="rdma_rename %k NAME_FALLBACK" - -# Example: -# * NAME_FIXED -# fixed name for specific board_id -# -#ACTION=="add", ATTR{board_id}=="MSF0010110035", SUBSYSTEM=="infiniband", PROGRAM="rdma_rename %k NAME_FIXED myib" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-sensor.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-sensor.rules" deleted file mode 100644 index 68929d6bee46ac333b57fd482d30cce9d92446c4..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-sensor.rules" +++ /dev/null @@ -1,34 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-serial.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-serial.rules" deleted file mode 100644 index 0f3f71dbd47bb090e76be356ad28d64dd734a41c..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-serial.rules" +++ /dev/null @@ -1,26 +0,0 @@ -# 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}=="?*", ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-path/$env{ID_PATH}-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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-srp_daemon.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-srp_daemon.rules" deleted file mode 100644 index cedc828b2c62179ccb781e45d1d81abeff84502d..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/60-srp_daemon.rules" +++ /dev/null @@ -1 +0,0 @@ -#SUBSYSTEM=="infiniband_mad", KERNEL=="*umad*", PROGRAM=="/bin/systemctl show srp_daemon -p ActiveState", RESULT=="ActiveState=active", ENV{SYSTEMD_WANTS}+="srp_daemon_port@$attr{ibdev}:$attr{port}.service" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/62-multipath.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/62-multipath.rules" deleted file mode 100644 index ef4859594e0b032d00e5e9898228a621726ca9df..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/62-multipath.rules" +++ /dev/null @@ -1,92 +0,0 @@ -# Set DM_MULTIPATH_DEVICE_PATH if the device should be handled by multipath -SUBSYSTEM!="block", GOTO="end_mpath" -KERNEL!="sd*|dasd*|nvme*", GOTO="end_mpath" -ACTION=="remove", TEST=="/dev/shm/multipath/find_multipaths/$major:$minor", \ - RUN+="/usr/bin/rm -f /dev/shm/multipath/find_multipaths/$major:$minor" -ACTION!="add|change", GOTO="end_mpath" - -IMPORT{cmdline}=="nompath" -ENV{nompath}=="?*", GOTO="end_mpath" -IMPORT{cmdline}=="multipath" -ENV{multipath}=="off", GOTO="end_mpath" - -ENV{DEVTYPE}!="partition", GOTO="test_dev" -IMPORT{parent}=="DM_MULTIPATH_DEVICE_PATH" -ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{ID_FS_TYPE}="none", \ - ENV{SYSTEMD_READY}="0" -GOTO="end_mpath" - -LABEL="test_dev" - -ENV{MPATH_SBIN_PATH}="/sbin" -TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin" - -# FIND_MULTIPATHS_WAIT_UNTIL is the timeout (in seconds after the -# epoch). -IMPORT{db}=="FIND_MULTIPATHS_WAIT_UNTIL" -ENV{.SAVED_FM_WAIT_UNTIL}="$env{FIND_MULTIPATHS_WAIT_UNTIL}" - -# multipath -u needs to know if this device has ever been exported -IMPORT{db}=="DM_MULTIPATH_DEVICE_PATH" - -# multipath -u sets DM_MULTIPATH_DEVICE_PATH and, -# if "find_multipaths smart", also FIND_MULTIPATHS_WAIT_UNTIL. -IMPORT{program}=="$env{MPATH_SBIN_PATH}/multipath -u %k" - -# case 1: this is definitely multipath -ENV{DM_MULTIPATH_DEVICE_PATH}=="1", \ - ENV{ID_FS_TYPE}="mpath_member", ENV{SYSTEMD_READY}="0", \ - GOTO="stop_wait" - -# case 2: this is definitely not multipath, or timeout has expired -ENV{DM_MULTIPATH_DEVICE_PATH}!="2", \ - GOTO="stop_wait" - -# Code below here is only run in "smart" mode. -# multipath -u has indicated this is "maybe" multipath. - -# Note that DM_MULTIPATH_DEVICE_PATH has the value 2 at this point. -# This value will never propagate to other rules files, because -# it will be reset to 1 in the "pretend_multipath" section below. - -# This shouldn't happen, just in case. -ENV{FIND_MULTIPATHS_WAIT_UNTIL}!="?*", GOTO="end_mpath" - -# Be careful not to start the timer twice. -ACTION!="add", GOTO="pretend_mpath" -ENV{.SAVED_FM_WAIT_UNTIL}=="?*", GOTO="pretend_mpath" - -# At this point, we are seeing this path for the first time, and it's "maybe" multipath. - -# The actual start command for the timer. -# -# The purpose of this command is only to make sure we will receive another -# uevent eventually. *Any* uevent may cause waiting to finish if it either ends -# in case 1-3 above, or if it arrives after FIND_MULTIPATHS_WAIT_UNTIL. -# -# Note that this will try to activate multipathd if it isn't running yet. -# If that fails, the unit starts and expires nonetheless. If multipathd -# startup needs to wait for other services, this wait time will add up with -# the --on-active timeout. -# -# We must trigger an "add" event because LVM2 will only act on those. - -# RUN+="/usr/bin/systemd-run --unit=cancel-multipath-wait-$kernel --description 'cancel waiting for multipath siblings of $kernel' --no-block --timer-property DefaultDependencies=no --timer-property Conflicts=shutdown.target --timer-property Before=shutdown.target --timer-property AccuracySec=500ms --property DefaultDependencies=no --property Conflicts=shutdown.target --property Before=shutdown.target --property Wants=multipathd.service --property After=multipathd.service --on-active=$env{FIND_MULTIPATHS_WAIT_UNTIL} /usr/bin/udevadm trigger --action=add $sys$devpath" -RUN+="/usr/bin/devctl trigger --action=add $sys$devpath" - -LABEL="pretend_mpath" -ENV{DM_MULTIPATH_DEVICE_PATH}="1" -ENV{SYSTEMD_READY}="0" -GOTO="end_mpath" - -LABEL="stop_wait" -# If timeout hasn't expired but we're not in "maybe" state any more, stop timer -# Do this only once, and only if the timer has been started before -IMPORT{db}=="FIND_MULTIPATHS_WAIT_CANCELLED" -# ENV{FIND_MULTIPATHS_WAIT_CANCELLED}!="?*", \ -# ENV{FIND_MULTIPATHS_WAIT_UNTIL}=="?*", \ -# ENV{FIND_MULTIPATHS_WAIT_UNTIL}!="0", \ -# ENV{FIND_MULTIPATHS_WAIT_CANCELLED}="1", \ -# RUN+="/usr/bin/systemctl stop cancel-multipath-wait-$kernel.timer" - -LABEL="end_mpath" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/63-md-raid-arrays.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/63-md-raid-arrays.rules" deleted file mode 100644 index 36ee97913e51f030911b51b2d49303fc076aefe8..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/63-md-raid-arrays.rules" +++ /dev/null @@ -1,41 +0,0 @@ -# do not edit this file, it will be overwritten on update - -SUBSYSTEM!="block", GOTO="md_end" - -# handle md arrays -ACTION!="add|change", GOTO="md_end" -KERNEL!="md*", GOTO="md_end" - -# partitions have no md/{array_state,metadata_version}, but should not -# for that reason be ignored. -ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" - -# container devices have a metadata version of e.g. 'external:ddf' and -# never leave state 'inactive' -ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -TEST!="md/array_state", ENV{SYSTEMD_READY}="0", GOTO="md_end" -ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0", GOTO="md_end" -LABEL="md_ignore_state" - -IMPORT{program}=="/usr/sbin/mdadm --detail --export $devnode" -ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace" -ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" -ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" -ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace" -ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n" -ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" -ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" - -IMPORT{builtin}=="blkid" -OPTIONS+="link_priority=100" -OPTIONS+="watch" -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", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" - -ENV{MD_LEVEL}=="raid[1-9]*", ENV{SYSTEMD_WANTS}+="mdmonitor.service" - -# Tell systemd to run mdmon for our container, if we need it. -ENV{MD_LEVEL}=="raid[1-9]*", ENV{MD_CONTAINER}=="?*", PROGRAM="/usr/bin/readlink $env{MD_CONTAINER}", ENV{MD_MON_THIS}="%c" -ENV{MD_MON_THIS}=="?*", PROGRAM="/usr/bin/basename $env{MD_MON_THIS}", ENV{SYSTEMD_WANTS}+="mdmon@%c.service" - -LABEL="md_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/64-btrfs-dm.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/64-btrfs-dm.rules" deleted file mode 100644 index b2e49f4e8529edecc0c31a16e5b7385590c57f68..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/64-btrfs-dm.rules" +++ /dev/null @@ -1,10 +0,0 @@ -SUBSYSTEM!="block", GOTO="btrfs_end" -KERNEL!="dm-[0-9]*", GOTO="btrfs_end" -ACTION!="add|change", GOTO="btrfs_end" -ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end" - -# Once the device mapper symlink is created, tell btrfs about it -# so we get the friendly name in /proc/mounts (and tools that read it) -ENV{DM_NAME}=="?*", RUN{builtin}+="btrfs ready /dev/mapper/$env{DM_NAME}" - -LABEL="btrfs_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/64-btrfs.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/64-btrfs.rules" deleted file mode 100644 index 2c62d0cb08f3161bf6b92f26e6fc2bde66f68a6c..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/64-btrfs.rules" +++ /dev/null @@ -1,17 +0,0 @@ -# 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+="/usr/bin/udevadm trigger -s block -p ID_BTRFS_READY=0" - -LABEL="btrfs_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/64-md-raid-assembly.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/64-md-raid-assembly.rules" deleted file mode 100644 index d6138248807cd228881bc2520939d88e3533769c..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/64-md-raid-assembly.rules" +++ /dev/null @@ -1,38 +0,0 @@ -# do not edit this file, it will be overwritten on update - -# Don't process any events if anaconda is running as anaconda brings up -# raid devices manually -ENV{ANACONDA}=="?*", GOTO="md_inc_end" -# assemble md arrays - -SUBSYSTEM!="block", GOTO="md_inc_end" - -# skip non-initialized devices -ENV{SYSTEMD_READY}=="0", GOTO="md_inc_end" - -# handle potential components of arrays (the ones supported by md) -ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="md_inc" - -# "noiswmd" on kernel command line stops mdadm from handling -# "isw" (aka IMSM - Intel RAID). -# "nodmraid" on kernel command line stops mdadm from handling -# "isw" or "ddf". -IMPORT{cmdline}=="noiswmd" -IMPORT{cmdline}=="nodmraid" - -ENV{nodmraid}=="?*", GOTO="md_inc_end" -ENV{ID_FS_TYPE}=="ddf_raid_member", GOTO="md_inc" -ENV{noiswmd}=="?*", GOTO="md_inc_end" -ENV{ID_FS_TYPE}=="isw_raid_member", GOTO="md_inc" -GOTO="md_inc_end" - -LABEL="md_inc" - -# remember you can limit what gets auto/incrementally assembled by -# mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY' -ACTION=="add|change", IMPORT{program}=="/usr/sbin/mdadm --incremental --export $devnode --offroot $env{DEVLINKS}" -ACTION=="add|change", ENV{MD_STARTED}=="*unsafe*", ENV{MD_FOREIGN}=="no", ENV{SYSTEMD_WANTS}+="mdadm-last-resort@$env{MD_DEVICE}.timer" -ACTION=="remove", ENV{ID_PATH}=="?*", RUN+="/usr/sbin/mdadm -If $name --path $env{ID_PATH}" -ACTION=="remove", ENV{ID_PATH}!="?*", RUN+="/usr/sbin/mdadm -If $name" - -LABEL="md_inc_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/66-kpartx.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/66-kpartx.rules" deleted file mode 100644 index ea12ac41a218aa6f59cbee941eccfa7ec1e9d290..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/66-kpartx.rules" +++ /dev/null @@ -1,41 +0,0 @@ -# -# persistent links for device-mapper devices -# only hardware-backed device-mapper devices (ie multipath, dmraid, -# and kpartx) have meaningful persistent device names -# - -KERNEL!="dm-*", GOTO="kpartx_end" -ACTION!="add|change", GOTO="kpartx_end" -ENV{DM_UUID}!="?*", GOTO="kpartx_end" -ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="kpartx_end" - -# Create dm tables for partitions on multipath devices. -ENV{DM_UUID}!="mpath-?*", GOTO="mpath_kpartx_end" - -# DM_SUBSYSTEM_UDEV_FLAG1 is the "skip_kpartx" flag. -# For events not generated by libdevmapper, we need to fetch it from db: -# - "change" events with DM_ACTIVATION!="1" (e.g. partition table changes) -# - "add" events for which rules are not disabled ("coldplug" case) -ENV{DM_ACTIVATION}!="1", IMPORT{db}=="DM_SUBSYSTEM_UDEV_FLAG1" -ACTION=="add", IMPORT{db}=="DM_SUBSYSTEM_UDEV_FLAG1" -ENV{DM_SUBSYSTEM_UDEV_FLAG1}=="1", GOTO="mpath_kpartx_end" - -# 11-dm-mpath.rules sets MPATH_UNCHANGED for events that can be ignored. -ENV{MPATH_UNCHANGED}=="1", GOTO="mpath_kpartx_end" - -# Don't run kpartx now if we know it will fail or hang. -ENV{DM_SUSPENDED}=="1", GOTO="mpath_kpartx_end" -ENV{DM_NOSCAN}=="1", GOTO="mpath_kpartx_end" - -# Run kpartx -GOTO="run_kpartx" -LABEL="mpath_kpartx_end" - -## Code for other subsystems (non-multipath) could be placed here ## - -GOTO="kpartx_end" - -LABEL="run_kpartx" -RUN+="/sbin/kpartx -un /dev/$name" - -LABEL="kpartx_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/68-del-part-nodes.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/68-del-part-nodes.rules" deleted file mode 100644 index 0b3f12195fdd4adfa2e73cf9ae425b17b1ccfcbb..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/68-del-part-nodes.rules" +++ /dev/null @@ -1,33 +0,0 @@ -# These rules can delete partitions devnodes for slave devices -# for certain aggregate devices such as multipath. -# This is desirable to avoid confusion and keep the number -# of device nodes and symlinks within limits. -# -# This is done only once on the first "add" or "change" event for -# any given device. -# -# To suppress this, use the kernel parameter "dont_del_part_nodes", -# or create an udev rule file that sets ENV{DONT_DEL_PART_NODES}="1". - -SUBSYSTEM!="block", GOTO="end_del_part_nodes" -KERNEL!="sd*|dasd*", GOTO="end_del_part_nodes" -ACTION!="add|change", GOTO="end_del_part_nodes" -ENV{DEVTYPE}=="partition", GOTO="end_del_part_nodes" - -IMPORT{cmdline}=="dont_del_part_nodes" -ENV{dont_del_part_nodes}=="1", GOTO="end_del_part_nodes" -ENV{DONT_DEL_PART_NODES}=="1", GOTO="end_del_part_nodes" - -# dm-multipath -ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="del_part_nodes" - -# Other aggregate device types can be added here. - -GOTO="end_del_part_nodes" - -LABEL="del_part_nodes" -IMPORT{db}=="DM_DEL_PART_NODES" -ENV{DM_DEL_PART_NODES}!="1", ENV{DM_DEL_PART_NODES}="1", \ - RUN+="/usr/sbin/partx -d --nr 1-1024 $env{DEVNAME}" - -LABEL="end_del_part_nodes" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/69-dm-lvm.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/69-dm-lvm.rules" deleted file mode 100644 index 871ebd3668710f5a1b6db67f83f578c0aedd522c..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/69-dm-lvm.rules" +++ /dev/null @@ -1,83 +0,0 @@ -# This rule requires blkid to be called on block devices before so only devices -# used as LVM PVs are processed (ID_FS_TYPE="LVM2_member"). - -SUBSYSTEM!="block", GOTO="lvm_end" - - -ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="lvm_end" - -# Only process devices already marked as a PV - this requires blkid to be called before. -ENV{ID_FS_TYPE}!="LVM2_member", GOTO="lvm_end" -ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="lvm_end" -ACTION=="remove", GOTO="lvm_end" - -# Create /dev/disk/by-id/lvm-pv-uuid- symlink for each PV -ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-id/lvm-pv-uuid-$env{ID_FS_UUID_ENC}" - -# If the PV is a special device listed below, scan only if the device is -# properly activated. These devices are not usable after an ADD event, -# but they require an extra setup and they are ready after a CHANGE event. -# Also support coldplugging with ADD event but only if the device is already -# properly activated. -# This logic should be eventually moved to rules where those particular -# devices are processed primarily (MD and loop). - -# DM device: -KERNEL!="dm-[0-9]*", GOTO="next" -ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", ENV{DM_ACTIVATION}=="1", GOTO="lvm_scan" -GOTO="lvm_end" - -# MD device: -LABEL="next" -KERNEL!="md[0-9]*", GOTO="next" -IMPORT{db}=="LVM_MD_PV_ACTIVATED" -ACTION=="add", ENV{LVM_MD_PV_ACTIVATED}=="1", GOTO="lvm_scan" -ACTION=="change", ENV{LVM_MD_PV_ACTIVATED}!="1", TEST=="md/array_state", ENV{LVM_MD_PV_ACTIVATED}="1", GOTO="lvm_scan" -ACTION=="add", KERNEL=="md[0-9]*p[0-9]*", GOTO="lvm_scan" -ENV{LVM_MD_PV_ACTIVATED}!="1", ENV{SYSTEMD_READY}="0" -GOTO="lvm_end" - -# Loop device: -LABEL="next" -KERNEL!="loop[0-9]*", GOTO="next" -ACTION=="add", ENV{LVM_LOOP_PV_ACTIVATED}=="1", GOTO="lvm_scan" -ACTION=="change", ENV{LVM_LOOP_PV_ACTIVATED}!="1", TEST=="loop/backing_file", ENV{LVM_LOOP_PV_ACTIVATED}="1", GOTO="lvm_scan" -ENV{LVM_LOOP_PV_ACTIVATED}!="1", ENV{SYSTEMD_READY}="0" -GOTO="lvm_end" - -LABEL="next" -ACTION!="add", GOTO="lvm_end" - -LABEL="lvm_scan" - -ENV{SYSTEMD_READY}="1" - -# pvscan will check if this device completes a VG, -# i.e. all PVs in the VG are now present with the -# arrival of this PV. If so, it prints to stdout: -# LVM_VG_NAME_COMPLETE='foo' -# -# When the VG is complete it can be activated, so -# vgchange -aay is run. It is run via -# systemd since it can take longer to run than -# udev wants to block when processing rules. -# (if there are hundreds of LVs to activate, -# the vgchange can take many seconds.) -# -# pvscan only reads the single device specified, -# and uses temp files under /run/lvm to check if -# other PVs in the VG are present. -# -# If event_activation=0 in lvm.conf, this pvscan -# (using checkcomplete) will do nothing, so that -# no event-based autoactivation will be happen. -# -# TODO: adjust the output of vgchange -aay so that -# it's better suited to appearing in the journal. - -IMPORT{program}=="/usr/sbin/lvm pvscan --cache --listvg --checkcomplete --vgonline --udevoutput --journal=output $env{DEVNAME}" -# ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} lvm vgchange -aay --nohints $env{LVM_VG_NAME_COMPLETE}" -ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/sbin/lvm vgchange -aay --nohints $env{LVM_VG_NAME_COMPLETE}" -GOTO="lvm_end" - -LABEL="lvm_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/69-md-clustered-confirm-device.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/69-md-clustered-confirm-device.rules" deleted file mode 100644 index fcc2e23568a18118a46ffdcde42d50bf7230f568..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/69-md-clustered-confirm-device.rules" +++ /dev/null @@ -1,21 +0,0 @@ -# do not edit this file, it will be overwritten on update - -SUBSYSTEM!="block", GOTO="clustermd_end" - -# handle md arrays -KERNEL!="md*", GOTO="clustermd_end" -ENV{DEVTYPE}!="disk", GOTO="clustermd_end" -ACTION!="change", GOTO="clustermd_end" -ENV{EVENT}!="ADD_DEVICE", GOTO="clustermd_end" -ENV{DEVICE_UUID}!="?*", GOTO="clustermd_end" -ENV{RAID_DISK}!="?*", GOTO="clustermd_end" - -# Based on the received UUID, node confirms the device if -# it is found by blkid, otherwise the node reports it is -# missing. -PROGRAM="/usr/sbin/blkid -o device -t UUID_SUB=$env{DEVICE_UUID}", ENV{.md.newdevice} = "$result" - -ENV{.md.newdevice}!="", RUN+="/usr/sbin/mdadm --manage $env{DEVNAME} --cluster-confirm $env{RAID_DISK}:$env{.md.newdevice}" -ENV{.md.newdevice}=="", RUN+="/usr/sbin/mdadm --manage $env{DEVNAME} --cluster-confirm $env{RAID_DISK}:missing" - -LABEL="clustermd_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-camera.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-camera.rules" deleted file mode 100644 index e30db76a47e4ecc9c7c57afa70af5575d96c32d3..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-camera.rules" +++ /dev/null @@ -1,9 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-joystick.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-joystick.rules" deleted file mode 100644 index 2d436bd092e49ac3c2410ba24a9b9c6cde19d9e1..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-joystick.rules" +++ /dev/null @@ -1,12 +0,0 @@ -# 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::vp:name::* -KERNELS=="input*", ENV{ID_BUS}!="", \ - IMPORT{builtin}=="hwdb 'joystick:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \ - GOTO="joystick_end" - -LABEL="joystick_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-memory.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-memory.rules" deleted file mode 100644 index 88b3e81fa3fd740e2972153352f1b0ec92133eed..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-memory.rules" +++ /dev/null @@ -1,8 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-mouse.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-mouse.rules" deleted file mode 100644 index 69a983fb2e03dfb82d239af07b7c2504f4b97ad8..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-mouse.rules" +++ /dev/null @@ -1,18 +0,0 @@ -# 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::vp: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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-power-switch.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-power-switch.rules" deleted file mode 100644 index ff2f63db3ef88f0bf558f1fd73001c7e79e150de..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-power-switch.rules" +++ /dev/null @@ -1,6 +0,0 @@ -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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-touchpad.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-touchpad.rules" deleted file mode 100644 index e16c6cfb1b5d2ad8b46f9e7c15b3dde75a8605a2..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-touchpad.rules" +++ /dev/null @@ -1,13 +0,0 @@ -# do not edit this file, it will be overwritten on update - -ACTION=="remove", GOTO="touchpad_end" -ENV{ID_INPUT}=="", GOTO="touchpad_end" -ENV{ID_INPUT_TOUCHPAD}=="", GOTO="touchpad_end" -KERNEL!="event*", GOTO="touchpad_end" - -# touchpad::vp:name::* -KERNELS=="input*", ENV{ID_BUS}!="", \ - IMPORT{builtin}=="hwdb 'touchpad:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \ - GOTO="touchpad_end" - -LABEL="touchpad_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-uaccess.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-uaccess.rules" deleted file mode 100644 index e66a06340f1386714f2550d27772680c59e9fa23..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/70-uaccess.rules" +++ /dev/null @@ -1,83 +0,0 @@ -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" - -# 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" - -# 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" - -# 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" - -LABEL="uaccess_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/71-seat.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/71-seat.rules" deleted file mode 100644 index 68d8a93e3b9fb841e634d024186a594d560783a8..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/71-seat.rules" +++ /dev/null @@ -1,70 +0,0 @@ -ACTION=="remove", GOTO="seat_end" - -TAG=="uaccess", SUBSYSTEM!="sound", TAG+="seat" -SUBSYSTEM=="sound", KERNEL=="card*", TAG+="seat" -SUBSYSTEM=="input", KERNEL=="input*", 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 -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" - -# 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+="/usr/bin/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+="/usr/bin/loginctl lock-sessions" - -LABEL="seat_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/73-idrac.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/73-idrac.rules" deleted file mode 100644 index d67fc425b18008f7ea896a371a928aa59619d405..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/73-idrac.rules" +++ /dev/null @@ -1,6 +0,0 @@ -# do not edit this file, it will be overwritten on update - -# On Dell PowerEdge systems, the iDRAC7 and later support a USB Virtual NIC -# with terminates in the iDRAC. Help identify this with 'idrac' - -ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb", ATTRS{idVendor}=="413c", ATTRS{idProduct}=="a102", NAME="idrac" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/73-seat-late.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/73-seat-late.rules" deleted file mode 100644 index 8f88dce396e36e19f0694694f64d7afecb7f267c..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/73-seat-late.rules" +++ /dev/null @@ -1,9 +0,0 @@ -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}" -TAG=="uaccess", ENV{MAJOR}!="", RUN{builtin}+="uaccess" - -LABEL="seat_late_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/75-net-description.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/75-net-description.rules" deleted file mode 100644 index 14fd2eb285c588a27fc542cbbc468ad41a0a2897..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/75-net-description.rules" +++ /dev/null @@ -1,14 +0,0 @@ -# do not edit this file, it will be overwritten on update - -ACTION=="remove", GOTO="net_end" -SUBSYSTEM!="net", GOTO="net_end" - -IMPORT{builtin}=="net_id" - -SUBSYSTEMS=="usb", IMPORT{builtin}=="usb_id", IMPORT{builtin}=="hwdb --subsystem=usb" -SUBSYSTEMS=="usb", GOTO="net_end" - -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="net_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/75-probe_mtd.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/75-probe_mtd.rules" deleted file mode 100644 index e42f63e753901e3629175cfdcd72827e5f8257fb..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/75-probe_mtd.rules" +++ /dev/null @@ -1,7 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/75-rdma-description.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/75-rdma-description.rules" deleted file mode 100644 index 17fef0753b63fae9cfc5813b7efeb5e0affecb71..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/75-rdma-description.rules" +++ /dev/null @@ -1,43 +0,0 @@ -# This is a version of net-description.rules for /sys/class/infiniband devices - -ACTION=="remove", GOTO="rdma_description_end" -SUBSYSTEM!="infiniband", GOTO="rdma_description_end" - -# NOTE: DRIVERS searches up the sysfs path to find the driver that is bound to -# the PCI/etc device that the RDMA device is linked to. This is not the kernel -# driver that is supplying the RDMA device (eg as seen in ID_NET_DRIVER) - -# FIXME: with kernel support we could actually detect the protocols the RDMA -# driver itself supports, this is a work around for lack of that support. -# In future we could do this with a udev IMPORT{program} helper program -# that extracted the ID information from the RDMA netlink. - -# Hardware that supports InfiniBand -DRIVERS=="ib_mthca", ENV{ID_RDMA_INFINIBAND}="1" -DRIVERS=="mlx4_core", ENV{ID_RDMA_INFINIBAND}="1" -DRIVERS=="mlx5_core", ENV{ID_RDMA_INFINIBAND}="1" -DRIVERS=="ib_qib", ENV{ID_RDMA_INFINIBAND}="1" - -# Hardware that supports OPA -DRIVERS=="hfi1", ENV{ID_RDMA_OPA}="1" - -# Hardware that supports iWarp -DRIVERS=="cxgb4", ENV{ID_RDMA_IWARP}="1" -DRIVERS=="i40e", ENV{ID_RDMA_IWARP}="1" - -# Hardware that supports RoCE -DRIVERS=="be2net", ENV{ID_RDMA_ROCE}="1" -DRIVERS=="bnxt_en", ENV{ID_RDMA_ROCE}="1" -DRIVERS=="hns", ENV{ID_RDMA_ROCE}="1" -DRIVERS=="mlx4_core", ENV{ID_RDMA_ROCE}="1" -DRIVERS=="mlx5_core", ENV{ID_RDMA_ROCE}="1" -DRIVERS=="qede", ENV{ID_RDMA_ROCE}="1" -DRIVERS=="vmw_pvrdma", ENV{ID_RDMA_ROCE}="1" -DEVPATH=="*/infiniband/rxe*", ATTR{parent}=="*", ENV{ID_RDMA_ROCE}="1" - -# Setup the usual ID information so that systemd will display a sane name for -# the RDMA device units. -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="rdma_description_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/78-sound-card.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/78-sound-card.rules" deleted file mode 100644 index 1390dbc2feb0f36075b5b79f00e758428eaa69a8..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/78-sound-card.rules" +++ /dev/null @@ -1,96 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/80-drivers.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/80-drivers.rules" deleted file mode 100644 index 4bf942f3d70e03149af53f366bcddb0cc9320afb..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/80-drivers.rules" +++ /dev/null @@ -1,13 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/80-net-setup-link.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/80-net-setup-link.rules" deleted file mode 100644 index f80d23fb9f3e7e7bc9b1d70cbad2491521b9f84b..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/80-net-setup-link.rules" +++ /dev/null @@ -1,13 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/80-tpm-udev.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/80-tpm-udev.rules" deleted file mode 100644 index e023629ab5807fcc13416120e3cf62fa02581b27..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/80-tpm-udev.rules" +++ /dev/null @@ -1,4 +0,0 @@ -# tpm devices can only be accessed by the tss user but the tss -# group members can access tpmrm devices -KERNEL=="tpm[0-9]*", TAG+="systemd", MODE="0660", OWNER="tss" -KERNEL=="tpmrm[0-9]*", TAG+="systemd", MODE="0660", OWNER="tss", GROUP="tss" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/80-udisks2.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/80-udisks2.rules" deleted file mode 100644 index 0a5ba928fd5e2e0d091263d1a1cb2b09da4ea91d..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/80-udisks2.rules" +++ /dev/null @@ -1,187 +0,0 @@ -# This file contains udev rules for udisks 2.x -# -# Do not edit this file, it will be overwritten on updates -# - -# ------------------------------------------------------------------------ -# Probing -# ------------------------------------------------------------------------ - -# Skip probing if not a block device or if requested by other rules -# -SUBSYSTEM!="block", GOTO="udisks_probe_end" -ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="udisks_probe_end" -ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="?*", GOTO="udisks_probe_end" - -# MD-RAID (aka Linux Software RAID) members -# -# TODO: file bug against mdadm(8) to have --export-prefix option that can be used with e.g. UDISKS_MD_MEMBER -# -SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="raid", ENV{ID_FS_TYPE}=="linux_raid_member", ENV{UDISKS_MD_MEMBER_LEVEL}=="", IMPORT{program}=="/bin/sh -c '/sbin/mdadm --examine --export $tempnode | /bin/sed s/^MD_/UDISKS_MD_MEMBER_/g'" - -SUBSYSTEM=="block", KERNEL=="md*", ENV{DEVTYPE}!="partition", IMPORT{program}=="/bin/sh -c '/sbin/mdadm --detail --export $tempnode | /bin/sed s/^MD_/UDISKS_MD_/g'" - -LABEL="udisks_probe_end" - -# ------------------------------------------------------------------------ -# Tag floppy drives since they need special care - -# PC floppy drives -# -KERNEL=="fd*", ENV{ID_DRIVE_FLOPPY}="1" - -# USB floppy drives -# -SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="08", ATTRS{bInterfaceSubClass}=="04", ENV{ID_DRIVE_FLOPPY}="1" - -# ATA Zip drives -# -ENV{ID_VENDOR}=="*IOMEGA*", ENV{ID_MODEL}=="*ZIP*", ENV{ID_DRIVE_FLOPPY_ZIP}="1" - -# MMC/SD: import parent MMC_TYPE -KERNEL=="mmcblk[0-9]*", SUBSYSTEMS=="mmc", ENV{DEVTYPE}=="disk", IMPORT{parent}=="MMC_TYPE" -KERNEL=="mmcblk[0-9]*", SUBSYSTEMS=="mmc", ENV{DEVTYPE}=="disk", ENV{MMC_TYPE}=="MMC", ENV{ID_DRIVE_FLASH_MMC}="1", ENV{ID_DRIVE_MEDIA_FLASH_MMC}="1" -# TODO: figure out if the drive supports SD, SDHC or SDXC and what the current -# kind of media is - right now we just assume SD -KERNEL=="mmcblk[0-9]*", SUBSYSTEMS=="mmc", ENV{DEVTYPE}=="disk", ENV{MMC_TYPE}=="SD", ENV{ID_DRIVE_FLASH_SD}="1", ENV{ID_DRIVE_MEDIA_FLASH_SD}="1" -KERNEL=="mmcblk[0-9]*", SUBSYSTEMS=="mmc", ENV{DEVTYPE}=="disk", ENV{MMC_TYPE}=="SDIO", ENV{ID_DRIVE_FLASH_SDIO}="1", ENV{ID_DRIVE_MEDIA_FLASH_SDIO}="1" -KERNEL=="mmcblk[0-9]*", SUBSYSTEMS=="mmc", ENV{DEVTYPE}=="disk", ENV{MMC_TYPE}=="SDcombo", ENV{ID_DRIVE_FLASH_SD_COMBO}="1", ENV{ID_DRIVE_MEDIA_FLASH_SD}="1", ENV{ID_DRIVE_MEDIA_FLASH_SDIO}="1" -# compatibility fallback in case of an unavailable MMC_TYPE attr -KERNEL=="mmcblk[0-9]*", SUBSYSTEMS=="mmc", ENV{DEVTYPE}=="disk", ENV{MMC_TYPE}=="", ENV{ID_DRIVE_FLASH_SD}="1", ENV{ID_DRIVE_MEDIA_FLASH_SD}="1" -# import ID_SERIAL and related for "mmcblk_boot" devices from its parent -KERNEL=="mmcblk[0-9]boot[0-9]*", SUBSYSTEMS=="mmc", ENV{DEVTYPE}=="disk", IMPORT{parent}=="ID_*" -# ditto for memstick -KERNEL=="msblk[0-9]|mspblk[0-9]", SUBSYSTEMS=="memstick", ENV{DEVTYPE}=="disk", ENV{ID_DRIVE_FLASH_MS}="1", ENV{ID_DRIVE_MEDIA_FLASH_MS}="1" - -# TODO: maybe automatically convert udisks1 properties to udisks2 ones? -# (e.g. UDISKS_PRESENTATION_HIDE -> UDISKS_IGNORE) - -# ------------------------------------------------------------------------ -# ------------------------------------------------------------------------ -# ------------------------------------------------------------------------ -# Whitelist for tagging drives with the property media type. -# TODO: figure out where to store this database - -SUBSYSTEMS=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0248", ENV{ID_INSTANCE}=="0:0", ENV{ID_DRIVE_FLASH_CF}="1" -SUBSYSTEMS=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0248", ENV{ID_INSTANCE}=="0:1", ENV{ID_DRIVE_FLASH_MS}="1" -SUBSYSTEMS=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0248", ENV{ID_INSTANCE}=="0:2", ENV{ID_DRIVE_FLASH_SM}="1" -SUBSYSTEMS=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0248", ENV{ID_INSTANCE}=="0:3", ENV{ID_DRIVE_FLASH_SD}="1" - -SUBSYSTEMS=="usb", ATTRS{idVendor}=="05e3", ATTRS{idProduct}=="070e", ENV{ID_INSTANCE}=="0:0", ENV{ID_DRIVE_FLASH_CF}="1" -SUBSYSTEMS=="usb", ATTRS{idVendor}=="05e3", ATTRS{idProduct}=="070e", ENV{ID_INSTANCE}=="0:1", ENV{ID_DRIVE_FLASH_SM}="1" -SUBSYSTEMS=="usb", ATTRS{idVendor}=="05e3", ATTRS{idProduct}=="070e", ENV{ID_INSTANCE}=="0:2", ENV{ID_DRIVE_FLASH_SD}="1" -SUBSYSTEMS=="usb", ATTRS{idVendor}=="05e3", ATTRS{idProduct}=="070e", ENV{ID_INSTANCE}=="0:3", ENV{ID_DRIVE_FLASH_MS}="1" - -# APPLE SD Card Reader (MacbookPro5,4) -# -SUBSYSTEMS=="usb", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="8403", ENV{ID_DRIVE_FLASH_SD}="1" - -# Realtek card readers -DRIVERS=="rts_pstor", ENV{ID_DRIVE_FLASH_SD}="1" -DRIVERS=="rts5229", ENV{ID_DRIVE_FLASH_SD}="1" - -# Lexar Dual Slot USB 3.0 Reader Professional -SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="05dc",ENV{ID_MODEL_ID}=="b049", ENV{ID_INSTANCE}=="0:0", ENV{ID_DRIVE_FLASH_CF}="1" -SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="05dc",ENV{ID_MODEL_ID}=="b049", ENV{ID_INSTANCE}=="0:1", ENV{ID_DRIVE_FLASH_SD}="1" - -# Transcend USB 3.0 Multi-Card Reader (TS-RDF8K) -SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="8564",ENV{ID_MODEL_ID}=="4000", ENV{ID_INSTANCE}=="0:0", ENV{ID_DRIVE_FLASH_CF}="1" -SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="8564",ENV{ID_MODEL_ID}=="4000", ENV{ID_INSTANCE}=="0:1", ENV{ID_DRIVE_FLASH_SD}="1" -SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="8564",ENV{ID_MODEL_ID}=="4000", ENV{ID_INSTANCE}=="0:2", ENV{ID_DRIVE_FLASH_MS}="1" - -# Common theme -# -SUBSYSTEMS=="usb", ENV{ID_MODEL}=="*Reader*SD*", ENV{ID_DRIVE_FLASH_SD}="1" -SUBSYSTEMS=="usb", ENV{ID_MODEL}=="*CF_Reader*", ENV{ID_DRIVE_FLASH_CF}="1" -SUBSYSTEMS=="usb", ENV{ID_MODEL}=="*SM_Reader*", ENV{ID_DRIVE_FLASH_SM}="1" -SUBSYSTEMS=="usb", ENV{ID_MODEL}=="*MS_Reader*", ENV{ID_DRIVE_FLASH_MS}="1" - -# USB stick / thumb drives -# -SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="*Kingston*", ENV{ID_MODEL}=="*DataTraveler*", ENV{ID_DRIVE_THUMB}="1" -SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="*SanDisk*", ENV{ID_MODEL}=="*Cruzer*", ENV{ID_CDROM}!="1", ENV{ID_DRIVE_THUMB}="1" -SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="HP", ENV{ID_MODEL}=="*v125w*", ENV{ID_DRIVE_THUMB}="1" -SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="13fe", ENV{ID_MODEL}=="*Patriot*", ENV{ID_DRIVE_THUMB}="1" -SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="*JetFlash*", ENV{ID_MODEL}=="*Transcend*", ENV{ID_DRIVE_THUMB}="1" - -# SD-Card reader in Chromebook Pixel -SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="05e3", ENV{ID_MODEL_ID}=="0727", ENV{ID_DRIVE_FLASH_SD}="1" - -# ------------------------------------------------------------------------ -# ------------------------------------------------------------------------ -# ------------------------------------------------------------------------ -# Devices which should not be display in the user interface -# -# (note that RAID/LVM members are not normally shown in an user -# interface so setting UDISKS_IGNORE at first does not seem to achieve -# anything. However it helps for RAID/LVM members that are encrypted -# using LUKS. See bug #51439.) - -# Apple Bootstrap partitions -ENV{ID_PART_ENTRY_SCHEME}=="mac", ENV{ID_PART_ENTRY_TYPE}=="Apple_Bootstrap", ENV{UDISKS_IGNORE}="1" - -# Apple Boot partitions -ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_TYPE}=="426f6f74-0000-11aa-aa11-00306543ecac", ENV{UDISKS_IGNORE}="1" - -# special DOS partition types (EFI, hidden, etc.) and RAID/LVM -# see http://www.win.tue.nl/~aeb/partitions/partition_types-1.html -ENV{ID_PART_ENTRY_SCHEME}=="dos", \ - ENV{ID_PART_ENTRY_TYPE}=="0x0|0x11|0x12|0x14|0x16|0x17|0x1b|0x1c|0x1e|0x27|0x3d|0x84|0x8d|0x8e|0x90|0x91|0x92|0x93|0x97|0x98|0x9a|0x9b|0xbb|0xc2|0xc3|0xdd|0xef|0xfd", \ - ENV{UDISKS_IGNORE}="1" - -# special GUID-identified partition types (EFI System Partition, BIOS Boot partition, RAID/LVM) -# see http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs -ENV{ID_PART_ENTRY_SCHEME}=="gpt", \ - ENV{ID_PART_ENTRY_TYPE}=="c12a7328-f81f-11d2-ba4b-00a0c93ec93b|21686148-6449-6e6f-744e-656564454649|a19d880f-05fc-4d3b-a006-743f0f84911e|e6d6d379-f507-44c2-a23c-238f2a3df928|e3c9e316-0b5c-4db8-817d-f92df00215ae|de94bba4-06d1-4d40-a16a-bfd50179d6ac", \ - ENV{UDISKS_IGNORE}="1" - -# special Extended Boot Loader partition (XBOOTLDR) -# see https://systemd.io/BOOT_LOADER_SPECIFICATION/ -ENV{ID_PART_ENTRY_SCHEME}=="gpt", \ - ENV{ID_PART_ENTRY_TYPE}=="bc13c2ff-59e6-4262-a352-b275fd6f7172", \ - ENV{UDISKS_IGNORE}="1" - -# ZFS member partitions -ENV{ID_PART_ENTRY_SCHEME}=="gpt", \ - ENV{ID_FS_TYPE}=="zfs_member", ENV{ID_PART_ENTRY_TYPE}=="6a898cc3-1dd2-11b2-99a6-080020736631", \ - ENV{UDISKS_IGNORE}="1" - -# MAC recovery/tool partitions/devices which are useless on Linux -ENV{ID_PART_ENTRY_SCHEME}=="mac", \ - ENV{ID_CDROM}=="?*", ENV{ID_FS_TYPE}=="udf", ENV{ID_FS_LABEL}=="WD*SmartWare", \ - ENV{UDISKS_IGNORE}="1" -ENV{ID_PART_TABLE_TYPE}=="mac", \ - ENV{ID_CDROM}=="?*", ENV{ID_FS_TYPE}=="udf", ENV{ID_FS_LABEL}=="WD*SmartWare", \ - ENV{UDISKS_IGNORE}="1" - -# recovery partitions -ENV{ID_FS_TYPE}=="ntfs|vfat", \ - ENV{ID_FS_LABEL}=="Recovery|RECOVERY|Lenovo_Recovery|HP_RECOVERY|Recovery_Partition|DellUtility|DellRestore|IBM_SERVICE|SERVICEV001|SERVICEV002|SYSTEM_RESERVED|System_Reserved|WINRE_DRV|DIAGS|IntelRST", \ - ENV{UDISKS_IGNORE}="1" - -# read-only non-Linux software installer partitions -ENV{ID_VENDOR}=="Sony", ENV{ID_MODEL}=="PRS*Launcher", ENV{UDISKS_IGNORE}="1" - -# non-Linux software -KERNEL=="sr*", ENV{ID_VENDOR}=="SanDisk", ENV{ID_MODEL}=="Cruzer", ENV{ID_FS_LABEL}=="U3_System", ENV{UDISKS_IGNORE}="1" - -# Virtual Windows tools installation on Asus Zendisk (0b05:17b4) -KERNEL=="sr*", ENV{ID_VENDOR}=="ASMT",ENV{ID_MODEL}=="VirtualCDROM", ENV{ID_FS_LABEL}=="ASUS_+Speed_ZENDISK*", ENV{UDISKS_IGNORE}="1" - -# Virtual Windows tools installation CD on Nokia 7 Plus (2e04:c025) -KERNEL=="sr*", ENV{ID_VENDOR}=="Linux", ENV{ID_MODEL}=="File-CD_Gadget*", ENV{ID_FS_LABEL}=="CDROM*", ATTRS{manufacturer}=="HMD Global", ENV{UDISKS_IGNORE}="1" - -# Content created using isohybrid (typically used on CDs and USB -# sticks for bootable media) is a bit special insofar that the -# interesting content is on a DOS partition with type 0x00* ... which -# is hidden above. So undo this. -# -# See http://mjg59.dreamwidth.org/11285.html for more details -# -# *) This is true only for 64bit images. For 32bit images the type is 0x17 -# (Hidden HPFS/NTFS/exFAT). This is most likely a bug but we still need to -# stop ignoring these. -ENV{ID_PART_TABLE_TYPE}=="dos", ENV{ID_PART_ENTRY_TYPE}=="0x0|0x17", ENV{ID_PART_ENTRY_NUMBER}=="1|2", ENV{ID_FS_TYPE}=="iso9660|udf", ENV{UDISKS_IGNORE}="0" - -# Explicitly ignore ram block devices, they don't work with udev -KERNEL=="ram*", ENV{UDISKS_IGNORE}="1" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/81-net-dhcp.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/81-net-dhcp.rules" deleted file mode 100644 index 2ef25ba060e6c5fc46b218cde600d03b04ff19b1..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/81-net-dhcp.rules" +++ /dev/null @@ -1,14 +0,0 @@ -# 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" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/84-nm-drivers.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/84-nm-drivers.rules" deleted file mode 100644 index 519652acb60dcfa21347187f316f5ec869f84d76..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/84-nm-drivers.rules" +++ /dev/null @@ -1,12 +0,0 @@ -# Do not modify this file, it will get overwritten on updates. -# To override or extend the rules place a file in /etc/udev/rules.d - -SUBSYSTEM!="net", GOTO="nm_drivers_end" -ACTION!="add|change|move", GOTO="nm_drivers_end" - -# Determine ID_NET_DRIVER if there's no ID_NET_DRIVER or DRIVERS (old udev?) -ENV{ID_NET_DRIVER}=="?*", GOTO="nm_drivers_end" -# DRIVERS=="?*", GOTO="nm_drivers_end" -PROGRAM="/bin/sh -c '/usr/sbin/ethtool -i $$1 |/usr/bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", ENV{ID_NET_DRIVER}="%c" - -LABEL="nm_drivers_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/85-nm-unmanaged.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/85-nm-unmanaged.rules" deleted file mode 100644 index eae8d7ce1cd8f0c1e30094e54f87448535530f81..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/85-nm-unmanaged.rules" +++ /dev/null @@ -1,34 +0,0 @@ -# Do not modify this file, it will get overwritten on updates. -# To override or extend the rules place a file in /etc/udev/rules.d - -SUBSYSTEM!="net", GOTO="nm_unmanaged_end" -ACTION!="add|change|move", GOTO="nm_unmanaged_end" - -# VirtualBox host networking. Out-of-tree driver that looks like an ordinary -# Ethernet. No parent device (lives in /virtual/), no support for ethtool -# to identify the driver, MAC address defaults to 08:00:27:, but can be -# changed. Interface name will have to do, it's always vboxnet*. -ENV{INTERFACE}=="vboxnet[0-9]*", ENV{NM_UNMANAGED}="1" - -# VMWare host networking. Out-of-tree driver that looks like an ordinary -# Ethernet. No parent device (lives in /virtual/), no support for -# ethtool to identify the driver. They have their own MAC prefix that -# can not be changed. -ATTR{address}=="00:50:56:*", ENV{INTERFACE}=="vmnet[0-9]*", ENV{NM_UNMANAGED}="1" - -# Parallels Workstation host networking. Out-of-tree driver that looks like -# an ordinary Ethernet. No parent device (lives in /virtual/), no support for -# ethtool to identify the driver and the interface name is too generic. -# However, they have their own MAC prefix that can not be changed. -ATTR{address}=="00:1c:42:*", ENV{INTERFACE}=="vnic[0-9]*", ENV{NM_UNMANAGED}="1" - -# Virtual Ethernet device pair. Often used to communicate with a peer interface -# in another net namespace and managed by libvirt, Docker or the like. -ENV{ID_NET_DRIVER}=="veth", ENV{NM_UNMANAGED}="1" - -# USB gadget device. Unmanage by default, since whatever created it -# might want to set it up itself (e.g. activate an ipv4.method=shared -# connection). -ENV{DEVTYPE}=="gadget", ENV{NM_UNMANAGED}="1" - -LABEL="nm_unmanaged_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-iprutils.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-iprutils.rules" deleted file mode 100644 index 1bb5a4a6eef8b43bedcf2e23f35703c97b28398e..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-iprutils.rules" +++ /dev/null @@ -1 +0,0 @@ -DRIVERS=="ipr", TAG+="systemd", ENV{SYSTEMD_WANTS}+="iprutils.target" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-iwpmd.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-iwpmd.rules" deleted file mode 100644 index 5b22cceaf29f8c9e7632fdd85a24df123d867a7e..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-iwpmd.rules" +++ /dev/null @@ -1 +0,0 @@ -TAG+="systemd", ENV{ID_RDMA_IWARP}=="1", ENV{SYSTEMD_WANTS}+="iwpmd.service" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-nm-thunderbolt.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-nm-thunderbolt.rules" deleted file mode 100644 index be105fd414a9ff3d34e70eeb2ac187e4751aa77e..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-nm-thunderbolt.rules" +++ /dev/null @@ -1,13 +0,0 @@ -# Do not modify this file, it will get overwritten on updates. -# To override or extend the rules place a file in /etc/udev/rules.d - -ACTION!="add|change|move", GOTO="nm_thunderbolt_end" - -# Load he thunderbolt-net driver if we a device of type thunderbolt_xdomain -# is added. -SUBSYSTEM=="thunderbolt", ENV{DEVTYPE}=="thunderbolt_xdomain", RUN{builtin}+="kmod load thunderbolt-net" - -# For all thunderbolt network devices, we want to enable link-local configuration -SUBSYSTEM=="net", ENV{ID_NET_DRIVER}=="thunderbolt-net", ENV{NM_AUTO_DEFAULT_LINK_LOCAL_ONLY}="1" - -LABEL="nm_thunderbolt_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-rdma-hw-modules.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-rdma-hw-modules.rules" deleted file mode 100644 index 95eaf72067024eeacdc60bffe402044989e96a2d..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-rdma-hw-modules.rules" +++ /dev/null @@ -1,46 +0,0 @@ -ACTION=="remove", GOTO="rdma_hw_modules_end" - -SUBSYSTEM!="net", GOTO="rdma_hw_modules_net_end" -# For Ethernet cards with RoCE support -# Automatically load RDMA specific kernel modules when a multi-function device is installed -# These drivers autoload an ethernet driver based on hardware detection and -# need userspace to load the module that has their RDMA component to turn on -# RDMA. - -ENV{ID_NET_DRIVER}=="be2net", RUN{builtin}+="kmod load ocrdma" -ENV{ID_NET_DRIVER}=="bnxt_en", RUN{builtin}+="kmod load bnxt_re" -ENV{ID_NET_DRIVER}=="cxgb4", RUN{builtin}+="kmod load iw_cxgb4" -ENV{ID_NET_DRIVER}=="hns", RUN{builtin}+="kmod load hns_roce" -ENV{ID_NET_DRIVER}=="i40e", RUN{builtin}+="kmod load i40iw" -ENV{ID_NET_DRIVER}=="mlx4_en", RUN{builtin}+="kmod load mlx4_ib" -ENV{ID_NET_DRIVER}=="mlx5_core", RUN{builtin}+="kmod load mlx5_ib" -ENV{ID_NET_DRIVER}=="qede", RUN{builtin}+="kmod load qedr" - -# The user must explicitly load these modules via /etc/modules-load.d/ or otherwise -# rxe - -# enic no longer has a userspace verbs driver, this rule should probably be -# owned by libfabric -ENV{ID_NET_DRIVER}=="enic", RUN{builtin}+="kmod load usnic_verbs" - -# These providers are single function and autoload RDMA automatically based on -# PCI probing -# hfi1verbs -# ipathverbs -# mthca -# vmw_pvrdma - -LABEL="rdma_hw_modules_net_end" - -SUBSYSTEM!="pci", GOTO="rdma_hw_modules_pci_end" -# For InfiniBand cards -# Normally the request_module inside the driver will trigger this, but in case that fails due to -# missing modules in the initrd, trigger it again. HW that doesn't create a netdevice will not -# trigger the net based rules above. - -ENV{DRIVER}=="mlx4_core", RUN{builtin}+="kmod load mlx4_ib" -ENV{DRIVER}=="mlx5_core", RUN{builtin}+="kmod load mlx5_ib" - -LABEL="rdma_hw_modules_pci_end" - -LABEL="rdma_hw_modules_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-rdma-ulp-modules.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-rdma-ulp-modules.rules" deleted file mode 100644 index fbd195a2c0b3e8b2e4978a5cf85b02874189c848..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-rdma-ulp-modules.rules" +++ /dev/null @@ -1,11 +0,0 @@ -ACTION=="remove", GOTO="rdma_ulp_modules_end" -SUBSYSTEM!="infiniband", GOTO="rdma_ulp_modules_end" - -# Automatically load general RDMA ULP modules when RDMA hardware is installed -TAG+="systemd", ENV{SYSTEMD_WANTS}+="rdma-hw.target" -TAG+="systemd", ENV{ID_RDMA_INFINIBAND}=="1", ENV{SYSTEMD_WANTS}+="rdma-load-modules@infiniband.service" -TAG+="systemd", ENV{ID_RDMA_IWARP}=="1", ENV{SYSTEMD_WANTS}+="rdma-load-modules@iwarp.service" -TAG+="systemd", ENV{ID_RDMA_OPA}=="1", ENV{SYSTEMD_WANTS}+="rdma-load-modules@opa.service" -TAG+="systemd", ENV{ID_RDMA_ROCE}=="1", ENV{SYSTEMD_WANTS}+="rdma-load-modules@roce.service" - -LABEL="rdma_ulp_modules_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-rdma-umad.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-rdma-umad.rules" deleted file mode 100644 index ba7ee613815a7d403f7926e414b91158110796c5..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-rdma-umad.rules" +++ /dev/null @@ -1 +0,0 @@ -SUBSYSTEM=="infiniband_mad", KERNEL=="*umad*", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/rdma/devices/$attr{ibdev}:$attr{port}/umad" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-vconsole.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-vconsole.rules" deleted file mode 100644 index 2e6165411e70a852f5333a3d8ba7ba6967f3c14c..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/90-vconsole.rules" +++ /dev/null @@ -1,3 +0,0 @@ -# Each vtcon keeps its own state of fonts. -# -# ACTION=="add", SUBSYSTEM=="vtconsole", KERNEL=="vtcon*", RUN+="/usr/lib/systemd/systemd-vconsole-setup" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/91-drm-modeset.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/91-drm-modeset.rules" deleted file mode 100644 index f1bb5ecec6a5cc6e239bcee0f9877a5435667b10..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/91-drm-modeset.rules" +++ /dev/null @@ -1 +0,0 @@ -KERNEL=="controlD[0-9]*", SUBSYSTEM=="drm", MODE="0600" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/95-dm-notify.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/95-dm-notify.rules" deleted file mode 100644 index d30e4b4f00969f02599df95ecbb185979a7d1420..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/95-dm-notify.rules" +++ /dev/null @@ -1,8 +0,0 @@ -# Udev rules for device-mapper devices. -# -# These rules are responsible for sending a notification to a process -# waiting for completion of udev rules. The process is identified by -# a cookie value sent within "change" and "remove" events (the cookie -# value is set before by that process for every action requested). - -ENV{DM_COOKIE}=="?*", RUN+="/usr/sbin/dmsetup udevcomplete $env{DM_COOKIE}" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/96-e2scrub.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/96-e2scrub.rules" deleted file mode 100644 index b6dc30b760ac39a66644ecd1f26ea74cf9398466..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/96-e2scrub.rules" +++ /dev/null @@ -1,2 +0,0 @@ -# Try to hide our fsck snapshots from udev's /dev/disk linking... -ACTION=="add|change", ENV{DM_LV_NAME}=="*.e2scrub", ENV{UDISKS_IGNORE}="1", OPTIONS="link_priority=-100" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/98-kexec.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/98-kexec.rules" deleted file mode 100644 index 8db8946a27d1447c544237523130a6610c99e48b..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/98-kexec.rules" +++ /dev/null @@ -1,18 +0,0 @@ -SUBSYSTEM=="cpu", ACTION=="add", GOTO="kdump_reload" -SUBSYSTEM=="cpu", ACTION=="remove", GOTO="kdump_reload" -SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload" -SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload" - -GOTO="kdump_reload_end" - -LABEL="kdump_reload" - -# If kdump is not loaded, calling kdump-udev-throttle will end up -# doing nothing, but systemd-run will always generate extra logs for -# each call, so trigger the kdump-udev-throttler only if kdump -# service is active to avoid unnecessary logs -#RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; /usr/bin/systemd-run --quiet --no-block /usr/lib/udev/kdump-udev-throttler'" - -RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; /usr/lib/udev/kdump-udev-throttler'" - -LABEL="kdump_reload_end" diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/99-systemd.rules" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/99-systemd.rules" deleted file mode 100644 index 53d8a6af265178a993e9954d7aa61d9f93cbf8c9..0000000000000000000000000000000000000000 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/rules.d/99-systemd.rules" +++ /dev/null @@ -1,75 +0,0 @@ -# -#ACTION=="remove", GOTO="systemd_end" -# -#SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*", TAG+="systemd" -#KERNEL=="vport*", TAG+="systemd" -# -#SUBSYSTEM=="ubi", TAG+="systemd" -# -#SUBSYSTEM=="block", TAG+="systemd" -# -## We can't make any conclusions about suspended DM devices so let's just import previous SYSTEMD_READY state and skip other rules -#SUBSYSTEM=="block", ENV{DM_SUSPENDED}=="1", IMPORT{db}=="SYSTEMD_READY", GOTO="systemd_end" -#SUBSYSTEM=="block", ACTION=="add", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0" -# -## Ignore encrypted devices with no identified superblock on it, since -## we are probably still calling mke2fs or mkswap on it. -#SUBSYSTEM=="block", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0" -# -## Explicitly set SYSTEMD_READY=1 for DM devices that don't have it set yet, so that we always have something to import above -#SUBSYSTEM=="block", ENV{DM_UUID}=="?*", ENV{SYSTEMD_READY}=="", ENV{SYSTEMD_READY}="1" -# -## add symlink to GPT root disk -#SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT}=="1", ENV{ID_FS_TYPE}!="crypto_LUKS", SYMLINK+="gpt-auto-root" -#SUBSYSTEM=="block", ENV{ID_PART_GPT_AUTO_ROOT}=="1", ENV{ID_FS_TYPE}=="crypto_LUKS", SYMLINK+="gpt-auto-root-luks" -#SUBSYSTEM=="block", ENV{DM_UUID}=="CRYPT-*", ENV{DM_NAME}=="root", SYMLINK+="gpt-auto-root" -# -## Ignore raid devices that are not yet assembled and started -#SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0" -#SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0" -# -## Ignore loop devices that don't have any file attached -#SUBSYSTEM=="block", KERNEL=="loop[0-9]*", ENV{DEVTYPE}=="disk", TEST!="loop/backing_file", ENV{SYSTEMD_READY}="0" -# -## Ignore nbd devices until the PID file exists (which signals a connected device) -#SUBSYSTEM=="block", KERNEL=="nbd*", ENV{DEVTYPE}=="disk", TEST!="pid", ENV{SYSTEMD_READY}="0" -# -## We need a hardware independent way to identify network devices. We -## use the /sys/subsystem/ path for this. Kernel "bus" and "class" names -## should be treated as one namespace, like udev handles it. This is mostly -## just an identification string for systemd, so whether the path actually is -## accessible or not does not matter as long as it is unique and in the -## filesystem namespace. -# -#SUBSYSTEM=="net", KERNEL!="lo", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/subsystem/net/devices/$name" -#SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/subsystem/bluetooth/devices/%k", \ -# ENV{SYSTEMD_WANTS}+="bluetooth.target", ENV{SYSTEMD_USER_WANTS}+="bluetooth.target" -# -#ENV{ID_SMARTCARD_READER}=="?*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="smartcard.target", ENV{SYSTEMD_USER_WANTS}+="smartcard.target" -#SUBSYSTEM=="sound", KERNEL=="controlC*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sound.target", ENV{SYSTEMD_USER_WANTS}+="sound.target" -# -#SUBSYSTEM=="printer", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target", ENV{SYSTEMD_USER_WANTS}+="printer.target" -#SUBSYSTEM=="usb", KERNEL=="lp*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target", ENV{SYSTEMD_USER_WANTS}+="printer.target" -#SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target", ENV{SYSTEMD_USER_WANTS}+="printer.target" -# -#SUBSYSTEM=="udc", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="usb-gadget.target" -# -## Apply sysctl variables to network devices (and only to those) as they appear. -#ACTION=="add", SUBSYSTEM=="net", KERNEL!="lo", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/$name --prefix=/net/ipv4/neigh/$name --prefix=/net/ipv6/conf/$name --prefix=/net/ipv6/neigh/$name" -# -## Pull in backlight save/restore for all backlight devices and -## keyboard backlights -#SUBSYSTEM=="backlight", TAG+="systemd", IMPORT{builtin}=="path_id", ENV{SYSTEMD_WANTS}+="systemd-backlight@backlight:$name.service" -#SUBSYSTEM=="leds", KERNEL=="*kbd_backlight", TAG+="systemd", IMPORT{builtin}=="path_id", ENV{SYSTEMD_WANTS}+="systemd-backlight@leds:$name.service" -# -## Pull in rfkill save/restore for all rfkill devices -#SUBSYSTEM=="rfkill", ENV{SYSTEMD_RFKILL}="1" -#SUBSYSTEM=="rfkill", IMPORT{builtin}=="path_id" -#SUBSYSTEM=="misc", KERNEL=="rfkill", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-rfkill.socket" -# -## Asynchronously mount file systems implemented by these modules as soon as they are loaded. -#SUBSYSTEM=="module", KERNEL=="fuse", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-fs-fuse-connections.mount" -#SUBSYSTEM=="module", KERNEL=="configfs", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-kernel-config.mount" -# -#LABEL="systemd_end" -# diff --git "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/uninstall_devmaster.sh" "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/uninstall_devmaster.sh" index 3a8030f27e1c91815e9ebd030c569596eedda57a..23367c1d9eac7d9d74cc8d9869eee50967a78e4f 100644 --- "a/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/uninstall_devmaster.sh" +++ "b/docs/use/devmaster\346\233\277\344\273\243udev\350\277\220\350\241\214/uninstall_devmaster.sh" @@ -8,7 +8,8 @@ etc_netconf_install_dir=${etc_conf_install_dir}/network.d etc_rules_install_dir=${etc_conf_install_dir}/rules.d lib_devmaster_dir=/lib/devmaster -lib_rules_install_dir=${lib_devmaster_dir}/rules.d + +dracut_modules=/lib/dracut/modules.d/95devmaster service_install_dir=/lib/sysmaster/system sysinit_target_dir=/etc/sysmaster/system/sysinit.target.wants @@ -21,6 +22,6 @@ done unlink ${sysinit_target_dir}/devmaster.service unlink ${multi_user_target_dir}/devctl-trigger.service -rm -rf ${lib_devmaster_dir} ${etc_conf_install_dir} +rm -rf ${lib_devmaster_dir} ${etc_conf_install_dir} ${dracut_modules} sync diff --git a/exts/devmaster/config/config.toml b/exts/devmaster/config/config.toml index 8685e072c8c812b34ac59c262c563783ed05e231..ba5ac05a1b61bde92ddc6458486689cdbc5d3d67 100644 --- a/exts/devmaster/config/config.toml +++ b/exts/devmaster/config/config.toml @@ -5,7 +5,12 @@ log_level = "error" # Support multiple rules directories. -rules_d = ["/etc/devmaster/rules.d", "/lib/devmaster/rules.d"] +rules_d = [ + "/etc/udev/rules.d", + "/lib/udev/rules.d", + "/etc/devmaster/rules.d", + "/lib/devmaster/rules.d", +] # Support multiple network interface configuration directories. network_d = ["/etc/devmaster/network.d"] diff --git a/exts/devmaster/dracut_modules/95devmaster/init.sh b/exts/devmaster/dracut_modules/95devmaster/init.sh new file mode 100755 index 0000000000000000000000000000000000000000..8fcbf48ae5d80d7aca4cbecb8327b9c246e0ad56 --- /dev/null +++ b/exts/devmaster/dracut_modules/95devmaster/init.sh @@ -0,0 +1,407 @@ +#!/bin/sh +# +# Licensed under the GPLv2 +# +# Copyright 2008-2010, Red Hat, Inc. +# Harald Hoyer +# Jeremy Katz + +export -p > /tmp/export.orig + +NEWROOT="/sysroot" +[ -d $NEWROOT ] || mkdir -p -m 0755 $NEWROOT + +OLDPATH=$PATH +PATH=/usr/sbin:/usr/bin:/sbin:/bin +export PATH + +# mount some important things +if [ ! -d /proc/self ]; then + if ! mount -t proc -o nosuid,noexec,nodev proc /proc > /dev/null; then + echo "Cannot mount proc on /proc! Compile the kernel with CONFIG_PROC_FS!" + exit 1 + fi +fi + +if [ ! -d /sys/kernel ]; then + if ! mount -t sysfs -o nosuid,noexec,nodev sysfs /sys > /dev/null; then + echo "Cannot mount sysfs on /sys! Compile the kernel with CONFIG_SYSFS!" + exit 1 + fi +fi + +RD_DEBUG="" +. /lib/dracut-lib.sh + +setdebug + +if ! ismounted /dev; then + mount -t devtmpfs -o mode=0755,noexec,nosuid,strictatime devtmpfs /dev > /dev/null +fi + +if ! ismounted /dev; then + echo "Cannot mount devtmpfs on /dev! Compile the kernel with CONFIG_DEVTMPFS!" + exit 1 +fi + +# prepare the /dev directory +[ ! -h /dev/fd ] && ln -s /proc/self/fd /dev/fd > /dev/null 2>&1 +[ ! -h /dev/stdin ] && ln -s /proc/self/fd/0 /dev/stdin > /dev/null 2>&1 +[ ! -h /dev/stdout ] && ln -s /proc/self/fd/1 /dev/stdout > /dev/null 2>&1 +[ ! -h /dev/stderr ] && ln -s /proc/self/fd/2 /dev/stderr > /dev/null 2>&1 + +if ! ismounted /dev/pts; then + mkdir -m 0755 -p /dev/pts + mount -t devpts -o gid=5,mode=620,noexec,nosuid devpts /dev/pts > /dev/null +fi + +if ! ismounted /dev/shm; then + mkdir -m 0755 -p /dev/shm + mount -t tmpfs -o mode=1777,noexec,nosuid,nodev,strictatime tmpfs /dev/shm > /dev/null +fi + +if ! ismounted /run; then + mkdir -m 0755 -p /newrun + if ! str_starts "$(readlink -f /bin/sh)" "/run/"; then + mount -t tmpfs -o mode=0755,noexec,nosuid,nodev,strictatime tmpfs /newrun > /dev/null + else + # the initramfs binaries are located in /run, so don't mount it with noexec + mount -t tmpfs -o mode=0755,nosuid,nodev,strictatime tmpfs /newrun > /dev/null + fi + cp -a /run/* /newrun > /dev/null 2>&1 + mount --move /newrun /run + rm -fr -- /newrun +fi + +if command -v kmod > /dev/null 2> /dev/null; then + kmod static-nodes --format=tmpfiles 2> /dev/null \ + | while read -r type file mode _ _ _ majmin || [ -n "$type" ]; do + type=${type%\!} + case $type in + d) + mkdir -m "$mode" -p "$file" + ;; + c) + mknod -m "$mode" "$file" "$type" "${majmin%:*}" "${majmin#*:}" + ;; + esac + done +fi + +trap "emergency_shell Signal caught!" 0 + +export UDEVRULESD=/run/udev/rules.d +[ -d /run/udev ] || mkdir -p -m 0755 /run/udev +[ -d "$UDEVRULESD" ] || mkdir -p -m 0755 "$UDEVRULESD" + +if [ "$RD_DEBUG" = "yes" ]; then + mkfifo /run/initramfs/loginit.pipe + loginit "$DRACUT_QUIET" < /run/initramfs/loginit.pipe > /dev/console 2>&1 & + exec > /run/initramfs/loginit.pipe 2>&1 +else + exec 0<> /dev/console 1<> /dev/console 2<> /dev/console +fi + +[ -f /usr/lib/initrd-release ] && . /usr/lib/initrd-release +[ -n "$VERSION_ID" ] && info "$NAME-$VERSION_ID" + +source_conf /etc/conf.d + +if getarg "rd.cmdline=ask"; then + echo "Enter additional kernel command line parameter (end with ctrl-d or .)" + while read -r -p "> " ${BASH:+-e} line || [ -n "$line" ]; do + [ "$line" = "." ] && break + echo "$line" >> /etc/cmdline.d/99-cmdline-ask.conf + done +fi + +if ! getargbool 1 'rd.hostonly'; then + [ -f /etc/cmdline.d/99-cmdline-ask.conf ] && mv /etc/cmdline.d/99-cmdline-ask.conf /tmp/99-cmdline-ask.conf + remove_hostonly_files + [ -f /tmp/99-cmdline-ask.conf ] && mv /tmp/99-cmdline-ask.conf /etc/cmdline.d/99-cmdline-ask.conf +fi + +# run scriptlets to parse the command line +make_trace_mem "hook cmdline" '1+:mem' '1+:iomem' '3+:slab' +getarg 'rd.break=cmdline' -d 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline" +source_hook cmdline + +[ -z "$root" ] && die "No or empty root= argument" +[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" + +export root rflags fstype netroot NEWROOT + +# pre-udev scripts run before udev starts, and are run only once. +make_trace_mem "hook pre-udev" '1:shortmem' '2+:mem' '3+:slab' +getarg 'rd.break=pre-udev' -d 'rdbreak=pre-udev' && emergency_shell -n pre-udev "Break before pre-udev" +source_hook pre-udev + +UDEV_LOG=err +getargbool 0 rd.udev.info -d -y rdudevinfo && UDEV_LOG=info +getargbool 0 rd.udev.debug -d -y rdudevdebug && UDEV_LOG=debug + +# create /run/udev symlink +source /lib/devmaster/simulate_udev.sh + +# start up udev and trigger cold plugs +# UDEV_LOG=$UDEV_LOG "$systemdutildir"/systemd-udevd --daemon --resolve-names=never +/lib/devmaster/devmaster & + +UDEV_QUEUE_EMPTY="udevadm settle --timeout=0" + +# udevproperty "hookdir=$hookdir" + +make_trace_mem "hook pre-trigger" '1:shortmem' '2+:mem' '3+:slab' +getarg 'rd.break=pre-trigger' -d 'rdbreak=pre-trigger' && emergency_shell -n pre-trigger "Break before pre-trigger" +source_hook pre-trigger + +# devctl does not support reload +# udevadm control --reload > /dev/null 2>&1 || : +udevadm control --exit +/lib/devmaster/devmaster & + +# then the rest +udevadm trigger --type=subsystems --action=add > /dev/null 2>&1 +udevadm trigger --type=devices --action=add > /dev/null 2>&1 + +make_trace_mem "hook initqueue" '1:shortmem' '2+:mem' '3+:slab' +getarg 'rd.break=initqueue' -d 'rdbreak=initqueue' && emergency_shell -n initqueue "Break before initqueue" + +RDRETRY=$(getarg rd.retry -d 'rd_retry=') +RDRETRY=${RDRETRY:-180} +RDRETRY=$((RDRETRY * 2)) +export RDRETRY +main_loop=0 +export main_loop +while :; do + + check_finished && break + + udevsettle + + check_finished && break + + if [ -f "$hookdir"/initqueue/work ]; then + rm -f -- "$hookdir"/initqueue/work + fi + + for job in "$hookdir"/initqueue/*.sh; do + [ -e "$job" ] || break + # shellcheck disable=SC2097 disable=SC1090 disable=SC2098 + job=$job . "$job" + check_finished && break 2 + done + + $UDEV_QUEUE_EMPTY > /dev/null 2>&1 || continue + + for job in "$hookdir"/initqueue/settled/*.sh; do + [ -e "$job" ] || break + # shellcheck disable=SC2097 disable=SC1090 disable=SC2098 + job=$job . "$job" + check_finished && break 2 + done + + $UDEV_QUEUE_EMPTY > /dev/null 2>&1 || continue + + # no more udev jobs and queues empty. + sleep 0.5 + + if [ $main_loop -gt $((2 * RDRETRY / 3)) ]; then + for job in "$hookdir"/initqueue/timeout/*.sh; do + [ -e "$job" ] || break + # shellcheck disable=SC2097 disable=SC1090 disable=SC2098 + job=$job . "$job" + udevadm settle --timeout=0 > /dev/null 2>&1 || main_loop=0 + [ -f "$hookdir"/initqueue/work ] && main_loop=0 + done + fi + + main_loop=$((main_loop + 1)) + [ $main_loop -gt $RDRETRY ] \ + && { + flock -s 9 + emergency_shell "Could not boot." + } 9> /.console_lock +done +unset job +unset queuetriggered +unset main_loop +unset RDRETRY + +# pre-mount happens before we try to mount the root filesystem, +# and happens once. +make_trace_mem "hook pre-mount" '1:shortmem' '2+:mem' '3+:slab' +getarg 'rd.break=pre-mount' -d 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break before pre-mount" +source_hook pre-mount + +getarg 'rd.break=mount' -d 'rdbreak=mount' && emergency_shell -n mount "Break before mount" +# mount scripts actually try to mount the root filesystem, and may +# be sourced any number of times. As soon as one succeeds, no more are sourced. +_i_mount=0 +while :; do + if ismounted "$NEWROOT"; then + usable_root "$NEWROOT" && break + umount "$NEWROOT" + fi + for f in "$hookdir"/mount/*.sh; do + # shellcheck disable=SC1090 + [ -f "$f" ] && . "$f" + if ismounted "$NEWROOT"; then + usable_root "$NEWROOT" && break + warn "$NEWROOT has no proper rootfs layout, ignoring and removing offending mount hook" + umount "$NEWROOT" + rm -f -- "$f" + fi + done + + _i_mount=$((_i_mount + 1)) + [ $_i_mount -gt 20 ] \ + && { + flock -s 9 + emergency_shell "Can't mount root filesystem" + } 9> /.console_lock +done + +{ + printf "Mounted root filesystem " + while read -r dev mp _ || [ -n "$dev" ]; do [ "$mp" = "$NEWROOT" ] && echo "$dev"; done < /proc/mounts +} | vinfo + +# pre pivot scripts are sourced just before we doing cleanup and switch over +# to the new root. +make_trace_mem "hook pre-pivot" '1:shortmem' '2+:mem' '3+:slab' +getarg 'rd.break=pre-pivot' -d 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot "Break before pre-pivot" +source_hook pre-pivot + +make_trace_mem "hook cleanup" '1:shortmem' '2+:mem' '3+:slab' +# pre pivot cleanup scripts are sourced just before we switch over to the new root. +getarg 'rd.break=cleanup' -d 'rdbreak=cleanup' && emergency_shell -n cleanup "Break before cleanup" +source_hook cleanup + +# By the time we get here, the root filesystem should be mounted. +# Try to find init. +for i in "$(getarg real_init=)" "$(getarg init=)" $(getargs rd.distroinit=) /sbin/init; do + [ -n "$i" ] || continue + + __p="${NEWROOT}/${i}" + if [ -h "$__p" ]; then + # relative links need to be left alone, + # while absolute links need to be resolved and prefixed. + __pt=$(readlink "$__p") + [ "${__pt#/}" = "$__pt" ] || __p="${NEWROOT}/$__pt" + fi + if [ -x "$__p" ]; then + INIT="$i" + break + fi +done + +[ "$INIT" ] || { + echo "Cannot find init!" + echo "Please check to make sure you passed a valid root filesystem!" + emergency_shell +} + +udevadm control --exit +udevadm info --cleanup-db + +debug_off # Turn off debugging for this section + +CAPSH=$(command -v capsh) +SWITCH_ROOT=$(command -v switch_root) + +# unexport some vars +export_n root rflags fstype netroot NEWROOT +unset CMDLINE + +# Clean up the environment +for i in $(export -p); do + i=${i#declare -x} + i=${i#export} + strstr "$i" "=" || continue + i=${i%%=*} + [ -z "$i" ] && continue + case $i in + root | PATH | HOME | TERM | PS4 | RD_*) + : + ;; + *) + unset "$i" + ;; + esac +done +. /tmp/export.orig 2> /dev/null || : +rm -f -- /tmp/export.orig + +initargs="" +read -r CLINE < /proc/cmdline +if getarg init= > /dev/null; then + ignoreargs="console BOOT_IMAGE" + # only pass arguments after init= to the init + CLINE=${CLINE#*init=} + # shellcheck disable=SC2086 + set -- $CLINE + shift # clear out the rest of the "init=" arg + for x in "$@"; do + for s in $ignoreargs; do + [ "${x%%=*}" = "$s" ] && continue 2 + done + initargs="$initargs $x" + done + unset CLINE +else + debug_off # Turn off debugging for this section + # shellcheck disable=SC2086 + set -- $CLINE + for x in "$@"; do + case "$x" in + [0-9] | s | S | single | emergency | auto) + initargs="$initargs $x" + ;; + esac + done +fi +debug_on + +if ! [ -d "$NEWROOT"/run ]; then + NEWRUN=/dev/.initramfs + mkdir -m 0755 -p "$NEWRUN" + mount --rbind /run/initramfs "$NEWRUN" +fi + +wait_for_loginit + +# remove helper symlink +[ -h /dev/root ] && rm -f -- /dev/root + +bv=$(getarg rd.break -d rdbreak) && [ -z "$bv" ] \ + && emergency_shell -n switch_root "Break before switch_root" +unset bv +info "Switching root" + +unset PS4 + +PATH=$OLDPATH +export PATH + +if [ -f /etc/capsdrop ]; then + . /etc/capsdrop + info "Calling $INIT with capabilities $CAPS_INIT_DROP dropped." + unset RD_DEBUG + exec "$CAPSH" --drop="$CAPS_INIT_DROP" -- \ + -c "exec \"$SWITCH_ROOT\" \"$NEWROOT\" \"$INIT\" $initargs" \ + || { + warn "Command:" + warn capsh --drop="$CAPS_INIT_DROP" -- -c exec "$SWITCH_ROOT" "$NEWROOT" "$INIT" "$initargs" + warn "failed." + emergency_shell + } +else + unset RD_DEBUG + # shellcheck disable=SC2086 + exec "$SWITCH_ROOT" "$NEWROOT" "$INIT" $initargs || { + warn "Something went very badly wrong in the initramfs. Please " + warn "file a bug against dracut." + emergency_shell + } +fi diff --git a/exts/devmaster/dracut_modules/95devmaster/module-setup.sh b/exts/devmaster/dracut_modules/95devmaster/module-setup.sh new file mode 100755 index 0000000000000000000000000000000000000000..f316debc74ae291151993b497b02c9b8031eb583 --- /dev/null +++ b/exts/devmaster/dracut_modules/95devmaster/module-setup.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +check() { + require_binaries devctl || return 1 + return 0 +} + +# called by dracut +install() { + inst_script "$moddir/init.sh" "/init" + + inst_multiple devctl + + inst_dir /etc/devmaster + inst_dir /lib/devmaster + inst_dir /etc/devmaster/network.d + inst_multiple -o /etc/devmaster/config.toml \ + /etc/devmaster/network.d/99-default.link \ + /lib/devmaster/simulate_udev.sh + ln -sf /bin/devctl "${initdir}"/bin/udevadm + ln -sf /bin/devctl "${initdir}"/lib/devmaster/devmaster +} diff --git a/exts/devmaster/src/lib/rules/rules_load.rs b/exts/devmaster/src/lib/rules/rules_load.rs index 438e812f21ae965a054ddc797f3dfc57f611fa4f..5cafb6c94b88f9f2ecb7d9289b84bba610248c53 100644 --- a/exts/devmaster/src/lib/rules/rules_load.rs +++ b/exts/devmaster/src/lib/rules/rules_load.rs @@ -23,6 +23,7 @@ use basic::IN_SET; use nix::unistd::{Group, User}; use std::fs::File; use std::io::{BufRead, BufReader}; +use std::path::PathBuf; trait Location { fn location(&self, context: &(u32, String, String)) -> String; @@ -62,6 +63,8 @@ impl Rules { /// enumerate and parse all rule files under rule directories pub(crate) fn parse_rules(rules: Arc>) { let dirs = rules.as_ref().read().unwrap().dirs.clone(); + + let mut files: Vec = vec![]; for dir in dirs { let dir_path = std::path::Path::new(&dir); if !dir_path.exists() || !dir_path.is_dir() { @@ -69,8 +72,6 @@ impl Rules { continue; } - let mut files: Vec = vec![]; - for file in dir_path.read_dir().unwrap() { if file.is_err() { log::warn!( @@ -81,19 +82,28 @@ impl Rules { continue; } let buf = file.unwrap().path(); - let de = buf.as_os_str().to_str().unwrap(); - if !de.ends_with(".rules") { - log::warn!("Ignore file not ending with rules: {}", de); + if !buf + .file_name() + .unwrap_or_default() + .to_str() + .unwrap_or_default() + .ends_with(".rules") + { + log::warn!("Ignore file not ending with .rules: {:?}", buf); continue; } - files.push(de.to_string()); + files.push(buf); } + } - files.sort(); + files.sort_by(|a, b| { + a.file_name() + .unwrap_or_default() + .cmp(b.file_name().unwrap_or_default()) + }); - for f in files { - Self::parse_file(rules.clone(), f); - } + for f in files { + Self::parse_file(rules.clone(), f.to_str().unwrap().to_string()); } } diff --git a/exts/libudev/build.rs b/exts/libudev/build.rs index e28ed7fa2543f476e3b509badf98dda91217d275..f941e9023f2bbc0e49d58c3f0b6bbc1b33f1dc4a 100644 --- a/exts/libudev/build.rs +++ b/exts/libudev/build.rs @@ -16,6 +16,8 @@ //! Because rustc will append rust native version script, 'ld' is unavailable. Instead, //! we should use 'lld' linker of llvm, as it support multiple declarations of version scripts. +use std::env; + fn main() { let symbols = [ "udev_device_get_action", @@ -41,7 +43,7 @@ fn main() { // "udev_device_get_udev", // "udev_device_get_usec_since_initialized", "udev_device_has_tag", - // "udev_device_new_from_devnum", + "udev_device_new_from_devnum", "udev_device_new_from_environment", "udev_device_new_from_subsystem_sysname", "udev_device_new_from_syspath", @@ -112,8 +114,12 @@ fn main() { // "udev_device_get_current_tags_list_entry", ]; + let current_dir = env::current_dir().unwrap(); println!("cargo:rustc-cdylib-link-arg=-fuse-ld=lld"); - println!("cargo:rustc-link-arg=-Wl,--version-script=/root/sysmaster/exts/libudev/libudev.sym"); + println!( + "cargo:rustc-link-arg=-Wl,--version-script={}/libudev.sym", + current_dir.display() + ); for s in symbols { println!("cargo:rustc-link-arg=-Wl,--defsym={}={}_impl", s, s); diff --git a/libs/device/src/device.rs b/libs/device/src/device.rs index 2d8dc1e53b005e5ed44f950e47402dea523c1601..b3f6cd21128a023ca273b715a60467240fe40cb3 100644 --- a/libs/device/src/device.rs +++ b/libs/device/src/device.rs @@ -1458,9 +1458,14 @@ impl Device { let db_path = format!("{}/{}/{}", self.base_path.borrow(), DB_BASE_DIR, id); if !has_info && *self.devnum.borrow() == 0 && *self.ifindex.borrow() == 0 { - unlink(db_path.as_str()).context(Nix { + if let Err(e) = unlink(db_path.as_str()).context(Nix { msg: format!("update_db failed: can't unlink db '{}'", db_path), - })?; + }) { + if e.get_errno() != nix::errno::Errno::ENOENT { + return Err(e); + } + } + return Ok(()); } @@ -3868,7 +3873,7 @@ V:100 let _ = unlink("/tmp/devmaster/data/+drivers:usb:usb"); dev.set_base_path("/tmp/devmaster"); - assert!(dev.update_db().is_err()); + assert!(!dev.update_db().is_err()); dev.add_property("hello", "world").unwrap(); dev.update_db().unwrap(); assert!(Path::new("/tmp/devmaster/data/+drivers:usb:usb").exists());