Commit Graph

2650 Commits

Author SHA1 Message Date
Paul Drews
8bae3b5667 Break the circular dependencies with curl, openssl, git
Building the chroot environment from sources using
"--bootstrap" currently runs into a circular dependency:

curl->openssl->git->curl

The openssl->git dependency comes indirectly from the fact
that the current version of openssl uses the "cros-workon"
ebuild package to assist in applying packages.  The ebuild
system automatically and silently resolves this circular
dependency by reverting the openssl library to an earlier
version that does not use cros-workon based patching.
Unfortunately this older version of openssl has a bug that
causes it not to work when doing builds in a firewalled
environment:  When curl (using this older version of openssl
library) attempts to fetch an "https" url, it authenticates
the target server against a bundle of certificate-authority
certificates it maintains.  Finding the certificate fails
(although the validation succeeds if curl is told explicitly
what certificate to use).  With the certificate not-found,
server authentication fails, the curl download fails, and
the build ultimately fails.

This patch breaks the circular dependency, allowing a
more-current version of openssl to be used in curl, making
the above build scenario work in a firewalled environment.
The circularity is broken by first building git without curl
support (and webdav that depends on curl).  Then early
toolchain components up through and including curl are
built.  This build of curl then uses a more up-to-date
version of openssl with the desired bug-fix.  Once curl is
built, then git is re-built and re-installed with the
now-installed version of curl (re-)enabled.

BUG=None
TEST=create chroot with --bootstrap ; build_packages (behind firewall)

Change-Id: Iaa560fdb6623fcb73cde066a3b2bc2a342169c62
Reviewed-on: https://gerrit.chromium.org/gerrit/34292
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: paul drews <paul.drews@intel.com>
Tested-by: paul drews <paul.drews@intel.com>
2012-10-10 23:25:48 -07:00
Liam McLoughlin
8ad01c5e9a Add a layout type named "big" to allow for gmerge/chrome development
BUG=none
TEST=build_image --board=stumpy --disk_layout=big

Change-Id: Id48bbdda2b3a570e267ae860acb87415db82a9b9
Reviewed-on: https://gerrit.chromium.org/gerrit/34685
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Peter Mayo <petermayo@chromium.org>
2012-10-09 12:42:54 -07:00
Paul Drews
b688cbe4f4 Fix chroot bootstrap "no such file or directory" breakage
CL:33868 (7b6f377c58) introduced a
breakage in the "cros_sdk --replace --bootstrap" scenario.
The make_chroot.sh script invokes early_enter_chroot before
invoking init_setup.  The chroot/etc/profiles.d directory is
created in init_setup, but the referenced change was
expecting to create a file in that directory in the context
of early_enter_chroot before the directory was created.
This led to a "no such file or directory" error when trying
to create the file.

This change does a "mkdir -p" of the referenced directory
before putting things in it in the context of
early_enter_chroot.  The filename is also fixed to the name
expected elsewhere in the scripts.

BUG=none
TEST=cros_sdk --replace --bootstrap

Change-Id: I6ac0467117d7b0dd413695153469b367d56c256c
Reviewed-on: https://gerrit.chromium.org/gerrit/34958
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-10-08 22:36:47 -07:00
Mike Frysinger
1ef08a9fcf cgpt: validate layout files when loading
Add more sanity checks to the input .json file to catch when people
make typos or other random mistakes.

BUG=None
TEST=loaded all .json files we have

Change-Id: Ibc2439684628225da43639c2fac25958b5fa794e
Reviewed-on: https://gerrit.chromium.org/gerrit/34708
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-10-08 13:13:39 -07:00
Mike Frysinger
c17cf6aff0 cgpt: fix up "with open" handling
There is no need to call .close() ourself in a with block.

We can also use a with block in the WritePartitionScript func.

BUG=None
TEST=build_image still works

