Commit Graph

2074 Commits

Author SHA1 Message Date
Mike Frysinger
9e30234e50 setup_board: allow toolchain.conf to list multiple toolchains
We want to have some 64bit boards also install the 32bit toolchain, so
extend the toolchain.conf file to allow specifying of multiple targets.

BUG=chromium-os:25969
TEST=build_packages for x86-mario installed both i686-pc-linux-gnu and x86_64-cros-linux-gnu

Change-Id: Ic2ca1aeeefa5ea2207d3c963ac856909cb40cae5
CQ-DEPEND=Iea6f682e258d59c0b3b3ca2cad7e15ae521dcc89
CQ-DEPEND=Ib71e7503c3ebc98549d09e35cb0bb9687b8fafb8
Reviewed-on: https://gerrit.chromium.org/gerrit/15902
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-02-17 18:19:43 -08:00
Mike Frysinger
bdc4fb1998 make_chroot: clean up final log info
When we create a chroot for the first time, we see:
	...
	Exiting: Nothing left to do; exiting. :)
	Elapsed time: 5m10s
	cros_sdk: All set up.  To enter the chroot, run:"
	cros_sdk: $ cros_sdk --enter "

	CAUTION: Do *NOT* rm -rf the chroot directory; if there are stale bind
	mounts you may end up deleting your source tree too.  To unmount and
	delete the chroot cleanly, use:
	$ cros_sdk --delete
	(cr) (v) vapier@vapier ~/trunk/src/scripts $

Kill the spurious double quotes, add new lines to make the text easier
to pick out from the previous command/new prompt, and only show the
sdk prefix on the first line.

BUG=None
TEST=`cros_sdk --delete && cros_sdk` looks nice

Change-Id: Iba0ee68035fffe6fc946e9b3476cc0d0b55abfc5
Reviewed-on: https://gerrit.chromium.org/gerrit/16075
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-02-17 15:30:04 -08:00
Gilad Arnold
a829f3392f image_to_usb.sh: prompt when detected image is not the default image.
Having introduced autodetection and autoselection of images, some users
may be surprised to find that the script will happily choose to copy an
image other than chromiumos_image.bin when only one image is present.
Since this is substantially different from the previous behavior, we now
present a menu (with a single choice) in this case as well.

Also fixing the list of images to be detected and properly prioritizing
a default image over others. The code should already work with the
future image naming scheme, where chromiumos_image.bin will be a symlink
to one of six concrete images (with unique names).

BUG=None
TEST=Ran script with different image configurations and flags.

Change-Id: I5d448c5425754496d256258281694cd7ec2554d2
Reviewed-on: https://gerrit.chromium.org/gerrit/15982
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
2012-02-17 11:22:08 -08:00
Mike Frysinger
fe8601bb51 setup_board: add portage-utils wrappers too
I use these wrappers all the time on my own system.

BUG=None
TEST=`./setup_board --board=x86-mario && qlist-x86-mario -Iv` works

Change-Id: I609ea07337b2fd14257fae9a0c89b544a40beab9
Reviewed-on: https://gerrit.chromium.org/gerrit/16071
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-02-17 09:37:30 -08:00
J. Richard Barnette
8a7aa3e502 Delete unnecessary -d options from umount
The -d option to umount is unnecessary in cases where the original
mount was created with '-o loop' (it says so in the man page).
Moreover, there's a demonstrable bug when using 'umount -d' in this
case:  umount complains that it's unable to delete the loop device
in this case.  This change silences those messages.

The demonstrated bug in umount is a plausible explanation for build
failures characterized by unexpected failures of 'mount -o loop';
see the BUG, below.

BUG=chromium-os:24975
TEST=run the changed commands, see no loopback devices leaked

Change-Id: I1df9f60b40eabd279164b79ee66994ff9f644ee9
Reviewed-on: https://gerrit.chromium.org/gerrit/15998
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
2012-02-15 18:23:14 -08:00
Gilad Arnold
7293bd8524 image_to_usb.sh: warn before copying to non-existent /dev/sdX device.
Without this fix, when the script is invoked with (say) --to=/dev/sdk
but /dev/sdk is not a valid block device, we will interpret it as if the
user intended to copy the image to a file of the same name. However, it
is more likely that the user specified the wrong device name.  Hence,
this fix catches this type of error and will fail the operation with
a corresponding error message.

Also includes minor changes to printed messages.

BUG=None
TEST=Ran the script with different values of --to

