Commit Graph

14 Commits

Author SHA1 Message Date
David James
359d3e119d Simplify boilerplate common.sh code in src/scripts.
Currently, the scripts in src/scripts have multiple implementations
for handling when common.sh fails to load, some of which are buggy.
To simplify the boilerplate, these scripts now just exit if common.sh
fails to load. The shell itself will print the following message if
common.sh is not found:
  /usr/lib/crosutils/common.sh: No such file or directory

BUG=chromium-os:32442
TEST=Run these scripts with and without common.sh installed.

Change-Id: Ie54420b6c649774f9cb039c14c80f4cf6c6ebc07
Reviewed-on: https://gerrit.chromium.org/gerrit/27058
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
2012-07-12 10:55:37 -07:00
Brian Harring
aa13ea4658 Shift crosutils scripts to use the common.sh they were written against.
Rather than trying to use an old/stale common.sh, use the common.sh
from the invocation point- if invoked via /usr/lib/crosutils, use that
common.sh.  If invoked via src/scripts/, use that, etc.

Trying to intermix it just introduces potential for bugs and invalidly
freezes common.sh api, thus the efforts to revert this and ultimately
revert the existing of a crosutils ebuild.

BUG=chromium-os:27201
TEST=cbuildbot x86-generic-full

Change-Id: I4c6c5fbade3d28c71752bd4c44dccad49af52ec0
Reviewed-on: https://gerrit.chromium.org/gerrit/18303
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-03-15 23:35:06 -07:00
Brian Harring
d5d5dbffa1 Fix/standardize exiting if common.sh can't be found
The problem here is that most were doing their exiting w/in a subshell;
exit within a subshell kills the subshell, not the parent.  Not all scripts
were using set -e (which would pick up the failing subshell); as such
just rewriting them to remove the potential via eliminateing the subshelling.

Beyond that, removed a couple of custom (working, although non-standard)
approaches, and removed a duplicate common.sh sourc'ing w/in mk_memento_images.sh

TEST=force 'find_common_sh' to fail, note the scripts fails to exit
BUG=none

Change-Id: Ia1108a091a6399ad6aedd3cade4a107f4411686c
Reviewed-on: http://gerrit.chromium.org/gerrit/3905
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2011-07-22 12:06:59 -07:00
Zdenek Behan
99f7a5397d scripts: call devserver/payload generators from chroot & delete moved scripts
BUG=chromium-os:5246

TEST=below, During all tests, the directory platform/dev was manually removed
1) Ran cros_au_test_harness.py and saw it succeed
2) Ran generate_au_zip.py, compared the generated .zip with one before this
patch - they were identical
3) Ran cros_image_to_target.py and saw it succeed

Change-Id: Iab2620245a45442b79ee8369f3af1a3990f4644e

Review URL: http://codereview.chromium.org/6576023
2011-03-01 22:57:33 +01:00
Andrew de los Reyes
ed145d0c51 Revert "start_devserver: update relative paths in command line flags"
This reverts commit d5e061957f.

BUG=chromium-os:12122
TEST=None

Review URL: http://codereview.chromium.org/6534027

Change-Id: I286ac77dd463be067055ecbef6ba2dd0e321cad2
2011-02-17 12:26:38 -08:00
Andrew de los Reyes
d5e061957f start_devserver: update relative paths in command line flags
Because this scripts changes directory, it's possible for relative
paths to be incorrect when read by the actual dev server. This fixes
the issue by prepending the current working directory to relative path
args.

BUG=chromium-os:12122
TEST=tested relative paths w/ dev server

Change-Id: I7a85e4af5df291ec78afb0f2c1580855c38a258e

Review URL: http://codereview.chromium.org/6525011
2011-02-17 10:44:00 -08:00
Greg Spencer
798d75f3be This starts to fix the scripts so that they load from /usr/lib/crosutils
from within the chroot.

It also fixes a number of style issues.

It changes the meaning of cros_workon "list-all" to list all available
packages, and adds "list-live" to list all live packages.

It changes things that load chromeos-common.sh from the installer to
load it from /usr/lib/installer.

BUG=chromium-os:4230
TEST=synced, rebuilt chroot, made packages, made images, built chrome
from source, and wrote an image to a USB stick.

Review URL: http://codereview.chromium.org/6240018

Change-Id: I90c34420af1a64020402bafef8e9e77f56837c02
2011-02-01 22:04:49 -08:00
Tan Gao
ffbe06d6d1 remove update_engine flag from start_devserver
Change-Id: Ie54dcad3e12b51272f05dbb5f2de5bfb994c6f90

Review URL: http://codereview.chromium.org/2897011
2010-07-12 15:22:53 -07:00
Darin Petkov
16ca07c92e Use PKG_INSTALL_MASK to prevent debug symbols from getting into the binpkg.
The mask is set only if it's not set already. Also, it picks up the default
install mask from common.sh.

BUG=none
TEST=gmerged chromeos-chrome with PKG_INSTALL_MASK set/unset.

Review URL: http://codereview.chromium.org/2907005
2010-07-08 15:17:01 -07:00
Tan Gao
f5a61e900c add boolean flag to start_devserver to support requests from update_engine
Change-Id: Iaea128d9626ff93ec600d3a2b878885a2efefb28

Review URL: http://codereview.chromium.org/2817049
2010-07-02 13:53:17 -07:00
Sean O'Connor
07eec0a9c2 Make stateful_update use ping_omaha's flags. small devserver cleanups.
TEST=Tested this by running it locally on my workstation and calling both stateful_update and memento_updater on a ToT build of chromiumOS on an eee1008HA.

Review URL: http://codereview.chromium.org/2283003
2010-05-27 17:53:32 -07:00
Don Garrett
640a0585f5 Added restart_in_chroot_if_needed to common.sh.
Add restart_in_chroot_if_needed to common.sh, and modify the build scripts which referred to assert_inside_chroot to use it instead. The effect is that you don't ever have to explicitly enter_chroot.sh to build (still can, it work's fine).

Update mod_image_for_test.sh to use restart_in_chroot_if_needed

Review URL: http://codereview.chromium.org/1736025
2010-05-04 16:54:28 -07:00
Sean O'Connor
505822a37c adds Devserver support for statically serving versioned updates.
Also decouples it from the chroot when run in serve-only mode.

Review URL: http://codereview.chromium.org/1141001
2010-03-20 23:23:48 -07:00
Darin Petkov
9a0a96dbbd Move the dev server script to src/scripts and remove the .sh extension.
Review URL: http://codereview.chromium.org/1153005
2010-03-19 16:24:45 -07:00