Change-Id: I53b31ba96c94e885b1d4415889b5d2a9691ccda1
Reviewed-on: https://gerrit.chromium.org/gerrit/34707
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-10-08 13:13:39 -07:00
Mike Frysinger
624071a08b cgpt: touch up style
No functional changes here.

BUG=None
TEST=build_image worked

Change-Id: I4dc7968c7417cefcb6576e9452dcf71847101c56
Reviewed-on: https://gerrit.chromium.org/gerrit/34706
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-10-08 13:13:38 -07:00
Ahmad Sharif
e824585f80 setup_board: add ELF qa post_install hooks for all boards.
BUG=chromium-os:24742
TEST=./setup_board --board=$board
  emerge-$board quipper # no warnings.
  sudo binutils-config <non-gold config>
  emerge-$board quipper # gold warning.
  <edit> # Change sysroot wrapper to not pass in -fstack-protector
  emerge-$board quipper # stack warning.
  etc.

Change-Id: I94ccda99e9ac47c25ff23a7fe45774fb62447e4c
Reviewed-on: https://gerrit.chromium.org/gerrit/34151
Tested-by: asharif <asharif@chromium.org>
Reviewed-by: <jimhebert@google.com>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: asharif <asharif@chromium.org>
2012-10-05 15:21:09 -07:00
Kees Cook
a242b0a7cd build_library: move update_partition_table to common location
The "update_partition_table" routine is used by mod_image_for_recovery.sh
and ~/trunk/src/platform/dev/host/tests/mod_recovery_for_decryption.sh.

This moves the routine into a common location so future changes will not
break things. Additional removes the duplicate okboat/failboat
definitions from mod_image_for_recovery.sh since those are in a common
place already.

This change does not fix the stateful resize logic part of the bug, but
does move the code into a single place so mod_recovery_for_decryption.sh
can use it once it has been fixed.

BUG=chromium-os:35003
TEST=created working recovery image

Change-Id: Ibcd5289389dcadf58ccf0678ecfb29095848b247
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34678
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-10-04 15:15:49 -07:00
Mike Frysinger
3a70d67b7f security_test_image: new signer test script
Add a script so devs can run signer security tests themselves to
make sure they don't break them.

BUG=chromium-os:19543
TEST=`cbuildbot lumpy-release` passed and ran signer tests

Change-Id: I68cc3ec19616be3c91a1a14550cb38c2e6f2503d
Reviewed-on: https://gerrit.chromium.org/gerrit/34326
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-10-02 16:45:18 -07:00
Kees Cook
8df86b24fa build_image: disable module restrictions in factory image
The factory test image uses third party kernel modules from /usr/local.
Since it builds with verity enabled, the module restrictions must be
disabled in the command line instead of via run-time sysctl values
(which are not available if verity is enabled).

BUG=chromium-os:34134
TEST=parrot build, manual testing

Change-Id: Ibfc3332eac88e3748f2c81d6dce1a595dd16c055
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34321
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
2012-10-02 01:52:21 -07:00
Mike Frysinger
8b82f358ed Revert "Added enable_bootcache option to scripts"
This reverts commit acff376525

This broke the signing process due to changed kernel params.
Please update ensure_secure_kernelparams.config under the
cros-signing/ tree before relanding this.