Change-Id: Ie060ff2be77b8c065ba95f635455049e034d4bbc
Reviewed-on: https://gerrit.chromium.org/gerrit/15822
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
2012-02-14 14:41:13 -08:00
Gilad Arnold
dd59d7e9a6 image_to_usb.sh: do not require chromiumos_image.bin when --test_image is used.
The recent changes to image_to_usb.sh assumed that chromiumos_image.bin
is always used for generating a test image. This wasn't the case before
these changes were applied, where a preexisting test image would have
sufficed.  This fix eliminates image autodetection entirely when
--test_image it used and falls back to the old behavior: if a test image
exists, it will use it; otherwise, it will generate it from the image
specified by --image_name, or from the default chromiumos_image.bin.

This is not to say that I like this behavior: it is subtle, may lead to
errors (e.g. using a stale test image whereas the user assumes a new one
should be generated), and inconsistent with other behaviors (e.g.
installing a recovery image, where no image generation takes place at
all).  I believe that long term we should eliminate the generation of
test images from image_to_usb.sh and have users invoke the necessary
scripts (like mod_image_for_test.sh) explicitly.

BUG=chromium-os:26239
TEST=Ran script with different combinations of --test_image,
--image_name and image files present.

Change-Id: Ib2491a7e45e23eb51ced6ef31d3f129ec7863a25
Reviewed-on: https://gerrit.chromium.org/gerrit/15764
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
2012-02-14 13:08:17 -08:00
Gilad Arnold
a0a02f4c3a Extended device autodetection to work with --to_product.
This both fixes an incorrect behavior where --to_product would unsafely
lead to using a target device not intended to by the user; and reuses
the existing logic for device autodetection to work with provided
product strings.  As a result, it is easier to find devices, and the
script's behavior is more consistent as far as device detection and
selection.  This preserves the pattern matching on product string (now
properly highlighted in usage text and inline comments).

BUG=None
TEST=Ran script with various flag combinations (--to, --to_product),
product strings,  and devices connected.

Change-Id: I80bfca086029555853a680e7c97251b11adc912e
Reviewed-on: https://gerrit.chromium.org/gerrit/15757
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
2012-02-14 10:11:20 -08:00
Han Shen
b91d73d7cf Roll out binutils 2.21-r4 version (setup_board part).
Includes 2 important bug fixes -
- bug fix for 24128 (fix glibc2.14 builds) (bfd)
- fix for ARM toolchain hardening (gold)

-------------------------------------------
Summary
-------------------------------------------
                                            vanilla       newbinutils
Autotest Key                    Iterations  Average       Average       Change
PageCyclerTests
de..ageCyclerTest.Alexa_usFile  5           218.08        217.93        1.00
de..  PageCyclerTest.BloatFile  5           22064.06      22145.45      1.00
de.. PageCyclerTest.MorejsFile  5           524.82        525.95        1.00
de..  PageCyclerTest.Intl1File  5           446.69        448.81        1.00
de..  PageCyclerTest.DhtmlFile  5           630.95        630.09        1.00
de..s   PageCyclerTest.MozFile  5           187.07        187.70        1.00
de../desktopui_PageCyclerTests  5           ALL PASS      ALL PASS      -
de..   PageCyclerTest.Moz2File  5           188.75        187.13        0.99
de..  PageCyclerTest.Intl2File  5           682.23        684.26        1.00
bvt   					    ALL PASS      ALL PASS      -
suite_Smoke                                 ALL PASS      ALL PASS      -

BUG=None
TEST=Built chromeos from scratch, and ran PageCyclerTests, bvt and suite_Smoke.

Change-Id: I85281eaee1702de0cc89e093caf70a5d45ccce14
Reviewed-on: https://gerrit.chromium.org/gerrit/15537
Commit-Ready: Han Shen <shenhan@chromium.org>
Reviewed-by: Han Shen <shenhan@chromium.org>
Tested-by: Han Shen <shenhan@chromium.org>
2012-02-14 10:11:20 -08:00
Ahmad Sharif
211259aacd Changed the logic to discover the gcc atom from the config.
The gcc-config file name could be different from the gcc atom that creates it.
Changed the logic to first find out the binary path of gcc and then to query
portage to see what package owns that path.

BUG=none
TEST=cros_sdk --bootstrap --replace
cros_sdk -- ./setup_board --board=x86-zgb --nousepkg

Change-Id: I3ccfa9948aaba6ba28107f150523c8a5d7cf1260
Reviewed-on: https://gerrit.chromium.org/gerrit/15556
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Tested-by: asharif <asharif@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: asharif <asharif@chromium.org>
2012-02-13 14:30:30 -08:00
Mike Frysinger
59d3d736a7 get_latest_image.sh: error out when image dirs are missing
Every consumer that I can find of get_latest_image.sh expects this
script to output something useful.  Many don't check the result and
end up spitting out unhelpful messages when it doesn't.  So make a
missing images dir fatal for this script so everyone on top of us
gets this checking for free.

