Commit Graph

2074 Commits

Author SHA1 Message Date
Mike Frysinger
4d8c285509 enter_chroot: fix spurious resolv.conf warning
When bootstrapping for the first time, files in chroot/etc/ might not
exist, so we can't run `find` on them.  This manifests itself currently
by spitting out the warning on all initial sdk boots:
	find: `.../chroot/etc/resolv.conf': No such file or directory

People can find this confusing and cause sheriffs to waste time on the
wrong thing, so rework the code to avoid this.

BUG=None
TEST=`cros_sdk --delete ; cros_sdk` no longer warns about resolv.conf

Change-Id: I83f892e325e63e682aeb370a9dfc33e284e059d2
Reviewed-on: https://gerrit.chromium.org/gerrit/22845
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-05-16 20:52:30 -07:00
Mike Frysinger
9e5b0a43ba enter_chroot: use /proc/mounts rather than mount
Since /etc/mtab could be stale, use /proc/mounts instead.

BUG=None
TEST=`cros_sdk` in diff terminals still works

Change-Id: I526e5173581820c6983fe3702493a0349c1232c3
Reviewed-on: https://gerrit.chromium.org/gerrit/22860
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-05-16 16:05:42 -07:00
Zdenek Behan
2fbd5af6a8 Make use of cros_setup_toolchains, take 2
Resubmit of If62b4f3973f02fd8e1deed35864c824a02ab0c22
This will be safe to land after
I2c4e21ec7e8c0c0cf58947e2b0a3a9edf7617a09
The breakage was a timing issue paired with people not always syncing
the complete tree. No changes to the CL are needed.

It is now used for:
- make_chroot (cros_sdk --bootstrap)
- update_chroot

setup_board is stripped of redundant code which was deprecated by this.

Also stripped is some usepkg logic in make_chroot, as that is now
exclusively source-only.

BUG=chromium-os:23032
TEST=trybot chromiumos-sdk

Change-Id: Ib888cf2886218622d9cfeebb17b9cd4462d06c89
Reviewed-on: https://gerrit.chromium.org/gerrit/22578
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: asharif <asharif@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
2012-05-14 18:43:04 -07:00
Michael Krebs
11454a191d scripts: Remove call to switch_to_strict_mode
My change in https://gerrit.chromium.org/gerrit/19795 had removed the "set
-e", but https://gerrit.chromium.org/gerrit/17225 re-enabled it --
presumably because that was originally written when the "set -e" was still
there.  The strict mode causes the script to exit when sym_upload fails
(which is often).

BUG=chromium-os:30878
TEST=Basic run of script

Change-Id: I2398341505eb9e375f5cb9e008d6c342e4f3b072
Reviewed-on: https://gerrit.chromium.org/gerrit/22617
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
2012-05-14 17:09:06 -07:00
David James
5e3342f369 Add conversion script to convert 2GB boards to 32bit.
BUG=chromium-os:30820
TEST=Launch incremental buildbots for these overlays and confirm they
     are converted to 32bit successfully.

Change-Id: I5ba9294d8b00204110c304a48c0c5f3c0cae9751
Reviewed-on: https://gerrit.chromium.org/gerrit/22497
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2012-05-14 13:01:22 -07:00
Vic Yang
d0694f5ac9 Check kernel image size when building image
Kernel and ramdisk image together are copied into a 16MB partition.
This CL logs their size when building image. If they are larger than
14MB, warning message is emitted. If they reached 16MB, building fails.

BUG=chromium-os:27739
TEST=Build success on x86 and arm.
     Check log and see kernel image size logged.
     Lower the size limit to 6MB and build x86 factory install shim and
     see build fail.

Change-Id: I4c4895c2989b302aa0c3624127518468566d1148
Reviewed-on: https://gerrit.chromium.org/gerrit/22543
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-05-13 19:57:51 -07:00
Mike Frysinger
6b1abb2a6f fix up function style
The "function" keyword is superfluous, not in POSIX, is inconsistent
between bash files, and generally makes me angry.  So convert every
instance to the form:
	foo() {

BUG=None
TEST=`cbuildbot x86-generic-paladin` works

Change-Id: I97f5ca30a3edfef7222b1e08ac23917dc613b556
Reviewed-on: https://gerrit.chromium.org/gerrit/22467
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-05-11 14:10:38 -07:00
Sean Paul
078164ea85 Reduce kernel loglevel to 0
Change the kernel loglevel from 1 to 0 to avoid showing console
messages on the screen during shutdown.

An example is the "Power down." message that is shown when shutting
down. This appears on the screen because the kernel prints the
message with KERN_EMERG (level 0). As such, 0 < 1, and the message
appears on the screen.

BUG=chromium-os:28602
TEST=Tested on lumpy, saw no messages when shutting down.

Change-Id: Id3842c2203f6cc4bf3bc9165d8537f440fffba61
Reviewed-on: https://gerrit.chromium.org/gerrit/22104
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Sean Paul <seanpaul@chromium.org>
Commit-Ready: Sean Paul <seanpaul@chromium.org>
2012-05-11 12:04:02 -07:00
David James
e6d980631d Switch off --nousepkg flag for tegra2 to save on build speed.
Now that the new compiler has been published, there is no need to use
nousepkg anymore. So we can remove this to speed up builds for folks
who are upgrading.

BUG=none
TEST=Remote trybot run to verify tegra2 toolchain is still upgraded
     to hardfp.

Change-Id: Iad08114f971c6a9e1a84b1101b25ae60e8822751
Reviewed-on: https://gerrit.chromium.org/gerrit/22406
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2012-05-10 16:41:47 -07:00
Mike Frysinger
c3d2145466 update hooks: upgrade softfp dirs to hardfp
We need to move the old softfp builds out of the way so people can
start working with hardfp.

BUG=None
TEST=`./update_chroot` migrated my few arm boards over

Change-Id: I22429a5f7d80ee20b21ab8a8a77157a46a574fdf
Reviewed-on: https://gerrit.chromium.org/gerrit/22368
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-05-10 11:54:16 -07:00
Brian Harring
28bb01f53e Make default parallelization controllable.
Specifically, do this via env for the time being since each program
doesn't necessarily have an option (nor warrant one).

BUG=None
TEST=None

Change-Id: I26e7f06ad5d6a44a7826bfa8465b34154d21b6a3
Reviewed-on: https://gerrit.chromium.org/gerrit/22295
Tested-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2012-05-09 16:06:40 -07:00
Brian Harring
34e0f953e3 Parallelize cros_generate_breakpad_symbols.
This actually turns out to be a prime example of amdahls; generating
symbols for just the chrome binary takes ~120s, and with parallelization
in place for my hardware it now takes just over 120s.

For wall time, on my local hardware this brings it down from ~472 to
~120; can't get any faster w/out speeding up dump_syms itself at this
point.

The way this works is via passing the workers pid down a named pipe
once it's finished.  The usual approch to bash parallelization is
a round robin loop over an array- this doesn't suffice here due
to the aforementioned chrome binary, thus the hash/control pipe
approach.

For output, we're relying on linux's atomic write gurantee for
pipes; all of our output passes through error/info/warn which
internally will chunk each line of text up into a separate
write (I517ffde4d1bb7e2310a74f5a6455b53ba2dea86c added this).
Via this approach (and the explicit check and setup if necessary
of a pipe), we don't have to worry about interleaved output.

Due to the new approch, we no longer report how much raw data
was generated; instead we report the unique end result.  This
is noteworthy since both versions are generating 1742989183 bytes
of data, but the actual ondisk is 1664241402.  While that is
78MB of redundant data generated, it's less than 5% of our
generated data and likely is more trouble removing than it's
worth (it won't bring the runtime down at all after all).

Finally... while I realize this is a bit more complex than
most script tricks we do, frankly this route's pretty straightforward-
while we could rewrite this into python, we run the risk of bugs
during conversion, issues w/ multiprocessing having it's own races,
and generally a bit more pain then was worth the hour to hack this
up.

BUG=chromium-os:23050
TEST=cbuildbot x86-generic-full --remote
TEST=manual runs comparing output before/after

Change-Id: I5dd0f685bbb7f5e63e6a1f998e38156b76e80582
Reviewed-on: https://gerrit.chromium.org/gerrit/21940
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-05-09 11:12:44 -07:00
Brian Harring
7f175a59e1 common.sh: output a backtrace and debug information on failure.
Currently, if set -e spots a nonzero exit we basically have
no real debug information- it just stops immediately without stating
where or why.  This forces our scripts to be stupidly verbose so
we can track roughly where they were, thus when they fail we can
use that information to localize the rough exit point.

Instead we should be traping that set -e induced exit and
outputing necessary debug information to run it down.  This includes
outputing the relevant stack trace, or at least what we can get of
it.

The 'die' function is now enhanced to automatically dump the trace
that lead to it.  For most consumers this is desired- however for
commandline parsing induced dies ("--board is missing" for example),
the trace is noise.  For those cases, a 'die_notrace' function was
added that retains the original non-backtrace behaviour.

Example output via instrumenting cros_generate_breakpad_symbols
w/ the failing command '/bin/false' (nonzero exit code).

Before:
./cros_generate_breakpad_symbols  monkeys --board=x86-alex
<no output at all, just exit code 1>

With this CL:
./cros_generate_breakpad_symbols  monkeys --board=x86-alex
ERROR   : script called: ./cros_generate_breakpad_symbols 'monkeys' '--board=x86-alex'
ERROR   : Backtrace:  (most recent call is last)
ERROR   :   file cros_generate_breakpad_symbols, line 207, called: main 'monkeys' '--board=x86-alex'
ERROR   :   file cros_generate_breakpad_symbols, line 163, called: die_err_trap '/bin/false' '1'
ERROR   :
ERROR   : Command failed:
ERROR   :   Command '/bin/false' exited with nonzero code: 1

BUG=chromium-os:30598
TEST=inject a failing command into a script, verify the output.
TEST=inject a 'command not found', verify the output
TEST=cbuildbot x86-generic-full --remote
TEST=cbuildbot arm-tegra2-full --remote
TEST=cbuildbot chromiumos-sdk --remote

Change-Id: I517ffde4d1bb7e2310a74f5a6455b53ba2dea86c
Reviewed-on: https://gerrit.chromium.org/gerrit/17225
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
2012-05-07 17:19:41 -07:00
Peter Mayo
82975f96c5 Add root growth option.
This allows us to specify a boost size where we know we are growing Chrome,
but don't know what the default sizes are, nor whether we are overriding them
elsewise.

BUG=chromium-os:29829
TEST=try(lumpy-chrome-pfq,lumpy-canary)

Change-Id: I3b7c927874fdfedace027e7a2398d9e97a9d3527
Reviewed-on: https://gerrit.chromium.org/gerrit/21519
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Peter Mayo <petermayo@chromium.org>
Tested-by: Peter Mayo <petermayo@chromium.org>
2012-05-07 12:16:13 -07:00
Brian Harring
fb2cc48203 cros_generate_breakpad_symbols: Output the # of errors encountered.
This is a straightforward change- the intent is to up the debug
information available so we can deal w/ crashes like:

http://chromegw.corp.google.com/i/chromeos/builders/x86-alex32%20canary/builds/56

BUG=None
TEST=# Manual inducing of failures.

Change-Id: Ibea75d1467160fc7f07c21235d701692cec96d05
Reviewed-on: https://gerrit.chromium.org/gerrit/21931
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
2012-05-07 00:23:32 -07:00
Brian Harring
5edf8bb308 Set a sane signal/noise ratio for cros_generate_breakpad_symbols.
Of the 11713 lines output via this for a mario build, 96% of it
is stating "Using dump_syms.32 for 32-bit file <the-path>".

At one point that may have been useful; now it just obscures errors,
thus only output that info when verbose is turned on.

BUG=None
TEST=./cros_generate_breakpad_symbols; # enjoy the 438 lines of
     # output rather than the 11,700 lines of output.

Change-Id: Iba9d1af3421c6b377af8388446521d106399ce25
Reviewed-on: https://gerrit.chromium.org/gerrit/21925
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
2012-05-05 01:30:50 -07:00
Chris Masone
09c05ecd19 [crosutils] Upgrade chroot to remove some never-used packages
We intended to use some extra python modules for autotest in the chroot,
but decided against it.  They're removed from hard-host-depends in
https://gerrit.chromium.org/gerrit/21816

BUG=None
TEST=./upgrade_chroot; see that they've been removed.
CQ-DEPEND=If896436bf9fed7c0fd600ffca9a4c854fd7eceba
CQ-DEPEND=I95df39e40b62c919df0bafcb490d8caa48c04dd4

Change-Id: If9854661b8774d519c5a587e77c31eafdc9b889b
Reviewed-on: https://gerrit.chromium.org/gerrit/21817
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
2012-05-04 09:12:53 -07:00
Mike Frysinger
a03fc04b22 update hooks: scrub some more old packages
These shouldn't be around anymore, so let's move them.

BUG=None
TEST=build_packages for x86-alex worked

Change-Id: I95df39e40b62c919df0bafcb490d8caa48c04dd4
Reviewed-on: https://gerrit.chromium.org/gerrit/21806
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-05-03 19:23:01 -07:00
Zdenek Behan
26fe5709a4 Revert "Make use of cros_setup_toolchains, take 2"
This reverts commit baa696e37bf1c48e5db0616460f7fbb0cff01e61

Change-Id: I6dcbc8afdcb715dc9ffe7b551a882279320f9f04
Reviewed-on: https://gerrit.chromium.org/gerrit/21813
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
2012-05-03 15:07:25 -07:00
Zdenek Behan
95fadc6e33 Make use of cros_setup_toolchains, take 2
Resubmit of If62b4f3973f02fd8e1deed35864c824a02ab0c22
This will be safe to land after I2c4e21ec7e8c0c0cf58947e2b0a3a9edf7617a09

It is now used for:
- make_chroot (cros_sdk --bootstrap)
- update_chroot

setup_board is stripped of redundant code which was deprecated by this.

Also stripped is some usepkg logic in make_chroot, as that is now
exclusively source-only.

BUG=chromium-os:23032
TEST=trybot chromiumos-sdk

Change-Id: Ic908eac712ac097e5c2062d3be70177e172aa924
Reviewed-on: https://gerrit.chromium.org/gerrit/20191
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
2012-05-03 13:27:13 -07:00
Nirnimesh
e52cb76907 Remove reference to desktopui_PageCyclerTests
BUG=None
TEST=None

Change-Id: I9bc3bbd72da506fb746bde9604378a0355381db6
Reviewed-on: https://gerrit.chromium.org/gerrit/21700
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Ready: Nirnimesh <nirnimesh@chromium.org>
Tested-by: Nirnimesh <nirnimesh@chromium.org>
2012-05-02 18:47:43 -07:00
Zdenek Behan
1d5d3b56e4 common.sh: Use /proc/mounts instead of mtab for umount
Using /proc/mounts is safer because mtab may in rare cases get desynced.
The only significant difference in output is "X Y" instead of "X on Y".

BUG=chromium-os:30249
TEST=create a chroot; enter a chroot; exit a chroot
TEST=assortment of manual tests

Change-Id: I392290e6f52a677ee2d77d77e025ef60240b11b5
Reviewed-on: https://gerrit.chromium.org/gerrit/21499
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
2012-05-02 17:47:01 -07:00
Chris Wolfe
916b1f1e11 enter_chroot: symlink boto config from chromeos-overlay, if available
The private chromeos-overlay has shared credentials for read-only
access to the archive of CrOS images. When entering the chroot check
whether these credentials are available, and install them to ~/.boto
within the chroot unless that file already exists.

BUG=None
TEST=Applied patch and entered fresh private and public chroots.
  Manually ran 'gsutil config' to replace the credentials;
    this works as long as there is no ~/.boto.bak already.
  Re-entered the chroot with manually-configured credentials.
  Ran 'gsutil ls' with BOTO_CONFIG set to a board-specific boto.

Change-Id: Ib62dc28f90bce692a833b5fc9d4c56981acc98d1
Reviewed-on: https://gerrit.chromium.org/gerrit/21480
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Chris Wolfe <cwolfe@chromium.org>
Commit-Ready: Chris Wolfe <cwolfe@chromium.org>
2012-05-01 08:26:14 -07:00
Mike Frysinger
db80fc54c9 build_packages: drop --oldchromebinary
We have pretty good binpkg support for chrome now, as well as incremental
building (and ccaching), so we should be able to drop this flag now.

BUG=None
TEST=build_packages still works for x86-alex

Change-Id: I3f3bf7e513ef45c091cc8363753035cac07d2f97
Reviewed-on: https://gerrit.chromium.org/gerrit/20967
Reviewed-by: Anush Elangovan <anush@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-04-26 13:21:07 -07:00
Michael Krebs
dc7b317587 scripts: Sleep for 200ms between symbol uploads
To avoid looking like we're DoS'ing the symbol server, force a delay between
symbol uploads.  If this becomes a bottleneck for buildbots, this should be
modified to only upload symbol files that have changed, by checking against
the buildbot's previous debug.tgz.

BUG=chromium-os:26596
TEST=Manually ran upload_symbols against staging symbol server

Change-Id: Iecf11e26a70f0c44838fb13e2ebc6ebb78336c50
Reviewed-on: https://gerrit.chromium.org/gerrit/19566
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
2012-04-25 18:41:47 -07:00
Zelidrag Hornung
4c5ed7dfc4 Fixed image download script.
BUG=none
TEST=none

Change-Id: I947a9b63a3822d6bf885096e77c1b66957674183
Reviewed-on: https://gerrit.chromium.org/gerrit/21109
Reviewed-by: Rahul Chaturvedi <rkc@chromium.org>
Commit-Ready: Zelidrag Hornung <zelidrag@chromium.org>
Tested-by: Zelidrag Hornung <zelidrag@chromium.org>
2012-04-25 14:34:24 -07:00
Michael Krebs
a7056f1b07 buildbot scripts: Increase number of retries for uploading
Delay up to 63 seconds when trying to upload a symbol file.  My default of
15 seconds before turned out to not be enough to cover at least one case
that davidjames@ found in ToT buildbots.

BUG=chromium-os:29963
TEST=Ran upload_symbols --testing

Change-Id: I82b038f8845c3f2aaba0ee95f40efd4b70e2ffb1
Reviewed-on: https://gerrit.chromium.org/gerrit/21016
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2012-04-24 21:04:18 -07:00
Vadim Bendebury
b90bf4aabf Revert "Use keyboard controller for hard reset instead of CF9"
This reverts commit bc856858be86b1ae7c4dc33b256f43baac51636d

The thing is that ${FLAGS_board} is not set when build_kernel_image.sh runs, so the check never kicks in.

Change-Id: I501cb979c7aef8d2f7061da2b6cf2daedfe65004
Reviewed-on: https://gerrit.chromium.org/gerrit/20977
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
2012-04-24 18:52:18 -07:00
Michael Krebs
c91d3ebb17 scripts: Show an error if a symbol file is too big
If the symbol file to be uploaded to the symbol server is close to the limit
at which the symbol server will reject it, show an error so we can do
something about it before it's too late.  This also prints the special
"@@@STEP_WARNINGS@@@" line to make the buildbot show the step as orange.

BUG=chromium-os:19194
TEST=Manually ran upload_symbols to make sure it worked with/without an error

Change-Id: I7942ba20f7bc83d66036f9f9fe66403083b1a1f1
Reviewed-on: https://gerrit.chromium.org/gerrit/20664
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2012-04-20 19:39:31 -07:00
Michael Krebs
44a3b35f44 scripts: Don't exit when the sym_upload command fails
My previous commit fixed a presumed oversight where the "set -e"
functionality had been disabled for the upload_file() function.  But
enabling it caused a problem for when sym_upload failed to upload the file
-- which is why I had written all that retry code in the first place.  We
could trap the shell's "ERR" signal instead of exiting, but rather than
complicating the script too much, I'm just removing the check.

I also added a rudimentary testing mode to the script.  I had a basic one
that I used locally, but when I had to expand it to mimic a non-zero exit
status, etc. I figured I might as well productize it.  This can be enabled
by passing "--testing" as the first argument to the script.

BUG=chromium-os:29103
TEST=Ran with new --testing option and various parameters

Change-Id: Ia10b4225d2db026839730510b31f7f4cdd101b98
Reviewed-on: https://gerrit.chromium.org/gerrit/19795
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
2012-04-17 14:44:23 -07:00
Zdenek Behan
3602abe286 Revert "Make use of cros_setup_toolchains"
Breaks the tree.

This reverts commit f3904d6530d3fd195a3659963a351b6ba8d0abff

Change-Id: Idaf6e59c506efcdf6a19d123ede7eb1cfafc3e2e
Reviewed-on: https://gerrit.chromium.org/gerrit/20182
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
2012-04-12 19:48:36 -07:00
Zdenek Behan
24ae1d01d7 Make use of cros_setup_toolchains
It is now used for:
- make_chroot (cros_sdk --bootstrap)
- update_chroot

setup_board is stripped of redundant code which was deprecated by this.

Also stripped is some usepkg logic in make_chroot, as that is now
exclusively source-only.

BUG=chromium-os:23032
TEST=trybot chromiumos-sdk

Change-Id: If62b4f3973f02fd8e1deed35864c824a02ab0c22
Reviewed-on: https://gerrit.chromium.org/gerrit/17910
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
2012-04-12 18:29:59 -07:00
Chris Sosa
dbc853b2bf Add an advanced option to build_image so that a caller can specify the version.
This change adds the ability for a caller to pass a specific version name
to build_image rather than rely on parsing of chromeos_version.sh + attempt
number.

BUG=chromium-os:29077
TEST=Ran build_image w/ w/out option

Change-Id: I69b76ae4bfc148325686902606476a0aae293e56
Reviewed-on: https://gerrit.chromium.org/gerrit/19861
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-04-10 13:06:46 -07:00
mukesh agrawal
df23c6db56 mod_for_test_scripts: add backchannel interface support for shill
To use a backchannel interface, we need to configure the connection
manager to ignore that interface. shill uses a different syntax
for that command-line option, because base's command-line parser
doesn't support the option syntax flimflam uses.

This CL adds code to rewrite the part of flimflam.conf that holds
shill's configuration options.

CQ-DEPEND=Ic2fdf49ec454995bf9378299e64378f957b9f26c
BUG=chromium-os:23531
TEST=manual (see below)

Manual testing: ran flimflam and shill on test images. Verified
that the connection manager ran with the appropriate command line
flags in both cases.

Change-Id: I57481387e207bf1ad5138a9fce9921539eed080f
Reviewed-on: https://gerrit.chromium.org/gerrit/19712
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
2012-04-06 17:00:20 -07:00
Michael Krebs
fbc6ca69fd scripts: Retry uploading symbol files
If there's an error uploading a symbol file, retry it up to four times
before giving an error.

BUG=chromium-os:28985
TEST=Manually ran upload_symbols to make sure it worked with/without errors

Change-Id: Ia2159d96d0fae9042c81147249986e39f05ca398
Reviewed-on: https://gerrit.chromium.org/gerrit/19625
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2012-04-05 17:39:41 -07:00
Mike Frysinger
aabca6c6a3 setup_board: quote flags var
Now that the flags variable can be "[stable]", if we don't quote its
expansion, it can match files like "t" resulting in bad flags being
passed to crossdev.

BUG=None
TEST=`touch t; ./setup_board --board=x86-alex` no longer results in "tgcc"

Change-Id: I866e934776e2d47a2c99bd08964017014aace97f
Reviewed-on: https://gerrit.chromium.org/gerrit/19595
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-04-05 11:41:41 -07:00
Michael Krebs
32294abc01 scripts: Increase size limit at which CFI is stripped
Crash server file size limit has been increased to 300MB

BUG=chromium-os:23765
TEST=Manually ran upload_symbols for chrome.sym

Change-Id: I9c683ad057abda1f8df7550243cd5c870228257c
Reviewed-on: https://gerrit.chromium.org/gerrit/19569
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Eric Blake <eblake@chromium.org>
2012-04-03 21:30:42 -07:00
Mike Frysinger
ba7584561c make_chroot: deploy pbzip2 early
Make sure our chroot has pbzip2 as early as possible so we can leverage
it later on in the build process as the default compressor.

BUG=None
TEST=semi-manual:
	- remove pbzip2 as soon as we've unpacked the chroot in make_chroot
	- run `cros_sdk` and see no pbzip2 warnings

Change-Id: I27d00cdb97c5ffcde79eb04cfabbe6e82a72c706
Reviewed-on: https://gerrit.chromium.org/gerrit/19469
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-04-03 10:22:33 -07:00
Daniel Erat
b51593405b build: Test /etc/localtime symlink in built images.
This makes us fail if /etc/localtime doesn't point at
/var/lib/timezone/localtime.

BUG=chromium-os:27413
TEST=manual: error from build_image after i patched chromeos-base to not create the symlink

Change-Id: I11ef272c2dcd67a189a5d67c46792490ec6d27a1
Reviewed-on: https://gerrit.chromium.org/gerrit/19335
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Daniel Erat <derat@chromium.org>
2012-03-30 13:01:26 -07:00
Mike Frysinger
eb1a9b4e4e make_chroot: drop build-docbook-catalog hack
Now that the newer build-docbook-catalog supports ROOT, we don't need
to manually run this ourselves.

BUG=chromium-os:18036
TEST=`cbuildbot chromiumos-sdk` works

Change-Id: I3a89701a49623f9e50e651af9d8d505608fdc615
Reviewed-on: https://gerrit.chromium.org/gerrit/19252
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-03-29 10:04:24 -07:00
Mike Frysinger
7d338f501d setup_board: use correct toolchain tuple for binutils gold selection
The update to support multiple toolchains missed one place -- selection
of gold as the linker.  It would always handle just the default toolchain.
Fix up the logic so it always checks the current toolchain.

BUG=chromium-os:28548
TEST=`./setup_board --board=x86-alex` selected gold for x86_64 and i686 toolchains

Change-Id: I3c09e3a4fd91b68170fe255e37580a3c9f5f6feb
Reviewed-on: https://gerrit.chromium.org/gerrit/19226
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-03-28 15:23:30 -07:00
Mike Frysinger
51409977a2 dev_image_util: make file work by default
File is compiled with a path to the default magic database, but since we
install it into /usr/local rather than the normal /usr, that default path
does not work.  Add a smaller wrapper script around `file` to specify the
new database location so people don't have to manually do so.

BUG=chromium-os:27725
TEST=`./build_image --board=x86-alex dev` produced an image where `file /bin/bash` worked

Change-Id: I3862cb368437a14bf1e4b6ccf4e2df3e4f774817
Reviewed-on: https://gerrit.chromium.org/gerrit/19137
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-03-28 09:29:12 -07:00
Michael Krebs
68da4439ff Don't try to generate symbols for symbolic links
In our build environment, we have lots of symbolic links such as
"debug/.build-id/5c/a06545ff3812557dc5fd259db4e905c5dc3484.debug" that just
link to another .debug file.  In our case, those links don't actually point
to the right place, so we've just been seeing lots of "Binary does not
exist" warnings.  But it would also be undesirable to actually generate
symbols for these even if their targets *did* exist.

BUG=None
TEST=Ran cros_generate_breakpad_symbols

Change-Id: I050c349f7fefbdf922d54250379bad9b3db073d7
Reviewed-on: https://gerrit.chromium.org/gerrit/19182
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2012-03-27 16:44:22 -07:00
Mike Frysinger
bf41543707 update_chroot: update gcc-config logic slightly
The latest gcc-config will accept the CHOST setting from the host env,
so export that variable since we already spent the time running portageq
to get it.  This allows gcc-config to never execute portageq, and since
we run it multiple times, it helps in every invocation.

Along those lines, make sure we run gcc-config with `sudo -E` to pass
through the setting.

Since awk can handle regexps, merge the grep|awk into a single awk call.

Finally, there was a slight logic typo where we would always re-run
gcc-config even when the profiles were the same.  This does not match
the comments, nor the spirit of this code, so fix the operator typo.

BUG=None
TEST=`./update_chroot` still works and doesn't re-select the toolchain

Change-Id: If73df81c014219f8f9ab5895e59d055696add777
Reviewed-on: https://gerrit.chromium.org/gerrit/19164
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-03-27 11:34:05 -07:00
Mike Frysinger
0957a18357 virtual/linux-sources: rename from virtual/kernel
Upstream Gentoo renamed this virtual, so follow suite.

BUG=None
TEST=`cbuildbot amd64-generic-full` worked
TEST=`cbuildbot arm-tegra2-full` worked
TEST=`cbuildbot x86-generic-full` worked

Change-Id: I2721c85fe83f4ee8a90533eda14813697430e98e
Reviewed-on: https://gerrit.chromium.org/gerrit/18781
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-03-27 09:12:29 -07:00
Joseph Hwang
ca63e041e5 Install uinput module in test image only
This CL adds uinput module in INSTALL_MASK so that the module
is not installed to non-test image. A mod_image_for_test script
is implemented to install the module in the test image if the
uinput module exists.

BUG=chromium-os:26707
TEST=Build a base image and a test image. Check the directory
  /lib/modules/<version>/kernel/drivers/input/misc
where current <version> is 3.2.7.
In the base image, there should be no uinput.ko,
while in the test image, there should be uinput.ko.
CQ-DEPEND=Ie96242c4d56403866a2298db2ba3bd6459248c1b

Change-Id: I0ca6599f80b9bb72cdc044fc97cdf990ce550edc
Reviewed-on: https://gerrit.chromium.org/gerrit/19032
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Ready: Joseph Shyh-In Hwang <josephsih@chromium.org>
2012-03-27 06:46:50 -07:00
Michael Krebs
7515d89be7 Dynamically use the 32-bit dump_syms for files when needed
'dump_syms' was recently changed to be built 64-bit, with a 32-bit version
available as 'dump_syms.32'.  This change makes use of the 32b dump_syms if
a file is built 32b.  For almost all targets nowadays, we should only see
64b files, but things like the installer can still be 32b.  Also see
https://gerrit.chromium.org/gerrit/14835.

BUG=chromium-os:22778
TEST=Ran cros_generate_breakpad_symbols on 32/64-bit executables
CQ-DEPEND=I6551fe22fb0caebd3584f76f95a543e9a91b7e1b

Change-Id: I780c20eeb745a919dbe130cf3cede7ec5ca6483a
Reviewed-on: https://gerrit.chromium.org/gerrit/18569
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2012-03-26 19:48:21 -07:00
Brian Harring
c03f260bb2 Revert "Install uinput module in test image only"
This reverts commit 5bf16bab5abb1cbf4f4acbc0d51d8aefa2c64091

Induced breakage: http://build.chromium.org/p/chromiumos/builders/x86%20generic%20incremental/builds/1259

Change-Id: I72170bc48cbc1cfe8b4913a9de1e5d8087525845
Reviewed-on: https://gerrit.chromium.org/gerrit/19023
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-03-23 22:44:04 -07:00
Joseph Hwang
50420556f8 Install uinput module in test image only
This CL adds uinput module in INSTALL_MASK so that the module
is not installed to non-test image. A mod_image_for_test script
is implemented to install the module in test image.

BUG=chromium-os:26707
TEST=Build a base image and a test image. Check the directory
  /lib/modules/<version>/kernel/drivers/input/misc
where current <version> is 3.2.7.
In the base image, there should be no uinput.ko,
while in the test image, there should be uinput.ko.

Change-Id: I02b557466a56e11c5dcc1649a9275d0c2a896f09
Reviewed-on: https://gerrit.chromium.org/gerrit/17209
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Ready: Joseph Shyh-In Hwang <josephsih@chromium.org>
2012-03-23 20:35:46 -07:00
Jim Hebert
fb97704081 Move enable-dbus-monitor to be a mod_for_dbusspy behavior
BUG=chromium-os:27091
TEST=mod_test_image_for_dbusspy test.bin

Change-Id: Ia2b84f314bd97f138680b7b05e00ff456d405bb0
Reviewed-on: https://gerrit.chromium.org/gerrit/18678
Reviewed-by: Jim Hebert <jimhebert@chromium.org>
Tested-by: Jim Hebert <jimhebert@chromium.org>
Commit-Ready: Jim Hebert <jimhebert@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
2012-03-21 12:23:48 -07:00