Commit Graph

2915 Commits

Author SHA1 Message Date
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
Brian Harring
23da619f13 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.

BUG=chromium-os:23443
TEST=manual validation, trybot.

Change-Id: Ie2514f6e8d2e10a19ab8d11c8056177bc1a2fb4d
Reviewed-on: https://gerrit.chromium.org/gerrit/32088
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-09-05 14:38:14 -07:00
Brian Harring
ece65e0633 Add a umount wrapper to suppress gvfsd/trashd breaking umount calls.
Specifically, detect if the umount failed due to current access, if so,
give it up to 9 more runs (w/ 1s pauses) continuing only if it's still
failing due to currently open files.

Via this, it should suppress the race of gvfs/trashd looking at
quick mounted/umounted pathways.

This CL is a two parter; this adds the script, and converts common.sh
consumers over to using the override.

The next CL will modify the chroot itself to ensure our script gets
picked up/used.

BUG=chromium-os:23443
TEST=trybot, manul validation.

Change-Id: I92dedd91d6133c2063b1e5dbbc1a68366844801d
Reviewed-on: https://gerrit.chromium.org/gerrit/32087
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-09-05 00:00:43 -07:00
Brian Harring
fd8a8ee7f6 Look for both kvm and qemu-kvm.
BUG=None
TEST=manual, rename kvm to qemu-kvm, else run it on a gentoo host.

Change-Id: I4971336a1be4c07fe2c8799643f52cd094d5caf1
Reviewed-on: https://gerrit.chromium.org/gerrit/32093
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
2012-09-05 00:00:43 -07:00
Brian Harring
710e7e9697 Fix breakage induced by CL:342067.
Specifically, argument handling was tightened- loman now enforces
argument count (rather than just ignoring it).

This however broke cros_workon.  Joy.

BUG=chromium-os:32247,chromium-os:31867,chromium-os:9914
TEST=manual; cros_workon start --board <blah> chromeos-base/chrome-login

Change-Id: Ic58ec457b7f43e14fa6347e8752653d5a466114f
Reviewed-on: https://gerrit.chromium.org/gerrit/32207
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-09-04 21:43:53 -07:00
Shawn Nematbakhsh
299493f340 Add conversion script to convert Butterfly board to 32bit.
Add conversion script to convert 2GB butterfly board to 32bit.

BUG=chrome-os-partner:13254
TEST=run update_chroot, verify butterfly upgraded

Change-Id: Ia6e834b727e70bfb27af9c81175b5df09ef56e2e
Reviewed-on: https://gerrit.chromium.org/gerrit/31777
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Shawn Nematbakhsh <shawnn@chromium.org>
2012-08-31 18:29:32 -07:00
Zdenek Behan
52970f47a5 common.sh: Change umount function to account for already deleted mounts.
BUG=chromium-os:31250
TEST=enter chroot; kill ssh-agent; exit chroot

Change-Id: Iea8e0fdd9a82047bb756a459dffc2ef59615074c
Reviewed-on: https://gerrit.chromium.org/gerrit/31929
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
2012-08-31 15:41:45 -07:00
Jon Salz
8c8186c832 Add factory bundle overlay in /usr/local/factory/bundle.
CQ-DEPEND=CL:31631 CL:31632 CL:31633 CL:31636
BUG=None
TEST=cbuildbot --remote

Change-Id: Ie9b30d16e31fcba20009ccc3d7b4b24d2e9a8f3f
Reviewed-on: https://gerrit.chromium.org/gerrit/31636
Tested-by: Jon Salz <jsalz@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Jon Salz <jsalz@chromium.org>
2012-08-30 14:38:53 -07:00
Gilad Arnold
2ff2f11d8c Command-line override of default SSH connection timeout/attempts.
The previous implementation fixed a number of SSH connection options,
including the connect request timeout (-o ConnectTimeout) and connection
attempts (-o ConnectionAttempts). These values are unreasonably high
when developing tests that do not require SSH at all.

* Add two command-line arguments for these options.

* Substitute the use of a fixed environment variable
  (SSH_CONNECT_SETTINGS) for a function call, which can populate SSH
  options based on command-line argument values.  Callers can still fix
  the settings to their liking by assigning a value to
  SSH_CONNECT_SETTINGS.