If, in the future, someone actually wants this to output nothing
when there's nothing found, we can add a dedicated flag.  That mode
of operation is a lot less common than having it die by default.

BUG=None
TEST=delete image tree, run ./get_latest_image.sh --board=${BOARD}, see it fail nicely
TEST=delete image tree, run ./image_to_vm.sh --board=${BOARD}, see it fail nicely

Change-Id: I0a2ffd0b9084297b6d2346f02dbdb7bd0ef667bf
Reviewed-on: https://gerrit.chromium.org/gerrit/15589
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-02-13 08:51:43 -08:00
Chris Sosa
2b73600f7f Update the copyright year in common.sh.
BUG=None
TEST=visual.

Change-Id: I66d6a6901930cfeb6391df5064f247e7148e5c80
Reviewed-on: https://gerrit.chromium.org/gerrit/15747
Commit-Ready: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2012-02-12 16:45:48 -08:00
Zdenek Behan
0b33e0a6d3 setup_board: make the gcc/glibc version stable by default, take 4
This is needed as part of transition to cros-workon.

Crossdev has a -S option to install the current stable, which is
the preferred future option, but would greatly complicate the logic.

BUG=chromium-os:25338
TEST=setup_board --board=any --force, see it build the right versions
TEST=trybot chromiumos-sdk

Change-Id: I60dfffcfa38e482499f909787ead26fd27ef36e1
Reviewed-on: https://gerrit.chromium.org/gerrit/15702
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
2012-02-11 18:59:56 -08:00
David James
a69b68deb7 Remove aura special case in setup_board.
Now that aura is default, we don't need to special-case it anymore.

BUG=chromium-os:25818
TEST=Verify that default prebuilts uploaded by the x86-generic builder
     are used now instead of the aura-specific prebuilts. These prebuilts
     have aura enabled now, since it is the default.

Change-Id: I8b78f53f5ceab6e5907390e03554120f20ea96fe
Reviewed-on: https://gerrit.chromium.org/gerrit/15726
Tested-by: Ryan Cui <rcui@chromium.org>
Reviewed-by: Ryan Cui <rcui@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2012-02-10 17:18:34 -08:00
Mike Frysinger
d5d23b8d5a Revert "setup_board: make the gcc/glibc version stable by default, take 3"
This reverts commit 19754342048a44304150981b2938f604751605e7

The tree is on fire: the x86 canaries and x86 generic full
bots are dying with internal gold link errors.
http://crosbug.com/26168

Only happens on new sdks, so we're shotgunning a few
suspicious revs and hoping for the best.

Change-Id: Iae05c876ff2a84f4a9f549f74b2ee7e0903f2b5a
Reviewed-on: https://gerrit.chromium.org/gerrit/15669
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-02-10 09:31:40 -08:00
Zdenek Behan
cdf3bad8a3 setup_board: make the gcc/glibc version stable by default, take 3
This is needed as part of transition to cros-workon.

Crossdev has a -S option to install the current stable, which is
the preferred future option, but would greatly complicate the logic.

BUG=chromium-os:25338
TEST=setup_board --board=any --force, see it build the right versions
TEST=trybot chromiumos-sdk

Change-Id: I07c1ade5731e9391fb22a572f7fe8517011e6239
Reviewed-on: https://gerrit.chromium.org/gerrit/15176
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
2012-02-09 18:58:59 -08:00
Matt Tennant
f7c9e7785b Copy ~/.gdata_token to chroot upon enter_chroot.
The refresh-packages builder needs to start using auth tokens for logging into
Google Docs, rather than email/password each time, so this copies ~/.gdata_token
into the chroot in the same way as ~/gdata_cred.txt.

BUG=chromium-os:23819
TEST=Put a file at ~/.gdata_token outside chroot, then run:
`cros_sdk true ; cmp {chroot/home/$USER/,~/}.gdata_token`, which passes.

Change-Id: Ib688a01aa88e0fd0f0211236bb0354813ef1fbb3
Reviewed-on: https://gerrit.chromium.org/gerrit/15550
Commit-Ready: Matt Tennant <mtennant@chromium.org>
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Tested-by: Matt Tennant <mtennant@chromium.org>
2012-02-09 17:27:44 -08:00
Gilad Arnold
0534a6ec41 image_to_usb.sh: detect and allow to select between candidate images.
The script does not assume a single source image (chromiumos_image.bin)
but detects which images of a list of candidate images are present, and
lets the user select one.  The default choice is the first image in the
list to be detected.  If only one image was detected, it will be
automatically selected.  The list contains the aforementioned standard
image, as well as the default names for recovery, test, factory and
factory install images.  If the script is invoked with --test, --factory
or --factory_install flags, it will only seek for the standard image
(and attempt to generate the desired image from it, as was previously
done).

