Skip to content

Commit b9758d7

Browse files
committed
Include udev/devd rules in Linux/FreeBSD install
This allows RPCS3 to communicate with Dualshock 3,4 and DualSense controller out of the box on Linux distributions and FreeBSD, without the need for manual actions.
1 parent d1bfa9c commit b9758d7

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

rpcs3/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,12 @@ if(UNIX AND NOT APPLE)
179179
install(DIRECTORY ../bin/test
180180
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpcs3)
181181
endif()
182+
183+
# Udev rules, per platform
184+
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
185+
install(FILES udev.rules
186+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/udev/rules.d/ RENAME 99-rpcs3.rules)
187+
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
188+
install(FILES devd.conf
189+
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/devd/ RENAME rpcs3.conf)
190+
endif()

rpcs3/devd.conf

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# DualShock 3
2+
notify 100 {
3+
match "system" "USB";
4+
match "subsystem" "INTERFACE";
5+
match "type" "ATTACH";
6+
match "vendor" "0x054c";
7+
match "product" "0x0268";
8+
action "chmod 0666 /dev/$cdev";
9+
};
10+
11+
# DualShock 4
12+
notify 100 {
13+
match "system" "USB";
14+
match "subsystem" "INTERFACE";
15+
match "type" "ATTACH";
16+
match "vendor" "0x054c";
17+
match "product" "0x05c4";
18+
action "chmod 0666 /dev/$cdev";
19+
};
20+
21+
# DualShock 4 Wireless Adapter
22+
notify 100 {
23+
match "system" "USB";
24+
match "subsystem" "INTERFACE";
25+
match "type" "ATTACH";
26+
match "vendor" "0x054c";
27+
match "product" "0x0ba0";
28+
action "chmod 0666 /dev/$cdev";
29+
};
30+
31+
# DualShock 4 Slim
32+
notify 100 {
33+
match "system" "USB";
34+
match "subsystem" "INTERFACE";
35+
match "type" "ATTACH";
36+
match "vendor" "0x054c";
37+
match "product" "0x09cc";
38+
action "chmod 0666 /dev/$cdev";
39+
};
40+
41+
# DualSense
42+
notify 100 {
43+
match "system" "USB";
44+
match "subsystem" "INTERFACE";
45+
match "type" "ATTACH";
46+
match "vendor" "0x054c";
47+
match "product" "0x0ce6";
48+
action "chmod 0666 /dev/$cdev";
49+
};

rpcs3/udev.rules

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# DualShock 3 over USB
2+
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0268", MODE="0666"
3+
4+
# DualShock 3 over Bluetooth
5+
KERNEL=="hidraw*", KERNELS=="*054C:0268*", MODE="0666"
6+
7+
# DualShock 4 over USB
8+
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", MODE="0666"
9+
10+
# DualShock 4 Wireless Adapter over USB
11+
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ba0", MODE="0666"
12+
13+
# DualShock 4 Slim over USB
14+
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="09cc", MODE="0666"
15+
16+
# DualShock 4 over Bluetooth
17+
KERNEL=="hidraw*", KERNELS=="*054C:05C4*", MODE="0666"
18+
19+
# DualShock 4 Slim over Bluetooth
20+
KERNEL=="hidraw*", KERNELS=="*054C:09CC*", MODE="0666"
21+
22+
# PS5 DualSense controller over USB hidraw
23+
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ce6", MODE="0666", TAG+="uaccess"
24+
25+
# PS5 DualSense controller over bluetooth hidraw
26+
KERNEL=="hidraw*", KERNELS=="*054C:0CE6*", MODE="0666", TAG+="uaccess"

0 commit comments

Comments
 (0)