diff --git a/build_library/test_image_util.sh b/build_library/test_image_util.sh index 1807d9f9e7..9f6729f9ad 100755 --- a/build_library/test_image_util.sh +++ b/build_library/test_image_util.sh @@ -116,6 +116,7 @@ mod_image_for_test () { # Run test setup script to modify the image sudo -E GCLIENT_ROOT="${GCLIENT_ROOT}" ROOT_FS_DIR="${ROOT_FS_DIR}" \ STATEFUL_DIR="${STATEFUL_FS_DIR}" ARCH="${ARCH}" BACKDOOR="${BACKDOOR}" \ + BOARD_ROOT="${BOARD_ROOT}" \ "${mod_test_script}" # Legacy parameter (used by mod_image_for_test.sh --factory) diff --git a/common.sh b/common.sh index c4a15c4321..2aa93b255e 100644 --- a/common.sh +++ b/common.sh @@ -238,6 +238,7 @@ COMMON_INSTALL_MASK=" DEFAULT_INSTALL_MASK=" $COMMON_INSTALL_MASK /usr/local/autotest + /lib/modules/*/kernel/drivers/input/misc/uinput.ko " # Mask for factory test image (build_image --factory) diff --git a/mod_for_test_scripts/920addUinput b/mod_for_test_scripts/920addUinput new file mode 100755 index 0000000000..6089c77654 --- /dev/null +++ b/mod_for_test_scripts/920addUinput @@ -0,0 +1,21 @@ +#!/bin/bash + +# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# Add the uinput kernel module into the image for test builds. +# This is for running trackpad autotest in VM. + +echo "Adding the uinput module for test builds." +MODULES_PATH="/lib/modules" +KERNEL_RELEASE=$(ls -tr "${ROOT_FS_DIR}${MODULES_PATH}" | tail -n1) +UINPUT_PATH="${MODULES_PATH}/${KERNEL_RELEASE}"/kernel/drivers/input/misc +SRC_FILE="${BOARD_ROOT}${UINPUT_PATH}"/uinput.ko +DST_DIR="${ROOT_FS_DIR}${UINPUT_PATH}" +if [ -f "${SRC_FILE}" ]; then + install -m 644 "${SRC_FILE}" "${DST_DIR}" + echo "The uinput module is installed." +else + echo "Cannot install the uinput module." +fi