Also fixed some log messages; option strings; and improved the logic for
unmounting the target device, eliminating an unnecessary message and
a 3 second delay.

BUG=chromium-os:26010
TEST=Tested image_to_usb.sh with different images and flags.
CQ-DEPEND=I53a42a46a3c90fd486fead578bfbae248f64cfc2

Change-Id: I0d2f20dc8d62ce5fa18c10d9f8b51a46b2ddca5d
Reviewed-on: https://gerrit.chromium.org/gerrit/15528
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
2012-02-09 15:19:57 -08:00
Gilad Arnold
207a7c7e7f common.sh: new function for a selection menu with a default option.
Defined a bash function choose(), which allows to present a menu and
prompting for a selection, with support for default choice. Usage is
commented appropriately.

Originally reviewed in CL I0d2f20dc8d62ce5fa18c10d9f8b51a46b2ddca5d.

BUG=chromium-os:26010
TEST=Tested in conjunction with a use in image_to_usb.sh, works fine.

Change-Id: I53a42a46a3c90fd486fead578bfbae248f64cfc2
Reviewed-on: https://gerrit.chromium.org/gerrit/15586
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
2012-02-09 13:31:41 -08:00
Brian Harring
feb04f77fe Require sudo usage to be non-interactive.
First, add a enable_strict_sudo helpers that scripts that are
sudo strict can invoke.  This does a sanity check bailing immediately
if invoked from a non sudo-keep-alive context.

Second, update enter_chroot.sh and make_chroot.sh to be strict.

While this is strict, that's the point.  The aim of this is to block
the previous sudo interactive mess for spreading, let alone reappearing
in scripts/code that has been cleansed.

BUG=chromium-os:18393
TEST=cros_sdk --replace; in the midst of it, do sudo -k.
     cros_sdk should thus bail out w/ an appropriate error.
CQ-DEPEND=I01bb1466cf027401fa387af7fad15e42fd33aea4

Change-Id: I76c5b87a812cc78c30a2eb1a0c56b9e438f4a98f
Reviewed-on: https://gerrit.chromium.org/gerrit/15294
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-02-08 16:19:14 -08:00
Gilad Arnold
4ac8731001 mod_image_for_recovery.sh: some cleanup.
Motivated by the need to share the default recovery image name across
scripts (image_to_usb.sh in this case) and have it setup in common.sh.
Includes some general cleanup steps such flags and usage strings,
migrating function definitions to the beginning of the script, etc.

BUG=chromium-os:26010
TEST=Tested mod_image_for_recovery.sh on local host.

Change-Id: Ife3731915302a2e7be8beb750501d0ae9a0c43a4
Reviewed-on: https://gerrit.chromium.org/gerrit/15523
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
2012-02-08 14:44:56 -08:00
Gilad Arnold
083662748f common.sh: add a variable for default recovery image name.
This is a preparatory step for changes to image_to_usb.sh and
mod_image_for_recovery.sh.  In general, by migrating the default
recovery image name to common.sh we can improve the interoperability
between the different scripts.

BUG=chromium-os:26010
TEST=Obvious change; tested to see the mod_image_for_recovery.sh and
image_to_usb.sh still work.

Change-Id: I765d665b656d5d25b2d9b0e40bf5c05048c3f255
Reviewed-on: https://gerrit.chromium.org/gerrit/15507
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
2012-02-08 12:09:16 -08:00
Mike Frysinger
77c674b54e common.sh: add missing die to local shflags inherit
When we source the local copy of shflags, we don't check for errors like
we do when sourcing the external one.  Add a `die` call for that too.

BUG=None
TEST=`rm lib/shflags/shflags && (. ./common.sh)` now exits properly

Change-Id: I62c9b33dd96f2934691c43d53dea012097116ca1
Reviewed-on: https://gerrit.chromium.org/gerrit/15443
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-02-08 08:58:19 -08:00
Mike Frysinger
669b28b666 common.sh: move output helper funcs up top the top
The shflags sourcing logic tries to use `die` before we've defined it, so
if there's an issue, we end up with:
	bash: die: command not found
and the shflags code doesn't actually get loaded.

