diff --git a/build_image b/build_image index c4feaf530e..3783351ea8 100755 --- a/build_image +++ b/build_image @@ -123,7 +123,7 @@ parse_build_image_args EXTRA_PACKAGES="" if [ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]; then # TODO: Build a separated ebuild for the install shim to reduce size. - INSTALL_MASK="${INSTALL_MASK} ${FACTORY_INSTALL_MASK}" + INSTALL_MASK="${FACTORY_SHIM_INSTALL_MASK}" # Reduce the size of factory install shim. info "Fixing the rootfs size at 320 MiB for install shim" diff --git a/build_library/test_image_util.sh b/build_library/test_image_util.sh index 67573d5044..ead04a08db 100755 --- a/build_library/test_image_util.sh +++ b/build_library/test_image_util.sh @@ -98,37 +98,6 @@ prepare_hwid_for_factory() { fi } -install_autotest_for_factory() { - local autotest_src="${BOARD_ROOT}/usr/local/autotest" - local stateful_root="${ROOT_FS_DIR}/usr/local" - local autotest_client="${stateful_root}/autotest" - - echo "Install autotest into stateful partition from ${autotest_src}" - - sudo mkdir -p "${autotest_client}" - - # Remove excess files from stateful partition. - sudo rm -rf "${autotest_client}/"* - sudo rm -rf "${stateful_root}/autotest-pkgs" - sudo rm -rf "${stateful_root}/lib/icedtea6" - - sudo rsync --delete --delete-excluded -au \ - --exclude=deps/realtimecomm_playground \ - --exclude=tests/ltp \ - --exclude=site_tests/graphics_O3DSelenium \ - --exclude=site_tests/realtimecomm_GTalk\* \ - --exclude=site_tests/platform_StackProtector \ - --exclude=deps/chrome_test \ - --exclude=site_tests/desktopui_BrowserTest \ - --exclude=site_tests/desktopui_PageCyclerTests \ - --exclude=site_tests/desktopui_UITest \ - --exclude=.svn \ - "${autotest_src}/client/"* "${autotest_client}" - - sudo chmod 755 "${autotest_client}" - sudo chown -R 1000:1000 "${autotest_client}" -} - # Converts a dev image into a test or factory test image # Takes as an arg the name of the image to be created. mod_image_for_test () { @@ -153,9 +122,10 @@ mod_image_for_test () { if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ]; then emerge_to_image --root="${ROOT_FS_DIR}" factorytest-init - + INSTALL_MASK="${FACTORY_TEST_INSTALL_MASK}" + emerge_to_image --root="${ROOT_FS_DIR}/usr/local" \ + chromeos-base/autotest chromeos-base/autotest-all prepare_hwid_for_factory "${BUILD_DIR}" - install_autotest_for_factory local mod_factory_script mod_factory_script="${SCRIPTS_DIR}/mod_for_factory_scripts/factory_setup.sh" diff --git a/common.sh b/common.sh index a4f1d9b292..4e3d1f3cba 100644 --- a/common.sh +++ b/common.sh @@ -170,7 +170,7 @@ CHROOT_TRUNK_DIR="/home/$USER/trunk" # Install make for portage ebuilds. Used by build_image and gmergefs. # TODO: Is /usr/local/autotest-chrome still used by anyone? -DEFAULT_INSTALL_MASK=" +COMMON_INSTALL_MASK=" *.a *.la /etc/init.d @@ -183,7 +183,6 @@ DEFAULT_INSTALL_MASK=" /usr/lib/gcc /usr/lib/gtk-2.0/include /usr/lib/pkgconfig - /usr/local/autotest /usr/local/autotest-chrome /usr/man /usr/share/aclocal @@ -199,18 +198,38 @@ DEFAULT_INSTALL_MASK=" /usr/src " -FACTORY_INSTALL_MASK=" - /opt/Qualcomm - /opt/Synaptics +# Mask for base, dev, and test images (build_image, build_image --test) +DEFAULT_INSTALL_MASK=" + $COMMON_INSTALL_MASK + /usr/local/autotest + " + +# Mask for factory test image (build_image --factory) +FACTORY_TEST_INSTALL_MASK=" + $COMMON_INSTALL_MASK + */.svn + */CVS + /usr/local/autotest/[^c]* + /usr/local/autotest/conmux + /usr/local/autotest/client/deps/chrome_test + /usr/local/autotest/client/deps/piglit + /usr/local/autotest/client/deps/pyauto_dep + /usr/local/autotest/client/deps/realtimecomm_* + /usr/local/autotest/client/site_tests/desktopui_PageCyclerTests + /usr/local/autotest/client/site_tests/graphics_WebGLConformance + /usr/local/autotest/client/site_tests/platform_ToolchainOptions + /usr/local/autotest/client/site_tests/realtimecomm_GTalk* + " + +# Mask for factory install shim (build_image --factory_install) +FACTORY_SHIM_INSTALL_MASK=" + $DEFAULT_INSTALL_MASK + /opt/[^g]* /opt/google/chrome /opt/google/o3d /opt/google/talkplugin - /opt/netscape - /usr/lib/debug /usr/lib/dri /usr/lib/python2.6/test - /usr/local/autotest - /usr/local/autotest-chrome /usr/local/autotest-pkgs /usr/share/X11 /usr/share/chewing diff --git a/mod_for_factory_scripts/100rebaseClient b/mod_for_factory_scripts/100rebaseClient new file mode 100755 index 0000000000..b217c29043 --- /dev/null +++ b/mod_for_factory_scripts/100rebaseClient @@ -0,0 +1,18 @@ +#!/bin/bash + +# Copyright (c) 2011 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. + +die() { + echo "ERROR: $*" + exit 1 +} + +echo "Rebasing autotest/client folder for factory." +base_dir="${ROOT_FS_DIR}/usr/local/autotest" + +[ -d "${base_dir}/client" ] || die "Missing client in root: ${base_dir}" +mv "${base_dir}/client/"* "${base_dir}" || die "Failed moving client folder." +rmdir "${base_dir}/client" || die "Failed removing client folder." +ln -s . "${base_dir}/client" || die "Failed creating symlink."