From 74f163b58776fc925e04de2a296b54592c172470 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 18 Dec 2012 15:46:51 -0800 Subject: [PATCH] install kernel testcase modules on test image only Similar to the uinput module, install the testcases/ tree of modules only on test images. BUG=chromium-os:37353 TEST=daisy test image build has modules, production does not. CQ-DEPEND=I16eee5afd1664f0ab4a9ab48b6cb2beaa6f30017 Change-Id: I5e7a48936b3fb45f49ff7ca4d592d46150c5610c Signed-off-by: Kees Cook Reviewed-on: https://gerrit.chromium.org/gerrit/39920 Reviewed-by: Chris Sosa Reviewed-by: Grant Grundler --- common.sh | 1 + mod_for_test_scripts/920addTestcases | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 mod_for_test_scripts/920addTestcases diff --git a/common.sh b/common.sh index 849570781f..574344f88a 100644 --- a/common.sh +++ b/common.sh @@ -363,6 +363,7 @@ DEFAULT_INSTALL_MASK=" /lib/modules/*/kernel/drivers/input/misc/uinput.ko /lib/modules/*/build /lib/modules/*/source + test_*.ko " # Mask for factory test image (build_image --factory) diff --git a/mod_for_test_scripts/920addTestcases b/mod_for_test_scripts/920addTestcases new file mode 100755 index 0000000000..9144fc1fb1 --- /dev/null +++ b/mod_for_test_scripts/920addTestcases @@ -0,0 +1,17 @@ +#!/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 kernel testcase modules into the image for test builds. +# This is for running various autotests needing specific kernel behaviors. + +echo "Adding the kernel test modules for autotest runs." +MODULES_PATH="/lib/modules" +KERNEL_RELEASE=$(ls -tr "${ROOT_FS_DIR}${MODULES_PATH}" | tail -n1) +TESTCASES_PATH="${MODULES_PATH}/${KERNEL_RELEASE}" +SRC_DIR="${BOARD_ROOT}${TESTCASES_PATH}" +DST_DIR="${ROOT_FS_DIR}${TESTCASES_PATH}" +(cd "${SRC_DIR}" && find . -type f -name 'test_*.ko') | \ + rsync -a --files-from=- "${SRC_DIR}" "${DST_DIR}"