So relocate these small helpers to the top so we don't have to worry about
when it's safe to use these things.

BUG=None
TEST=`rm lib/shflags/shflags && (. ./common.sh)` now exits properly

Change-Id: Ibdc268e6c081aa07679dc9fce76e5603b7217b20
Reviewed-on: https://gerrit.chromium.org/gerrit/15442
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-02-08 08:00:57 -08:00
Gilad Arnold
0ddf0241d4 image_to_usb.sh: cleanup and dead code removal
Migrated function definition to the beginning of the code; some minor
cosmetics.  This is a preliminary fix to the actual feature mentioned in
the cited issue.

BUG=chromium-os:26010
TEST=Executed in chroot environment with various combinations of flags
and connected devices

Change-Id: Ib73328e738ebecc38e6faafbd4feb33ced8804ad
Reviewed-on: https://gerrit.chromium.org/gerrit/15438
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
2012-02-07 23:21:27 -08:00
Gilad Arnold
602d1a17f6 image_to_usb.sh: autodetect a removable target device when none provided.
If no target device is provided, image_to_usb.sh will let the user
select one out of a list of autodetected devices. If only one device is
detected, it will be automatically selected.  Also improves the
descriptors shown for candidate/chosen target device(s), and prints
a noticeable warning when the target device does not appear to be
a USB/MMC one.

Also changed all fail/warning messages to use 'die' and 'warn',
respectively, for compliance with other scripts.  Slightly massaged
error/warning strings to be more compact and to-the-point.

BUG=chromium-os:25878
TEST=Executed in chroot environment with various combinations of flags
and connected devices

Change-Id: If248993b8e6f3bc8654c2c8f25f1e54e7899330d
Reviewed-on: https://gerrit.chromium.org/gerrit/15270
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
2012-02-07 14:07:04 -08:00
Brian Harring
36b102b5d1 Add upgrade script to move incremental chrome build content.
Via distfiles bind mounting, chrome build output was being cached
across chroot replacements.  This potentially is desirable, but
wasn't explicitly planned for and violates an assumption of the
canaries.

As such move the content to it's new location.

BUG=None
TEST=emerge-<board> chromeos-chrome
CQ-DEPEND=Ibfc5d42e74861ff498dd2cb6cc2d7be6ec0ded60

Change-Id: I18e384f0fc1cedb3c70ab85178103765322370eb
Reviewed-on: https://gerrit.chromium.org/gerrit/15383
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-02-07 00:35:44 -08:00
Brian Harring
7ee892d95a Mount bind external distfiles into the chroot.
Purpose of this is to allow us to avoid re-downloading everything
every time we rebuild the chroot.

This maintains two directories; host and target.  Future enhancement
involves collapsing this into one- this requires some host work however,
and has some potential gotchas in doing so.

Meanwhile, we now store distfiles in repo/distfiles/{host,target},
and mount bind repo/distfiles into /var/cache/distfiles.

An upgrade script in turn optimistically tries to move the content
into the new location; if it can't complete the move, it wipes the
content and the user has to redownload it (acceptable, if annoying).

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

Change-Id: Iea96429df0e1fdc4ac0860fbce0daabc90c4c2a3
Reviewed-on: https://gerrit.chromium.org/gerrit/15189
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
2012-02-06 21:49:37 -08:00
Brian Harring
357678296a Refactor make_chroot.sh to use enter_chroot, and cleanup complaints.
Now that make_chroot.sh lives alongside enter_chroot, we're able
to invoke it directly and use internal options not exposed through
cros_sdk.  Thus enter_chroot grows a --early_make_chroot flag.

This flag bypasses the normal sudo usage, and runs the command
as root.  It is needed and used by make_chroot for when sudo
may not yet exist (--bootstrap via stage3 lacks sudo).

For where sudo exists and we need access to the source tree,
distfiles, or profile sourcing, enter_chroot is directly used.

For all other invocations we use a single sudo chroot call to
bypass the overhead of enter_chroot.

This is a complete fix to chromium-os:25697 while addressing
all refactoring requests that came up in I8a6c5a26.

Finally, convert all comments into complete sentences, upper
case the leading word, etc to keep reviewers happy.

BUG=chromium-os:25697
TEST=Within a trybot, cros_sdk --bootstrap --replace
TEST=cros_sdk --replace
TEST=cros_sdk --delete
TEST=cros_sdk
Change-Id: I270ee7fc325ef0bea74c61505d25cdbb49a9a333
Reviewed-on: https://gerrit.chromium.org/gerrit/15322
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-02-06 18:40:07 -08:00
Brian Harring
f539bc3407 Import make_chroot from chromiumos-overlay.
Imported as of 09d3117c483c60f55f552694b84b0964dfc17477.

