diff --git a/99-solo.rules b/99-solo.rules deleted file mode 100644 index 1301cb7..0000000 --- a/99-solo.rules +++ /dev/null @@ -1,28 +0,0 @@ -# Notify ModemManager this device should be ignored -ACTION!="add|change|move", GOTO="mm_usb_device_blacklist_end" -SUBSYSTEM!="usb", GOTO="mm_usb_device_blacklist_end" -ENV{DEVTYPE}!="usb_device", GOTO="mm_usb_device_blacklist_end" - -ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", ENV{ID_MM_DEVICE_IGNORE}="1" - -LABEL="mm_usb_device_blacklist_end" - - -# Solo - -## bootloader + firmware access -ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", TAG+="uaccess", GROUP="plugdev" - -## DFU access -ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess", GROUP="plugdev" - -## Solo Secure symlink -SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", ATTRS{product}=="Solo [1-9]*", SYMLINK+="solokey" -## Solo Hacker symlink -SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", ATTRS{product}=="Solo Hacker [1-9]*", SYMLINK+="solohacker" -## Solo Serial access + symlink -SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", TAG+="uaccess", GROUP="plugdev", SYMLINK+="soloserial" - - -# U2F Zero -SUBSYSTEM=="hidraw", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="8acf", TAG+="uaccess", GROUP="plugdev", SYMLINK+="u2fzero" diff --git a/99-solo.rules b/99-solo.rules new file mode 120000 index 0000000..9f2214a --- /dev/null +++ b/99-solo.rules @@ -0,0 +1 @@ +udev/70-solokeys-access.rules \ No newline at end of file diff --git a/udev/70-solokeys-access.rules b/udev/70-solokeys-access.rules new file mode 100644 index 0000000..53fe9b9 --- /dev/null +++ b/udev/70-solokeys-access.rules @@ -0,0 +1,19 @@ +# Notify ModemManager this device should be ignored +ACTION!="add|change|move", GOTO="mm_usb_device_blacklist_end" +SUBSYSTEM!="usb", GOTO="mm_usb_device_blacklist_end" +ENV{DEVTYPE}!="usb_device", GOTO="mm_usb_device_blacklist_end" + +ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", ENV{ID_MM_DEVICE_IGNORE}="1" + +LABEL="mm_usb_device_blacklist_end" + + +# Solo bootloader + firmware access +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", TAG+="uaccess" +SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", TAG+="uaccess" + +# ST DFU access +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess" + +# U2F Zero +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="8acf", TAG+="uaccess" diff --git a/udev/70-solokeys-legacy-access.rules b/udev/70-solokeys-legacy-access.rules new file mode 100644 index 0000000..0711ea8 --- /dev/null +++ b/udev/70-solokeys-legacy-access.rules @@ -0,0 +1,19 @@ +# Notify ModemManager this device should be ignored +ACTION!="add|change|move", GOTO="mm_usb_device_blacklist_end" +SUBSYSTEM!="usb", GOTO="mm_usb_device_blacklist_end" +ENV{DEVTYPE}!="usb_device", GOTO="mm_usb_device_blacklist_end" + +ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", ENV{ID_MM_DEVICE_IGNORE}="1" + +LABEL="mm_usb_device_blacklist_end" + + +# Solo bootloader + firmware access +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", MODE="0660", GROUP="plugdev" +SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", MODE="0660", GROUP="plugdev" + +# ST DFU access +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0660", GROUP="plugdev" + +# U2F Zero +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="8acf", MODE="0660", GROUP="plugdev" diff --git a/udev/71-solokeys-symlinks.rules b/udev/71-solokeys-symlinks.rules new file mode 100644 index 0000000..db6801e --- /dev/null +++ b/udev/71-solokeys-symlinks.rules @@ -0,0 +1,17 @@ +# TODO: would like to lookup ID_SERIAL_SHORT from `usb` SUBSYSTEM +# but link on `hidraw` subsystem level +# and end up with symlinks `/dev/solo[hacker|secure]-` + +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", SYMLINK+="solo-$env{ID_SERIAL_SHORT}-%n" +## Solo Secure symlinks +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", ATTRS{product}=="Solo [1-9]*", SYMLINK+="solosecure-$env{ID_SERIAL_SHORT}-%n" +## Solo Hacker symlinks +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", ATTRS{product}=="Solo Hacker [1-9]*", SYMLINK+="solohacker-$env{ID_SERIAL_SHORT}-%n" +## Solo Serial access + symlink +SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", SYMLINK+="soloserial" + +# Non-unique rules (breakdown if multiple Solos are plugged in) +## Solo +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", SYMLINK+="solo" +## U2F Zero +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="8acf", SYMLINK+="u2fzero" diff --git a/udev/Makefile b/udev/Makefile new file mode 100644 index 0000000..f408e9b --- /dev/null +++ b/udev/Makefile @@ -0,0 +1,28 @@ +# On modern systems, udev has a TAG uaccess, which is used in 73-seat-late.rules +# On older systems, we use GROUP plugdev with MODE +# --> Try `make setup` first, if it doesn't work, try `make legacy-setup`. +# +# The symlinks are optional, install with `make symlinks`. +# +# We keep 99-solo.rules in the parent directory but deprecate it, +# remove when documentation is updated. + + +setup: install activate +legacy-setup: install-legacy activate +# symlinks: install-symlinks activate + +RULES_PATH=/etc/udev/rules.d + +activate: + sudo udevadm control --reload-rules + sudo udevadm trigger + +install: + sudo ln -sf $(PWD)/70-solokeys-access.rules ${RULES_PATH}/70-solokeys-access.rules + +install-legacy: + sudo ln -sf $(PWD)/70-solokeys-legacy-access.rules ${RULES_PATH}/70-solokeys-access.rules + +# install-symlinks: +# sudo cp $(PWD)/71-solokeys-symlinks.rules ${RULES_PATH}/71-solokeys-symlinks.rules