summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Blecker <matthewb@google.com>2019-04-03 15:48:20 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-05 13:43:52 -0700
commit9ca9a59dfb28331ddb9d46c18378ba2fd9d9ceaf (patch)
tree9712fc1e87083c43d37b6a2d0e6a4759b4dc9fb1
parentc34791f6b3c9e25c6abe1976efecf3bdc51ba453 (diff)
downloadchrome-ec-9ca9a59dfb28331ddb9d46c18378ba2fd9d9ceaf.tar.gz
i2c-pseudo: Simplify install shell script.
The script now unconditionally attempts to (re)install the module, even if it is already loaded. (This also removes a message which had a typo, mistakingly referring to i2c-dev instead of i2c-pseudo.) The script no longer attempts to load i2c-dev, since servod does that now. The script now runs "make clean" before "make" . The header comment no longer references a section of the README that was never checked in. BRANCH=none BUG=b:79684405 TEST=I ran the install script in various scenarios: 1) No i2c-pseudo module loaded or installed. 2) i2c-pseudo module loaded but not installed. 3) i2c-pseudo module installed but not loaded 4) i2c-pseudo module loaded and installed. In all cases the module was (re)installed and either left loaded (if applicable), or loaded (if not previously loaded). The script does not attempt to unload and re-load the module when re-installing only for simplicity. Change-Id: I5f2677b92406b8a49d229bc84d2efcca5504f501 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1552245 Reviewed-by: Nick Sanders <nsanders@chromium.org>
-rwxr-xr-xextra/i2c_pseudo/install20
1 files changed, 2 insertions, 18 deletions
diff --git a/extra/i2c_pseudo/install b/extra/i2c_pseudo/install
index 6d9e783b70..f4fbecedc9 100755
--- a/extra/i2c_pseudo/install
+++ b/extra/i2c_pseudo/install
@@ -1,27 +1,11 @@
#!/bin/sh
#
-# This attempts to build and install the i2c-pseudo Linux kernel module,
-# following the procedure documented in README.
+# This attempts to build and install the i2c-pseudo Linux kernel module.
set -e
-if ! lsmod | grep -q '^i2c_dev\s'; then
- sudo depmod -a
- sudo modprobe -q i2c-dev
-fi
-
-if lsmod | grep -q '^i2c_pseudo\s'; then
- echo "SUCCESS: i2c-dev module already loaded"
- exit
-fi
-
-if sudo modprobe -q i2c-pseudo; then
- echo "SUCCESS: loaded already-installed i2c-pseudo module"
- exit
-fi
-
+make clean
make
-
ret=0
sudo make modules_install || ret="$?"