Only modification is so that it can find common.sh.

BUG=chromium-os:25697
TEST=None

Change-Id: Idb43f1ecff3dff10a61396629a344c8bd10f505e
Reviewed-on: https://gerrit.chromium.org/gerrit/15317
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
2012-02-06 17:03:36 -08:00
Stéphane Marchesin
27ef3ab406 Remove chromeos-wm from the files that we test for.
With Aura, we won't have a need for the WM any more.

TEST=built an image without chromeos-wm, verified that the build system didn't complain.

Change-Id: Id6e5006770f72ea45f440dbe56ff7f53262864c1
Reviewed-on: https://gerrit.chromium.org/gerrit/15212
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Erat <derat@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
2012-02-03 10:17:08 -08:00
Chris Wolfe
fe7aac1f82 image_to_usb: Add error for missing image
Add a clearer error message if the source image was not found.
This can occur if the --from directory exists, but the selected
image within it does not. An easy case is --from'ing a directory
from a chromeos-images zip.

Previously image_to_usb would copy zero bytes and return success.

BUG=None
TEST=Ran image_to_usb.sh for default, directory and .bin --froms.

Change-Id: I826f2bbc8effd9554f558e517b51cc03b4f832d5
Reviewed-on: https://gerrit.chromium.org/gerrit/15120
Tested-by: Chris Wolfe <cwolfe@chromium.org>
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Commit-Ready: Chris Wolfe <cwolfe@chromium.org>
2012-02-01 08:12:27 -08:00
Zdenek Behan
bcb72afd00 Revert "setup_board: make the gcc/glibc version stable by default, take 2"
Breaks chromiumos-sdk on failing to resolve the 'stable' keywords into actual versions.

This reverts commit 82eadcf2de828e4dd1182ee717998128387ecbad

Change-Id: I031e1edb90a251562621d935bb9e3800f35318af
Reviewed-on: https://gerrit.chromium.org/gerrit/15150
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
2012-02-01 06:10:23 -08:00
Zdenek Behan
22fe627981 setup_board: make the gcc/glibc version stable by default, take 2
This is needed as part of transition to cros-workon.

Crossdev has a -S option to install the current stable, which is
the preferred future option, but would greatly complicate the logic.

BUG=chromium-os:25338
TEST=setup_board --board=any --force, see it build the right versions

Change-Id: I9139b8a38c9156ea27dfb428cff8c7deffb0e6de
Reviewed-on: https://gerrit.chromium.org/gerrit/15011
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
2012-01-31 16:05:07 -08:00
Jim Hebert
4eb59d19a4 Add script which can instrument a test system for dbusspy at boot time
BUG=chromium-os:23229
TEST=ran this against a ToT alex img, image_to_usb, boots, installs, works

Change-Id: Ia1e589a8b920332c1a247986e6bbc3cad17ed751
Reviewed-on: https://gerrit.chromium.org/gerrit/14650
Commit-Ready: Jim Hebert <jimhebert@chromium.org>
Tested-by: Jim Hebert <jimhebert@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
2012-01-31 11:54:38 -08:00
Zdenek Behan
3ae2b4b5d1 Revert "setup_board: make the gcc version stable by default"
This reverts commit 76a930df83466050ef065c1e433681145b83ab4c

Change-Id: I1b3bd9e8ebc87edcce42a0c105cfeb96c0d1ffd4
Reviewed-on: https://gerrit.chromium.org/gerrit/15004
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
2012-01-28 09:45:02 -08:00
Zdenek Behan
03b28fcbcf setup_board: make the gcc version stable by default
This is needed as part of transition to cros-workon.

Crossdev has a -S option to install the current stable, which is
the preferred future option, but would greatly complicate the logic.

BUG=chromium-os:25338
TEST=setup_board --board=any --force, see it build the right one

Change-Id: Ibb4fd18d122f69835eb471b2fa1a258c571dfdd1
Reviewed-on: https://gerrit.chromium.org/gerrit/14878
Tested-by: Zdenek Behan <zbehan@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
2012-01-28 08:13:30 -08:00
Brian Harring
dd7d7939e0 enter_chroot: add support for git object pool indirection
This adds repo --references awareness (which maps down to git shared object
pools; see git clone -s); specifically, it sets up the appropriate indirection
bindings back to the actual shared source for use from within the chroot.

Note that the approach is a bit complex, but it's required complexity- via
this approach the references are accessible both from within, and without
the chroot.