* Defaults kept the same.

BUG=None

TEST=Dependent scripts (like run_remote_tests.sh) running properly and
responding to timeout/reattempt value changes.

Change-Id: I23805b78ffa6ffc743c0ddae98334eee26bd1e5e
Reviewed-on: https://gerrit.chromium.org/gerrit/31608
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
2012-08-29 16:51:03 -07:00
Liam McLoughlin
eb7ccc33b3 Move chromeos-factory into mod_image_for_test
Previously it was a dependency of chromeos-test which isn't correct

BUG=none
TEST=Build base and factory images

Change-Id: I133b937d1b56f96d5ebf3428172f9a4457c6bf5e
Reviewed-on: https://gerrit.chromium.org/gerrit/31156
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-08-28 13:38:19 -07:00
Brian Harring
06d3c2e20b Pass more proxy vars into the chroot, rework sudoers.d maintenance.
In particular, put the sudoers.d setup into one script (making
updates to it easier in the future if necessary), and
centralize the proxied vars into a const in common.sh.

Thanks to Kevin McCray/Josh Triplett/Alexander Kanevsky for
pointing out the missing proxy variables, and fixes/cleanup.

BUG=None
TEST=https_proxy=blah cros_sdk -- bash -c 'echo $https_proxy'
TEST=build_packages behind a proxy.
TEST=cros_sdk --replace && \
     RSYNC_PROXY=blah cros_sdk -- bash -c 'echo $RSYNC_PROXY'

Change-Id: I3165882dfd9c8b52d25c2b26d7ff9242c84c91bd
Reviewed-on: https://gerrit.chromium.org/gerrit/31185
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Josh Triplett <josh@joshtriplett.org>
2012-08-24 13:26:03 -07:00
Brian Harring
305e1361f7 Move cros_deps_diff and cros_generate_deps_grah into chromite.
The core util they rely on, cros_extract_deps has been over yonder
for a while, thus complete the move.

CQ-DEPEND=CL:31218
BUG=chromium-os:33829
TEST=manual invocation of the scripts in question.

Change-Id: I13d7f82f74ef3551f6efcbaf361a34b8847fa4e0
Reviewed-on: https://gerrit.chromium.org/gerrit/31217
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
2012-08-23 16:16:37 -07:00
Sameer Nanda
542cb53e9d build_kernel_image: modify console, loglevel and quiet kernel options
Three related changes to kernel command line:

1. quiet kernel command line option is redundant with loglevel option
since quiet sets the loglevel to 4 but it is immediately overriden by
the loglevel option. Remove quiet option.

2. with loglevel set to 0 in the kernel command line, pstore console
doesn't work most of the time. This is because all printk's with level
lower than that don't make it to the console drivers. Set loglevel
to 7.

3. console=tty2 doesn't do what we want since the early boot and
shutdown messages with appropriate message log level are still visible
on screen. Set console to empty.

BUG=chrome-os-partner:12780
TEST=1. boot system and ensure that no kernel log messages appear on
screen. Then do a warm reboot and check that /dev/pstore/console-ramoops
file contains kernel log messages from the previous boot.
2. run bootperf test and ensure there are no boot time regressions.

Change-Id: Id1348c30d6aa3d818bae3259e748bf7100bf9c51
Reviewed-on: https://gerrit.chromium.org/gerrit/31180
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Sameer Nanda <snanda@chromium.org>
Tested-by: Sameer Nanda <snanda@chromium.org>
2012-08-23 10:51:12 -07:00
Brian Harring
ac6712fed3 Drop the dead enter_chroot error script.
BUG=None
TEST=n/a; anything using this path was already broke.

Change-Id: Ie120009a633ef58115bc0ec8eb0a62b273226440
Reviewed-on: https://gerrit.chromium.org/gerrit/31215
Commit-Ready: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2012-08-23 09:31:44 -07:00
Mike Frysinger
5e2e27345f update_chroot: fix clobbering of initial toolchain flags with --nousepkg
The current logic accidentally sets TOOLCHAIN_FLAGS when the --nousepkg
flag is used rather than appending it leading to possible flag loss.

While we're at it, use arrays.

BUG=None
TEST=`./setup_board --board=x32-generic --nousepkg` works now

