From 4228f22c9732080a9a1707a33b6b6c2cbe9569d1 Mon Sep 17 00:00:00 2001 From: Scott Zawalski Date: Thu, 16 Dec 2010 13:44:32 -0800 Subject: [PATCH 01/21] Change tegra2 binary builder to use board=tegra2_dev-board instead of tegra2. This aligns the binary builder with the full builder. BUG=NA TEST=NA Review URL: http://codereview.chromium.org/5839004 --- bin/cbuildbot_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cbuildbot_config.py b/bin/cbuildbot_config.py index ba3706e0f5..2f7b6361dd 100644 --- a/bin/cbuildbot_config.py +++ b/bin/cbuildbot_config.py @@ -100,7 +100,7 @@ config['x86_pineview_bin'] = { 'push_overlays': None, } config['arm_tegra2_bin'] = { - 'board' : 'tegra2', + 'board' : 'tegra2_dev-board', 'uprev' : True, 'master' : False, 'important' : False, From 9362fa85c74eadbe6abb1d463000c3735a3a7caf Mon Sep 17 00:00:00 2001 From: Doug Anderson Date: Thu, 16 Dec 2010 14:44:12 -0800 Subject: [PATCH 02/21] Allow specifying environment variables w/ enter_chroot again. Examples of how people might be using enter_chroot: 1. ./enter_chroot [chroot_flags] VAR1=val1 VAR2=val2 -- cmd arg1 arg2 Set env vars and run cmd w/ args 2. ./enter_chroot [chroot_flags] VAR1=val1 VAR2=val2 Set env vars and run shell 3. ./enter_chroot [chroot_flags] -- cmd arg1 arg2 Run cmd w/ args 4. ./enter_chroot [chroot_flags] VAR1=val1 VAR2=val2 cmd arg1 arg2 Like #1 _if_ args aren't flags (if they are, enter_chroot will claim them) 5. ./enter_chroot [chroot_flags] cmd arg1 arg2 Like #3 _if_ args aren't flags (if they are, enter_chroot will claim them) I also updated the help to indicate that whole-command quoting is no longer supported. If you really need whole-command quoting (maybe you want in- chroot redirection), you'll need to use sh -c like: ./enter_chroot.sh -- sh -c "echo \"Save me\" > /tmp/save.txt" You should avoid single quotes in the command and arguments. This isn't a new limitation: it's shflags related. Change-Id: I0452a8730ac9b8197834edc753b9eece69896135 BUG=chromium-os:7072 TEST=Tried a whole bunch of these commands. Review URL: http://codereview.chromium.org/5840003 --- enter_chroot.sh | 46 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/enter_chroot.sh b/enter_chroot.sh index 431afa3bab..bc06ddfc4a 100755 --- a/enter_chroot.sh +++ b/enter_chroot.sh @@ -34,23 +34,53 @@ DEFINE_boolean unmount $FLAGS_FALSE "Only tear down mounts." DEFINE_boolean ssh_agent $FLAGS_TRUE "Import ssh agent." # More useful help -FLAGS_HELP="USAGE: $0 [flags] [VAR=value] [-- \"command\"] +FLAGS_HELP="USAGE: $0 [flags] [VAR=value] [-- command [arg1] [arg2] ...] One or more VAR=value pairs can be specified to export variables into the chroot environment. For example: $0 FOO=bar BAZ=bel -If [-- \"command\"] is present, runs the command inside the chroot, -after changing directory to /$USER/trunk/src/scripts. Note that the -command should be enclosed in quotes to prevent interpretation by the -shell before getting into the chroot. For example: +If [-- command] is present, runs the command inside the chroot, +after changing directory to /$USER/trunk/src/scripts. Note that neither +the command nor args should include single quotes. For example: - $0 -- \"./build_platform_packages.sh\" + $0 -- ./build_platform_packages.sh Otherwise, provides an interactive shell. " +# Double up on the first '--' argument. Why? For enter_chroot, we want to +# emulate the behavior of sudo for setting environment vars. That is, we want: +# ./enter_chroot [flags] [VAR=val] [-- command] +# ...but shflags ends up eating the '--' out of the command line and gives +# us back "VAR=val" and "command" together in one chunk. By doubling up, we +# end up getting what we want back from shflags. +# +# Examples of how people might be using enter_chroot: +# 1. ./enter_chroot [chroot_flags] VAR1=val1 VAR2=val2 -- cmd arg1 arg2 +# Set env vars and run cmd w/ args +# 2. ./enter_chroot [chroot_flags] VAR1=val1 VAR2=val2 +# Set env vars and run shell +# 3. ./enter_chroot [chroot_flags] -- cmd arg1 arg2 +# Run cmd w/ args +# 4. ./enter_chroot [chroot_flags] VAR1=val1 VAR2=val2 cmd arg1 arg2 +# Like #1 _if_ args aren't flags (if they are, enter_chroot will claim them) +# 5. ./enter_chroot [chroot_flags] cmd arg1 arg2 +# Like #3 _if_ args aren't flags (if they are, enter_chroot will claim them) +_FLAGS_FIXED='' +_SAW_DASHDASH=0 +while [ $# -gt 0 ]; do + _FLAGS_FIXED="${_FLAGS_FIXED:+${_FLAGS_FIXED} }'$1'" + if [ $_SAW_DASHDASH -eq 0 ] && [[ "$1" == "--" ]]; then + _FLAGS_FIXED="${_FLAGS_FIXED:+${_FLAGS_FIXED} }'--'" + _SAW_DASHDASH=1 + fi + shift +done +eval set -- "${_FLAGS_FIXED}" + + # Parse command line flags FLAGS "$@" || exit 1 eval set -- "${FLAGS_ARGV}" @@ -303,9 +333,9 @@ git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all user.email \ # Run command or interactive shell. Also include the non-chrooted path to # the source trunk for scripts that may need to print it (e.g. # build_image.sh). -sudo chroot "$FLAGS_chroot" sudo -i -u $USER $CHROOT_PASSTHRU \ +sudo -- chroot "$FLAGS_chroot" sudo -i -u $USER $CHROOT_PASSTHRU \ EXTERNAL_TRUNK_PATH="${FLAGS_trunk}" LANG=C SSH_AGENT_PID="${SSH_AGENT_PID}" \ - SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" -- "$@" + SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" "$@" # Remove trap and explicitly unmount trap - EXIT From ea621903e927acf77889bcda4fa71636f4af7158 Mon Sep 17 00:00:00 2001 From: Mandeep Singh Baines Date: Thu, 16 Dec 2010 18:27:06 -0800 Subject: [PATCH 03/21] build_kernel_image: enable nmi watchdog BUG=10425 TEST=Tested before and after. Change-Id: Ic3e66805945f379a79562338b16845bb5dbd674f Before: Machine hangs till power-cycle. After: Machine reboots and we get a crash dump. Review URL: http://codereview.chromium.org/5893005 --- build_kernel_image.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build_kernel_image.sh b/build_kernel_image.sh index 08cca4c726..6387431547 100755 --- a/build_kernel_image.sh +++ b/build_kernel_image.sh @@ -146,6 +146,7 @@ cros_secure kern_guid=%U tpm_tis.force=1 tpm_tis.interrupts=0 +nmi_watchdog=1 EOF WORK="${WORK} ${FLAGS_working_dir}/config.txt" From 78bc7d7415c66b5350ebc4c5019b2f21d1bbec08 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Thu, 16 Dec 2010 19:37:28 -0800 Subject: [PATCH 04/21] Fix regression introduced by proxy port. Change-Id: I42a6110d41e79bb0ad50817e2e76b06f7973f6c2 BUG=chromium-os:10434 TEST=Ran it with --test_prefix for delay payload test and it succeeded. Review URL: http://codereview.chromium.org/5877007 --- bin/cros_run_vm_update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cros_run_vm_update b/bin/cros_run_vm_update index 863b66dc65..53617b6f89 100755 --- a/bin/cros_run_vm_update +++ b/bin/cros_run_vm_update @@ -41,7 +41,7 @@ if [ -n "${FLAGS_payload}" ]; then fi if [ -n "${FLAGS_proxy_port}" ]; then - IMAGE_ARGS="--proxy_port=${FLAGS_proxy_port}" + IMAGE_ARGS="${IMAGE_ARGS} --proxy_port=${FLAGS_proxy_port}" fi $(dirname $0)/../image_to_live.sh \ From e516dae95019bc8ab1609fcbbe5bd30ae10167d0 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Thu, 16 Dec 2010 20:01:58 -0800 Subject: [PATCH 05/21] Simplify and clearify push logic. Change-Id: I5366fb930ca76f596f49d0312228aa5beeccbc31 BUG=chromium-os:8693 TEST=Ran it with and without dryrun and chrome uprev. Review URL: http://codereview.chromium.org/5846005 --- cros_mark_as_stable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cros_mark_as_stable.py b/cros_mark_as_stable.py index 9a87062635..9eb092cfd6 100755 --- a/cros_mark_as_stable.py +++ b/cros_mark_as_stable.py @@ -252,7 +252,7 @@ def PushChange(stable_branch, tracking_branch): merge_branch_name = 'merge_branch' for push_try in range(num_retries + 1): try: - _SimpleRunCommand('git remote update') + _SimpleRunCommand('repo sync .') merge_branch = GitBranch(merge_branch_name, tracking_branch) merge_branch.CreateBranch() if not merge_branch.Exists(): From b4f6b3c6a12874fcef2397e497b27a162d545077 Mon Sep 17 00:00:00 2001 From: David Rochberg Date: Fri, 17 Dec 2010 11:55:40 -0500 Subject: [PATCH 06/21] Make restart_in_chroot_if_needed run against scripts that are symlinks This reverts the main change of 84e72fab23c1359785f93685df6a3a45e7612d6e and undoes the breakage of scripts that are symlinks to ...chromeos/scripts..., but at the cost of re-breaking scripts under scripts/bin. The correct fix is a combination of removing all the symlinks to ...chromeos/scripts... and a more robust way of finding the chroot path of the executable. But that will have to wait until someone else does it next week or I return from vacation TEST=Ran all of these outside chroot. None seemed more broken than when run in the chroot. /setup_board --board=x86-generic, ./cros_workon list --all --board=x86-mario, ./start_devserver , ./build_image --help, ./build_packages --help, ./cros_upgrade_chroot --help, ./enter_chroot.sh , ./customize_rootfs --help, ./run_remote_tests.sh , ./verify_rootfs_chksum.sh , ./set_shared_user_password.sh BUG=n0ne Change-Id: Ic2b7484e53e6a977ed6ae675fe99e109b385020d Review URL: http://codereview.chromium.org/5946003 --- common.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/common.sh b/common.sh index a11f257289..5510b2c3af 100644 --- a/common.sh +++ b/common.sh @@ -234,12 +234,9 @@ function restart_in_chroot_if_needed { # NB: Pass in ARGV: restart_in_chroot_if_needed "$@" if [ $INSIDE_CHROOT -ne 1 ] then - local abspath=$(readlink -f "$0") - # strip everything up to (and including) /src/scripts/ from abspath - local path_from_scripts="${abspath##*/src/scripts/}" + # Equivalent to enter_chroot.sh -- exec $SCRIPTS_DIR/enter_chroot.sh -- \ - "$CHROOT_TRUNK_DIR/src/scripts/$path_from_scripts" "$@" - exit + $CHROOT_TRUNK_DIR/src/scripts/$(basename $0) "$@" fi } From d523d23f2eb272f8218d2449bdaf80d6e98473ad Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Fri, 17 Dec 2010 12:35:34 -0800 Subject: [PATCH 07/21] Remove explicit call to build Chrome. Since the package.keywords change, it's already built as part of build_packages. With this change we don't have to needlessly build chrome twice as part of the pfq. Change-Id: I8dae745496a5d6f6213663b034ffe8d279d4efd3 BUG=chromium-os:8693 TEST=Ran unittests Review URL: http://codereview.chromium.org/5973003 --- bin/cbuildbot.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py index 8424e9e527..be066b0dbd 100755 --- a/bin/cbuildbot.py +++ b/bin/cbuildbot.py @@ -367,14 +367,6 @@ def _Build(buildroot, emptytree): RunCommand(cmd, cwd=cwd, enter_chroot=True) -def _BuildChrome(buildroot, board, chrome_atom_to_build): - """Wrapper for emerge call to build Chrome.""" - cwd = os.path.join(buildroot, 'src', 'scripts') - RunCommand(['emerge-%s' % board, - '=%s' % chrome_atom_to_build], - cwd=cwd, enter_chroot=True) - - def _EnableLocalAccount(buildroot): cwd = os.path.join(buildroot, 'src', 'scripts') # Set local account for test images. @@ -700,9 +692,6 @@ def main(): if options.sync: _Build(buildroot, emptytree) - if chrome_atom_to_build: - _BuildChrome(buildroot, buildconfig['board'], chrome_atom_to_build) - if buildconfig['unittests'] and options.tests: _RunUnitTests(buildroot) From 40fa0ded27c6480adef0f0a4956769dd14edea05 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Fri, 17 Dec 2010 13:15:05 -0800 Subject: [PATCH 08/21] Fixes to get ctest up and running again. We had a major issue because the latest dev channel release pre-dates the virtio change. Because of this, ctest was connecting to update that channel using virtio (which is unsupported for that). This change drops a file telling the vm lib to use e1000 as before. Also, fixed stateful change logic. Change-Id: I394a8cece71bdd0d55efa21ba5b6d24804432c6b BUG=chromium-os:10434 TEST=Ran it with ctest and cros_au_test_harness on images with/without the file. Review URL: http://codereview.chromium.org/5928005 --- bin/cros_au_test_harness.py | 46 ++++++++++++++++++++++--------------- bin/ctest.py | 8 +++++++ lib/cros_vm_lib.sh | 8 ++++++- 3 files changed, 43 insertions(+), 19 deletions(-) diff --git a/bin/cros_au_test_harness.py b/bin/cros_au_test_harness.py index 0e484947ab..6e537036ae 100755 --- a/bin/cros_au_test_harness.py +++ b/bin/cros_au_test_harness.py @@ -85,14 +85,14 @@ class AUTest(object): if self.use_delta_updates: try: self.source_image = src_image - self._UpdateImageReportError(image) + self._UpdateImageReportError(image, stateful_change) except: Warning('Delta update failed, disabling delta updates and retrying.') self.use_delta_updates = False self.source_image = '' - self._UpdateImageReportError(image) + self._UpdateImageReportError(image, stateful_change) else: - self._UpdateImageReportError(image) + self._UpdateImageReportError(image, stateful_change) def _UpdateImageReportError(self, image_path, stateful_change='old', proxy_port=None): @@ -125,8 +125,8 @@ class AUTest(object): self.PrepareBase(target_image_path) - # The devserver runs at port 8080 by default. We assume that here, and - # start our proxy at 8081. We then tell our update tools to have the + # The devserver runs at port 8080 by default. We assume that here, and + # start our proxy at 8081. We then tell our update tools to have the # client connect to 8081 instead of 8080. proxy_port = 8081 proxy = cros_test_proxy.CrosTestProxy(port_in=proxy_port, @@ -298,15 +298,15 @@ class AUTest(object): class InterruptionFilter(cros_test_proxy.Filter): """This filter causes the proxy to interrupt the download 3 times - + It does this by closing the first three connections to transfer - 2M total in the outbound connection after they transfer the + 2M total in the outbound connection after they transfer the 2M. """ def __init__(self): """Defines variable shared across all connections""" self.close_count = 0 - + def setup(self): """Called once at the start of each connection.""" self.data_size = 0 @@ -321,9 +321,9 @@ class AUTest(object): if self.data_size > (2 * 1024 * 1024): self.close_count += 1 return None - + self.data_size += len(data) - return data + return data self._AttemptUpdateWithFilter(InterruptionFilter()) @@ -332,7 +332,7 @@ class AUTest(object): class DelayedFilter(cros_test_proxy.Filter): """Causes intermittent delays in data transmission. - + It does this by inserting 3 20 second delays when transmitting data after 2M has been sent. """ @@ -351,13 +351,23 @@ class AUTest(object): if self.data_size > (2 * 1024 * 1024): self.delay_count += 1 time.sleep(20) - - self.data_size += len(data) - return data + self.data_size += len(data) + return data self._AttemptUpdateWithFilter(DelayedFilter()) + def SimpleTest(self): + """A simple update that updates the target image to itself. + + We explicitly don't use test prefix so that isn't run by default. Can be + run using test_prefix option. + """ + self.PrepareBase(target_image_path) + self.UpdateImage(target_image_path) + self.VerifyImage(100) + + class RealAUTest(unittest.TestCase, AUTest): """Test harness for updating real images.""" @@ -380,7 +390,7 @@ class RealAUTest(unittest.TestCase, AUTest): ] if proxy_port: - cmd.append('--proxy_port=%s' % proxy_port) + cmd.append('--proxy_port=%s' % proxy_port) if self.verbose: try: @@ -406,7 +416,7 @@ class RealAUTest(unittest.TestCase, AUTest): ] if proxy_port: - cmd.append('--proxy_port=%s' % proxy_port) + cmd.append('--proxy_port=%s' % proxy_port) if self.verbose: try: @@ -491,7 +501,7 @@ class VirtualAUTest(unittest.TestCase, AUTest): ] if proxy_port: - cmd.append('--proxy_port=%s' % proxy_port) + cmd.append('--proxy_port=%s' % proxy_port) if self.verbose: try: @@ -524,7 +534,7 @@ class VirtualAUTest(unittest.TestCase, AUTest): ] if proxy_port: - cmd.append('--proxy_port=%s' % proxy_port) + cmd.append('--proxy_port=%s' % proxy_port) if self.verbose: try: diff --git a/bin/ctest.py b/bin/ctest.py index 3310056df7..135ecfed38 100755 --- a/bin/ctest.py +++ b/bin/ctest.py @@ -22,6 +22,7 @@ from cros_build_lib import RunCommand from cros_build_lib import Warning _IMAGE_TO_EXTRACT = 'chromiumos_test_image.bin' +_NEW_STYLE_VERSION = '0.9.131.0' class HTMLDirectoryParser(HTMLParser.HTMLParser): """HTMLParser for parsing the default apache file index.""" @@ -216,6 +217,13 @@ def GrabZipAndExtractImage(zip_url, download_folder, image_name) : fh.write(zip_url) fh.close() + version = zip_url.split('/')[-2] + if not _GreaterVersion(version, _NEW_STYLE_VERSION) == version: + # If the version isn't ready for new style, touch file to use old style. + old_style_touch_path = os.path.join(download_folder, '.use_e1000') + fh = open(old_style_touch_path, 'w+') + fh.close() + def RunAUTestHarness(board, channel, latest_url_base, zip_server_base, no_graphics, type, remote): diff --git a/lib/cros_vm_lib.sh b/lib/cros_vm_lib.sh index 3048c3dd30..741c5feae5 100644 --- a/lib/cros_vm_lib.sh +++ b/lib/cros_vm_lib.sh @@ -70,11 +70,17 @@ function start_kvm() { snapshot="-snapshot" fi + local net_option="-net nic,model=virtio" + if [ -f "$(dirname $1)/.use_e1000" ]; then + info "Detected older image, using e1000 instead of virtio." + net_option="-net nic,model=e1000" + fi + sudo kvm -m 1024 \ -vga std \ -pidfile "${KVM_PID_FILE}" \ -daemonize \ - -net nic,model=virtio \ + ${net_option} \ ${nographics} \ ${snapshot} \ -net user,hostfwd=tcp::${FLAGS_ssh_port}-:22 \ From 3a13f911951e51b689a52a3b751edd2cbd07f6e5 Mon Sep 17 00:00:00 2001 From: Daniel Erat Date: Fri, 17 Dec 2010 16:36:02 -0800 Subject: [PATCH 09/21] scripts: Update factory mod diff for boot-complete job. I'm changing the boot-complete init script to start on login-prompt-visible instead of login-prompt-ready in http://codereview.chromium.org/5868004/. This also adds a missing description and fixes an outdated email address. BUG=chromium-os:10349 TEST=ran mod_image_for_test.sh with --factory and with --factory_install and checked that resulting image contained boot-complete.conf change Review URL: http://codereview.chromium.org/5975002 Change-Id: I709bc2b4eaaccd222b31388633522c32514206ac --- mod_for_factory_scripts/200patchInitScript | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mod_for_factory_scripts/200patchInitScript b/mod_for_factory_scripts/200patchInitScript index 747f10b215..0244f74533 100755 --- a/mod_for_factory_scripts/200patchInitScript +++ b/mod_for_factory_scripts/200patchInitScript @@ -20,8 +20,8 @@ patch -d "${ROOT_FS_DIR}" -Np1 <"${ROOT_FS_DIR}/etc/init/factory.conf" <"${ROOT_FS_DIR}/etc/init/factorylog.conf" < Date: Sat, 18 Dec 2010 07:18:33 -0800 Subject: [PATCH 10/21] parallel_emerge now uninstalls packages correctly when use flags change. When I added the --force-remote-binary flag, I needed to find a way to get emerge to install binary packages whose use flags were not fully up to date. To do this, I removed the --newuse flag from the call to the emerge depgraph calculation code. This seemed safe at the time because parallel_emerge already checks the use flags of every package it installs. Unfortunately, things are a little more complex. Sometimes, emerge decides to install a different version of a package because of a use flag change. To implement this, Portage needs to know about the --newuse flag. To fix this bug, I've updated parallel_emerge to force in the remote binary packages using a less intrusive method, that only impacts the package that is being forced. This method should have less side effects and allow us to install packages correctly. TEST=./setup_board --board=tegra2_dev-board --force && ./parallel_emerge --board=tegra2_dev-board -uDNvg opengles && ./parallel_emerge --board=tegra2_dev-board -puDNvg board-devices ./parallel_emerge --board=tegra2_dev-board -uDNvg chromeos --force-remote-binary=chromeos-chrome BUG=chromium-os:10423 Change-Id: I2057d2992abcb08f184cfaa6c099bd6eb8c21a99 Review URL: http://codereview.chromium.org/6033001 --- parallel_emerge | 143 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 95 insertions(+), 48 deletions(-) diff --git a/parallel_emerge b/parallel_emerge index 6516c29f5e..930f53dcd6 100755 --- a/parallel_emerge +++ b/parallel_emerge @@ -76,7 +76,8 @@ if "PORTAGE_USERNAME" not in os.environ: from _emerge.actions import adjust_configs from _emerge.actions import load_emerge_config from _emerge.create_depgraph_params import create_depgraph_params -from _emerge.depgraph import backtrack_depgraph +from _emerge.depgraph import depgraph as emerge_depgraph +from _emerge.depgraph import _frozen_depgraph_config from _emerge.main import emerge_main from _emerge.main import parse_opts from _emerge.Package import Package @@ -479,24 +480,9 @@ class DepGraphGenerator(object): cur_iuse, now_use, now_iuse) return not flags - def GenDependencyTree(self, remote_pkgs): - """Get dependency tree info from emerge. - - TODO(): Update cros_extract_deps to also use this code. - Returns: - Dependency tree - """ - start = time.time() - + def CreateDepgraph(self, emerge, packages): + """Create an emerge depgraph object.""" # Setup emerge options. - # - # We treat dependency info a bit differently than emerge itself. Unless - # you're using --usepkgonly, we disable --getbinpkg and --usepkg here so - # that emerge will look at the dependencies of the source ebuilds rather - # than the binary dependencies. This helps ensure that we have the option - # of merging a package from source, if we want to switch to it with - # --workon and the dependencies have changed. - emerge = self.emerge emerge_opts = emerge.opts.copy() # Enable --emptytree so that we get the full tree, which we need for @@ -507,12 +493,86 @@ class DepGraphGenerator(object): emerge_opts["--tree"] = True emerge_opts["--emptytree"] = True - # Tell emerge not to worry about use flags yet. We handle those inside - # parallel_emerge itself. Further, when we use the --force-remote-binary - # flag, we don't emerge to reject a package just because it has different - # use flags. - emerge_opts.pop("--newuse", None) - emerge_opts.pop("--reinstall", None) + # Set up parameters. + params = create_depgraph_params(emerge_opts, emerge.action) + frozen_config = _frozen_depgraph_config(emerge.settings, emerge.trees, + emerge_opts, emerge.spinner) + backtrack_max = emerge_opts.get('--backtrack', 5) + runtime_pkg_mask = None + allow_backtracking = backtrack_max > 0 + + # Try up to backtrack_max times to create a working depgraph. Each time we + # run into a conflict, mask the offending package and try again. + # TODO(davidjames): When Portage supports --force-remote-binary directly, + # switch back to using the backtrack_depgraph function. + for i in range(backtrack_max + 1): + if i == backtrack_max: + # Looks like we hit the backtracking limit. Run the dependency + # calculation one more time (from scratch) to show the original error + # message. + runtime_pkg_mask = None + allow_backtracking = False + + # Create a depgraph object. + depgraph = emerge_depgraph(emerge.settings, emerge.trees, emerge_opts, + params, emerge.spinner, frozen_config=frozen_config, + allow_backtracking=allow_backtracking, + runtime_pkg_mask=runtime_pkg_mask) + + if i == 0: + for cpv in self.forced_remote_binary_packages: + # If --force-remote-binary was specified, we want to use this package + # regardless of its use flags. Unfortunately, Portage doesn't support + # ignoring use flags for just one package. To convince Portage to + # install the package, we trick Portage into thinking the package has + # the right use flags. + # TODO(davidjames): Update Portage to support --force-remote-binary + # directly, so that this hack isn't necessary. + pkg = depgraph._pkg(cpv, "binary", emerge.root_config) + pkgsettings = frozen_config.pkgsettings[pkg.root] + pkgsettings.setcpv(pkg) + pkg.use.enabled = pkgsettings["PORTAGE_USE"].split() + + # Select the packages we want. + success, favorites = depgraph.select_files(packages) + if success: + break + elif depgraph.need_restart(): + # Looks like we found some packages that can't be installed due to + # conflicts. Try again, masking out the conflicting packages. + runtime_pkg_mask = depgraph.get_runtime_pkg_mask() + elif allow_backtracking and i > 0: + # Looks like we tried all the possible combinations, and we still can't + # solve the graph. Stop backtracking, so that we can report an error + # message. + runtime_pkg_mask = None + allow_backtracking = False + else: + break + + # Delete the --tree option, because we don't really want to display a + # tree. We just wanted to get emerge to leave uninstall instructions on + # the graph. Later, when we display the graph, we'll want standard-looking + # output, so removing the --tree option is important. + frozen_config.myopts.pop("--tree", None) + + emerge.depgraph = depgraph + + # Is it impossible to honor the user's request? Bail! + if not success: + depgraph.display_problems() + sys.exit(1) + + def GenDependencyTree(self, remote_pkgs): + """Get dependency tree info from emerge. + + TODO(): Update cros_extract_deps to also use this code. + Returns: + Dependency tree + """ + start = time.time() + + emerge = self.emerge # Create a list of packages to merge packages = set(emerge.cmdline_packages[:]) @@ -527,9 +587,17 @@ class DepGraphGenerator(object): full_pkgname in self.force_remote_binary): forced_pkgs.setdefault(full_pkgname, []).append(pkg) + # Add forced binary packages to the dependency list. This is necessary + # to ensure that the install plan contains the right package. + # + # Putting the forced binary package at the beginning of the list is an + # optimization that helps avoid unnecessary backtracking (e.g., if + # Portage first selects the wrong version, and then backtracks later, it + # takes a bit longer and uses up an unnecessary backtrack iteration.) + packages = list(packages) for pkgs in forced_pkgs.values(): forced_package = portage.versions.best(pkgs) - packages.add("=%s" % forced_package) + packages.insert(0, "=%s" % forced_package) self.forced_remote_binary_packages.add(forced_package) # Tell emerge to be quiet. We print plenty of info ourselves so we don't @@ -544,18 +612,8 @@ class DepGraphGenerator(object): if "--quiet" not in emerge.opts: print "Calculating deps..." - # Ask portage to build a dependency graph. with the options we specified - # above. - params = create_depgraph_params(emerge_opts, emerge.action) - success, depgraph, _ = backtrack_depgraph( - emerge.settings, emerge.trees, emerge_opts, params, emerge.action, - packages, emerge.spinner) - emerge.depgraph = depgraph - - # Is it impossible to honor the user's request? Bail! - if not success: - depgraph.display_problems() - sys.exit(1) + self.CreateDepgraph(emerge, packages) + depgraph = emerge.depgraph # Build our own tree from the emerge digraph. deps_tree = {} @@ -604,11 +662,6 @@ class DepGraphGenerator(object): vardb = frozen_config.trees[root]["vartree"].dbapi pkgsettings = frozen_config.pkgsettings[root] - # It's time to start worrying about use flags, if necessary. - for flag in ("--newuse", "--reinstall"): - if flag in emerge.opts: - emerge_opts[flag] = emerge.opts[flag] - deps_info = {} for pkg in depgraph.altlist(): if isinstance(pkg, Package): @@ -636,12 +689,6 @@ class DepGraphGenerator(object): deps_info[str(pkg.cpv)] = {"idx": len(deps_info), "optional": optional} - # Delete the --tree option, because we don't really want to display a - # tree. We just wanted to get emerge to leave uninstall instructions on - # the graph. Later, when we display the graph, we'll want standard-looking - # output, so removing the --tree option is important. - frozen_config.myopts.pop("--tree", None) - seconds = time.time() - start if "--quiet" not in emerge.opts: print "Deps calculated in %dm%.1fs" % (seconds / 60, seconds % 60) From 6b69ba71218c4d6eed73e564829b112200a56887 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Mon, 20 Dec 2010 11:40:29 -0800 Subject: [PATCH 11/21] Always run build_packages regardless of sync for chrome builder. Change-Id: If08f3a0c1212e3e7d4ae8dc9f8aa92e2454d4d74 BUG=chromium-os:8693 TEST=Ran it Review URL: http://codereview.chromium.org/6016005 --- bin/cbuildbot.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py index be066b0dbd..90e965bb4f 100755 --- a/bin/cbuildbot.py +++ b/bin/cbuildbot.py @@ -688,9 +688,7 @@ def main(): buildconfig['board'], rev_overlays) _EnableLocalAccount(buildroot) - # Doesn't rebuild without acquiring more source. - if options.sync: - _Build(buildroot, emptytree) + _Build(buildroot, emptytree) if buildconfig['unittests'] and options.tests: _RunUnitTests(buildroot) From 702f0e31ca689506cfa18b88fad0f2cb5af6658e Mon Sep 17 00:00:00 2001 From: David James Date: Tue, 21 Dec 2010 12:46:46 -0800 Subject: [PATCH 12/21] Be more selective about what packages we remove so that we can detect conflicts. Right now, the preflight queue unmerges all changed packages prior to upgrading them. This is done to ensure that any lingering state from failed package uprevs is cleaned up. This change updates cros_mark_as_stable to be more selective. This both improves speed and allows for more conflicts to be detected. Change-Id: I3134918eb16b41e8882c8af1f1bdf9052bafd9ad BUG=chromium-os:10127 TEST=Test uprev. Run unit tests. Review URL: http://codereview.chromium.org/5513012 --- cros_mark_as_stable.py | 42 ++++++++++++++++++--------------- cros_mark_as_stable_unittest.py | 30 +++++++++++++++-------- 2 files changed, 43 insertions(+), 29 deletions(-) diff --git a/cros_mark_as_stable.py b/cros_mark_as_stable.py index 9eb092cfd6..013ccd1ca9 100755 --- a/cros_mark_as_stable.py +++ b/cros_mark_as_stable.py @@ -78,15 +78,15 @@ def _Print(message): Info(message) -def _CleanStalePackages(board, package_array): +def _CleanStalePackages(board, package_atoms): """Cleans up stale package info from a previous build.""" - Info('Cleaning up stale packages %s.' % package_array) + Info('Cleaning up stale packages %s.' % package_atoms) unmerge_board_cmd = ['emerge-%s' % board, '--unmerge'] - unmerge_board_cmd.extend(package_array) + unmerge_board_cmd.extend(package_atoms) RunCommand(unmerge_board_cmd) unmerge_host_cmd = ['sudo', 'emerge', '--unmerge'] - unmerge_host_cmd.extend(package_array) + unmerge_host_cmd.extend(package_atoms) RunCommand(unmerge_host_cmd) RunCommand(['eclean-%s' % board, '-d', 'packages'], redirect_stderr=True) @@ -319,15 +319,15 @@ class EBuild(object): """Sets up data about an ebuild from its path.""" from portage.versions import pkgsplit unused_path, self.category, self.pkgname, filename = path.rsplit('/', 3) - unused_pkgname, version_no_rev, rev = pkgsplit( + unused_pkgname, self.version_no_rev, rev = pkgsplit( filename.replace('.ebuild', '')) self.ebuild_path_no_version = os.path.join( os.path.dirname(path), self.pkgname) self.ebuild_path_no_revision = '%s-%s' % (self.ebuild_path_no_version, - version_no_rev) + self.version_no_rev) self.current_revision = int(rev.replace('r', '')) - self.version = '%s-%s' % (version_no_rev, rev) + self.version = '%s-%s' % (self.version_no_rev, rev) self.package = '%s/%s' % (self.category, self.pkgname) self.ebuild_path = path @@ -454,17 +454,19 @@ class EBuildStableMarker(object): OSError: Error occurred while creating a new ebuild. IOError: Error occurred while writing to the new revved ebuild file. Returns: - True if the revved package is different than the old ebuild. + If the revved package is different than the old ebuild, return the full + revved package name, including the version number. Otherwise, return None. """ if self._ebuild.is_stable: - new_stable_ebuild_path = '%s-r%d.ebuild' % ( - self._ebuild.ebuild_path_no_revision, - self._ebuild.current_revision + 1) + stable_version_no_rev = self._ebuild.version_no_rev else: # If given unstable ebuild, use 0.0.1 rather than 9999. - new_stable_ebuild_path = '%s-0.0.1-r%d.ebuild' % ( - self._ebuild.ebuild_path_no_version, - self._ebuild.current_revision + 1) + stable_version_no_rev = '0.0.1' + + new_version = '%s-r%d' % (stable_version_no_rev, + self._ebuild.current_revision + 1) + new_stable_ebuild_path = '%s-%s.ebuild' % ( + self._ebuild.ebuild_path_no_version, new_version) _Print('Creating new stable ebuild %s' % new_stable_ebuild_path) unstable_ebuild_path = ('%s-9999.ebuild' % @@ -480,7 +482,7 @@ class EBuildStableMarker(object): if 0 == RunCommand(diff_cmd, exit_code=True, redirect_stdout=True, redirect_stderr=True, print_cmd=gflags.FLAGS.verbose): os.unlink(new_stable_ebuild_path) - return False + return None else: _Print('Adding new stable ebuild to git') _SimpleRunCommand('git add %s' % new_stable_ebuild_path) @@ -489,7 +491,7 @@ class EBuildStableMarker(object): _Print('Removing old ebuild from git') _SimpleRunCommand('git rm %s' % old_ebuild_path) - return True + return '%s-%s' % (self._ebuild.package, new_version) @classmethod def CommitChange(cls, message): @@ -556,16 +558,18 @@ def main(argv): # Contains the array of packages we actually revved. revved_packages = [] + new_package_atoms = [] for ebuild in ebuilds: try: _Print('Working on %s' % ebuild.package) worker = EBuildStableMarker(ebuild) commit_id = ebuild.GetCommitId() - if worker.RevWorkOnEBuild(commit_id): + new_package = worker.RevWorkOnEBuild(commit_id) + if new_package: message = _GIT_COMMIT_MESSAGE % (ebuild.package, commit_id) worker.CommitChange(message) revved_packages.append(ebuild.package) - + new_package_atoms.append('=%s' % new_package) except (OSError, IOError): Warning('Cannot rev %s\n' % ebuild.package, 'Note you will have to go into %s ' @@ -573,7 +577,7 @@ def main(argv): raise if revved_packages: - _CleanStalePackages(gflags.FLAGS.board, revved_packages) + _CleanStalePackages(gflags.FLAGS.board, new_package_atoms) if gflags.FLAGS.drop_file: fh = open(gflags.FLAGS.drop_file, 'w') fh.write(' '.join(revved_packages)) diff --git a/cros_mark_as_stable_unittest.py b/cros_mark_as_stable_unittest.py index 4f9763e7f9..a2fcbd5ad3 100755 --- a/cros_mark_as_stable_unittest.py +++ b/cros_mark_as_stable_unittest.py @@ -129,6 +129,7 @@ class EBuildTest(mox.MoxTestBase): self.mox.ReplayAll() fake_ebuild = cros_mark_as_stable.EBuild(fake_ebuild_path) self.mox.VerifyAll() + self.assertEquals(fake_ebuild.version_no_rev, '0.0.1') self.assertEquals(fake_ebuild.ebuild_path_no_revision, '/path/to/test_package/test_package-0.0.1') self.assertEquals(fake_ebuild.ebuild_path_no_version, @@ -144,6 +145,7 @@ class EBuildTest(mox.MoxTestBase): fake_ebuild = cros_mark_as_stable.EBuild(fake_ebuild_path) self.mox.VerifyAll() + self.assertEquals(fake_ebuild.version_no_rev, '9999') self.assertEquals(fake_ebuild.ebuild_path_no_revision, '/path/to/test_package/test_package-9999') self.assertEquals(fake_ebuild.ebuild_path_no_version, @@ -160,12 +162,14 @@ class EBuildStableMarkerTest(mox.MoxTestBase): self.mox.StubOutWithMock(os, 'unlink') self.m_ebuild = self.mox.CreateMock(cros_mark_as_stable.EBuild) self.m_ebuild.is_stable = True - self.m_ebuild.package = 'test_package' + self.m_ebuild.package = 'test_package/test_package' + self.m_ebuild.version_no_rev = '0.0.1' self.m_ebuild.current_revision = 1 self.m_ebuild.ebuild_path_no_revision = '/path/test_package-0.0.1' self.m_ebuild.ebuild_path_no_version = '/path/test_package' self.m_ebuild.ebuild_path = '/path/test_package-0.0.1-r1.ebuild' self.revved_ebuild_path = '/path/test_package-0.0.1-r2.ebuild' + self.unstable_ebuild_path = '/path/test_package-9999.ebuild' def testRevWorkOnEBuild(self): self.mox.StubOutWithMock(cros_mark_as_stable.fileinput, 'input') @@ -197,8 +201,9 @@ class EBuildStableMarkerTest(mox.MoxTestBase): self.mox.ReplayAll() marker = cros_mark_as_stable.EBuildStableMarker(self.m_ebuild) - marker.RevWorkOnEBuild('my_id', redirect_file=m_file) + result = marker.RevWorkOnEBuild('my_id', redirect_file=m_file) self.mox.VerifyAll() + self.assertEqual(result, 'test_package/test_package-0.0.1-r2') def testRevUnchangedEBuild(self): self.mox.StubOutWithMock(cros_mark_as_stable.fileinput, 'input') @@ -229,8 +234,9 @@ class EBuildStableMarkerTest(mox.MoxTestBase): self.mox.ReplayAll() marker = cros_mark_as_stable.EBuildStableMarker(self.m_ebuild) - marker.RevWorkOnEBuild('my_id', redirect_file=m_file) + result = marker.RevWorkOnEBuild('my_id', redirect_file=m_file) self.mox.VerifyAll() + self.assertEqual(result, None) def testRevMissingEBuild(self): self.mox.StubOutWithMock(cros_mark_as_stable.fileinput, 'input') @@ -239,6 +245,11 @@ class EBuildStableMarkerTest(mox.MoxTestBase): self.mox.StubOutWithMock(cros_mark_as_stable, 'Die') m_file = self.mox.CreateMock(file) + revved_ebuild_path = self.m_ebuild.ebuild_path + self.m_ebuild.ebuild_path = self.unstable_ebuild_path + self.m_ebuild.is_stable = False + self.m_ebuild.current_revision = 0 + # Prepare mock fileinput. This tests to make sure both the commit id # and keywords are changed correctly. mock_file = ['EAPI=2', 'CROS_WORKON_COMMIT=old_id', @@ -247,25 +258,24 @@ class EBuildStableMarkerTest(mox.MoxTestBase): ebuild_9999 = self.m_ebuild.ebuild_path_no_version + '-9999.ebuild' cros_mark_as_stable.os.path.exists(ebuild_9999).AndReturn(False) cros_mark_as_stable.Die("Missing unstable ebuild: %s" % ebuild_9999) - cros_mark_as_stable.shutil.copyfile(ebuild_9999, self.revved_ebuild_path) - cros_mark_as_stable.fileinput.input(self.revved_ebuild_path, + cros_mark_as_stable.shutil.copyfile(ebuild_9999, revved_ebuild_path) + cros_mark_as_stable.fileinput.input(revved_ebuild_path, inplace=1).AndReturn(mock_file) m_file.write('EAPI=2') m_file.write('CROS_WORKON_COMMIT="my_id"\n') m_file.write('KEYWORDS="x86 arm"') m_file.write('src_unpack(){}') - diff_cmd = ['diff', '-Bu', self.m_ebuild.ebuild_path, - self.revved_ebuild_path] + diff_cmd = ['diff', '-Bu', self.unstable_ebuild_path, revved_ebuild_path] cros_mark_as_stable.RunCommand(diff_cmd, exit_code=True, print_cmd=False, redirect_stderr=True, redirect_stdout=True).AndReturn(1) - cros_mark_as_stable._SimpleRunCommand('git add ' + self.revved_ebuild_path) - cros_mark_as_stable._SimpleRunCommand('git rm ' + self.m_ebuild.ebuild_path) + cros_mark_as_stable._SimpleRunCommand('git add ' + revved_ebuild_path) self.mox.ReplayAll() marker = cros_mark_as_stable.EBuildStableMarker(self.m_ebuild) - marker.RevWorkOnEBuild('my_id', redirect_file=m_file) + result = marker.RevWorkOnEBuild('my_id', redirect_file=m_file) self.mox.VerifyAll() + self.assertEqual(result, 'test_package/test_package-0.0.1-r1') def testCommitChange(self): From 892e6d8f3c3e3550112143588c41946b3bb8845c Mon Sep 17 00:00:00 2001 From: David James Date: Tue, 21 Dec 2010 12:50:21 -0800 Subject: [PATCH 13/21] Fix failing unit test for cros_mark_as_stable. Change-Id: I683cdbec489395bbce53ae4d4ba45ec3538c2aac BUG=chromium-os:8693 TEST=Run unit tests. Review URL: http://codereview.chromium.org/6089002 --- cros_mark_as_stable_unittest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cros_mark_as_stable_unittest.py b/cros_mark_as_stable_unittest.py index a2fcbd5ad3..40fda64c27 100755 --- a/cros_mark_as_stable_unittest.py +++ b/cros_mark_as_stable_unittest.py @@ -33,7 +33,7 @@ class NonClassTests(mox.MoxTestBase): cros_mark_as_stable.GitBranch.Exists().AndReturn(True) cros_mark_as_stable._SimpleRunCommand('git log --format=format:%s%n%n%b ' + self._tracking_branch + '..').AndReturn(git_log) - cros_mark_as_stable._SimpleRunCommand('git remote update') + cros_mark_as_stable._SimpleRunCommand('repo sync .') cros_mark_as_stable._SimpleRunCommand('git merge --squash %s' % self._branch) cros_mark_as_stable._SimpleRunCommand('git commit -m "%s"' % From e82f07c262482bb45c675d42bc3dd60175f0ad60 Mon Sep 17 00:00:00 2001 From: Daniel Erat Date: Tue, 21 Dec 2010 13:39:22 -0800 Subject: [PATCH 14/21] crosutils: Exclude Xvfb and Xnest from images. These are used to run virtual or nested X servers, which we don't do. Removing the binaries saves 3.4 MB. Change-Id: I528231a781f8a7a0202ca109f8064c3b11ff172b BUG=chromium-os:8073 TEST=built an image and checked that the files were gone Review URL: http://codereview.chromium.org/5990003 --- common.sh | 66 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 14 deletions(-) diff --git a/common.sh b/common.sh index 5510b2c3af..291c112f77 100644 --- a/common.sh +++ b/common.sh @@ -129,21 +129,59 @@ 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="/usr/include /usr/man /usr/share/man /usr/share/doc \ - /usr/share/gtk-doc /usr/share/gtk-2.0 /usr/lib/gtk-2.0/include \ - /usr/share/info /usr/share/aclocal /usr/lib/gcc /usr/lib/pkgconfig \ - /usr/share/pkgconfig /usr/share/gettext /usr/share/readline /etc/runlevels \ - /usr/share/openrc /lib/rc *.a *.la /etc/init.d /usr/lib/debug - /usr/local/autotest /usr/local/autotest-chrome" +DEFAULT_INSTALL_MASK=" + *.a + *.la + /etc/init.d + /etc/runlevels + /lib/rc + /usr/bin/Xnest + /usr/bin/Xvfb + /usr/include + /usr/lib/debug + /usr/lib/gcc + /usr/lib/gtk-2.0/include + /usr/lib/pkgconfig + /usr/local/autotest + /usr/local/autotest-chrome + /usr/man + /usr/share/aclocal + /usr/share/doc + /usr/share/gettext + /usr/share/gtk-2.0 + /usr/share/gtk-doc + /usr/share/info + /usr/share/man + /usr/share/openrc + /usr/share/pkgconfig + /usr/share/readline + " -FACTORY_INSTALL_MASK="/opt/google/chrome /opt/google/o3d /opt/netscape \ - /opt/google/talkplugin /opt/Qualcomm /opt/Synaptics \ - /usr/lib/dri /usr/lib/python2.6/test \ - /usr/share/chewing /usr/share/fonts \ - /usr/share/ibus-pinyin /usr/share/libhangul /usr/share/locale \ - /usr/share/m17n /usr/share/mime /usr/share/sounds /usr/share/tts \ - /usr/share/X11 /usr/share/zoneinfo /usr/lib/debug - /usr/local/autotest /usr/local/autotest-chrome /usr/local/autotest-pkgs" +FACTORY_INSTALL_MASK=" + /opt/Qualcomm + /opt/Synaptics + /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 + /usr/share/fonts + /usr/share/ibus-pinyin + /usr/share/libhangul + /usr/share/locale + /usr/share/m17n + /usr/share/mime + /usr/share/sounds + /usr/share/tts + /usr/share/zoneinfo + " # Check to ensure not running old scripts V_REVERSE='' From c6c925d8efea14f7e34c155691a9b7f56ef48bc5 Mon Sep 17 00:00:00 2001 From: Don Garrett Date: Tue, 21 Dec 2010 13:41:57 -0800 Subject: [PATCH 15/21] image_to_live verifies root_dev changed. Without this, image_to_live can sometimes think that an update from the same version to same version worked when it failed. BUG=chromium-os:9002 TEST=By hand (hardware && success only) Review URL: http://codereview.chromium.org/6045004 Change-Id: Ic0835372a45a45785e21ba1527d478f447bcf42a --- image_to_live.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/image_to_live.sh b/image_to_live.sh index 6c237820b5..553cd4d21d 100755 --- a/image_to_live.sh +++ b/image_to_live.sh @@ -329,6 +329,11 @@ function verify_image { fi } +function find_root_dev { + remote_sh "rootdev -s" + echo ${REMOTE_OUT} +} + function main() { assert_outside_chroot @@ -356,6 +361,8 @@ function main() { remote_reboot fi + local initial_root_dev=$(find_root_dev) + if [ -z "${FLAGS_update_url}" ]; then # Start local devserver if no update url specified. start_dev_server @@ -386,6 +393,13 @@ function main() { remote_sh "grep ^CHROMEOS_RELEASE_DESCRIPTION= /etc/lsb-release" if [ ${FLAGS_verify} -eq ${FLAGS_TRUE} ]; then verify_image + + if [ "${initial_root_dev}" == "$(find_root_dev)" ]; then + # At this point, the software version didn't change, but we didn't + # switch partitions either. Means it was an update to the same version + # that failed. + die "The root partition did NOT change. The update failed." + fi else local release_description=$(echo ${REMOTE_OUT} | cut -d '=' -f 2) info "Update was successful and rebooted to $release_description" From 4e32890c9b3884116fcbf79af40103b7853b5752 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Tue, 21 Dec 2010 14:56:32 -0800 Subject: [PATCH 16/21] Add new script to stop a kvm using vm library and use in harness. Change-Id: Ie80843a7b81a37b41ae19fc33244b5c0b8152282 BUG=chromium-os:10434 TEST=Ran it with full au test harness (still running but already showing promise). Review URL: http://codereview.chromium.org/5988006 --- bin/cros_au_test_harness.py | 10 ++++------ bin/cros_stop_vm | 24 ++++++++++++++++++++++++ lib/cros_vm_lib.sh | 1 + 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100755 bin/cros_stop_vm diff --git a/bin/cros_au_test_harness.py b/bin/cros_au_test_harness.py index 6e537036ae..5d5b221760 100755 --- a/bin/cros_au_test_harness.py +++ b/bin/cros_au_test_harness.py @@ -446,12 +446,10 @@ class VirtualAUTest(unittest.TestCase, AUTest): if os.path.exists(pid_file): Warning('Existing %s found. Deleting and killing process' % pid_file) - pid = RunCommand(['sudo', 'cat', pid_file], redirect_stdout=True, - enter_chroot=False) - if pid: - RunCommand(['sudo', 'kill', pid.strip()], error_ok=True, - enter_chroot=False) - RunCommand(['sudo', 'rm', pid_file], enter_chroot=False) + RunCommand(['./cros_stop_vm', '--kvm_pid=%s' % pid_file], + cwd=self.crosutilsbin) + + assert not os.path.exists(pid_file) def setUp(self): """Unit test overriden method. Is called before every test.""" diff --git a/bin/cros_stop_vm b/bin/cros_stop_vm new file mode 100755 index 0000000000..84fa56c291 --- /dev/null +++ b/bin/cros_stop_vm @@ -0,0 +1,24 @@ +#!/bin/bash + +# Copyright (c) 2010 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. +# +# Simple wrapper scipt to stop a vm specified from a pid file. + +. "$(dirname $0)/../common.sh" +. "$(dirname $0)/../lib/cros_vm_lib.sh" + +set -e + +# Parse command line. +FLAGS "$@" || exit 1 +eval set -- "${FLAGS_ARGV}" + +# Requires pid file to be set. +if [ -z "${FLAGS_kvm_pid}" ]; then + die "Must specify file with pid of kvm to kill." +fi + +KVM_PID_FILE="${FLAGS_kvm_pid}" +stop_kvm diff --git a/lib/cros_vm_lib.sh b/lib/cros_vm_lib.sh index 741c5feae5..b0cd1ee6da 100644 --- a/lib/cros_vm_lib.sh +++ b/lib/cros_vm_lib.sh @@ -86,6 +86,7 @@ function start_kvm() { -net user,hostfwd=tcp::${FLAGS_ssh_port}-:22 \ -hda "${1}" + info "KVM started with pid stored in ${KVM_PID_FILE}" LIVE_VM_IMAGE="${1}" fi } From 5a46bfb321e1367af7b4b8ca0cc4b1293b603865 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Wed, 22 Dec 2010 12:14:21 -0800 Subject: [PATCH 17/21] update_kernel: add support for modules and firmware Change-Id: I7b38b5f9656bd21f6c88c5385c1aa0c526f48294 Signed-off-by: Olof Johansson BUG=n0ne TEST=build kernel and firmware, update a mario Review URL: http://codereview.chromium.org/5974003 --- update_kernel.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/update_kernel.sh b/update_kernel.sh index 4166709aea..b5e26d3198 100755 --- a/update_kernel.sh +++ b/update_kernel.sh @@ -14,6 +14,8 @@ DEFINE_string board "" "Override board reported by target" DEFINE_string partition "" "Override kernel partition reported by target" +DEFINE_boolean modules false "Update modules on target" +DEFINE_boolean firmware false "Update firmware on target" function cleanup { cleanup_remote_access @@ -74,6 +76,28 @@ function main() { remote_sh dd if=/tmp/new_kern.bin of="${FLAGS_partition}" + if [[ ${FLAGS_modules} -eq ${FLAGS_TRUE} ]]; then + echo "copying modules" + cmd="tar -C /build/${FLAGS_board}/lib/modules -cjf new_modules.tar ." + ./enter_chroot.sh -- ${cmd} + + remote_cp_to new_modules.tar /tmp/ + + remote_sh mount -o remount,rw / + remote_sh tar -C /lib/modules -xjf /tmp/new_modules.tar + fi + + if [[ ${FLAGS_firmware} -eq ${FLAGS_TRUE} ]]; then + echo "copying firmware" + cmd="tar -C /build/${FLAGS_board}/lib/firmware -cjf new_firmware.tar ." + ./enter_chroot.sh -- ${cmd} + + remote_cp_to new_firmware.tar /tmp/ + + remote_sh mount -o remount,rw / + remote_sh tar -C /lib/firmware -xjf /tmp/new_firmware.tar + fi + remote_reboot remote_sh uname -r -v From b1d17e24eb5027aa7057d330390cbb27e42d0b93 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Wed, 22 Dec 2010 14:10:10 -0800 Subject: [PATCH 18/21] Move git config till after we sync. This deals with the condition where on a clobber we don't actually re-config to use ssh:// until the second run (because git config is called before we first sync the code). Change-Id: Icf1a46aced633b570db9d280b10ae6866af04709 BUG=chromium-os:10545 TEST=Unit tests Review URL: http://codereview.chromium.org/6027006 --- bin/cbuildbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py index 90e965bb4f..ff3fb8a94c 100755 --- a/bin/cbuildbot.py +++ b/bin/cbuildbot.py @@ -74,10 +74,10 @@ def RepoSync(buildroot, retries=_DEFAULT_RETRIES): # The --trace option ensures that repo shows the output from git. This # is needed so that the buildbot can kill us if git is not making # progress. + RunCommand(['repo', '--trace', 'sync'], cwd=buildroot) RunCommand(['repo', 'forall', '-c', 'git', 'config', 'url.ssh://git@gitrw.chromium.org:9222.insteadof', 'http://git.chromium.org/git'], cwd=buildroot) - RunCommand(['repo', '--trace', 'sync'], cwd=buildroot) retries = 0 except: retries -= 1 From 607c0780c0789e38f1ecbc30ac09a5f3cfec44a6 Mon Sep 17 00:00:00 2001 From: Nick Sanders Date: Tue, 28 Dec 2010 22:27:11 -0800 Subject: [PATCH 19/21] Allow disk image target for copy machine. BUG=10531 TEST=build and imaged a mario Change-Id: I60790f178159d707f610ba1668c29179a6c32e61 Review URL: http://codereview.chromium.org/6050006 --- lib/cros_image_common.sh | 20 ++++ make_factory_package.sh | 244 ++++++++++++++++++++++++++------------- 2 files changed, 182 insertions(+), 82 deletions(-) diff --git a/lib/cros_image_common.sh b/lib/cros_image_common.sh index 86bba75504..abfdbc57c9 100644 --- a/lib/cros_image_common.sh +++ b/lib/cros_image_common.sh @@ -168,3 +168,23 @@ image_umount_partition() { umount -d "$mount_point" } + +# Copy a partition from one image to another. +image_partition_copy() { + local src="$1" + local srcpart="$2" + local dst="$3" + local dstpart="$4" + + local srcoffset=$(image_part_offset "${src}" "${srcpart}") + local dstoffset=$(image_part_offset "${dst}" "${dstpart}") + local length=$(image_part_size "${src}" "${srcpart}") + local dstlength=$(image_part_size "${dst}" "${dstpart}") + + if [ "${length}" -gt "${dstlength}" ]; then + exit 1 + fi + + image_dump_partition "${src}" "${srcpart}" | + dd of="${dst}" bs=512 seek="${dstoffset}" conv=notrunc +} diff --git a/make_factory_package.sh b/make_factory_package.sh index 0eb200e52a..71233fb09c 100755 --- a/make_factory_package.sh +++ b/make_factory_package.sh @@ -34,6 +34,11 @@ DEFINE_string release "" \ "Directory and file containing release image: /path/chromiumos_image.bin" DEFINE_string subfolder "" \ "If set, the name of the subfolder to put the payload items inside" +DEFINE_string diskimg "" \ + "If set, the name of the diskimage file to output" +DEFINE_boolean preserve ${FLAGS_FALSE} \ + "If set, reuse the diskimage file, if available" +DEFINE_integer sectors 31277232 "Size of image in sectors" # Parse command line FLAGS "$@" || exit 1 @@ -80,6 +85,35 @@ FACTORY_DIR="$(dirname "${FLAGS_factory}")" RELEASE_IMAGE="$(basename "${FLAGS_release}")" FACTORY_IMAGE="$(basename "${FLAGS_factory}")" +prepare_img() { + local outdev="$FLAGS_diskimg" + local sectors="$FLAGS_sectors" + local force_full="true" + + # We'll need some code to put in the PMBR, for booting on legacy BIOS. + echo "Fetch PMBR" + local pmbrcode="$(mktemp -d)/gptmbr.bin" + sudo dd bs=512 count=1 if="${FLAGS_release}" of="${pmbrcode}" status=noxfer + + echo "Prepare base disk image" + # Create an output file if requested, or if none exists. + if [ -b "${outdev}" ] ; then + echo "Using block device ${outdev}" + elif [ ! -e "${outdev}" -o \ + "$(stat -c %s ${outdev})" != "$(( ${sectors} * 512 ))" -o \ + "$FLAGS_preserve" = "$FLAGS_FALSE" ]; then + echo "Generating empty image file" + image_dump_partial_file /dev/zero 0 "${sectors}" | + dd of="${outdev}" bs=8M + else + echo "Reusing $outdev" + fi + + # Create GPT partition table. + install_gpt "${outdev}" 0 0 "${pmbrcode}" 0 "${force_full}" + # Activate the correct partition. + cgpt add -i 2 -S 1 -P 1 "${outdev}" +} prepare_omaha() { sudo rm -rf "${OMAHA_DATA_DIR}/rootfs-test.gz" @@ -145,9 +179,6 @@ compress_and_hash_partition() { fi } -# Clean up stale config and data files. -prepare_omaha - # Decide if we should unpack partition if image_has_part_tools; then IMAGE_IS_UNPACKED= @@ -159,103 +190,144 @@ else IMAGE_IS_UNPACKED=1 fi -# Get the release image. -pushd "${RELEASE_DIR}" >/dev/null -echo "Generating omaha release image from ${FLAGS_release}" -echo "Generating omaha factory image from ${FLAGS_factory}" -echo "Output omaha image to ${OMAHA_DATA_DIR}" -echo "Output omaha config to ${OMAHA_CONF}" +generate_img() { + local outdev="$FLAGS_diskimg" + local sectors="$FLAGS_sectors" -prepare_dir + prepare_img -if [ -n "${IMAGE_IS_UNPACKED}" ]; then - echo "Unpacking image ${RELEASE_IMAGE} ..." >&2 - sudo ./unpack_partitions.sh "${RELEASE_IMAGE}" 2>/dev/null -fi + # Get the release image. + pushd "${RELEASE_DIR}" >/dev/null -release_hash="$(compress_and_hash_memento_image "${RELEASE_IMAGE}")" -sudo chmod a+rw update.gz -mv update.gz rootfs-release.gz -mv rootfs-release.gz "${OMAHA_DATA_DIR}" -echo "release: ${release_hash}" + echo "Release Kernel" + image_partition_copy "${RELEASE_IMAGE}" 2 "${outdev}" 4 -oem_hash="$(compress_and_hash_partition "${RELEASE_IMAGE}" 8 "oem.gz")" -mv oem.gz "${OMAHA_DATA_DIR}" -echo "oem: ${oem_hash}" + echo "Release Rootfs" + image_partition_copy "${RELEASE_IMAGE}" 3 "${outdev}" 5 -efi_hash="$(compress_and_hash_partition "${RELEASE_IMAGE}" 12 "efi.gz")" -mv efi.gz "${OMAHA_DATA_DIR}" -echo "efi: ${efi_hash}" + echo "OEM parition" + image_partition_copy "${RELEASE_IMAGE}" 8 "${outdev}" 8 -popd >/dev/null + popd >/dev/null -# Go to retrieve the factory test image. -pushd "${FACTORY_DIR}" >/dev/null -prepare_dir + # Go to retrieve the factory test image. + pushd "${FACTORY_DIR}" >/dev/null -if [ -n "${IMAGE_IS_UNPACKED}" ]; then - echo "Unpacking image ${FACTORY_IMAGE} ..." >&2 - sudo ./unpack_partitions.sh "${FACTORY_IMAGE}" 2>/dev/null -fi + echo "Factory Kernel" + image_partition_copy "${FACTORY_IMAGE}" 2 "${outdev}" 2 + echo "Factory Rootfs" + image_partition_copy "${FACTORY_IMAGE}" 3 "${outdev}" 3 + echo "Factory Stateful" + image_partition_copy "${FACTORY_IMAGE}" 1 "${outdev}" 1 + echo "EFI Partition" + image_partition_copy "${FACTORY_IMAGE}" 12 "${outdev}" 12 -test_hash="$(compress_and_hash_memento_image "${FACTORY_IMAGE}")" -sudo chmod a+rw update.gz -mv update.gz rootfs-test.gz -mv rootfs-test.gz "${OMAHA_DATA_DIR}" -echo "test: ${test_hash}" + echo "Generated Image at $outdev." + echo "Done" +} -state_hash="$(compress_and_hash_partition "${FACTORY_IMAGE}" 1 "state.gz")" -mv state.gz "${OMAHA_DATA_DIR}" -echo "state: ${state_hash}" +generate_omaha() { + # Clean up stale config and data files. + prepare_omaha -popd >/dev/null + # Get the release image. + pushd "${RELEASE_DIR}" >/dev/null + echo "Generating omaha release image from ${FLAGS_release}" + echo "Generating omaha factory image from ${FLAGS_factory}" + echo "Output omaha image to ${OMAHA_DATA_DIR}" + echo "Output omaha config to ${OMAHA_CONF}" -if [ -n "${FLAGS_firmware_updater}" ]; then - SHELLBALL="${FLAGS_firmware_updater}" - if [ ! -f "$SHELLBALL" ]; then - echo "Failed to find firmware updater: $SHELLBALL." - exit 1 + prepare_dir + + if [ -n "${IMAGE_IS_UNPACKED}" ]; then + echo "Unpacking image ${RELEASE_IMAGE} ..." >&2 + sudo ./unpack_partitions.sh "${RELEASE_IMAGE}" 2>/dev/null fi - firmware_hash="$(compress_and_hash_file "$SHELLBALL" "firmware.gz")" - mv firmware.gz "${OMAHA_DATA_DIR}" - echo "firmware: ${firmware_hash}" -fi + release_hash="$(compress_and_hash_memento_image "${RELEASE_IMAGE}")" + sudo chmod a+rw update.gz + mv update.gz rootfs-release.gz + mv rootfs-release.gz "${OMAHA_DATA_DIR}" + echo "release: ${release_hash}" -# If the file does exist and we are using the subfolder flag we are going to -# append another config. -if [ -n "${FLAGS_subfolder}" ] && - [ -f "${OMAHA_CONF}" ]; then - # Remove the ']' from the last line of the file so we can add another config. - while [ -s "${OMAHA_CONF}" ]; do - # If the last line is null - if [ -z "$(tail -1 "${OMAHA_CONF}")" ]; then - sed -i '$d' "${OMAHA_CONF}" - elif [ "$(tail -1 "${OMAHA_CONF}")" != ']' ]; then - sed -i '$d' "${OMAHA_CONF}" - else - break + oem_hash="$(compress_and_hash_partition "${RELEASE_IMAGE}" 8 "oem.gz")" + mv oem.gz "${OMAHA_DATA_DIR}" + echo "oem: ${oem_hash}" + + popd >/dev/null + + # Go to retrieve the factory test image. + pushd "${FACTORY_DIR}" >/dev/null + prepare_dir + + if [ -n "${IMAGE_IS_UNPACKED}" ]; then + echo "Unpacking image ${FACTORY_IMAGE} ..." >&2 + sudo ./unpack_partitions.sh "${FACTORY_IMAGE}" 2>/dev/null + fi + + test_hash="$(compress_and_hash_memento_image "${FACTORY_IMAGE}")" + sudo chmod a+rw update.gz + mv update.gz rootfs-test.gz + mv rootfs-test.gz "${OMAHA_DATA_DIR}" + echo "test: ${test_hash}" + + state_hash="$(compress_and_hash_partition "${FACTORY_IMAGE}" 1 "state.gz")" + mv state.gz "${OMAHA_DATA_DIR}" + echo "state: ${state_hash}" + + efi_hash="$(compress_and_hash_partition "${FACTORY_IMAGE}" 12 "efi.gz")" + mv efi.gz "${OMAHA_DATA_DIR}" + echo "efi: ${efi_hash}" + + popd >/dev/null + + if [ -n "${FLAGS_firmware_updater}" ]; then + SHELLBALL="${FLAGS_firmware_updater}" + if [ ! -f "$SHELLBALL" ]; then + echo "Failed to find firmware updater: $SHELLBALL." + exit 1 fi - done - # Remove the last ] - if [ "$(tail -1 "${OMAHA_CONF}")" = ']' ]; then - sed -i '$d' "${OMAHA_CONF}" + firmware_hash="$(compress_and_hash_file "$SHELLBALL" "firmware.gz")" + mv firmware.gz "${OMAHA_DATA_DIR}" + echo "firmware: ${firmware_hash}" fi - # If the file is empty, create it from scratch - if [ ! -s "${OMAHA_CONF}" ]; then + # If the file does exist and we are using the subfolder flag we are going to + # append another config. + if [ -n "${FLAGS_subfolder}" ] && + [ -f "${OMAHA_CONF}" ]; then + # Remove the ']' from the last line of the file + # so we can add another config. + while [ -s "${OMAHA_CONF}" ]; do + # If the last line is null + if [ -z "$(tail -1 "${OMAHA_CONF}")" ]; then + sed -i '$d' "${OMAHA_CONF}" + elif [ "$(tail -1 "${OMAHA_CONF}")" != ']' ]; then + sed -i '$d' "${OMAHA_CONF}" + else + break + fi + done + + # Remove the last ] + if [ "$(tail -1 "${OMAHA_CONF}")" = ']' ]; then + sed -i '$d' "${OMAHA_CONF}" + fi + + # If the file is empty, create it from scratch + if [ ! -s "${OMAHA_CONF}" ]; then + echo "config = [" >"${OMAHA_CONF}" + fi + else echo "config = [" >"${OMAHA_CONF}" fi -else - echo "config = [" >"${OMAHA_CONF}" -fi -if [ -n "${FLAGS_subfolder}" ]; then - subfolder="${FLAGS_subfolder}/" -fi + if [ -n "${FLAGS_subfolder}" ]; then + subfolder="${FLAGS_subfolder}/" + fi -echo -n "{ + echo -n "{ 'qual_ids': set([\"${FLAGS_board}\"]), 'factory_image': '${subfolder}rootfs-test.gz', 'factory_checksum': '${test_hash}', @@ -268,20 +340,28 @@ echo -n "{ 'stateimg_image': '${subfolder}state.gz', 'stateimg_checksum': '${state_hash}'," >>"${OMAHA_CONF}" -if [ -n "${FLAGS_firmware_updater}" ] ; then - echo -n " + if [ -n "${FLAGS_firmware_updater}" ] ; then + echo -n " 'firmware_image': '${subfolder}firmware.gz', 'firmware_checksum': '${firmware_hash}'," >>"${OMAHA_CONF}" -fi + fi -echo -n " + echo -n " }, ] " >>"${OMAHA_CONF}" -echo "The miniomaha server lives in src/platform/dev. + echo "The miniomaha server lives in src/platform/dev. To validate the configutarion, run: python2.6 devserver.py --factory_config miniomaha.conf \ --validate_factory_config To run the server: python2.6 devserver.py --factory_config miniomaha.conf" +} + +# Main +if [ -n "$FLAGS_diskimg" ]; then + generate_img +else + generate_omaha +fi From 70311cdfdd9acdbb885f442c1fcc17935f81d4c6 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Wed, 29 Dec 2010 15:23:15 -0800 Subject: [PATCH 20/21] Change logic to auto-rev for latest_release and sticky branch. Also some cleanup and fixing so we don't create unnecessary ebuilds. I noticed that both the latest release and stable release code were trying to rev the same branch whenever we moved to a new stable version. It was harmless before but now that we're pushing this as stable we want exactly to have the minimum number of revs that are correct Change-Id: I9f834d35be8e85c27ab0505ec81637f9a3c27b88 BUG= TEST=Unittests and mocked in my own directory by creating new stable branch. Review URL: http://codereview.chromium.org/6025012 --- bin/cros_mark_chrome_as_stable.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bin/cros_mark_chrome_as_stable.py b/bin/cros_mark_chrome_as_stable.py index d7a75605e6..dc006a7b92 100755 --- a/bin/cros_mark_chrome_as_stable.py +++ b/bin/cros_mark_chrome_as_stable.py @@ -264,9 +264,12 @@ def MarkChromeEBuildAsStable(stable_candidate, unstable_ebuild, chrome_rev, new_ebuild_path = base_path + ('%s-r1.ebuild' % portage_suffix) + # Mark latest release and sticky branches as stable. + mark_stable = chrome_rev != TIP_OF_TRUNK + cros_mark_as_stable.EBuildStableMarker.MarkAsStable( unstable_ebuild.ebuild_path, new_ebuild_path, 'CROS_SVN_COMMIT', commit, - make_stable=False) + make_stable=mark_stable) new_ebuild = ChromeEBuild(new_ebuild_path) if stable_candidate and ( stable_candidate.chrome_version == new_ebuild.chrome_version): @@ -321,12 +324,21 @@ def main(): commit_to_use = _GetTipOfTrunkSvnRevision() elif chrome_rev == LATEST_RELEASE: version_to_uprev = _GetLatestRelease() + # Don't rev on stable branch for latest_release. + if re.match('%s\.\d+' % sticky_branch, version_to_uprev): + Info('Latest release is sticky branch. Nothing to do.') + return else: version_to_uprev = _GetLatestRelease(sticky_branch) stable_candidate = FindChromeUprevCandidate(stable_ebuilds, chrome_rev, sticky_branch) + if stable_candidate: + Info('Stable candidate found %s' % stable_candidate) + else: + Info('No stable candidate found.') + os.chdir(overlay_dir) work_branch = cros_mark_as_stable.GitBranch( cros_mark_as_stable.STABLE_BRANCH_NAME, options.tracking_branch) From 50744ba57c85dc9953cd265dd095b8863a84d61a Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Tue, 4 Jan 2011 12:17:17 -0800 Subject: [PATCH 21/21] Remove try/catch so that ctest blocks builds. All blocking reasons for au test harness flakiness have been resolved. Removing try/catch from ctest so that we propagate the correct error code upon exit. Change-Id: Iee1f09ade37ac7a590c2dbf4ebb96985818f1882 BUG=chromium-os:10434 TEST=Ran ctest unittests. Review URL: http://codereview.chromium.org/5971009 --- bin/ctest.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bin/ctest.py b/bin/ctest.py index 135ecfed38..3f7da2b9f8 100755 --- a/bin/ctest.py +++ b/bin/ctest.py @@ -307,9 +307,5 @@ def main(): if __name__ == '__main__': - try: - main() - except Exception: - print "Got exception." - traceback.print_exc(file=sys.stdout) + main()