通过Netlink检测USB设备的插拔

时间:2024-10-25 11:25:46

add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2
add@/devices/platform/Mstar[  120.529879] scsi0 : usb-storage 4-1.2:1.0
-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0
add@/devices[  120.537275] isa bounce pool size: 16 pages
/platform/Mstar-[  120.543612] scsi 0:0:0:0: Direct-Access     SanDisk  Cruzer Blade     2.01 PQ: 0 ANSI: 5
ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0
add@/de[  120.556037] sd 0:0:0:0: [sda] 7821312 512-byte logical blocks: (4.00 GB/3.72 GiB)
vices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1[  120.567115] sd 0:0:0:0: [sda] Write Protect is off
.2:1.0/host0/scs[  120.573404] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
i_host/host0
add@/devices/platform/Mstar-ehci-2[  120.587278] emmc_partition()
.1/usb4/4-1/4-1.2/usb_device/usbdev4.4
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.[  120.598422] 0x0
2:1.0/host0/targ[  120.600753]  sda: sda1
et0:0:0
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/scsi_disk/0:0:0:0
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/scsi_device[  120.629463] sd 0:0:0:0: [sda] Attached SCSI removable disk
/0:0:0:0
add@/devices/virtual/bdi/8:0
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/block/sda
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda1

add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-[  163.282004] input: PIXART USB OPTICAL MOUSE as /devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/4-1.4:1.0/input/input10
1.4/4-1.4:1.0
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1[  163.297335] generic-usb 0003:093A:2510.0003: input,hidraw1: USB HID v1.11 Mouse [PIXART USB OPTICAL MOUSE] on usb-mstar-1.4/input0
.4/4-1.4:1.0/0003:093A:2510.0003
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/4-1.4:1.0/input/input10
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/4-1.4:1.0/input/input10/mouse2
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/4-1.4:1.0/input/input10/event4
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/4-1.4:1.0/0003:093A:2510.0003/hidraw/hidraw1
add@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/usb_device/usbdev4.5

remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda1
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/scsi_disk/0:0:0:0
remove@/devices/virtual/bdi/8:0
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/block/sda
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0/scsi_host/host0
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0/host0
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/4-1.2:1.0
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2/usb_device/usbdev4.4
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.2

remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/4-1.4:1.0/input/input4/mouse2
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/4-1.4:1.0/input/input4/event4
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/4-1.4:1.0/input/input4
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/4-1.4:1.0/0003:093A:2510.0002/hidraw/hidraw1
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/4-1.4:1.0/0003:093A:2510.0002
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/4-1.4:1.0
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4/usb_device/usbdev4.3
remove@/devices/platform/Mstar-ehci-2.1/usb4/4-1/4-1.4