chromiumos/platform/crosutils.git
15 months agoMove encrypted_import scripts to src/platform/installer. 51/66451/2 master
Don Garrett [Tue, 20 Aug 2013 23:08:17 +0000 (16:08 -0700)]
Move encrypted_import scripts to src/platform/installer.

These files will be readded in a new CL.

BUG=None
TEST=None (Retested scripts in CL that readds them).

Change-Id: Ib465898d443e481eda7f9b73b48fc7c33696373c
Reviewed-on: https://gerrit.chromium.org/gerrit/66451
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
15 months agobuild_image: also install fully versioned python symlink 68/66568/2
Mike Frysinger [Wed, 21 Aug 2013 22:30:49 +0000 (18:30 -0400)]
build_image: also install fully versioned python symlink

Some generated Gentoo scripts like to use the full python version in
their shebang e.g. /usr/bin/python2.7.

We already create the symlinks:
 - /usr/bin/python
 - /usr/bin/python2
 - /usr/local/bin/python
 - /usr/local/bin/python2

And we already have the file (the real python interp which those symlinks
point to):
 - /usr/local/bin/python2.7

So let's slip in /usr/bin/python2.7 too.

BUG=None
TEST=`./build_image --board=x86-alex` generates the right symlinks and works at runtime

Change-Id: I3a687ed07b3b2a0e75ecd9a05117590422c3541c
Reviewed-on: https://gerrit.chromium.org/gerrit/66568
Reviewed-by: Marc MERLIN <merlin@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
15 months agoRemove old versions of autotest-chrome 06/66306/3
Ilja Friedel [Tue, 20 Aug 2013 03:27:08 +0000 (20:27 -0700)]
Remove old versions of autotest-chrome

This CL is verbatim copied from:
https://gerrit.chromium.org/gerrit/#/c/65804/

Several graphics_* tests no longer depends on GraphicsUITest, so we moved them
from autotest-chrome to autotest-tests.

Unfortunately, this causes a conflict since autotest-chrome RDEPENDS on
autotest-tests, so the old autotest-chrome must be unmerged first, before
the new autotest-tests can be merged.

This migration script will take care of the uninstallation.

BUG=chromium:272220
CQ-DEPEND=66134
TEST=apply patch:
  ./build_packages
 ==>
INFO    : Old chroot version (62) found, running upgrade hooks
INFO    : Rollup 63_parrot_go_public
INFO    : Rollup 64_upgrade_autotest_pkgs

Change-Id: If843c072373154453a2dd9a6c4cec18f57df5332
Reviewed-on: https://gerrit.chromium.org/gerrit/66306
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
Tested-by: Ilja H. Friedel <ihf@chromium.org>
15 months agocros_generate_breakpad_symbols: use 64bit dump_syms all the time 14/66214/2
Mike Frysinger [Mon, 19 Aug 2013 18:47:21 +0000 (14:47 -0400)]
cros_generate_breakpad_symbols: use 64bit dump_syms all the time

Upstream fixed dump_syms so that it is no longer wordsize specific.  That
means you can use the 64bit version of dump_syms on 32bit ELFs.  This is
good because the current Chrome builds are producing a debug file so big
that it's filling up the VM space of the 32bit ELF.  The 64bit one has no
such problem as it has a bigger VM space for maps.

BUG=chromium:266064
TEST=ran cros_generate_breakpad_symbols before & after change and compared breakpad/ output -- they were the same

Change-Id: Ib564fa1f3acc17fcf26ddcbaac2b46471908f41f
Reviewed-on: https://gerrit.chromium.org/gerrit/66214
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

15 months agoMake EFI boot from kernel on EFI partition. 70/66170/3
Don Garrett [Wed, 7 Aug 2013 19:41:31 +0000 (12:41 -0700)]
Make EFI boot from kernel on EFI partition.

EFI boot was broken for official images since it was using the /boot kernel
which has been removed. This change starts using the kernel already on the
EFI partition for syslinux.

Matching changes to postinst are required.

BUG=chromium:260512
TEST=chromeos-install to EFI system, image_to_live testing.

Change-Id: Ia987815398bd19fc1da90a5b725d27dcbd699dc5
Reviewed-on: https://gerrit.chromium.org/gerrit/66170
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>

15 months agoupdate hooks: slip in public parrot overlay 92/64792/3
Mike Frysinger [Tue, 6 Aug 2013 18:27:09 +0000 (14:27 -0400)]
update hooks: slip in public parrot overlay

For people who have parrot builds already, regen their board configs
so that they also include the public overlay.

BUG=None
TEST=`./update_chroot` converts a private-only /build/parrot to include the public repo

Change-Id: I44b2f4b508a9e24105dcef5d91ffbef4d4db905c
Reviewed-on: https://gerrit.chromium.org/gerrit/64792
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

15 months agocreate_legacy_bootloader_templates.sh: Use the same grub-mkimage for all targets 16/65516/2
Josh Triplett [Sat, 10 Aug 2013 02:25:39 +0000 (19:25 -0700)]
create_legacy_bootloader_templates.sh: Use the same grub-mkimage for all targets

According to GRUB upstream, the GRUB utilities in bin and sbin support
all targets installed to the same prefix.  See
https://savannah.gnu.org/bugs/?39721 for details.  Thus, use the same
grub-mkimage for both x86_64-efi and i386-efi.  This will allow
simplifying the sys-boot/grub ebuild.

BUG=None
TEST=build_packages and build_image

Change-Id: I27e9f9ab1d352391376c9ab34b575ffaa5534d07
Reviewed-on: https://gerrit.chromium.org/gerrit/65516
Tested-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Josh Triplett <josh@joshtriplett.org>

15 months agocreate_legacy_bootloader_templates.sh: Drop support for pre-2.00 GRUB 15/65515/2
Josh Triplett [Sat, 10 Aug 2013 01:55:28 +0000 (18:55 -0700)]
create_legacy_bootloader_templates.sh: Drop support for pre-2.00 GRUB

Now that we've transitioned to GRUB 2.00, drop the compatibility support
for running an older GRUB.

BUG=None
TEST=build_packages and build_image

Change-Id: Icb936c8a95c4293a449c81632fa0234fed4b7976
Reviewed-on: https://gerrit.chromium.org/gerrit/65515
Tested-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Josh Triplett <josh@joshtriplett.org>

15 months agocros_generate_breakpad_symbols: try dumping w/out cfi info when falling back 97/66097/2
Mike Frysinger [Thu, 15 Aug 2013 22:53:04 +0000 (18:53 -0400)]
cros_generate_breakpad_symbols: try dumping w/out cfi info when falling back

The dump_syms prog can be buggy and crash when given a really large debug
file.  If that happens, automatically fall back to stripping out some of
the extended information so that we still at least get symbols.

BUG=chromium:266064
TEST=ran `./cros_generate_breakpad_symbols` on a Chrome that is causing dump_syms to crash and watched retry
TEST=`cbuildbot daisy-release` dumps chrome symbols

Change-Id: I1cba5d515e28d668b114298a99d290df25d18601
Reviewed-on: https://gerrit.chromium.org/gerrit/66097
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
15 months agomake_chroot: uninstall openrc as needed 41/64441/2
Mike Frysinger [Sun, 4 Aug 2013 15:38:43 +0000 (11:38 -0400)]
make_chroot: uninstall openrc as needed

We don't need openrc in our chroot, so clear it out.  It actually
gets in the way when using our custom baselayout package.

BUG=chromium:267982
TEST=`cbuildbot chromiumos-sdk` works w/new and old stage3

Change-Id: I7eecba20b4160065236641d60afb022b3d37629f
Reviewed-on: https://gerrit.chromium.org/gerrit/64441
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

15 months agoMake /mnt/stateful_partition easily available for ebuild installation. 88/65788/2
Don Garrett [Tue, 13 Aug 2013 22:11:04 +0000 (15:11 -0700)]
Make /mnt/stateful_partition easily available for ebuild installation.

By mounting the stateful partition when images are being built, ebuilds
can easily install files to stateful by just referencing the same
directory paths that will be used after the image is booted.

Not that files in stateful will NOT be installed if the whitelist in
chromeos-install is not updated.

BUG=chromium:259592
TEST=Temp modified an ebuild to install to /mnt/stateful_partition, and
     observed that the file was present in stateful afterwards. Copied
     to USB and booted the image for real to confirm.

Change-Id: I6d1fdbe3da64b92ccc56595777e98657a4aadc13
Reviewed-on: https://gerrit.chromium.org/gerrit/65788
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>

15 months agoCreate tool to validate files before copying them. 27/65527/8
Don Garrett [Sun, 11 Aug 2013 21:57:03 +0000 (14:57 -0700)]
Create tool to validate files before copying them.

The intention is that this tool will be used to verify files that will
be moved from unencrypted stateful partion to encrypted stateful partion
using a validation file stored on the rootfs.

The same tool will be run by build image to create a validation file, and
again by the boot scripts at first boot.

This CL creates a tool for doing a validated copy, but does not use the
tool in any way.

BUG=chromium:269788
TEST=It passes the new unittests included.

Change-Id: I75bc66040a06bf0a4a2a8512c96e12a03e14da3c
Reviewed-on: https://gerrit.chromium.org/gerrit/65527
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
15 months agoRemove old versions of autotest-chrome 04/65804/2
Daniel Kurtz [Wed, 14 Aug 2013 03:49:15 +0000 (11:49 +0800)]
Remove old versions of autotest-chrome

