Commit e961769b authored by Guillaume Tucker's avatar Guillaume Tucker

udev rule, systemd service: drop dependency on google-servo kernel driver

Use the udev device name as the systemd service instance name, and use
it to create the full device path which can then be used to find the
udev device.  Also make the udev rule match the USB vendor/device IDs
and drop all dependencies on the google-servo kernel driver.
Signed-off-by: Guillaume Tucker's avatarGuillaume Tucker <guillaume.tucker@collabora.com>
parent 1622e206
[Unit]
Description="Google Servo control board manager"
ConditionPathExists=/etc/google-servo.conf
BindsTo=dev-usb-googleservo%i.device
[Service]
Type=notify
NotifyAccess=all
ExecStart=/usr/bin/run-servod /dev/usb/google-servo%i
ExecStart=/usr/bin/run-servod /sys/bus/usb/devices/%i
Restart=on-failure
# google-servo* matches on our usbmisc child device, then we specify
# SUBSYSTEMS/DRIVERS to walk up from the specific interface, to the overall
# device, which will actually have a serial
ACTION=="add",KERNEL=="google-servo*",SUBSYSTEMS=="usb",DRIVERS=="usb",TAG+="systemd",ENV{SYSTEMD_WANTS}+="google-servo@%n.service",ENV{ID_MODEL}="Google Servo control board %n"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="5002", TAG+="systemd", ENV{SYSTEMD_WANTS}+="google-servo@$name.service", ENV{ID_MODEL}="Google Servo control board %n"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment