diff options
author | Anton Staaf <robotboy@chromium.org> | 2016-05-24 14:00:19 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-05-25 22:55:43 -0700 |
commit | b756628c7e76957ba2115bfde7c819a1e981c12f (patch) | |
tree | c1c6265c3aa1ae8b9b4165d4e13cd4f6d8c4e3f5 | |
parent | e1dc48480f9ffdf6089efdff44f906d2f1b91b55 (diff) | |
download | chrome-ec-b756628c7e76957ba2115bfde7c819a1e981c12f.tar.gz |
USB Serial: Add simple install script
The install script builds and installs the raiden module, it also copies
the udev rules file into /etc/udev/rules.d and updates the module alias
and dependency information.
The install script will also retrigger udev to process rules for all
devices that have the Google Vendor ID (0x18d1). This ensures that
any devices that are connected when the install is run will immediately
be available for use (as opposed to requiring that these devices be
unplugged and replugged before use).
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=Remove udev rules file
Remove raiden.ko module, aliases, and dependency information
Reboot workstation
Run ./install
Plug in CCD capable device
ls /dev/google
Change-Id: I7bcb02f05ee84738a6259800afc4d0c69bea9e69
Reviewed-on: https://chromium-review.googlesource.com/347092
Commit-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rwxr-xr-x | extra/usb_serial/install | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/extra/usb_serial/install b/extra/usb_serial/install new file mode 100755 index 0000000000..f802f10af4 --- /dev/null +++ b/extra/usb_serial/install @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +make modules + +# Install the new module and update dependency and alias information +sudo make modules_install +sudo depmod -a + +# Install the udev rule for creating /dev/google symlinks. +sudo cp 51-google-serial.rules /etc/udev/rules.d + +# Trigger udev to create the symlinks for any attached devices that have the +# Google Vendor ID. Limiting triggering like this prevents unwanted resetting +# of some device state, even with the change action specified. +for syspath in $(dirname $(grep -rxl --include=idVendor 18d1 /sys/devices)); do + sudo udevadm trigger --action=change --parent-match=${syspath} +done |