-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path60-Logitec_LHR-4BNHEU3.rules
39 lines (33 loc) · 1.83 KB
/
60-Logitec_LHR-4BNHEU3.rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# udev rules for Logitec LHR-4BNHEU3
# Copyright 2017 Koichi OKADA. All rights reserved.
# This script is distributed under the MIT license.
#
# Note: This script must be read before `/lib/udev/rules.d/60-persistent-storage.rules`.
#
#GOTO="Logitec_LHR-4BNHEU3_end" # for DEBUG
ACTION=="remove", GOTO="Logitec_LHR-4BNHEU3_end"
SUBSYSTEM!="block", GOTO="Logitec_LHR-4BNHEU3_end"
KERNEL!="sd*", GOTO="Logitec_LHR-4BNHEU3_end"
ATTRS{idVendor}=="0789", GOTO="Logitec_LHR-4BNHEU3_Logitec"
GOTO="Logitec_LHR-4BNHEU3_end"
LABEL="Logitec_LHR-4BNHEU3_Logitec"
ATTRS{idProduct}=="0192", GOTO="Logitec_LHR-4BNHEU3_Logitec_LHR-4BNHEU3"
GOTO="Logitec_LHR-4BNHEU3_end"
LABEL="Logitec_LHR-4BNHEU3_Logitec_LHR-4BNHEU3"
# for partitions import parent information
ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"
# Logitec LHR-4BNHEU3
KERNEL=="sd*", ENV{ID_SERIAL}=="?*", GOTO="Logitec_LHR-4BNHEU3_SERIAL_set"
IMPORT{builtin}="usb_id"
IMPORT{program}="Logitec_LHR-4BNHEU3.sh $devnode"
LABEL="Logitec_LHR-4BNHEU3_SERIAL_set"
# same as default udev rule
KERNEL=="sd*", ENV{DEVTYPE}=="disk", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_MODEL}_$env{ID_USB_SERIAL_SHORT}-$env{ID_USB_INSTANCE}"
KERNEL=="sd*", ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_MODEL}_$env{ID_USB_SERIAL_SHORT}-$env{ID_USB_INSTANCE}-part%n"
# Persistent naming from the perspective of physical layout in the HDD cage.
KERNEL=="sd*", ENV{DEVTYPE}=="disk", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_USB_SERIAL}"
KERNEL=="sd*", ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_USB_SERIAL}-part%n"
# Persistent naming from spec and identifier of HDD.
KERNEL=="sd*", ENV{DEVTYPE}=="disk", SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}"
KERNEL=="sd*", ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}-part%n"
LABEL="Logitec_LHR-4BNHEU3_end"