This CL is copied from:
https://gerrit.chromium.org/gerrit/#/c/61600

graphics_Sanity no longer depends on GraphicsUITest, so we moved it from
autotest-chrome to autotest-tests.

Unfortunately, this causes a conflict since autotest-chrome RDEPENDS on
autotest-tests, so the old autotest-chrome must be unmerged first, before
the new autotest-tests can be merged.

This migration script will take care of the uninstallation.

BUG=chromium:272220
TEST=w/out patch:
  ./build_packages
TEST=apply patch:
  ./build_packages
 ==>
 INFO    : Old chroot version (61) found, running upgrade hooks
 INFO    : Rollup 62_upgrade_autotest_pkgs
 chromeos-base/autotest-chrome: 0.0.1-r2914 none none
 All selected packages: chromeos-base/autotest-chrome-0.0.1-r2914
 >>> Unmerging chromeos-base/autotest-chrome-0.0.1-r2914...
 INFO    : Elapsed time (run_chroot_version_hooks): 0m3s

Change-Id: Idab26430afa90109044f3c60e1ae45a50124cc21
Reviewed-on: https://gerrit.chromium.org/gerrit/65804
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>

15 months agosecurity_test_image: default to using signer vboot rev 02/60502/3
Mike Frysinger [Fri, 28 Jun 2013 19:49:08 +0000 (15:49 -0400)]
security_test_image: default to using signer vboot rev

Rather than running security tests against the ToT vboot, use the same
git ref that the signer does.  This way, when a change is landed in the
vboot repo that the build logic uses but breaks with the older vboot,
we'll notice in the build bot phase rather than when the signer runs.

BUG=chromium:255529
TEST=`./security_test_image --board=stumpy` checked out the vboot ref the signer uses

Change-Id: I5e6ea9495e498c092f8ed80b81d9693dd133f034
Reviewed-on: https://gerrit.chromium.org/gerrit/60502
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

15 months agocros_workon: tweak style 81/59581/3
Mike Frysinger [Fri, 21 Jun 2013 18:41:03 +0000 (14:41 -0400)]
cros_workon: tweak style

Hopefully no functional changes.  Just making style more consistent.

BUG=None
TEST=ran a few cros_workon commands (start/stop/list/...)

Change-Id: I757781a7cf26064aa11839b0b63fd87d52d3ae95
Reviewed-on: https://gerrit.chromium.org/gerrit/59581
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
15 months agobuild_packages: add --board_root, --unpackonly and --usepkgonly 13/64013/6
Thiago Goncales [Fri, 12 Jul 2013 17:55:11 +0000 (10:55 -0700)]
build_packages: add --board_root, --unpackonly and --usepkgonly

--board_root: Allows the specification of a root location in which
parallel_emerge will emerge the packages to. This flag will setup the
board in /build/$BOARD if it's not set yet. It also assumes we are only
building binary packages and that the toolchain is installed in the
board_root.

--unpackonly: Specifies to fetch and unpack all packages, not building
them.

--usepkgonly: Only use binary packages while building.

BUG=chromium:267879
TEST=build_packages --root<root>; check that --unpackonly is in
     EMERGE_FLAGS; compare using --board_root sysroot with regular
     sysroot; ensure that --usepkgonly is specified in EMERGE_FLAGS.

Change-Id: Ie55510b93d6200f3a5fb712d69c71f8292db8cef
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64013
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ryan Cui <rcui@chromium.org>
15 months agosetup_board: add --skip_board_pkg_init option. 46/60146/6
Thiago Goncales [Fri, 12 Jul 2013 17:54:10 +0000 (10:54 -0700)]
setup_board: add --skip_board_pkg_init option.

--skip_board_pkg_init skips installation of initial packages in the sysroot.
This is useful to speed up setup_board when we are not interested in
emerging any package.

BUG=chromium:267825
TEST=None

Change-Id: I14bd3baaf0e24e4b0b9f7d295a6d494457081164
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60146

15 months agoDon't copy OEM image to partition if it doesn't exist 16/64716/3 stabilize-4512.B
Liam McLoughlin [Tue, 6 Aug 2013 00:00:36 +0000 (17:00 -0700)]
Don't copy OEM image to partition if it doesn't exist

BUG=none
TEST=Run build_image for sonic, verify it doesn't fail

Change-Id: I6be223faecc7322894ddcdbba3bbac2a4e52e0a7
Reviewed-on: https://gerrit.chromium.org/gerrit/64716
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Liam McLoughlin <lmcloughlin@google.com>
Tested-by: Liam McLoughlin <lmcloughlin@google.com>
15 months agomount_gpt_image: fix bugs in new esp handling 94/64694/2
Mike Frysinger [Mon, 5 Aug 2013 22:44:11 +0000 (18:44 -0400)]
mount_gpt_image: fix bugs in new esp handling

Some assumptions about how this script is invoked were made when updating
for handling missing esp partitions which lead to non-fatal warnings.
Rework the code to avoid those.

BUG=chromium:263681
TEST=`./build_image --board=daisy daisy` no longer spits out warnings
TEST=`./mount_gpt_image.sh --from ../build/images/daisy/latest/chromiumos_base_image.bin` works
TEST=`./mount_gpt_image.sh -u` works cleanly

Change-Id: I4554739029d6af89920eaa098930a4266c2edaaa
Reviewed-on: https://gerrit.chromium.org/gerrit/64694
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
15 months agomake_chroot: make bare_chroot more robust 36/64336/2
Mike Frysinger [Fri, 2 Aug 2013 17:44:18 +0000 (13:44 -0400)]
make_chroot: make bare_chroot more robust

With some distros merging /bin and /sbin and /usr, assuming the $PATH
outside of the chroot contains all the elements we need when we're in
the chroot no longer flies.  Update the bare_chroot helper so that it
always includes all the paths that matter inside the chroot.

BUG=None
TEST=`cros_sdk --chroot asdf` still works

Change-Id: Ieacf2772448b8b3803f60b78412aa5d179e6b49f
Reviewed-on: https://gerrit.chromium.org/gerrit/64336
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
15 months agoRevert "Revert "Changed linux command line to use the linux format for uuids"" 65/63265/2
Paul Taysom [Wed, 24 Jul 2013 22:56:18 +0000 (15:56 -0700)]
Revert "Revert "Changed linux command line to use the linux format for uuids""

https://gerrit.chromium.org/gerrit/#/c/61889/ fixes the problem that forced this change to be reverted.

BUG=chromium:224066
TEST=cbuildbot parrot-paladin link-paladin daiy-paladin

This reverts commit 18673a8b2dff05bb28d1f0c49f6e0b61a24548be

Change-Id: I26bc74d3149605121caff9c006c133b21a3f6234
Reviewed-on: https://gerrit.chromium.org/gerrit/63265
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>

15 months agoDon't mount OEM partition if it's nonexistent 82/62382/2
Liam McLoughlin [Wed, 17 Jul 2013 19:18:09 +0000 (12:18 -0700)]
Don't mount OEM partition if it's nonexistent

BUG=none
TEST=Build image with no OEM partition, works

Change-Id: Ic30d0d14ec4c68233ffc81bd367b66d4193531d2
Reviewed-on: https://gerrit.chromium.org/gerrit/62382
Reviewed-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Queue: Liam McLoughlin <lmcloughlin@chromium.org>

15 months agocreate_legacy_bootloader_templates.sh: Include efi_gop video module for GRUB 2.00 82/63982/2
Josh Triplett [Wed, 31 Jul 2013 22:21:08 +0000 (15:21 -0700)]
create_legacy_bootloader_templates.sh: Include efi_gop video module for GRUB 2.00

GRUB 2.00 requires the efi_gop video module to properly set a video mode
for the Linux kernel.

BUG=chromium:265918
TEST=With the complete patch series, built a complete x86-generic image,
     and booted it via UEFI on both 32-bit and 64-bit UEFI platforms.

Change-Id: Iad634e17f518800cda4dd2654772cd2e3e4bc16e
Reviewed-on: https://gerrit.chromium.org/gerrit/63982
Tested-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Commit-Queue: Josh Triplett <josh@joshtriplett.org>

15 months agocreate_legacy_bootloader_templates.sh: Support GRUB 2.00 92/63292/2 firmware-pit-4482.B
Josh Triplett [Wed, 24 Jul 2013 20:59:11 +0000 (13:59 -0700)]
create_legacy_bootloader_templates.sh: Support GRUB 2.00

Don't expect grub2-mkimage to exist, since GRUB 2.00 normally installs
grub-mkimage just like GRUB 1.97.  Instead, check for a module that only
exists in GRUB 2.00.

BUG=None
TEST=Built an image with GRUB 2.00.

Change-Id: I239fd14ae8affcf9d29a3b264bf52b5c9e539007
Reviewed-on: https://gerrit.chromium.org/gerrit/63292
Tested-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Josh Triplett <josh@joshtriplett.org>

15 months agoimage_to_usb: actually fail if umount fails 77/63377/3
Kees Cook [Thu, 25 Jul 2013 19:50:41 +0000 (12:50 -0700)]
image_to_usb: actually fail if umount fails

Unmount failures were being masked by the "| grep" for the chroot helper
message. Remove all of this, since it is critical that the umount
failure stop the script. Otherwise we'll end up with corrupted images
from situations like the Ubuntu automounter.

BUG=None
TEST=attempted image writing with an automounted drive