Change-Id: I33627ec088afb649b4fdde42b933a4af1521675b
Reviewed-on: https://gerrit.chromium.org/gerrit/31150
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-22 19:09:20 -07:00
Brian Harring
df4a5b41ea Move loman to chromite (proper location for it after all).
BUG=chromium-os:32247,chromium-os:31867,chromium-os:9914
CQ-DEPEND=CL:29250
TEST=manual validation

Change-Id: I055b1dc4b1be54684ac01d3ec4b8760ed33e0aa4
Reviewed-on: https://gerrit.chromium.org/gerrit/29245
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: Ryan Cui <rcui@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
2012-08-22 18:34:43 -07:00
Josh Triplett
f4dfd18b12 Drop fixup_image_for_qemu.py; ChromeOS works fine in qemu/kvm without an xorg.conf
fixup_image_for_qemu.py exists only to add an xorg.conf; however, Xorg's
autodetection has handled qemu/kvm just fine for quite a while now, with
or without -vga std.  Drop the script and the call to it from
image_to_vm.sh.

BUG=None
TEST=Build an image, confirm that it still works fine in kvm and
     autodetects an appropriate resolution.

Change-Id: I9f550fef1eebe7387d232795105ec47bfa908f22
Reviewed-on: https://gerrit.chromium.org/gerrit/31181
Tested-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Rahul Chaturvedi <rkc@chromium.org>
Commit-Ready: Josh Triplett <josh@joshtriplett.org>
2012-08-22 18:08:34 -07:00
Ryan Cui
be24c739e9 Remove running of gerrit source transition chroot-upgrade hook.
The code has been in here long enough - most people should be
transitioned over who are using gerrit-source.  We've also already
removed the chrome projects from the default manifest, and things look
good so far.

BUG=chromium-os:32963
TEST=remote trybot

Change-Id: Idd5e3a2ad77ea86c7316a9d50f5da1a5fdf01d8b
Reviewed-on: https://gerrit.chromium.org/gerrit/31161
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Ryan Cui <rcui@chromium.org>
Tested-by: Ryan Cui <rcui@chromium.org>
2012-08-22 17:44:16 -07:00
Mike Frysinger
919bf0c5b8 image_to_vm.sh: avoid subshells
There is a bug in bash where BASH_COMMAND is not correct when an error
is hit in a subshell (it retains the command run *before* the subshell).

Since this has confused a few people using image_to_vm.sh so far, drop
the use of subshells in this file.  They weren't necessary in the first
place so it isn't like we're losing anything.

URL: http://lists.gnu.org/archive/html/bug-bash/2012-08/msg00052.html
BUG=None
TEST=`./image_to_vm.sh --board=x86-alex --from=../build/images/x86-alex/latest` still works
TEST=`rm ../build/images/x86-alex/latest/chromiumos_image.bin && ./image_to_vm.sh --board=x86-alex --from=../build/images/x86-alex/latest/` reports correct line

Change-Id: Iaa7560b4868128119a4f6223b54020611f203635
Reviewed-on: https://gerrit.chromium.org/gerrit/31135
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-22 15:03:39 -07:00
Zdenek Behan
4d21a2926a chroot: pass through USE and GCC_GITHASH from outside the chroot
This is used to build toolchains with specific env variables

BUG=chromium-os:33240
TEST=trybot x86-generic-toolchain-minor

Change-Id: I2bbdd7d013a15c57c590a0d660a210e0ae2a6695
Reviewed-on: https://gerrit.chromium.org/gerrit/30645
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
2012-08-21 10:56:54 -07:00
Mike Frysinger
bc09fb8974 setup_board: drop binutils from package.provided
We don't have anything pulling this into the target, so there is no reason
to list it in package.provided.  Further, this messes us up when we we do
want to install it into the target image (for debugging/etc...).

BUG=chromium-os:21330
TEST=`build_packages+build_image` for x86-alex did not install binutils
TEST=`cbuildbot {amd64,arm,x86}-generic-full` did not install binutils
TEST=`emerge-x86-alex binutils` worked