BUG=chromium-os:19939
TEST=cbuildbot x86-generic-full --clobber --notests --nouprev
TEST=cbuildbot x86-generic-full --notests --nouprev
CQ-DEPEND=I986f17503dc154234ecadd90f6975d7164117cdb

Change-Id: I8498863010cefe0bf5b8f20350fa45a5f2a093d3
Reviewed-on: https://gerrit.chromium.org/gerrit/13467
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
2012-01-26 19:32:18 -08:00
Michael Krebs
104d20d8ea Don't generate symbols for files that dump_syms can't handle.
dump_syms can only dump the symbols of an executable with the same ELF
format as itself.  Some recent build configurations now have binaries with
differing ELF formats.  For example, issue 25468 has a 64-bit kernel where
everything else is 32-bit, and issue 25466 indicates there's a test that
contains a 32-bit executable.

BUG=chromium-os:25496, chromium-os:25468, chromium-os:25466
TEST=Ran cros_generate_breakpad_symbols on 32/64-bit executables

Change-Id: I15f5115585b3ed54ca7ae7b631216285baef8580
Reviewed-on: https://gerrit.chromium.org/gerrit/14835
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
2012-01-25 17:47:25 -08:00
Mike Frysinger
84f66f5864 use helper info/die funcs rather than raw echo
We have helper funcs already for displaying messages, so convert
some raw `echo` calls to them.

BUG=None
TEST=build_image still works and boots

Change-Id: Ie66cc59d0362ef6aa19011fa6cb0bc64a6a4fce8
Reviewed-on: https://gerrit.chromium.org/gerrit/14478
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-01-24 21:57:30 -08:00
Don Garrett
48df416640 Include libstdc++ in the libraries bundled with delta generator.
We have updated the toolchain in the chroot to use a newer version of
libstdc++ than what is installed on our workstations. This means
this additional library is required to generate deltas outside of the
chroot.

BUG=chromium-os:25277
TEST=Generated zip file, and ran contents outside of chroot on my workstation.

Change-Id: I5a90ee355aabd4849a9186a9a66e3dc9b1c51d52
Reviewed-on: https://gerrit.chromium.org/gerrit/14597
Reviewed-by: Eric M. Blake <eblake@google.com>
Reviewed-by: Eric Blake <eblake@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Don Garrett <dgarrett@chromium.org>
2012-01-20 20:05:28 -08:00
Hung-Te Lin
d32c59fe47 crosutils: build factory test image by emerge commands
The factory test image was created by using rsync from build artifacts
in chroot, which has some concerns:
 - Runtime dependencies of autotest-factory won't be picked into image.
 - If a developer skips build_package and builds image by using only pre-built
   binary packages, he will get nothing in factory test image.
 - It's hard for developers to figure out how and when his changes will be
   merged to next build_image (cros_workon does not really work).
 - Output image will be definitely different for every developers, also the
   official build bots.
 - If developers never wipes his chroot (setup_board), the factory test image
   will grow until out of space. (For example, my environment outputs a 825M
   image while the official buildbot generates only 563M for same ToT source).

This CL changes image build command to using portage emerge, so that output
image can be prepared faster and smaller, and easier for maintenance.

BUG=chromium-os:3335
TEST=./build_packages; ./build_image --factory  # Image starts factory UI successfully
     # Also tried tests in test_list.all, seems fine.

     time ./mod_image_for_test.sh --factory --force_copy --no_inplace
     # time: 3m2s => 1m55s, factory test image data: 825/563M => 378M

     ./build_image --factory_install # factory install shim is also fine

Change-Id: I82b4505c74cd31e718aaff4a319d50b69b2c852c
Reviewed-on: https://gerrit.chromium.org/gerrit/14473
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-01-20 17:54:11 -08:00
Vincent Palatin
08df4201a7 Fix amd64 platform detection for minidump symbols generation
Not all 64-bit platforms have names starting with amd64-, so we should
use portageq to get the board architecture name.

BUG=chromium-os:25228
TEST=./cros_generate_breakpad_symbols --board=x86-alex, amd64-corei7, link

Change-Id: I83769575dbd19112b929724995d0c97ed4df2b02
Reviewed-on: https://gerrit.chromium.org/gerrit/14444
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2012-01-19 04:57:48 -08:00
J. Richard Barnette
25d540d75d Add more information to loopback mount failures.
Buildbots are periodically failing to build images; the evidence
points to failures in mount_gpt_image.sh, but it's inconclusive.
Add detailed error messages to mount failures so as to be able
to debug more the next time it happens.

BUG=chromium-os:24975
TEST=build_image, to see that successful cases still work
TEST=repeatedly mount new images with mount_gpt_image until it fails