Change-Id: I3be62e16299eb69bbfef9f1530d92200a2e309d7
Reviewed-on: https://gerrit.chromium.org/gerrit/34320
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2012-09-28 19:16:40 -07:00
Brian Harring
7b6f377c58 sdk_lib/*: Make --cache_dir option required.
This is forced by cros_sdk; in conjunction w/ this,
drop --distfiles and mangle the chroot on during entrance
dropping a symlink in the old /var/cache/distfiles location
pointing to the new mounted cache_dir location.

Additionally, thread CHROMEOS_CACHEDIR down through the end.
Do this without relying on a version upgrade script- we can't
require they be run before entering, thus we exploit the fact
that cros_sdk explicitly forces a write lock to do the upgrade,
if we see the old form we know we can do the upgrade w/out
worrying about collisions.

CQ-DEPEND=CL:33871

BUG=chromium-os:34457
TEST=manual testing.

Change-Id: I6805266e3ec683f05d3ba615f9e8840642a28e48
Reviewed-on: https://gerrit.chromium.org/gerrit/33868
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-09-28 19:16:39 -07:00
Paul Taysom
acff376525 Added enable_bootcache option to scripts
Added a new flag for enabling the boot cache.

BUG=chromium-os:25441
TEST=built and ran amd64 and arm

Change-Id: Ia151d40c4b02f4353981affd321763521d972ee6
Reviewed-on: https://gerrit.chromium.org/gerrit/33617
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Paul Taysom <taysom@chromium.org>
2012-09-28 11:31:13 -07:00
Ryan Cui
fe573cdbdf Fix bug with chroot updating /etc/hosts.
enter_chroot.sh was not updating /etc/hosts from the out-of-chroot
environment.  Make it do that.

BUG=None
TEST=locally

Change-Id: Ieaa337ae90dbc0700c42fa7e4b96faf12d3968cb
Reviewed-on: https://gerrit.chromium.org/gerrit/34226
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Ryan Cui <rcui@chromium.org>
Tested-by: Ryan Cui <rcui@chromium.org>
2012-09-27 16:07:35 -07:00
Liam McLoughlin
b2a30d6fab Mask out OEM partition for factory images
BUG=chrome-os-partner:14645
TEST=Build factory image, verify OEM partition is empty

Change-Id: I4ca863401137051bf0bacfd0dc886811c21fcc37
Reviewed-on: https://gerrit.chromium.org/gerrit/34181
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-27 07:43:33 -07:00
Mike Frysinger
b344800aa6 build_image: clean up emit_gpt_scripts a bit
Looks like the func was copy & pasted, so delete the first one (which
doesn't get used).  Then expand on the existing func to also generate
a mount and an umount script.

BUG=None
TEST=ran build_image, then tested the mount/umount and unpack/pack scripts

Change-Id: I34a372c7b4858b8e9057a29b2eb58c38d547eadd
Reviewed-on: https://gerrit.chromium.org/gerrit/33929
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-09-26 15:35:03 -07:00
Liam McLoughlin
0915c1e100 Fix bug where cros_factory_install didn't end up in the kernel cmdline
BUG=none
TEST=./build_image --board=stumpy factory_install, verify kernel cmdline

Change-Id: Icdf3156ea08e46d0ce5154133d62cb8d98d144f5
Reviewed-on: https://gerrit.chromium.org/gerrit/34102
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-26 06:35:49 -07:00
Liam McLoughlin
e61da0dff1 Fixes the ability to AU after running chromeos-install
Make it possible to run chromeos-install without root

BUG=none
TEST=Build image, chromeos-install, verify ROOT-B is full size

Change-Id: Id506f1e5a6f8b8ee03ea1bdd621aaab1239bca2c
Reviewed-on: https://gerrit.chromium.org/gerrit/34081
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
2012-09-26 03:01:41 -07:00
Liam McLoughlin
53fbca3fdb Correct partition layout calculation code
The CURR counter wasn't being correctly incremented for the stateful
partition resulting in an invalid layout

BUG=chromium-os:34715
TEST=Build image and verify it can be installed

Change-Id: Ie2f90d2e51e34e2056414363d7b2b42413018322
Reviewed-on: https://gerrit.chromium.org/gerrit/33928
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Olof Johansson <olofj@chromium.org>
2012-09-24 16:25:08 -07:00
Mike Frysinger
e82e99e999 cgpt_shell: avoid bash
This script gets run on the target, so we need to avoid bash.

BUG=chromium-os:34715
TEST=build_image works

Change-Id: Ib64036246149b8b98414e4434ed89a3a40c2f693
Reviewed-on: https://gerrit.chromium.org/gerrit/33911
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-09-24 12:18:42 -07:00
Ahmad Sharif
89b8a8bf85 update_chroot: pass env vars to cros_setup_toolchain.
BUG=chromium-os:33007
TEST=remote trybot (chromiumos-sdk) with this CL.

Change-Id: If8a0de45eebf158bfc51aa87348b3c96c6c2626e
Reviewed-on: https://gerrit.chromium.org/gerrit/33848
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: asharif <asharif@chromium.org>
Tested-by: asharif <asharif@chromium.org>
2012-09-24 11:36:40 -07:00
Liam McLoughlin
e81a23207f Updated verity error_behavior and max_ios defaults to match expected values
BUG=chromium-os:34696
TEST=Run ensure_secure_kernelparams.sh on an image built with this change

Change-Id: I16a6f5127bdfae958f9cd0d9ce1b0c55a0f68c67
Reviewed-on: https://gerrit.chromium.org/gerrit/33888
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-24 10:56:52 -07:00
Liam McLoughlin
080202b5d1 Fix up recovery image generation
As part of my image creation overhaul, I patched up this script to keep it
alive. I made a couple of oversights in this, which broke recovery image
generation.

The call to update_partition_table had an incorrect arg and the order of
operations inside the function was also incorrect (offsets were being
calculated before the new partition table had been written). Lastly
the call to copy the root FS to the new image was incorrect.

BUG=chromium-os:34689
TEST=Run mod_image_for_recovery, verify root FS partition is mountable

Change-Id: I5cc6f6f53284075bbdac8e57602aae86a15ee32e
Reviewed-on: https://gerrit.chromium.org/gerrit/33872
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-23 17:00:40 -07:00
Liam McLoughlin
aca5e1edfe Fix up OEM partition during image build
BUG=chrome-os-partner:14340
BUG=chromium-os:34688
TEST=Build an image, verify OEM partition has filesystem

Change-Id: Ie3e51427a36f5e8ea288abb7ac3ceeefb20cdb6f
Reviewed-on: https://gerrit.chromium.org/gerrit/33866
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-23 17:00:37 -07:00
Liam McLoughlin
5b37c5443a Simplify and add flexibility to image creation process
This change adds support for building the disk layout from a
configuration file. It also cleans up much of the image creation
code.

install_gpt no longer exists, and has been replaced by cgpt.py's
write action. This spits out a file that has two functions that can
be called to write a partition layout to a disk/file. This gets rid
of the gigantic nest of calculations that built the layout previously.

All instances of partition/filesystem sizes in build scripts should now
be gone in favour of calls to the cgpt.py tool.

create_boot_desc has moved inside the base image creation, in an effort
to simplify build_image.

load_kernel_test is gone since it's apparently not supposed to be called
here anyway (asked wfrichar/rspangler about this one).

Base image creation now uses files rather than loop devices when
building an image. This means we can simply umount them once we're
done and not worry about cleaning up the loop device, since it's
been done for us.

Hash pad calculation has been removed. This is now set manually inside
the partition config file.

Hybrid MBR creation is gone, since it's now possible to do that in a board
specific hook (see overlay-beaglebone/scripts/board_specific_setup.sh).

OEM partition now has a filesystem, which is mounted at /usr/share/oem
during emerge so that packages can stash files here.

root_fs_dir and friends are still globals, but the long-term idea
is to make this not the case.

BUG=chromium-os:33817
TEST=All types of images and their respective flows
  (VM, recovery, test, factory etc)

Change-Id: I8a596728a4d1845c930e837bea627f5b6a11c098
Reviewed-on: https://gerrit.chromium.org/gerrit/29931
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-23 10:05:12 -07:00
Michael Krebs
04c4f736f5 cros_sdk: Allow additional chroot mounts via .local_mounts file
This change was coopted from http://codereview.chromium.org/5331009/,
originally written by hungte@.  And the coopted commit message:

It would be helpful if we could share some directories inside/outside the
chroot (e.g. editor configuration or the default Downloads directory).  This
CL reads .local_mounts (just like .default_boards) from the "src/scripts"
folder, and mounts the directories whenever you do cros_sdk.

For safety concern, and to prevent the developer from accidentally deleting
their mounted files, the mounts are made read-only.

.local_mounts has a very simple syntax:
  mount_path
  or source_path(outside chroot) destination_path(inside chroot)
  or # comments.

Examples:
/usr/share/vim/google
/home/XXX/Downloads /outside

BUG=chromium-os:34561
TEST=Manually:
1. Create ~/trunk/src/scripts/.local_mounts with following content:
 # comment here
/usr/share/vim/google  # test
/home/XXX/Downloads /outside
2. cros_sdk
3. ls -l /usr/share/vim/google/ # ensure dir is mounted correctly
   ls -l /outside/  # ensure dir is mounted correctly
4. exit
5. mount | grep chroot  # ensure nothing is left

Change-Id: I6f3400a436a825e8cdfcb18b788afe96ebba6757
Reviewed-on: https://gerrit.chromium.org/gerrit/33585
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
2012-09-21 16:48:52 -07:00
Peter Mayo
4411efeb87 Propagate Google API keys into the chroot.
These are a new type of credential baked into chrome/chromium for
developers without internal copies of ChromeOS, and not building internal
versions of Chrome.

We automatically move .googleapikeys into the chroot each time.

We don't overwrite the destination, so that people can configure keys the
way they want. If they just don't want to be bothered, the best thing happens
the easiest way.  Get Keys, put them in home.  Keep working.

BUG=chromium-os:34438
TEST=local

Change-Id: I08e5970c6092f7b789aa5efef52db93841996d8f
Reviewed-on: https://gerrit.chromium.org/gerrit/33771
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Peter Mayo <petermayo@chromium.org>
Tested-by: Peter Mayo <petermayo@chromium.org>
2012-09-21 16:07:53 -07:00
Mike Frysinger
dda30b4f70 setup_board: merge common wrapper logic
Now that all the wrapper logic is one function, we can merge some of the
sub-pieces (chown/chmod/messages) into single calls.

BUG=chromium-os:34519
TEST=`./setup_board --board=lumpy` output looked ok

Change-Id: If959b48877adfaaca121370495e15cf912deea37
Reviewed-on: https://gerrit.chromium.org/gerrit/33526
Reviewed-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-09-20 17:32:22 -07:00
Ryan Cui
e49d487245 Ensure user has a chromium checkout before running chrome_set_ver.
Since the chrome sources have been removed from the default manifest,
leaving only a remnant inside chromium/src, we need to verify that they
actually have the chromium/src.git project checked out.

BUG=None
TEST=Local

Change-Id: I09f871034bb0d2664485a5ca6429204ebee67a19
Reviewed-on: https://gerrit.chromium.org/gerrit/33646
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Commit-Ready: Ryan Cui <rcui@chromium.org>
Tested-by: Ryan Cui <rcui@chromium.org>
2012-09-20 17:32:22 -07:00
Mike Frysinger
2f9a82df4c setup_board: add new --regen_configs option
This lets people run setup_board w/out re-installing the toolchain,
but otherwise setting up all the config files.  This is useful when
people want to make overlay changes that don't affect the settings
but do affect file layout (like when moving from private to public
overlays).

BUG=chromium-os:34519
TEST=`cbuildbot {x86,amd64,arm}-generic-full chromiumos-sdk` worked

Change-Id: I6202073a74700379fe2b705d1ff3d6148b9723ec
Reviewed-on: https://gerrit.chromium.org/gerrit/33487
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-09-20 15:57:31 -07:00
Kris Rambish
4404791930 Add boats to common.sh
TEST=See boat
    .  o ..
    o . o o.o
         ...oo_
           _[__\___
        __|_o_o_o_o\__
    OK  \' ' ' ' ' ' /
    ^^^^^^^^^^^^^^^^^^^^
BUG=None

Change-Id: I0a38d572c338762084e2ce83211d9067217586e4
Reviewed-on: https://gerrit.chromium.org/gerrit/33372
Commit-Ready: Kris Rambish <krisr@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Kris Rambish <krisr@chromium.org>
2012-09-19 19:47:06 -07:00
Mike Frysinger
e1d2c1f10c setup_board: use sudo_multi in more places
This gives a side speed up and a slight clean up.

While we're here, merge a few commands (like mkdirs).

BUG=chromium-os:34519
TEST=`./setup_board --board=lumpy` output looked ok
TEST=`cbuildbot {x86,amd64,arm}-generic-full chromiumos-sdk` worked

Change-Id: I8d03448e2df549e76d320cc23ab9d36242c3b118
Reviewed-on: https://gerrit.chromium.org/gerrit/33486
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-09-18 15:05:06 -07:00
Chris Sosa
0538571ce1 Deprecate for_test upstart jobs by building and installing test/dev init pkgs.
We also remove some dead mod_for_test scripts.

BUG=chromium-os:9729, chromium-os:14091
TEST=build_packages, build_image dev test
CQ-DEPEND=If58678ab4fe7abd9142a619850be07249d159781

Change-Id: Iff6a143dbf8ce58878dc1b07629c52bbb7f02ded
Reviewed-on: https://gerrit.chromium.org/gerrit/32998
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-09-18 11:10:29 -07:00
Mike Frysinger
70c8db6806 setup_board: move all wrapper gen code into one func
Makes the code flow easier to follow, and makes it easier to skip
wrapper generation if we so desire.

BUG=chromium-os:34519
TEST=`./setup_board --board=lumpy` output looked ok
TEST=`cbuildbot {x86,amd64,arm}-generic-full chromiumos-sdk` worked

Change-Id: Ie7a1d387fb21a495c6a2da2c9147587743240929
Reviewed-on: https://gerrit.chromium.org/gerrit/33485
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-09-18 09:38:58 -07:00
Nirnimesh
80c426856a Remove external_extensions.json from test images
Remove external_extensions.json to further reduce the differences between
test and base images.

/opt/google/chrome/extensions/external_extensions.json was a symlink to
/usr/local/autotest/tests/external_extensions.json (broken by default)
so that a test could put an extension at the destination to make chrome
load it at login. This was an ugly hack from the time when we didn't have
a way to install extensions during tests on chromeos.

power_LoadTest has been updated to not need this hack.

BUG=None
TEST=None

Change-Id: Ibee30315aef725d69725fcf9c5ea72687d030f4e
Reviewed-on: https://gerrit.chromium.org/gerrit/33255
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Ready: Nirnimesh <nirnimesh@chromium.org>
Tested-by: Nirnimesh <nirnimesh@chromium.org>
2012-09-17 11:40:17 -07:00
Mike Frysinger
76452baac3 build_packages: allow people to specify a specific set of packages
This way we can tweak buildbot configs to install specific packages rather
than all of ChromeOS (useful for firmware builders).

BUG=chromium-os:19140
TEST=`cbuildbot {{x86,amd64}-generic,daisy}-paladin {amd64,arm,x86}-generic-full stout-release` passed
TEST=`./build_packages nano` installed just nano

Change-Id: I9c316d7c390ebe6ceade97cf33c1387dc83fb887
Reviewed-on: https://gerrit.chromium.org/gerrit/33266
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-09-14 15:15:32 -07:00
Mike Frysinger
4114c79297 build_packages: arrayify things
Convert strings-used-as-lists to arrays.  This makes the code nicer.

Further, package the variable initializations together.  There is no
need to have them all intermingled.  e.g. we set up EMERGE_FLAGS all
in the same region rather than doing some at the top, some in the
middle, and then more at the bottom.

BUG=chromium-os:19140
TEST=`cbuildbot {{x86,amd64}-generic,daisy}-paladin {amd64,arm,x86}-generic-full stout-release` passed

Change-Id: I593e01e6f450370545335144b06f814f306019df
Reviewed-on: https://gerrit.chromium.org/gerrit/33265
Reviewed-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-09-14 14:06:08 -07:00
Mike Frysinger
cc6d7b12a0 umount wrapper: fix inverted logic
The current logic exits when the output *is* "device is busy" when it
should be exiting when the output *isn't*.

BUG=chromium-os:23443
TEST=`./mod_image_for_recovery.sh` works again

Change-Id: I78eef746611de1044da664f32f8ec5e3b22b21f7
Reviewed-on: https://gerrit.chromium.org/gerrit/33170
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-09-12 22:32:18 -07:00
Mike Frysinger
4bf9456c7a umount wrapper: fix PATH cleansing
Even though we look up our wrapper script via $0, we don't use it.
Instead, the script has /usr/local/sbin hardcoded.  This causes the
code to constantly find itself and forkbomb.

BUG=chromium-os:23443
TEST=`cros_sdk -- true` no longer hangs

Change-Id: I64dc41880e3b7c0abf5da0f6a708c02510ddc8c0
Reviewed-on: https://gerrit.chromium.org/gerrit/33119
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-09-12 14:46:50 -07:00
Kees Cook
0f2cfe6b9d mod_image_for_recovery: add flag to decrypt stateful
When building the recovery image, add a flag file for triggering the
decryption of the stateful partition.

BUG=chromium-os:34199
TEST=parrot recovery

Change-Id: I43c6a8469d7fad1b9d5b85aae9aaf525b1588ed5
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32597
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Ready: Will Drewry <wad@chromium.org>
2012-09-07 19:00:11 -07:00
Paul Taysom
5b2c7e934c Moved knowledge of rootdev to one place
This CL centralizes the setting of which root device to use
in a single place. A boolean flag, --verity_is_enabled, indicates
if the the verity device should be used.

This is the first of about a half-dozen CLs to fix all the references
to dm-0.

BUG=chromium-os:25441
TEST=built images with and without verity enabled.
     cbuildbot --remote -g Id6c6e766 amd64-generic-paladin daisy-paladin

Change-Id: Id6c6e766bfde3651266323f7bc94c0e1f87cea38
Reviewed-on: https://gerrit.chromium.org/gerrit/32239
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Paul Taysom <taysom@chromium.org>
Tested-by: Paul Taysom <taysom@chromium.org>
2012-09-07 17:24:27 -07:00
Gilad Arnold
264f64d70b enter_chroot.sh: install /root/.boto symlink for sudoed invocations
Since sudo changes $HOME to /root, sudoed invocations of gsutil/boto
won't find the necessary credentials. This solves the problem by
installing a symlink at /root/.boto to the correct credentials file,
similar to how it's done for /home/$USER/.boto.

BUG=None
TEST=/root/.boto symlink created upon entering the chroot

Change-Id: I541556f836fa5d0b9708e5604218058401563fb3
Reviewed-on: https://gerrit.chromium.org/gerrit/32430
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Ryan Cui <rcui@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
2012-09-07 12:07:34 -07:00
Chris Sosa
bd0ba0c9da VDisk size must also be changed to allot for large stateful partition.
BUG=chromium-os:34126
TEST=Ran image_to_vm with full line from buildbot.

Change-Id: I7b579500e80f3b3882f7e9aa62f73e89bf11ceba
Reviewed-on: https://gerrit.chromium.org/gerrit/32429
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2012-09-06 14:02:07 -07:00
Chris Sosa
1c98948e3b Double the size of the stateful partition for vm testing.
BUG=chromium-os:34126
TEST=image_to_vm with new size and ran desktopui_NaClSanity

Change-Id: I5553de776cb5dec3d2b0dde362ff3560926a6472
Reviewed-on: https://gerrit.chromium.org/gerrit/32424
Reviewed-by: Rahul Chaturvedi <rkc@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2012-09-06 13:20:16 -07:00
Brian Harring
f264b82dd2 Force our umount w/in the chroot.
Do this via ensuring that any common.sh invoker
of raw umount (say a root script) sees our umount
path.

Additionally, inject into default profiles our override,
and via an upgrade scriptlet.

This is round two; originally appeared as CL:32088, was
reverted due to:
https://uberchromegw.corp.google.com/i/chromiumos/builders/chromiumos%20sdk/builds/2314/steps/BuildBoard/logs/stdio

The fix however is just adding a single sudo mkdir. :/

BUG=chromium-os:23443
TEST=cros_sdk --replace --bootstrap
TEST=cros_sdk --replace

Change-Id: I0dc7522a9c623f40081d4f138cea0c2c45171fea
Reviewed-on: https://gerrit.chromium.org/gerrit/32365
Commit-Ready: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
2012-09-06 10:34:33 -07:00
Rhyland Klein
d5e3c01c08 cros_workon: fix arguments passed to loman
fix arguments passed to loman. revision should not be passed wrapped in ""
otherwise, if not set, it will pass an extra blank argument to loman which
breaks the argument count checking.

BUG=chromium-os:33688
TEST=verified with remote project both with and without revision works.

CQ-DEPEND:I568a9e2821a1c089a0ba391f6df6c0e3b2dc61c9

Change-Id: Ica7d04cf5c3f7ab3871c71abe8b6025b561ac81f
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/32392
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-09-06 10:07:23 -07:00
Chris Sosa
389634d71c Revert "Force our umount w/in the chroot."
This change breaks the chromiumos_sdk builder.  See

http://uberchromegw.corp.google.com/i/chromiumos/builders/chromiumos%20sdk/builds/2314/steps/BuildBoard/logs/stdio

This reverts commit 23da619f13

Change-Id: I47aa6e94aa0c62494cc40e9964f25097d3353322
Reviewed-on: https://gerrit.chromium.org/gerrit/32349
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2012-09-05 19:57:02 -07:00
Mike Frysinger
15a884825a build_image: dump debug info when target image is full
When we run out of space in the target image, it can be unclear that this
is the actual issue.  Detect this case and issue an appropriate warning,
and dump disk usage to help people triage things.

BUG=chromium-os:34167
TEST=`./build_image --board=amd64-generic` passed normally
TEST=`./build_image --board=amd64-generic factory_install` triggered the out-of-space check

Change-Id: I3052892a8c8bc386c7f08e1df26432eea2285563
Reviewed-on: https://gerrit.chromium.org/gerrit/32250
Reviewed-by: Peter Mayo <petermayo@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-09-05 18:32:27 -07:00
Vadim Bendebury
0887dc2f7a Allow more room for factory shim rootfs
For reasons yet to be determined the factory shim rootfs size spills
over allotted 300 MBytes. The actual culprit will have to be
determined and hopefully eliminated, at the time the lower size could
be restored by reverting this change.

BUG=chromium-os:34167
TEST=manual

   ./build_image --board=amd64-generic factory_install
    was failing before this change and is succeeding now

Change-Id: I01456f8317b0d02968068f609811c36d4816f353
Reviewed-on: https://gerrit.chromium.org/gerrit/32298
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Jon Salz <jsalz@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Peter Mayo <petermayo@chromium.org>
2012-09-05 16:38:01 -07:00
Rhyland Klein
94d5e60654 cros_workon: Add support for revisions other than master
This changes adds support for specifying a revision to use for cros_workon
other than master.

BUG=chromium-os:33688
TEST=used cros_workon to workon a project, repo synced, and verified the
src was not synced to master but to the revision requested.

CQ-DEPEND:I3a0166aaf4baa3af008ba24e5e887c0ea6b6ab6e

Change-Id: I53cbf2819fc557c3ce6eca08c93a57598a64d85c
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/30914
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
2012-09-05 16:00:29 -07:00