summaryrefslogtreecommitdiff
path: root/package/base-files/files/etc/hotplug2-common.rules
blob: c284f8f3fe2c08db0afb09e4b7d11c3d1ef4cb3e (plain)
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
40
41
42
43
# uncomment me to log hotplug events
# DEVPATH is set {
# 	exec logger -s -t hotplug -p daemon.info "name=%DEVNAME%, path=%DEVPATH%"
# }

$include /etc/hotplug2-platform.rules

DEVNAME ~~ (^null$|^full$|^ptmx$|^zero$|^gpio|^hvc) {
	makedev /dev/%DEVNAME% 0666
	next-event
}

DEVNAME == mapper/control {
	makedev /dev/%DEVNAME% 0600
	next-event
}

ACTION == add, DEVPATH is set {
	makedev /dev/%DEVNAME% 0644
}

ACTION == add, DEVPATH is set, DEVNAME ~~ ^tty {
	chmod 0666 /dev/%DEVNAME%
}

ACTION == add, DEVPATH is set, DEVNAME ~~ ^ppp {
	chmod 0600 /dev/%DEVNAME%
}

ACTION == remove, DEVPATH is set, MAJOR is set, MINOR is set {
	remove /dev/%DEVNAME%
}

FIRMWARE is set, ACTION == add {
	exec /sbin/hotplug-call firmware
	load-firmware /lib/firmware
	next-event
}

SUBSYSTEM == platform {
	exec /sbin/hotplug-call %SUBSYSTEM%
}