From 9ca9a59dfb28331ddb9d46c18378ba2fd9d9ceaf Mon Sep 17 00:00:00 2001 From: Matthew Blecker Date: Wed, 3 Apr 2019 15:48:20 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/1552245 Reviewed-by: Nick Sanders --- extra/i2c_pseudo/install | 20 ++------------------ 1 file 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="$?" -- cgit v1.2.1