Change-Id: I171a0f298688f56df3a34384b0cc2052e97f8d85
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63377
Reviewed-by: Marc MERLIN <merlin@chromium.org>
16 months agocros_vm_lib: add support for copying image 11/63111/4
mukesh agrawal [Tue, 23 Jul 2013 21:13:08 +0000 (14:13 -0700)]
cros_vm_lib: add support for copying image

We sometimes see failures where we are unable to log in to the VM
over ssh. In these cases, we can't fetch log files for the VM,
because we normally do that via ssh.

We could fall back to mounting the VM's filesystem image, if not
for the fact that we use "-snapshot", which saves deltas to temporary
files.

Add an option to cros_vm_lib, so that we can start VMs with private
copies of the image file, and persist filesystem changes to that
private copy.

BUG=chromium:212084
TEST=trybot on amd64-generic-paladin, x86-generic-paladin, daisy-paladin

Change-Id: I30da0d4ca034a35cba64c403b736ba8db107a513
Reviewed-on: https://gerrit.chromium.org/gerrit/63111
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>

16 months agoRemove old versions of autotest-tests and autotest-deps. 87/62387/3 factory-4455.B stabilize-4443.B
Dan Shi [Wed, 17 Jul 2013 21:09:45 +0000 (14:09 -0700)]
Remove old versions of autotest-tests and autotest-deps.

This CL is copied from:
https://gerrit.chromium.org/gerrit/#/c/61600

To speed up the build, we are splitting the autotest-tests and
autotest-deps packages into a few other packages. This may cause
conflicts so we will need to uninstall the other packages first. This
migration script will take care of the uninstallation.

BUG=chromium:238407
TEST=none

Change-Id: Idd85c84279318ce1aaad07fa31e479c732e39752
Reviewed-on: https://gerrit.chromium.org/gerrit/62387
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>

16 months agoModified grub.cfg to set default value based on partition priority 76/58276/5
Sathish Kuppuswamy [Fri, 7 Jun 2013 18:33:03 +0000 (11:33 -0700)]
Modified grub.cfg to set default value based on partition priority

In this commit, template of grub.cfg is modified to set the default
parition to boot based on priority of the partition in the disk.
Grub reads the priority of partitions in the GPT disk with the help
of grub command "gptpriority". This change is required, say when
a new image is installed with image_to_live, system reboots to the
default image instead of newly installed image. This commit will
ensure the image booted is with high priority (in above case newly
installed image) instead of just booting default always. Note: This
above scenario works fine with coreboot, and the changes is to make
EFI boot behave the sameway

BUG=None
TEST=Tested by changing the parition priority manually using cgpt and
     verified that system boots to high priority image on reboot. And
     also verified image_to_live boots to newly installed image.

CQ-DEPEND=CL:I7cce1079b356e8459409113a4c17d62b25c5cd4e

Change-Id: I930d0f3f1a3f8f54edd1dce7f8259e3c261af9a1
Reviewed-on: https://gerrit.chromium.org/gerrit/58276
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Sathish Kuppuswamy <sathish.kuppuswamy@intel.com>
Commit-Queue: Josh Triplett <josh@joshtriplett.org>

16 months agoMask out /boot/config-x.y.z and /boot/System.map-x.y.z. 72/62572/2
Don Garrett [Fri, 19 Jul 2013 01:04:06 +0000 (18:04 -0700)]
Mask out /boot/config-x.y.z and /boot/System.map-x.y.z.

We want to install these files into /boot in the chroot, but not on the image.
Added these files to DEFAULT_INSTALL_MASK.

BUG=chromium:260889
TEST=Build/installed image, and checked /boot in chroot and on device.

Change-Id: I30ac808a9fd2db4b360bfd46c8afc9ff721a738a
Reviewed-on: https://gerrit.chromium.org/gerrit/62572
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
16 months agoAvoid duplication of keep_bootcon 66/62366/2
Vadim Bendebury [Wed, 17 Jul 2013 17:53:46 +0000 (10:53 -0700)]
Avoid duplication of keep_bootcon

The previous change added 'keep_bootcon' to the kernel command line
when early serial output is enabled. It happens to be added twice, as
the console= setting is duplicated in earlyprintk=. It is enough to
add it just once.

BUG=none
TEST=manual
   verified that keep_bootcon is indeed added only once.

Change-Id: I399864b9e29af7ef65ff3b00f84af4407f94865a
Reviewed-on: https://gerrit.chromium.org/gerrit/62366
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Paul Taysom <taysom@chromium.org>
Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>

16 months agoOnly use internal generic prebuilts for the Chrome binhost. 16/62316/2
David James [Wed, 17 Jul 2013 02:34:40 +0000 (19:34 -0700)]
Only use internal generic prebuilts for the Chrome binhost.

Right now, internal "generic" prebuilts are used for both the Chrome
binhost and for general prebuilts. This works great for the Chrome
binhost, but it doesn't work very well for general prebuilts.

BUG=chromium:259208
TEST=pre-cq-group and verify it uses prebuilts
TEST=Run local x86-zgb setup_board and convert it's not using prebuilts
     from x86-alex

Change-Id: If8fc2077f68d1b2e8263bf37c58738c67f01292d
Reviewed-on: https://gerrit.chromium.org/gerrit/62316
Reviewed-by: Marc MERLIN <merlin@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
16 months agoRevert "Move board-specific setup to common.sh & add a kernel signing function" 44/62244/2
Paul Taysom [Tue, 16 Jul 2013 22:55:23 +0000 (15:55 -0700)]
Revert "Move board-specific setup to common.sh & add a kernel signing function"

This reverts commit 4474bf2d62fc90eeb5689d2eb3445c29c30d0042

This change broke the factory build for parrot canary. crbug.com/260805

Change-Id: I5b971fa597b5b0ba04e65ec6563d44f3ca80ac02
Reviewed-on: https://gerrit.chromium.org/gerrit/62244
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>

16 months agoRemove old versions of autotest-tests and autotest-deps. 00/61600/2
David James [Thu, 11 Jul 2013 21:02:45 +0000 (14:02 -0700)]
Remove old versions of autotest-tests and autotest-deps.

To speed up the build, we are splitting the autotest-tests and
autotest-deps packages into a few other packages. This may cause
conflicts so we will need to uninstall the other packages first. This
migration script will take care of the uninstallation.

BUG=chromium:259427
TEST=Run build with before patch, then run migration script,
TEST=Next, run with autotest refactor and verify no conflicts.
CQ-DEPEND=CL:I587270557513e9b3e8bc5010b69a2b208d9b01ef

Change-Id: Iab019c7c9920f0c09fbf3e5d4cb80616977ddc57
Reviewed-on: https://gerrit.chromium.org/gerrit/61600
Reviewed-by: Dennis Jeffrey <dennisjeffrey@chromium.org>
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
16 months agoDo not switch off serial console 05/62005/3
Vadim Bendebury [Mon, 15 Jul 2013 23:05:55 +0000 (16:05 -0700)]
Do not switch off serial console

Linux kernel deregisters the serial console as soon as other consoles
become available (for instance LCD). This is not always optimal, as
the kernel sometimes hangs after alternative consoles became
available, but before user logs in.

Adding keep_bootcon to the command line keeps serial console enabled
for the entire duration. Note that the messages keep coming out even
after login screen appears, but this is an inconvenience one should be
able to live with.

BUG=chromium:260683
TEST=manual
  . with this change the serial console output is not shut off mid
    kernel startup.

Change-Id: I49be4739ce54f0a86b3433b8b73dc9d9acaebed0
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62005

16 months agobuild_image: skip EFI partition if its size is 0 04/60304/4
Mike Frysinger [Thu, 27 Jun 2013 00:20:55 +0000 (20:20 -0400)]
build_image: skip EFI partition if its size is 0

There are systems which will never see EFI in any form.  Including the
EFI partition on those system is a waste of space.  Let the code skip
it if the disk layout has declared it to have a 0 byte size.

BUG=chromium:236941
TEST=`cbuildbot {arm,amd64,x86}-generic-full` works
TEST=`./build_image` works when disk layout declares ESP as blank

Change-Id: I0237c2196435c2bb91054255f3b446cc9d2ad421
Reviewed-on: https://gerrit.chromium.org/gerrit/60304
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
16 months agoMove board-specific setup to common.sh & add a kernel signing function 89/61689/4
Albert Chaulk [Fri, 12 Jul 2013 18:42:18 +0000 (11:42 -0700)]
Move board-specific setup to common.sh & add a kernel signing function

Some platforms are not going to use the usual verified boot functionality,
so we move the signing code to a function and let it be overridden on
a per-board basis.

BUG=chromium:229631
TEST=built lumpy successfully

Change-Id: Ia3a481120d0cc47fffd24eacf69e169b34bf6698
Reviewed-on: https://gerrit.chromium.org/gerrit/61689
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
16 months agoAdd flag in setup_board and build_packages for only using the Chrome binhost. 44/60944/3 firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-wolf-4389.24.B
David James [Wed, 3 Jul 2013 22:59:29 +0000 (15:59 -0700)]
Add flag in setup_board and build_packages for only using the Chrome binhost.

This is needed so that the commit queue can compile everything from
source except for Chrome itself.

BUG=chromium:257167
TEST=setup_board --help
TEST=setup_board --board=link --force --chrome_binhost_only
TEST=setup_board --board=link --force