Change-Id: Ie43124a5e763e416508155ab6465a272e639905a
Reviewed-on: https://gerrit.chromium.org/gerrit/30287
Reviewed-by: asharif <asharif@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-18 13:57:33 -07:00
Olof Johansson
9a83e4e1b5 update_kernel: update syslinux before module copy
Otherwise if you switch architectures during the update (32/64-bit), the
module load that's needed to mount the FAT filesystem can't happen (the
module has been replaced with the other binary format).

BUG=none
TEST=run update_kernel on a 32-bit-kernel target after having changed
the overlay to use 64-bit kernel.

Change-Id: I9f302e777a563cbdab2ec636f9a3b35e39ef9c24
Reviewed-on: https://gerrit.chromium.org/gerrit/30681
Tested-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>
2012-08-17 07:18:41 -07:00
Jonathan Kliegman
775bc8e3c1 Warn if kernel build directory is fresher than installed image
update_kernel will silently run and report no errors if the user
runs cros_workon_make instead of cros_workon_make --install.  As
there are times where the 'uname -a' output doesn't change between
builds (modifying modules or devicetree entries), its not always
obvious that the most recently modified kernel wasn't what was deployed.

This doesn't catch the case where the user first cros_workon's a package
but hasn't done an install (either through emerge or cros_workon_make).

BUG=None
TEST=While cros_workon:
  cros_workon_make chromeos-kernel
  - observe update_kernel warns
  cros_workon_make --install chromeos-kernel
  - no warning
  cros_workon stop chromeos-kernel
  emerge-${BOARD} -g chromeos-kernel
  - no warning
  emerge-${BOARD} chromeos-kernel
  - no warning

Change-Id: I25caa44dc82e00c9bf8703b72d09f76df3db1251
Reviewed-on: https://gerrit.chromium.org/gerrit/30214
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Jon Kliegman <kliegs@chromium.org>
Tested-by: Jon Kliegman <kliegs@chromium.org>
2012-08-16 08:54:22 -07:00
Kees Cook
b6fa1b32f3 recovery: do not create empty /var on stateful partition
The /var directory on the stateful partition is no longer used in the
recovery image, so there is no reason to mkdir it here.

BUG=chromium-os:32774
TEST=parrot and lumpy recovery image build, manual testing

Change-Id: I9ad936943e88cd2c8cb96a6f715f778c5c65d701
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30488
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
2012-08-15 19:54:03 -07:00
Mike Frysinger
2cf2102f99 test_build_root: convert to arrays
Minor code clean up.

BUG=None
TEST=`build_image` still works + boots

Change-Id: I0e26dd3575f963a52d522c4f7c2da8aa5a7dda5c
Reviewed-on: https://gerrit.chromium.org/gerrit/30262
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-08-14 13:38:33 -07:00
Mike Frysinger
c17a493bcc setup DEFAULT_BOARD by default
Rather than forcing all consumers of DEFAULT_BOARD to remember to call
get_default_board, just do it for them automatically.

BUG=None
TEST=`cbuildbot {arm,amd64,x86}-generic-full` works
TEST=`./build_packages --help` shows correct default

Change-Id: I8d6ccb83babb2764a50692318eb9193c45fb3b39
Reviewed-on: https://gerrit.chromium.org/gerrit/17868
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-14 10:17:31 -07:00
Michael Krebs
5f43eb08d4 scripts: Dump symbols for executables that are not user readable
If an executable was only readable by root, we would skip it with a "Binary
is not user readable" message because the 'file' command was not running as
root.  This kept us from generating Breakpad symbols for Xorg, which is now
a top crasher for some boards.

BUG=chrome-os-partner:11791
TEST=Manually ran the script on some files

Change-Id: Id8a13c2968223e54cb1f6c5c3211e9bc2ca89057
Reviewed-on: https://gerrit.chromium.org/gerrit/29839
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
2012-08-09 21:32:52 -07:00
Mike Frysinger
27b5edb4db common.sh: fix pkgconfig install mask
Since pkgconfig is installed in the native libdir path, we need to
make sure to filter out all pkgconfig subdirs.

BUG=None
TEST=`./build_image --board=amd64-generic` no longer includes .pc files

Change-Id: Id8116190b6900ac86b433794551b250b6445d9d8
Reviewed-on: https://gerrit.chromium.org/gerrit/29682
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-09 01:57:02 -07:00
Olof Johansson
1222b2e736 common.sh: add /lib/modules/*/{build,source} to DEFAULT_INSTALL_MASK
Since we moved the source location during build, some of the security
testcases started reporting errors.

BUG=chromium-os:33392
TEST=build image, check /lib/module/*/{build,source} (none should be there)

