Commit Graph

17 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
Vic Yang
c321a9a026 Modify USE flags used when building network boot kernel
We need VFAT, ramdisk, and frame buffer console in network boot kernel.

BUG=chrome-os-partner:9805
TEST=Build success. Network boot and install success.

Change-Id: I267f305e2cedf44d002bb1acdf790b4279e20f2c
Reviewed-on: https://gerrit.chromium.org/gerrit/23196
Commit-Ready: Vic Yang <victoryang@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-05-22 08:00:35 -07:00
Vic Yang
3450deb3ea Add x86 network boot support to make_netboot.sh
Current make_netboot.sh only supports ARM. As we are using network boot
for x86 now, let's fix make_netboot.sh to support both.

BUG=chrome-os-partner:9805
TEST=Generates images and network boot install shim.

Change-Id: Ib445f68255fe8e8a1ee6b7901c9bd67a4a36636d
Reviewed-on: https://gerrit.chromium.org/gerrit/23010
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-05-18 03:14:12 -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
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
Stefan Reinauer
b392153c54 rename /u-boot --> /firmware
Also drop find_*_component, because it is not used anywhere anymore.

BUG=chrome-os-partner:5459
TEST=none

Change-Id: Iea49a81538c22fee4b91c8b3e5582b5174282151
Reviewed-on: http://gerrit.chromium.org/gerrit/7425
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Anton Staaf <robotboy@chromium.org>
2011-09-08 17:05:10 -07:00
Hung-Te Lin
920482f7f4 crosutils: add HWID folder when building factory test image
To always have HWID bundles in build output, this CL copies the HWID bundle
files from board temporary space into build output folder.

The HWID folder in make_netboot is also removed.

BUG=chrome-os-partner:5796
TEST=./build_image --factory
     # see "hwid" folder in build output

Change-Id: I8c2cd32c257b117261fba3654b52929c71310c82
Reviewed-on: http://gerrit.chromium.org/gerrit/7331
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-09-07 21:11:41 -07:00
Chris Sosa
2eb73c0be1 Quick test.
BUG=None
TEST=Change of copyright.

Change-Id: I9254f9456960a417e8584376d98388d3d8fd4467
Reviewed-on: http://gerrit.chromium.org/gerrit/7140
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-09-01 19:03:39 -07:00
Hung-Te Lin
0288219071 make_netboot: change HWID bundle filename
This is the counter part of https://gerrit-int.chromium.org/4790

BUG=none, see https://gerrit-int.chromium.org/4790
TEST=see https://gerrit-int.chromium.org/4790

Change-Id: If4adc586509c81808c1deb3e781317fbc244ff07
Reviewed-on: http://gerrit.chromium.org/gerrit/6892
Reviewed-by: Dave Parker <dparker@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-08-30 10:05:46 -07:00
David James
4dd4c54ccb Fix race condition by using different symlinks for factory images.
Both the tests and archive_build read and write the latest symlink.
This CL fixes a race condition in archive_build by moving away from
using the latest symlink in archive_build.

BUG=chromium-os:18967
TEST=Run release cbuildbot archive_build on x86-mario-release.
     Verify it completes successfully and that latest symlink
     is unchanged now.

Change-Id: Ia32d20903f3ef74e360944fbabdd9834c0edb99a
Reviewed-on: http://gerrit.chromium.org/gerrit/5746
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-08-11 12:44:02 -07:00
Nick Sanders
2027ca8dfb Fix build break on factory install kernel
BUG=chrome-os-partner:6384
TEST=it can netboot

Change-Id: I5bc3a64f2a70b6740791a68e25cb44536236c41b
Reviewed-on: http://gerrit.chromium.org/gerrit/5538
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
2011-08-09 01:06:05 -07:00
Nick Sanders
daebdee972 Add HWID bundle into buildbot output
Add bundle to factory_shim/hwid

BUG=chromium-os:16734
TEST=archive_build, with and without hwid present

Change-Id: I70eeca5ce9cd99d229081a92af5bc0c3c997dce7
Reviewed-on: http://gerrit.chromium.org/gerrit/5189
Reviewed-by: Rong Chang <rongchang@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
2011-08-03 23:16:41 -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
Nick Sanders
fa28c16842 Add u-boot env editor to factory bundle
BUG=chrome-os-partner:4606
TEST=no

Change-Id: Ie3f60a33a1bef9513ec8da8a170697eecb752a68
Reviewed-on: http://gerrit.chromium.org/gerrit/4296
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
2011-07-20 20:47:56 -07:00
Elly Jones
c871ba2df4 make_netboot: Fix syntax error.
http://chromeos-botmaster.mtv.corp.google.com:8026/builders/tegra2_dev-board-binary/builds/199/steps/cbuildbot/logs/stdio

BUG=None
TEST=Adhoc
Ran it. No error.

Change-Id: I7a6a2745bbde4a773b9c3a79df9ca135af823149
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/3017
Reviewed-by: Grant Grundler <grundler@chromium.org>
2011-06-22 12:18:57 -07:00
Grant Grundler
7c4328a65f Fix ARM generic build: no u-boot/legacy_image.bin built
Additional fix needed on top of nsanders commit from yesterday:
    http://gerrit.chromium.org/gerrit/#change,2028

ARM generic doesn't build chromeos-u-boot and thus has no u-boot
directory in the $SYSROOT.

BUG=chromium-os:16833
TEST=archive_build.sh

Change-Id: Ic8422419779dca1965c6832a4a0bd73078945e69
Signed-off-by: Grant Grundler <grundler@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/3001
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2011-06-22 11:10:17 -07:00
Nick Sanders
119677f3b9 Add netboot output to factory bundle
* kernel, initrd, legacy firmware

BUG=chrome-os-partner:3667
TEST=archive_build.sh

Change-Id: I54b11067624e1c626cb6f059d4b8a52602c5837c
Reviewed-on: http://gerrit.chromium.org/gerrit/2028
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2011-06-21 17:13:19 -07:00