Change-Id: I9ab7cd2e81a52c4579cb7a41cb47370c85619338
Reviewed-on: https://gerrit.chromium.org/gerrit/60944
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
16 months agoAdd test for au_generator.zip contents. 72/60172/4
Don Garrett [Thu, 27 Jun 2013 02:05:16 +0000 (19:05 -0700)]
Add test for au_generator.zip contents.

Add a new script that can be run (usually outside the chroot) to validate the
contents of au_generator.zip. This is mostly done to validate our handling of
dynamic library exports.

BUG=chromium:214885
TEST=Manual run + added to cbuildbot BuildImage stage.

Change-Id: I3051d622eebb67d27b0871379dfe8eb68c8da6ea
Reviewed-on: https://gerrit.chromium.org/gerrit/60172
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
16 months agoRevert "Changed linux command line to use the linux format for uuids" 08/60508/3
Paul Taysom [Fri, 28 Jun 2013 20:33:39 +0000 (13:33 -0700)]
Revert "Changed linux command line to use the linux format for uuids"

This reverts commit b6cf37f7e2e2b925b852b2c2f752bc9b382c4115

BUG=chromium:255529
TEST=./signing_poller.py -s

Change-Id: Iacd315e1256303c0192fae2a65ae905a8f77cd27
Reviewed-on: https://gerrit.chromium.org/gerrit/60508
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>

17 months agoChanged linux command line to use the linux format for uuids 16/57816/5
Paul Taysom [Thu, 6 Jun 2013 16:35:07 +0000 (09:35 -0700)]
Changed linux command line to use the linux format for uuids

Changed the linux command line so UUIDs to use PARTUUID=%U[/PARNTOFF=%d].

The old command line format will still be accepted for the next month
before we delete the dual format support from the kernel.

For now, kern_guid is excluded until installer and any other
users of kern_guid can be fixed.

Added changes required to work with legacy systems and VMTest.

BUG=chromium:224066
TEST=booted with new format with verity, no verity, and bootcaches on legacy, chromebooks and try bots.

Change-Id: I9152250e7ad7fda5c7cfe9434c64362fcb57828c
Reviewed-on: https://gerrit.chromium.org/gerrit/57816
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>

17 months agoenter_chroot: speed up entering by backgrounding locale generation 41/58041/2
Mike Frysinger [Mon, 10 Jun 2013 03:34:52 +0000 (23:34 -0400)]
enter_chroot: speed up entering by backgrounding locale generation

Half of the current time is spent on calling locale-gen even when there is
nothing to be done (all locales already generated).  Throw it into the bg
to unblock the main thread.

BUG=None
TEST=`cros_sdk` still works
TEST=`LANG=et_EE.UTF-8 cros_sdk` generates the new locale in the background

Change-Id: Ibe9a07bec60a59cab1cf4230358f7f8ff5b21c2e
Reviewed-on: https://gerrit.chromium.org/gerrit/58041
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
17 months agomask out systemd files 36/59836/2
Mike Frysinger [Mon, 24 Jun 2013 21:22:39 +0000 (17:22 -0400)]
mask out systemd files

We don't use systemd at all, so no need to install these files.

BUG=None
TEST=`cbuildbot {amd64,x86,arm}-generic-full` still work

Change-Id: If6008b1aabf3b079bbce441468c88691e88b0715
Reviewed-on: https://gerrit.chromium.org/gerrit/59836
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
17 months agocgpt: export details for all partitions 19/60119/3
Mike Frysinger [Tue, 7 May 2013 22:16:17 +0000 (18:16 -0400)]
cgpt: export details for all partitions

Knowing how big a partition is can be useful, but it's a lot more useful
to know how much data is filled in that partition.  This way we don't
waste time writing out unused data (usually just zeros).  This makes a
bigger difference on flash based devices where erasing/writing is not
only slow, but can degrade the life of the device.

Here we take the existing WriteRootPartitionSize func and generalize it
so that it generates info for all partitions.  At runtime, we can load
the right set of data and then refer to it by number.

BUG=chromium:236941
TEST=`./build_library/cgpt.py write usb build_library/legacy_disk_layout.json f.sh` includes new funcs
TEST=`cbuildbot {amd64,arm,x86}-generic-full` works

Change-Id: I3b756e3b8f5c24097cdedf46902ae7a503c5388f
Reviewed-on: https://gerrit.chromium.org/gerrit/60119
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
17 months agoupload_symbols: delete 89/57189/2
Mike Frysinger [Fri, 31 May 2013 01:56:33 +0000 (21:56 -0400)]
upload_symbols: delete

This has been rewritten in python and moved to chromite.

BUG=chromium:209442
BUG=chromium:213204
TEST=None
CQ-DEPEND=CL:57188

Change-Id: I2157a5d47846783da297cfb0a3a8e8a709ab55a0
Reviewed-on: https://gerrit.chromium.org/gerrit/57189
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
17 months agobuild_image: add support for setting filesystem format in the disk layout 48/59848/3
Mike Frysinger [Tue, 7 May 2013 18:27:28 +0000 (14:27 -0400)]
build_image: add support for setting filesystem format in the disk layout

As we expand into new devices, hardcoding the file system formats for
various partitions no longer scales.  By declaring the format in the json,
boards can do whatever they want, and the resulting code can now easily
scale to any fs format.

BUG=chromium:236941
TEST=`./build_image` for embedded now includes right info for formatting as UBIFS
TEST=`cbuildbot {arm,amd64,x86}-generic-full` works

Change-Id: Ic19ef66c66db5afbe5449672fa3fcbf01f361075
Reviewed-on: https://gerrit.chromium.org/gerrit/59848
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

17 months agocgpt: improve blank partition handling 45/59845/2
Mike Frysinger [Fri, 3 May 2013 20:21:25 +0000 (16:21 -0400)]
cgpt: improve blank partition handling

We want to be able to omit certain partitions when they don't make sense.
Like throwing away the EFI partition on a device that doesn't have an EFI
bootloader (or anything like it).

Currently if we try to do that in the disk layout (by setting them as
blank), the build scripts barf because cgpt returns an error when they
request information by partition #.  Now we return the right info, and
then the build scripts will use that to figure out what it should do.

We also fix the main partition write script to skip blank partitions.

BUG=chromium:236941
TEST=`./build_image` w/json declaring a blank EFI partition produces an image w/out EFI
TEST=`cbuildbot {amd64,x86,arm}-generic-full` works

Change-Id: I009c1eb2973fe18081432d019a008529adaff4ae
Reviewed-on: https://gerrit.chromium.org/gerrit/59845
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
17 months agobuild_image: cache DISK_LAYOUT_PATH early 26/59826/2 release-R29-4319.B
Mike Frysinger [Fri, 10 May 2013 20:01:08 +0000 (16:01 -0400)]
build_image: cache DISK_LAYOUT_PATH early

Since get_disk_layout_path gets run in subshells, the computed value of
DISK_LAYOUT_PATH never makes it to the larger env.  Even if it did, we
currently always recompute it.  This can be a little expensive since it
involves walking all our overlays to find the json file.

Instead, let's compute this value once before we start building the image
and have the code use that value if it's been set already.  This should
be backwards compatible.

BUG=chromium:236941
TEST=`./build_image` produces the same image

Change-Id: I7360995982f35289eda0c029493d435909b587b3
Reviewed-on: https://gerrit.chromium.org/gerrit/59826
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
17 months agocros_workon: add auto-complete support 80/59580/3
Mike Frysinger [Fri, 21 Jun 2013 18:38:23 +0000 (14:38 -0400)]
cros_workon: add auto-complete support

I often can't remember the full package name of the src repo I'm working
on since it's inconsistent (some people prefix "chromeos-", some don't).
But I do know that often there is only one package name that matches the
short string that I want.  Instead of requiring people to run:
$ cros_workon list --all | grep foo
$ cros_workon-$BOARD start <longer name for foo>
Add that smarts into cros_workon itself.  Now if there isn't an exact
match, we'll just pick the first ebuild that matches what they requested.

BUG=None
TEST=`cros_workon stop vboot` will stop chromeos-base/vboot_reference

Change-Id: I7aac70c6f29180d65c084764080628847594a989
Reviewed-on: https://gerrit.chromium.org/gerrit/59580
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
17 months agoAdd migration script for helping with update of autotest-chrome. 97/59497/3
David James [Thu, 20 Jun 2013 23:21:00 +0000 (16:21 -0700)]
Add migration script for helping with update of autotest-chrome.

With CL:59491, autotest-telemetry and autotest-chrome are again
being split into two separate ebuilds, so this means that we need
to uninstall the old version of autotest-chrome before we can install
the new version of autotest-telemetry. Do so.

BUG=chromium:59491
TEST=Run it locally.

Change-Id: I642bdf7faf17c6e9b917e61974726c14f1572011
Reviewed-on: https://gerrit.chromium.org/gerrit/59497
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
17 months agoSkip postinstall in image_to_usb.sh --install 25/58425/2 factory-4290.B factory-pit-4280.B stabilize-4287.B
Michael Spang [Wed, 12 Jun 2013 20:34:03 +0000 (16:34 -0400)]
Skip postinstall in image_to_usb.sh --install

It's not appropriate to run the device postinstall on the build
machine, so pass --skip_postinstall to chromeos-isntall.

BUG=chromium:217621
TEST=image_to_usb.sh --install