Change-Id: I4656f043e4014f33dda03e1f788ba9190e0ce38a
Reviewed-on: https://gerrit.chromium.org/gerrit/29674
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Jim Hebert <jimhebert@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>
Tested-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
2012-08-08 16:49:56 -07:00
Ryan Cui
b325ef81be Fix hook invocation to not clear the screen.
Don't run .bash_logout after invocation of the hook, which clears the
screen, sending unnecessary escape characters.

BUG=None
TEST=Ran locally.

Change-Id: I6c466040e7169d304b892b85be6a5b0d578e7714
Reviewed-on: https://gerrit.chromium.org/gerrit/29645
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Ryan Cui <rcui@chromium.org>
Tested-by: Ryan Cui <rcui@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2012-08-08 14:58:19 -07:00
Hung-Te Lin
76272be9de Add /firmware into INSTALL_MASK.
We will add more firmware-related tools (static AU programs, updater, netboot
firmware, firmware symbols, firmware for AU testing, ...) into /firmware for
buildbot archiver to output, and should not be picked into target chromiumos
image rootfs; so adding INSTALL_MASK should be the right approach.

BUG=chromium-os:33338
TEST=./build_packages; ./build_image

Change-Id: I64a4477a8ca1a5ed99e32d92767509f21a77c704
Reviewed-on: https://gerrit.chromium.org/gerrit/29411
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2012-08-07 21:20:31 -07:00
Liam McLoughlin
d606ee21b4 Adding board specific image creation stage
BUG=none
TEST=Build a beaglebone image then verify that the beaglebone
bootloader was installed into the ESP

Change-Id: I1037ee6a61d409e8fd2d66ec6746048a54ce8f14
Reviewed-on: https://gerrit.chromium.org/gerrit/26738
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
2012-08-07 19:06:42 -07:00
Mike Frysinger
5885d772f7 build_image: make initial fs setup quieter
No need to dump all these mkfs/dd details early on.

BUG=None
TEST=`./build_image` still works, and doesn't spew as much

Change-Id: Ia8113d2ce2c0e6a8a13535b67b37372f0f146398
Reviewed-on: https://gerrit.chromium.org/gerrit/29366
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-07 12:32:22 -07:00
Olof Johansson
d7a8aafa54 build_kernel_image: fix duplicate options
Don't append common options twice.

BUG=chromium-os:33220
TEST=build image, check bootargs

Change-Id: I632b6a9c7726ff3838e84c51ed8cea77142ba948
Reviewed-on: https://gerrit.chromium.org/gerrit/29134
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
Tested-by: Puneet Kumar <puneetster@chromium.org>
Commit-Ready: Puneet Kumar <puneetster@chromium.org>
2012-08-03 14:24:30 -07:00
Matt Tennant
0a9d32d61b Add more commands to build stats prototype.
Make the following commands send stats to chromiumos-build-stats.appspot.com:
build_image
run_chroot_version_hooks
make_chroot
setup_board
update_chroot

BUG=chromium-os:33088
TEST=`cbuildbot --remote -p chromiumos/platform/crosutils alex-paladin`
confirm in the log that uploads succeded, and see them show up in queries
at chromiumos-build-stats.appspot.com.

Change-Id: I0280f91a3e7e0a0483c01c87072bc589003dbe95
Reviewed-on: https://gerrit.chromium.org/gerrit/28969
Tested-by: Matt Tennant <mtennant@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Matt Tennant <mtennant@chromium.org>
2012-08-03 12:22:32 -07:00
Olof Johansson
1eafb5a351 build_kernel_image: turn off earlyprintk and make options common on ARM/x86
Also move the creation of config.txt to common code and add some of the
options that both platform should use to it.

BUG=chrome-os-partner:11403
TEST=build, boot

Change-Id: I9c6eed3bf05c9f0744063c1baf321bf6d24dc9cc
Reviewed-on: https://gerrit.chromium.org/gerrit/28914
Tested-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Ready: Olof Johansson <olofj@chromium.org>
2012-08-02 14:27:11 -07:00