Change-Id: I711fb0dec62dbab3817a62895b53e14376702544
Reviewed-on: https://gerrit.chromium.org/gerrit/14410
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2012-01-18 17:27:26 -08:00
Mike Frysinger
3e7245a788 image_to_usb: fix typo in flag checking which eats hard drives
The variable setup is "FLAGS_force_non_usb", not "FLAGS_force_non".
Trying to run this currently results in:
	./image_to_usb.sh: line 189: [: -ne: unary operator expected
	Copying USB image .../chromiumos_image.bin to device /dev/sdb...

This should have instead errored out:
	Error: Device /dev/sdb does not appear to be a USB or MMC disk!

Without this fix, image_to_usb.sh proceeds to corrupt the non-usb
disk (which in my case happened to be a backing store for lvm where
all my source was stored and ext4 not surprisingly barfed).

BUG=None
TEST=`./image_to_usb.sh --board=x86-alex -y --to=/dev/sdb` (where /dev/sdb is a disk) now errors out instead of clobbering data
TEST=`./image_to_usb.sh --board=x86-alex -y --to=/dev/sdc` (where /dev/sdc is USB) still works

Change-Id: Id691846393c02cf199309495ae2080b15626e684
Reviewed-on: https://gerrit.chromium.org/gerrit/14334
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Chris Wolfe <cwolfe@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-01-18 08:59:35 -08:00
Ahmad Sharif
a4856380eb Upgraded the target compiler to gcc-4.6.0-r13 for all boards.
BUG=none
TEST=cbuildbot x86-zgb and amd64-generic all pass.

Change-Id: I058fd27ebaad593f7b25f11c99f84d5f32cdb875
Reviewed-on: https://gerrit.chromium.org/gerrit/14193
Reviewed-by: Han Shen <shenhan@chromium.org>
Commit-Ready: asharif <asharif@chromium.org>
Tested-by: asharif <asharif@chromium.org>
2012-01-17 12:58:31 -08:00
David James
2ea8a7859e Don't skip over /usr/local/autotest when generating symbols.
Right now, the buildbot won't symbolize any crash that occurs in autotest
because all symbols in /usr/local/autotest are skipped by breakpad. Tweak
cros_generate_breakpad_symbols to not skip over these symbols so that
browser test crashes can be symbolized.

BUG=chromium-os:25061
TEST=Run cros_generate_breakpad_symbols and verify it still completes
     successfully, and generates working symbols for autotest that can
     be used to symbolize browser test crashes.

Change-Id: I072498060e78b373bd12c94ff95465878301cbce
Reviewed-on: https://gerrit.chromium.org/gerrit/14155
Commit-Ready: David James <davidjames@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2012-01-13 15:37:51 -08:00
Mike Frysinger
5d2df83002 Revert "Reduce the number of glibc patches Changed the glibc version"
This reverts commit 6fa1e14c59e541780e49a48f83683db079614d8f

We reverted the glibc-2.11.1-r4 ebuild (it no longer exists), so we have to revert this too since there is no 2.11.1-r4 to use.

Change-Id: Ie8d71eeaf436b348a695d55376e269557ced3b15
Reviewed-on: https://gerrit.chromium.org/gerrit/14061
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
Reviewed-by: asharif <asharif@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-01-12 11:53:07 -08:00
David James
74d6249356 Clean old breakpad symbols prior to generating new ones.
If we're generating new breakpad symbols, we don't need to keep the
old ones around. Keeping the old ones forever means the debug tarballs
get really large (e.g. >10GB).

This problem makes incremental bots get slower and slower over time. The
chromium.chromiumos bot spends over an hour archiving the debug symbols,
for example.

BUG=chromium-os:24994
TEST=Trybot run of archive stage, generating and uploading debug
     symbols.

Change-Id: Ibf57db2561d29085434439ecd4f23e5cec1f598a
Reviewed-on: https://gerrit.chromium.org/gerrit/14040
Commit-Ready: David James <davidjames@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2012-01-11 17:48:17 -08:00
Zelidrag Hornung
094160701f Added ability to download images othert than x86-generic.
BUG=chromium-os:24907
TEST=make sure ./bin/cros_download_latest_image downloads the correct board

Change-Id: I8c1784edf39a6a04d46bc8cdbf7b62d2a361d593
Reviewed-on: https://gerrit.chromium.org/gerrit/13948
Reviewed-by: Daniel Erat <derat@chromium.org>
Tested-by: Zelidrag Hornung <zelidrag@chromium.org>
2012-01-10 12:29:11 -08:00