Change-Id: I1076849430caed4467b31188003181155ac83f6a
Reviewed-on: https://gerrit.chromium.org/gerrit/58425
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Queue: Michael Spang <spang@chromium.org>
Tested-by: Michael Spang <spang@chromium.org>
17 months agoDon't fail 920addTestcases if it doesn't find the test modules. 87/57387/2 factory-spring-4262.B
Darin Petkov [Mon, 3 Jun 2013 21:51:20 +0000 (23:51 +0200)]
Don't fail 920addTestcases if it doesn't find the test modules.

This allows us to build a sonic "test" image successfully (it's in
quotes because it's not a fully functional test image yet).

BUG=chromium:220368
TEST=build_image test for sonic and daisy, inspected build logs

Change-Id: Ic51ace9206e90428df3bc4cad929b94e81efa46a
Reviewed-on: https://gerrit.chromium.org/gerrit/57387
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>

17 months agoReplace a cp with a user_cp. 25/57825/2 stabilize-4255.B
Peter Mayo [Thu, 6 Jun 2013 20:22:55 +0000 (16:22 -0400)]
Replace a cp with a user_cp.

Slightly cleaner, and should be equivalent.
We are, after all, creating file in the users dir here.

BUG=None
TEST=None

Change-Id: I2c5ce319878dbe496fc652a521b5b495d897398f
Reviewed-on: https://gerrit.chromium.org/gerrit/57825
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Peter Mayo <petermayo@chromium.org>
Tested-by: Peter Mayo <petermayo@chromium.org>
17 months agoCorrect promotion of ssh for chrome-bot. 04/57804/2
Peter Mayo [Thu, 6 Jun 2013 17:41:03 +0000 (13:41 -0400)]
Correct promotion of ssh for chrome-bot.

In some circumstances the user is root but the sudo user is
chrome-bot.  The copy would then be from the wrong source, yielding
either incorrect results or a failure.

BUG=chromium:247410
TEST=proof-of-concept run on test machine

Change-Id: Ife9e1eb6ece77f253d21af8d73860ba7d251b5a3
Reviewed-on: https://gerrit.chromium.org/gerrit/57804
Reviewed-by: Chris Wolfe <cwolfe@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Commit-Queue: Peter Mayo <petermayo@chromium.org>
Tested-by: Peter Mayo <petermayo@chromium.org>
17 months agoAccept a symlink'd chrome as valid for pgo_generate. 55/57355/4
Ahmad Sharif [Mon, 3 Jun 2013 19:04:52 +0000 (15:04 -0400)]
Accept a symlink'd chrome as valid for pgo_generate.

When chrome is built with USE="pgo_generate", it is installed in the stateful
partition and the usual location in rootfs is a symlink to that. This change
makes test_image_content.sh work with USE="pgo_generate" by accepting a symlink
in place of a valid chrome file.

BUG=chromium:240498
TEST=USE="pgo_generate" ./build_packages --board=$board
./build_image --board=$board --disk_layout=2gb-rootfs test

Change-Id: Ia13a011f9baaa6490e1747a1c4c860c3d8525485
Reviewed-on: https://gerrit.chromium.org/gerrit/57355
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: asharif <asharif@chromium.org>
Tested-by: asharif <asharif@chromium.org>
17 months agoUse daisy_spring prebuilts for internal boards. 38/56938/3
David James [Wed, 29 May 2013 13:59:50 +0000 (06:59 -0700)]
Use daisy_spring prebuilts for internal boards.

We now publish official Chrome prebuilts on daisy_spring, so we can
start using the prebuilts in setup_board for other daisy boards.

BUG=chromium:243485
TEST=Test that official Chrome prebuilts are available for daisy now.
TEST=Try daisy trybot and verify it has official chrome prebuilts.

Change-Id: Ib8312128f885f948ff23dc56507312aed727fa14
Reviewed-on: https://gerrit.chromium.org/gerrit/56938
Reviewed-by: Peter Mayo <petermayo@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
17 months agocros_show_stacks: search all possible user crash dirs 19/56819/2
Mike Frysinger [Tue, 28 May 2013 16:49:39 +0000 (12:49 -0400)]
cros_show_stacks: search all possible user crash dirs

The /home/chronos/user/ mount is going away, so search all the available
/home/user/*/ profiles.

BUG=chromium:221784
TEST=`./cros_show_stacks` worked

Change-Id: I7cc2a68f2f4282cb8547cc5e1b5cd398064c54b0
Reviewed-on: https://gerrit.chromium.org/gerrit/56819
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

18 months agoFix typo in binhost initialization that breaks internal binhosts. 03/56503/2
David James [Thu, 23 May 2013 20:47:42 +0000 (13:47 -0700)]
Fix typo in binhost initialization that breaks internal binhosts.

BUG=chromium:222377
TEST=Run with CL:50066 and confirm Chrome binhosts work now.

Change-Id: Ie4907eb9f37b0cd769130cc6e032060cc02209bd
Reviewed-on: https://gerrit.chromium.org/gerrit/56503
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>

18 months agoIncrease buffer size to 4M. 89/55889/2
Seigo Nonaka [Tue, 21 May 2013 08:30:18 +0000 (17:30 +0900)]
Increase buffer size to 4M.

It turned out that default buffer size is too small for high speed devices.
With specifying buffer size, the transfer speed become x10 faster than before in
the case of USB 3.0.

BUG=None
TEST=Manually tested on my environment.

Change-Id: Icfeed757634a61ef370d57cba75bbba0fa45b0a8
Reviewed-on: https://gerrit.chromium.org/gerrit/55889
Tested-by: Seigo Nonaka <nona@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Seigo Nonaka <nona@chromium.org>

18 months agoRevert "Run scripts in factory to modify factory image" 85/55685/2
Cheng-Yi Chiang [Mon, 20 May 2013 05:35:43 +0000 (22:35 -0700)]
Revert "Run scripts in factory to modify factory image"

This reverts commit 5b0f79618aa2db26070eb84e583e796c1e6651bc

Change-Id: I56d8e1677c139478e9153140f4787d7ecca22d8c
Reviewed-on: https://gerrit.chromium.org/gerrit/55685
Commit-Queue: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
18 months agoRun scripts in factory to modify factory image 47/51247/3
Cheng-Yi Chiang [Mon, 15 Apr 2013 19:22:29 +0000 (03:22 +0800)]
Run scripts in factory to modify factory image

Run platform/factory/common_mod_factory_image.sh to clean up factory
image.

CQ-DEPEND=CL:51553
BUG=chrome-os-partner:18548
TEST=build_image --board=daisy_spring factory_test and check that factor
image has been modified.

Change-Id: I36a3994be04e6dde48c3bd6d28f14491ee00ff98
Reviewed-on: https://gerrit.chromium.org/gerrit/51247
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
18 months agoUpdate prebuilt logic to use more prebuilts when available. 58/50058/3 factory-4128.B
David James [Wed, 8 May 2013 21:17:25 +0000 (14:17 -0700)]
Update prebuilt logic to use more prebuilts when available.

- Use chrome_internal prebuilts for internal builds when available.
- Use daisy prebuilts for chromeos-exynos5 boards, but not for other
  arm boards.
- Document that we don't use arm-generic prebuilts for other platforms,
  since they're not binary-compatible.

BUG=chromium:222377
TEST=Verify external prebuilts are still used by default.
TEST=Verify internal prebuilts are used when USE=chrome_internal
TEST=Trybot runs of paladin and incremental builders.
Change-Id: I667c68b767c2127297080ec3c2f23e8a01894b3c
Reviewed-on: https://gerrit.chromium.org/gerrit/50058
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
18 months agocgpt: allow sub-configs to inherit from base 70/50370/2
Mike Frysinger [Mon, 6 May 2013 22:08:34 +0000 (18:08 -0400)]
cgpt: allow sub-configs to inherit from base

The vast majority of the time, we want to tweak the size of partitions in
the sub-configs only.  Rather than requiring people to duplicate all the
other fields, have the config automatically populate the fields from the
settings found in the base config.

Now people need only specify the partition num to override an earlier one.
This will be more important in follow up commits that add more fields.

BUG=chromium:236941
TEST=`./cgpt.py debug usb legacy_disk_layout.json` looks the same before/after

Change-Id: I78674286e12bee16f03b002447fe70c557188814
Reviewed-on: https://gerrit.chromium.org/gerrit/50370
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
18 months agocgpt: clean up write funcs in output script 69/50369/2
Mike Frysinger [Mon, 6 May 2013 20:08:34 +0000 (16:08 -0400)]
cgpt: clean up write funcs in output script

This makes both the source code and the output script a bit more readable.

BUG=chromium:236941
TEST=chromeos-install on x86-alex still works

Change-Id: Iaa572e84b5a250569b289628617a07432c4a55a8
Reviewed-on: https://gerrit.chromium.org/gerrit/50369
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
18 months agobuild_image: drop sudo when using mkfs on non-root files 68/49368/3 release-R28-4100.B stabilize-4100.38.B stabilize-spring-4100.53.B toolchainB
Mike Frysinger [Fri, 26 Apr 2013 21:48:52 +0000 (17:48 -0400)]
build_image: drop sudo when using mkfs on non-root files

The use of sudo here is just to get a $PATH that includes these tools.
There's no need to run these as root since we're working on files the
user has created.

BUG=None
TEST=build_image still works

Change-Id: I2d10bcb795606bd118666097d78e94370391b2ec
Reviewed-on: https://gerrit.chromium.org/gerrit/49368
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>

18 months agocgpt: rewrite the debug dump helper 79/50079/2
Mike Frysinger [Fri, 3 May 2013 20:11:54 +0000 (16:11 -0400)]
cgpt: rewrite the debug dump helper

The current debug dumper elides some information which is useful when
trying to track down errors in the json.  Rewrite the output to include
all relevant fields and make the info dense/easily scanable.

BUG=None
TEST=`./build_library/cgpt.py debug usb disk_layout.json` has all info and is readable

Change-Id: Ifb02bd8a1824cd4b57b7dcb51f9515418cb93e49
Reviewed-on: https://gerrit.chromium.org/gerrit/50079
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
18 months agocgpt: fix spurious "None" output 80/50080/2
Mike Frysinger [Fri, 3 May 2013 20:13:37 +0000 (16:13 -0400)]
cgpt: fix spurious "None" output

Some functions don't return anything (they're commands to do something
rather than get something), so have the code swallow "None" return values.

BUG=None
TEST=`./build_library/cgpt.py debug usb disk_layout.json` no longer finishes with "None"

Change-Id: Ice95250be51241f1a73936fe3ef0544d7777a1d8
Reviewed-on: https://gerrit.chromium.org/gerrit/50080
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
18 months agopython_cleaner: clean up stale pyc & empty dirs 52/50052/2
Mike Frysinger [Fri, 3 May 2013 18:40:17 +0000 (14:40 -0400)]
python_cleaner: clean up stale pyc & empty dirs

If people run python code as root, sometimes they'll accidentally generate
pyc files in the system dirs.  Have the updater code clean that out.

BUG=chromium:236950
TEST=generated some bogus dirs/.pyc files in /usr/lib64/python2.6,
then ran `./python_updater && ./python_updater` and saw it run just once

Change-Id: I2fcae542d1179f909897ea85a28388b219cc6770
Reviewed-on: https://gerrit.chromium.org/gerrit/50052
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
18 months agotest_image_content: fix lddtree check so errors are noticed 95/48695/4
Mike Frysinger [Fri, 19 Apr 2013 21:11:10 +0000 (17:11 -0400)]
test_image_content: fix lddtree check so errors are noticed

The use of `local` prevents the exit code from the commands in the sub
shell assignment part to get ignored.  This means when they do error
out, the `set -e` doesn't catch the problem.

Split the local and assignment phases so that errors in the subshells
get noticed & abort the script.

BUG=None
TEST=`./build_image` for x86-alex passes
CQ-DEPEND=CL:48839
CQ-DEPEND=CL:48849

Change-Id: Ib5b3e90fdc7504f5142d953c52621c92780eda4f
Reviewed-on: https://gerrit.chromium.org/gerrit/48695
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
18 months agoEnsure write_gpt.sh is readable by all. 86/49786/2
Chris Sosa [Wed, 1 May 2013 20:59:52 +0000 (13:59 -0700)]
Ensure write_gpt.sh is readable by all.

BUG=chromium:237183
TEST=Ran it + cros_generate_update_payload locally

Change-Id: Idc2f89ad77ffa8f91568c6baa860ad700bdb47ad
Reviewed-on: https://gerrit.chromium.org/gerrit/49786
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>

18 months agoRemove vfat modules from recovery image 01/49701/2
Sonny Rao [Wed, 1 May 2013 01:07:32 +0000 (18:07 -0700)]
Remove vfat modules from recovery image

This essentially un-does 4051405da98e250a9dc695454cf12d4d75d1b6dc
Which added the vfat modules for the factory image.  We currently use
a make_netboot.sh for factory images instead of recovery, so this is
no longer necessary, and also increases the recovery kernel image size.

BUG=chromium:230529
TEST=`mod_image_for_recovery.sh --board=fox_wtm2` passes with image
under 8MB
TEST=build a recovery image and test on lumpy/link

Change-Id: Icf8a2aa8d3aabf4aaffd8b552d1896317caa128f
Reviewed-on: https://gerrit.chromium.org/gerrit/49701
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
18 months agocgpt change to add the size of a partition to the write_gpt.sh script. 01/49201/5
Chris Sosa [Thu, 25 Apr 2013 18:21:58 +0000 (11:21 -0700)]
cgpt change to add the size of a partition to the write_gpt.sh script.

Note, there was a bug previously where cgpt overwrote the base
dictionary each time. This means if you reversed the order of the
write layout calls, it wouldn't work.

A couple other style clean ups.

BUG=chromium:234556
TEST=canary + paladin trybot run -- inspected write_gpt.sh saw correct
script get printed out.

Change-Id: I443c82013a6a2cb566e5d0bc1fb8c67647412f58
Reviewed-on: https://gerrit.chromium.org/gerrit/49201
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>

19 months agoSupport 32-bit EFI boot 97/49197/3 stabilize-4068.0.B
Josh Triplett [Thu, 25 Apr 2013 18:08:13 +0000 (11:08 -0700)]
Support 32-bit EFI boot

Build and install bootia32.efi for use from 32-bit EFI BIOSes, alongside
the bootx64.efi used for 64-bit EFI BIOSes.

BUG=chrome-os-partner:18940
TEST=Built and tested a USB image on a system that only supports
     32-bit EFI boot, not 64-bit EFI boot.
CQ-DEPEND=Ib65f7effe0d09ae8690dcdfff76327e43720eed6

Change-Id: If13cd6c0529ea614c73f6b933450925fc3ca7714
Reviewed-on: https://gerrit.chromium.org/gerrit/49197
Tested-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Josh Triplett <josh@joshtriplett.org>

19 months agoRemove obselete VM disk layout. 62/48962/4
Chris Sosa [Tue, 23 Apr 2013 21:29:04 +0000 (14:29 -0700)]
Remove obselete VM disk layout.

Use case is either for an updatable vm layout where users should use
2gb-rootfs-updatable

OR

usb.

This reduces the size of the default VM image to 2.4GB back to where it was
before some of the disk layout refactoring.

In this CL I also cleanup the now unused VM constants that specified partition
numbers etc.

BUG=chromium:234556
TEST=canary + paladin trybot run.

Change-Id: I197dba95c6507edfe3f38ff8120be64a380691a8
Reviewed-on: https://gerrit.chromium.org/gerrit/48962
Commit-Queue: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Peter Mayo <petermayo@chromium.org>
19 months agoupdate_kernel: add option to disable syslinux kernel update 49/48949/2
Olof Johansson [Tue, 23 Apr 2013 21:06:28 +0000 (14:06 -0700)]
update_kernel: add option to disable syslinux kernel update

This makes it easier to do update_kernel to a system that has booted
without modules, since the syslinux partition tends to be FAT formatted
and we don't have that statically built into the kernel most of the time.

The code has just been moved (with whitespace reformatting).

BUG=none
TEST=adhoc; make sure update_kernel still works and that --nosyslinux
skips syslinux kernel install.

Change-Id: I07a4c6a240ef57846a7f8c7828ef17583b03b7b6
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48949
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
19 months agoUse GS wrapper to download from Google Storage. 33/48533/2 stabilize-4035.0.B
David James [Thu, 18 Apr 2013 17:47:17 +0000 (10:47 -0700)]
Use GS wrapper to download from Google Storage.

This bug is blocking the Pre-CQ because we're seeing lots of failures
during remote trybot runs.

BUG=chromium:233226
TEST=Run it locally.
CQ-DEPEND=CL:48505
Change-Id: Iceb2bd970770735730254fe973cb914b5a1a9636
Reviewed-on: https://gerrit.chromium.org/gerrit/48533
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
19 months agotest_image_content: use lddtree for checking ELF deps 38/47538/2
Mike Frysinger [Wed, 27 Mar 2013 04:01:22 +0000 (00:01 -0400)]
test_image_content: use lddtree for checking ELF deps

Now that lddtree supports all the --root ELF checking, use that
rather than implementing our own logic.

BUG=None
TEST=`./build_image` still works for x86-alex
TEST=`cbuildbot {amd64,x86,arm}-generic-full` works

Change-Id: Ie6410d3549f2bffdea700605622c451740a14a42
Reviewed-on: https://gerrit.chromium.org/gerrit/47538
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

19 months agoUpdate generate_au_zip.py to use lddtree.py. 90/48190/4
Don Garrett [Tue, 16 Apr 2013 02:02:23 +0000 (19:02 -0700)]
Update generate_au_zip.py to use lddtree.py.

generate_au_zip.py needs to bundle up some executables, along with the
libraries they depend on. Instead of using one-off code for this, switch
to using the standard helper script lddtree.py for this purpose.

BUG=chromium:224171
TEST=Manual testing, including unzipping a file and running binaries by hand.

Change-Id: I5120bf2ebeb25361342e03d5065452bea856f42f
Reviewed-on: https://gerrit.chromium.org/gerrit/48190
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>

19 months agoenter_chroot: bind mount /dev/pts 18/48018/2 stabilize-4008.0.B
Mike Frysinger [Fri, 12 Apr 2013 17:47:01 +0000 (13:47 -0400)]
enter_chroot: bind mount /dev/pts

All devpts mounts are actually shared, even if you do:
mount -t devpts none /dev/pts
mount -t devpts none /mnt/foo
mount -t devpts none /mnt/asdfasdf
These all provide the same data.

This is problematic because most distros mount their host devpts like so:
mount -t devpts devpts /dev/pts -o mode=620,gid=5

But when cros_sdk runs, it uses:
mount -t devpts none /dev/pts

We aren't specifying a mode/gid, so it ends up using the defaults, and
this resets the host devpts mount as well.

Since we've already assumed that the system has devpts available, it's
fine to also assume that the system has it mounted at /dev/pts and we
can simply bind mount it.

BUG=None
TEST=`cros_sdk` no longer messes up host perms on /dev/pts

Change-Id: Ib594fc5e47707f296d97ac1edce32659ed2b2273
Reviewed-on: https://gerrit.chromium.org/gerrit/48018
Reviewed-by: Steev Klimaszewski <threeway@gmail.com>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
19 months agoupdate hooks: rebuild packages that use python in their build system 24/47524/2
Mike Frysinger [Sat, 6 Apr 2013 06:38:16 +0000 (02:38 -0400)]
update hooks: rebuild packages that use python in their build system

Some packages have to set the active python interp to version 2 so that
they can build.  They don't actually link or install python files.

Unfortunately, the current eclass code ends up storing the current ver
of python in the env and then tries to use that when installed as binpkgs
(even though no src_* steps get run).  This fails when that version of
python is no longer installed.

Locate & rebuild those few packages.

BUG=chromium:206038
TEST=`./run_chroot_version_hooks` processed the few remaining binpkgs

Change-Id: I513694ecc2479aa65d346384e421ed68d65cffa6
Reviewed-on: https://gerrit.chromium.org/gerrit/47524
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>

19 months agopython_cleaner: handle misplaced chromite paths 19/47519/2
Mike Frysinger [Sat, 6 Apr 2013 02:42:39 +0000 (22:42 -0400)]
python_cleaner: handle misplaced chromite paths

The chroot upgrade hook created a chromite symlink in the
/usr/lib/pythonX.X/site-packages directory.  When update_chroot
changed (871a40aa8f627d7ed34206f22313f32a647eff24) from running
the hook to making the symlink itself, it introduced a bug where
it would create the symlink in just /usr/lib/pythonX.X/.

The python_cleaner script tried to clean up chromite links, but
it only handles the right path (site-packages/) which means the
old path sticks around and constantly triggers us.

Fix the make_chroot script to create the symlink where we expect,
and update python_cleaner to clean out all the possible paths.

We also allow the clean up step to run whenever we get triggered
so that we clean up in the case where python gets updated but we
still have old cruft laying around.  The overhead for the rm/ln/
rmdirs is low.

BUG=chromium:206038
TEST=`./python_cleaner` cleaned up various chromite links in /usr/lib64/ and left one behind

Change-Id: I9a5f262767839b3b867238dea608f95d1da700f8
Reviewed-on: https://gerrit.chromium.org/gerrit/47519
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

19 months agoupdate hooks: clean out python-2.6 packages 30/46730/11
Mike Frysinger [Thu, 28 Mar 2013 02:11:44 +0000 (22:11 -0400)]
update hooks: clean out python-2.6 packages

Once python-2.7 lands and the bots have generated new packages, we want
to clean out existing installs so that people can pull in the recompiled
packages against the newer python.

BUG=chromium:206038
TEST=`./update_chroot` cleaned out all python-2.6 related packages
CQ-DEPEND=CL:45835

Change-Id: I2209259b0f041e571663e97f6fd37438678576fb
Reviewed-on: https://gerrit.chromium.org/gerrit/46730
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
19 months agoFixed panic for both arm and intel 31/47131/2
Paul Taysom [Tue, 2 Apr 2013 16:41:26 +0000 (09:41 -0700)]
Fixed panic for both arm and intel

The last attempt at this fix only worked for intel.
Moved where panic code was setup in the command line
so that it covered both arm and intel platforms.

BUG=chromium:222959
TEST=platform_CorruptRootfs/control (snow, link, stumpy) and ./security_test_image (parrot)

Change-Id: I578a037abf551265cc8c16fed6a16221b3b247bf
Reviewed-on: https://gerrit.chromium.org/gerrit/47131
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>

19 months agoUse rbind for ChromeOS source directory 78/47178/2
Michael Spang [Tue, 2 Apr 2013 21:42:55 +0000 (17:42 -0400)]
Use rbind for ChromeOS source directory

I use a mount at src/build/images to stop image builds from repeatedly
filling up my SSD. The chroot needs to respect this.

TEST=cros_sdk
BUG=none

Change-Id: I5c7a26c3b4f263bd683d3a897e6edccb83187bda
Reviewed-on: https://gerrit.chromium.org/gerrit/47178
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Michael Spang <spang@chromium.org>
Tested-by: Michael Spang <spang@chromium.org>
19 months agoFail when the chroot version is too new. 78/46978/3
David James [Sun, 31 Mar 2013 04:35:50 +0000 (21:35 -0700)]
Fail when the chroot version is too new.

This enables us to know when to run cros_sdk --replace in cbuildbot.

BUG=none
TEST=Verify upgrades still work.
TEST=Run the script with a too-new chroot version, verify it fails now.

Change-Id: Ie81bc7d86d56c033c1298c3bb7ed91b64fff9464
Reviewed-on: https://gerrit.chromium.org/gerrit/46978
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

20 months agobuild_image: fix up python symlinks in /usr/local 50/46750/2
Mike Frysinger [Thu, 28 Mar 2013 06:42:35 +0000 (02:42 -0400)]
build_image: fix up python symlinks in /usr/local

This makes the logic dynamic rather than hardcode the python version.

BUG=chromium:206038
TEST=`./build_image test` produced an image with correct symlinks in the state partition
TEST=`cbuildbot {arm,amd64,x86}-generic-full` worked (including vmtests)

Change-Id: I93ed2c5a195418bcd30796c3f72889a6deb0439d
Reviewed-on: https://gerrit.chromium.org/gerrit/46750
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
20 months agoStop calling generate_au_zip inside build_image. 53/45953/5
Don Garrett [Wed, 20 Mar 2013 02:56:57 +0000 (19:56 -0700)]
Stop calling generate_au_zip inside build_image.

This is part of moving the call to generate_au_zip.py into cbuildbot and
out of the general build_image. We don't need that script if we aren't
building on the servers, and were even explicitly continuing if it failed.

So... stop doing it in every build, and only do it on the builders which
is when it's really needed.

BUG=chromium-os:214786
TEST=Built, build_image, image_to_live.sh.
CQ-DEPEND=Ibfea3c0c4d09235d24a590e53acb4e6506d145cf

Change-Id: Ibc39d15ef4dfa30b82330432d8b10d8154ba7545
Reviewed-on: https://gerrit.chromium.org/gerrit/45953
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>

20 months agocgpt: clean up the usage string 00/46600/3
Mike Frysinger [Wed, 27 Mar 2013 01:37:17 +0000 (21:37 -0400)]
cgpt: clean up the usage string

The command isn't easy to understand.  Document it.

BUG=chromium:224096
TEST=`./build_library/cgpt.py` looked good
TEST=`./build_library/cgpt.py -h` looked better

Change-Id: I0ee36fc00251b417577188d5902140fd58752b54
Reviewed-on: https://gerrit.chromium.org/gerrit/46600
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

20 months agoAdded "oops=panic panic=-1" to linux command line 42/46442/2
Paul Taysom [Mon, 25 Mar 2013 22:11:22 +0000 (15:11 -0700)]
Added "oops=panic panic=-1" to linux command line

These options are needed to be added to the command line to
that if the root volume is corrupt, the system will failover
to the alternate patitions automatically.

BUG=chromium:222959
TEST=manually corrupted the root volume, rebooted

Change-Id: I59f64158d63efdc6f7b3d2efdbb9bb509cd68a4a
Reviewed-on: https://gerrit.chromium.org/gerrit/46442
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>

20 months agoIn chroot itself, switch to --ipv4 for FETCHCOMMAND and RESUMECOMMAND. 25/46525/2
David James [Tue, 26 Mar 2013 17:38:55 +0000 (10:38 -0700)]
In chroot itself, switch to --ipv4 for FETCHCOMMAND and RESUMECOMMAND.

The --ipv4 option gives us better error messages when we see network flake.
This helps us determine the cause of failures such as the following:

  curl: (22) Failed to connect to 2607:f8b0:400c:c03::84: Network is unreachable

BUG=chromium:196547
TEST=Several remote trybots.

Change-Id: Ibf25b4163d7fa4dfe0d4c8b37b334babce9dba79
Reviewed-on: https://gerrit.chromium.org/gerrit/46525
Reviewed-by: Ryan Cui <rcui@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
20 months agoupdate_chroot: also handle python packages in /usr/local 29/46429/3
Mike Frysinger [Mon, 25 Mar 2013 20:37:48 +0000 (16:37 -0400)]
update_chroot: also handle python packages in /usr/local

We install a few python packages into /usr/local (protobuf) but the
current python update package doesn't search there.  Add code to handle
that upgrade path ourselves.

BUG=chromium:206038
TEST=`./update_chroot` also rebuilt protobuf
TEST=`cbuildbot daisy-chromium-pfq` now works

Change-Id: Idabab616d37c14da5c03ec3722b79f331cd1fe47
Reviewed-on: https://gerrit.chromium.org/gerrit/46429
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
20 months agoKeep cros_debug for legacy boot after image installation. 17/46117/6
Hung-Te Lin [Thu, 21 Mar 2013 08:59:12 +0000 (16:59 +0800)]
Keep cros_debug for legacy boot after image installation.

postinst for legacy BIOS will always copy rootfs(3):/boot/syslinux/root.*.cfg
into EFI(12):/syslinux/root.*.cfg for both AU and installation.

Currently cros_debug is set only in EFI(12) (in update_bootloaders.sh) so
cros_debug will be abandoned after user installing a ChromiumOS image into hdd,
by copying the boot configurations from rootfs(3).

To fix this, we should update the templates in rootfs. And to prevent
confusion, root.[AB].cfg processing in update_bootloaders.sh is also dropped.

BUG=chromium:222248
TEST=build_image --board x86-generic
    # Install image on a non-chromeos legacy BIOS, run chromeos-install,
    # and still see "cros_debug" in kernel command line.

Change-Id: I57318985c0f7bd04be91f9fd5f116f0e634fb918
Reviewed-on: https://gerrit.chromium.org/gerrit/46117
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
20 months agomake_chroot: handle make.conf files in /etc and /etc/portage 30/46230/2
Mike Frysinger [Fri, 22 Mar 2013 04:49:30 +0000 (00:49 -0400)]
make_chroot: handle make.conf files in /etc and /etc/portage

Newer stages are putting config files into /etc/portage.  Make sure we
clean them out before setting up /etc.

At some point we should migrate to /etc/portage, but this version is
designed to work with our current code base.

BUG=chromium:218085
TEST=`cbuildbot chromiumos-sdk` passes

Change-Id: I3e88909f1d8d46cdb4eef811236abc52554348ec
Reviewed-on: https://gerrit.chromium.org/gerrit/46230
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
20 months agomake_chroot: auto downgrade python as needed 32/46232/2
Mike Frysinger [Fri, 22 Mar 2013 05:37:37 +0000 (01:37 -0400)]
make_chroot: auto downgrade python as needed

Newer Gentoo stages come with python-3 only.  We aren't ready for that,
so automatically downgrade to python-2 if it isn't already installed.

BUG=chromium:218085
TEST=`cbuildbot chromiumos-sdk` passes

Change-Id: I4ad538629788c84b06e3e62278ee89d18a4ea1d6
Reviewed-on: https://gerrit.chromium.org/gerrit/46232
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
20 months agoenter_chroot: handle /var/lock->/run/lock symlinks 31/46231/2
Mike Frysinger [Fri, 22 Mar 2013 04:59:58 +0000 (00:59 -0400)]
enter_chroot: handle /var/lock->/run/lock symlinks

Newer Gentoo builds have moved to /run which means /var/lock is a symlink
to /run/lock.  But since that is an absolute symlink, it points outside of
the chroot which doesn't work for us.  Use a stable path unrelated to the
chroot instead, but only with newer chroots.

We no longer have to worry about backwards compat because the code that
used to rely on this lock file (running sync processes) was punted a long
time ago.

BUG=chromium:218085
TEST=`cbuildbot chromiumos-sdk` passes

Change-Id: I38c6848dfb86386849050d7ccf3f90cbbe8e0e81
Reviewed-on: https://gerrit.chromium.org/gerrit/46231
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
20 months agoFix EFI boot parameters written by updater_bootloaders.sh 75/45975/3
Hung-Te Lin [Wed, 20 Mar 2013 08:13:07 +0000 (16:13 +0800)]
Fix EFI boot parameters written by updater_bootloaders.sh

Boot parameters for EFI were not correctly handled.
 - The "cros_legacy" flag for EFI is actually named as "cros_efi".
 - Replacing parameter should be done only one time.

BUG=chromium:222248
TEST=build_image; # checked grub.cfg in partition 12 - see correct flags like
 "linux $grubpartA/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local
  rootwait ro noresume noswap loglevel=1 noinitrd i915.modeset=1 cros_efi
  cros_debug root=/dev/$linuxpartA

Change-Id: I6c1b7b450e12982e5183cd2037ec7deb2493119e
Reviewed-on: https://gerrit.chromium.org/gerrit/45975
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
20 months agoAdd capability to chroot to use proxies for git:// urls 59/41659/7
Paul Drews [Wed, 20 Mar 2013 15:47:47 +0000 (08:47 -0700)]
Add capability to chroot to use proxies for git:// urls

This patch installs "socat" and a proxy gateway script into
the chroot so that git can use a proxy to access "git://"
protocol urls.  This is needed when performing builds from
behind a firewall that requires a proxy.  The script reads
the proxy environment variables all_proxy (SOCKS),
https_proxy (CONNECT), and http_proxy (CONNECT), in order of
preference, and supports no_proxy as a whitelist of target
hosts that must NOT go through the proxy.

This also updates enter_chroot.sh to automatically use this
script as GIT_PROXY_COMMAND when it sees the proxy
environment variables set.

The "socat" program is added to hard-host-depends as a
separate patch.  That handles socat installation in case of
building a chroot from scratch or upgrading.

The proxy-gw script is installed in the src/scripts/bin
directory which can be stably referenced within the chroot
as /mnt/host/source/src/scripts/bin/.  The
"/mnt/host/source" portion of this path is obtained from the
CHROOT_TRUNK_DIR environment variable which is set to a
suitable value by preexisting logic in common.sh.

This change became necessary to unbreak builds behind
proxies with the recent addition of two ebuilds using
egit.eclass with repositories using git:// URLs.

Original patch by Paul Drews <paul.drews@intel.com>;
modified version by Josh Triplett <josh@joshtriplett.org>.

CQ-DEPENDS=I1b01bce6f3e6a562b87f748e61508d142af576d9
BUG=none
TEST=git clone git://nv-tegra.nvidia.com/tools/cbootimage.git

Change-Id: Ic7fc917d1aa24f408bef6f102b6458114dded694
Reviewed-on: https://gerrit.chromium.org/gerrit/41659
Tested-by: paul drews <paul.drews@intel.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: paul drews <paul.drews@intel.com>

20 months agoupdate_chroot: add python-updater support 39/45839/7
Mike Frysinger [Tue, 19 Mar 2013 05:55:39 +0000 (01:55 -0400)]
update_chroot: add python-updater support

The python packages have always been SLOT-ed which means when you install
a package that installs python helpers, they get installed/pre-compiled
for specific versions.  e.g. we currently have
/usr/lib64/python2.6/site-packages/...

When we update to a newer version, we'll see things like:
/usr/lib64/python2.6/site-packages/...
/usr/lib64/python2.7/site-packages/...

Since we only ever want one version of python at a time, automatically
select the latest and then clean out everything else.  Then invoke
python-updater to make sure that all relevant packages are built
against that version.

This is written such that it only ever runs as necessary.  This should
keep things flowing smoothly now (python 2.6 -> 2.7) as well as any
time in the future we try to do another upgrade (2.7 -> 2.8/3.3/...).

BUG=chromium:206038
TEST=`./update_chroot` rebuilt all the installed python packages
TEST=`./update_chroot; ./update_chroot` only ran update logic once
TEST=`emerge python -1u` worked
TEST=`cbuildbot chromiumos-sdk` worked
TEST=`cbuildbot {arm,amd64,x86}-generic-full` worked
TEST=`cbuildbot link-firmware` worked
TEST=`cbuildbot {stumpy,lumpy,daisy,x86-alex}-release` worked
TEST=`cbuildbot {x86-generic,amd64-generic,daisy}-chromium-pfq` worked
CQ-DEPEND=CL:45833

Change-Id: Icbc14001d02547006872a637df2629e559e25382
Reviewed-on: https://gerrit.chromium.org/gerrit/45839
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

20 months agoadd equery-$board autocomplete 31/45531/3 stabilize-3881.0.B
Aviv Keshet [Fri, 15 Mar 2013 01:37:54 +0000 (18:37 -0700)]
add equery-$board autocomplete

After starting down the programmatic autocomplete garden path, I
realized that the equery autocomplete did not cover all the
equery-$board use cases which are probably even more common, so I
couldn't resist adding those as well.

BUG=None
TEST=after calling setup_board for some particular $board,
`equery-$board [tab][tab]` will show autocomplete list of equery
commands.

Change-Id: I007e8a4867c08b6585fb90174f34ced73b73aedd
Reviewed-on: https://gerrit.chromium.org/gerrit/45531
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>

20 months agofix equery bash autocomplete 09/45509/2 factory-spring-3842.B
Aviv Keshet [Thu, 14 Mar 2013 23:03:31 +0000 (16:03 -0700)]
fix equery bash autocomplete

An unintended consequence of I186e14ac4b9e823885c0a7c7f4177603cbf3e682
is that filenames are no longer autocompleted when being entered as the
second CLI argument to equery. This CL reenables default autocompletion
for arguments after the first argument.

BUG=None
TEST=in chroot, enter `equery belongs [tab][tab]`. See autocomplete list
of files.

Change-Id: I3b2510de86a73c57a2c75427f5aa2e1b73821be7
Reviewed-on: https://gerrit.chromium.org/gerrit/45509
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>

20 months agoAdd upgrade hooks for gdb SLOT problem 99/45399/2
Yunlian Jiang [Mon, 11 Mar 2013 22:55:40 +0000 (15:55 -0700)]
Add upgrade hooks for gdb SLOT problem

In older versions of gdb, we set SLOT=${CHOST}.
In the latest ones, we always set SLOT="0".
Since migrating SLOTs like this is not programmatic,
rewrite the installed values to 0 so that we can upgrade cleanly.

BUG=chromium-os:31356
TEST=None

Change-Id: Ieb4c5a25e1e28fcab64e2014c463c587023009a0
Reviewed-on: https://gerrit.chromium.org/gerrit/45399
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>