From b756628c7e76957ba2115bfde7c819a1e981c12f Mon Sep 17 00:00:00 2001 From: Anton Staaf Date: Tue, 24 May 2016 14:00:19 -0700 Subject: 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 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 Tested-by: Anton Staaf Reviewed-by: Vadim Bendebury --- extra/usb_serial/install | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 extra/usb_serial/install 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 -- cgit v1.2.1