Commit Graph

3233 Commits

Author SHA1 Message Date
Gabe Black
0d7b85aacd Add the --include-masked flag when calling the equery which command.
When setting up a new ebuild, the process I've used in the past was to
create a 9999 ebuild and, to test it, cros_workon it so emerge can
choose that version to build. cros_workon uses equery in its
canonicalize_name function, and if it fails then it aborts the call to,
in my case, cros_workon start.

The problem is that equery ignores masked packages by default,
apparently, and because no stable version exists, it can't see the lone
9999 ebuild. Because that fails you can't cros_workon the package, and
because of that you can't build it because you've still only got the
unstable version.

To work around this new behavior, I added the --include-masked option I
found while digging around in equery's source. This option seems to
allow it to see the otherwise unavailable package, and the cros_workon
succeeds.

BUG=None
TEST=Saw that this allowed cros_workon-ing a new ebuild which only had a
9999 version. Ran cros_workon-link start and stop on an existing ebuild
and saw the command complete successfully.

Change-Id: Icfb271ed671b118bbd4ebfa1c3341353e203162a
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/42276
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
2013-01-30 14:25:44 -08:00
Peter Mayo
45ebc4c9fc Copy the netrc into the chroot at entry.
This seems to be needed for acessing some of the chrome repositories.
Without it we get git clone hangs trying to sync.

BUG=chromium-os:38303
TEST=local entry into chroot

Change-Id: Ia68a6486022e8d230572bad0f9031c3e5d36197c
Reviewed-on: https://gerrit.chromium.org/gerrit/42140
Commit-Queue: Peter Mayo <petermayo@chromium.org>
Reviewed-by: Peter Mayo <petermayo@chromium.org>
Tested-by: Peter Mayo <petermayo@chromium.org>
2013-01-28 14:01:37 -08:00
Vic Yang
e72689e500 make_netboot: Fix path to netboot firmware
Now that netboot firmware is named 'nv_image-xxx.bin', let's change it
in make_netboot.sh.

Also, update_firmware_vars.py is already included in factory_setup.
There is no need to copy it to factory_shim. Remove it.

BUG=chrome-os-partner:17471
TEST=Run make_netboot and see nv_image copied.

Change-Id: I513c0377d63e2088b36275ab79ea06c6652e4bb4
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42093
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2013-01-28 08:16:31 -08:00
Denis Glotov
61772d46aa Add 2gb-rootfs-updateble disk layout.
This is to be used with build_image and image_to_vm by cros buildbots
that need more rootfs size.

Unlike 2gb-rootfs, it has both ROOT-A and ROOT-B enlarged to 2gb, so
that image update test (1_update in SimpleTestsUpdateAndVerify) is possible.

BUG=chromium-os:38088
TEST=cbuildbot x86-generic-asan amd-64-generic-asan --remote -g I6f497214 -g I07d31d8b

Change-Id: I6f497214f54f4457cf2b40610beb9272622d1a47
Reviewed-on: https://gerrit.chromium.org/gerrit/41814
Tested-by: Denis Glotov <glotov@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Denis Glotov <glotov@chromium.org>
2013-01-28 08:16:28 -08:00
Mike Frysinger
cf7a09344b setup_board: make sure /usr/local/bin exists
We currently rely on the fact some package happens to install into
/usr/local/bin and creates the dir for us.  If that doesn't happen,
then we fail when generating local wrappers.  So run mkdir first to
make sure everything is sane.

BUG=chromium-os:31039
TEST=`cbuildbot chromiumos-sdk` works

Change-Id: I42f9122e1a8aa7aa19a7efb17deaa6dd28e58582
Reviewed-on: https://gerrit.chromium.org/gerrit/41929
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2013-01-24 14:21:20 -08:00
Mike Frysinger
79ae5b4a06 use new status=none with dd
The latest coreutils introduces a status=none option which suppresses
all information which is more than the current status=noxfer.

BUG=None
TEST=`./build_image` no longer spews any dd info

Change-Id: I3cfefed1d38e7e5ff52342c98e6a306d9a48950a
Reviewed-on: https://gerrit.chromium.org/gerrit/41930
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2013-01-24 13:58:27 -08:00
Anush Elangovan
87933c73cf Remove chromeos-[dev|test]-init deps
Now that chromeos-dev-init and chromeos-test-init are explicitly
specified in chromeos-dev and chromeos-test remove the hardcoding
in build_packages

BUG=None
TEST=build and run on daisy and trybots on a variety of x86/arm
paladin/full builders
CQ-DEPEND=CL:Iaceab4dbc2c215ba899d17e78c6c22e60c0802c8

Change-Id: I3064117ecf5bbafbc0f340f46cc07d4f6c959559
Reviewed-on: https://gerrit.chromium.org/gerrit/41943
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Anush Elangovan <anush@chromium.org>
Tested-by: Anush Elangovan <anush@chromium.org>
2013-01-24 13:58:22 -08:00
Paul Taysom
5e39bb6cd1 Configure the serial port for debugging
Enable the serial port from the build_image command line.
Currenly, you have to edit build_kernel_image.sh to enable
the serial port for kernel debugging. Now:

./build_image --board=${BOARD} --enable_serial=ttyS0

Will enable sending printks to the specified serial port.

BUG=chromium-os:38026
TEST=built images with and without serial enabled

Change-Id: I9ef4f2a20f0d451e132371339c4eba1faf4c94de
Reviewed-on: https://gerrit.chromium.org/gerrit/41638
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>
Tested-by: Paul Taysom <taysom@chromium.org>
2013-01-23 17:44:43 -08:00
Vic Yang
3239b1aacd Add TPM and I2C device USE flags when building initramfs kernel
This is to match the refactoring of kernel eclass.

BUG=chrome-os-partner:17368
TEST=Build factory install shim and install.

Change-Id: Ia47f1c9632f82c127a818ca69fbcc91feacbfdcd
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41755
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2013-01-22 18:57:41 -08:00
David James
4cae07382d Add pylint hook to src/scripts.
BUG=chromium-os:11550
TEST=Verify presubmit hook catches when there are pylint errors.

Change-Id: I6b3d3f7c93d7188dd3edaea56a795567200adea2
Reviewed-on: https://gerrit.chromium.org/gerrit/41620
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2013-01-18 11:40:40 -08:00
David James
fc49d8dd19 Fix broken boto file handling.
After CL:39921, I get the following warning every time I enter the chroot:

ln: failed to create symbolic link `.../chroot/root/.boto': File exists

All bots get this error as well. This is caused because CL:39921, causes
~/trunk to no longer resolve outside the chroot, so it's invalid for processes
outside the chroot to try to resolve paths inside there. Fix cases where we do
this inside enter_chroot.sh.

BUG=chromium-os:37347
TEST=cros_sdk doesn't print warnings anymore.

Change-Id: Iaeb9b7407e12397bce1600bd51559be20f998fdf
Reviewed-on: https://gerrit.chromium.org/gerrit/41571
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2013-01-17 15:09:29 -08:00
Mike Frysinger
baae8eb628 common.sh: convert to bash
We don't need to support POSIX shell, so convert to bash.

BUG=None
TEST=`cbuildbot {amd64,x86,arm}-generic-full chromiumos-sdk daisy-release` worked

Change-Id: I33ad25d2310c593f3e346d955e3aa27da41091fc
Reviewed-on: https://gerrit.chromium.org/gerrit/41271
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2013-01-16 13:59:21 -08:00
Brian Harring
9086a3f9d3 Calculate CHROOT_TRUNK_DIR earlier.
Issues flagged during unittest run; bit unsure how this got missed
since trybots were involved (Presuming human error).

BUG=chromium-os:37347
TEST=trybot run

Change-Id: Ib6e49d28f9427197a0abd0e4da68d2f628dc2803
Reviewed-on: https://gerrit.chromium.org/gerrit/41203
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2013-01-14 01:53:41 -08:00
Brian Harring
871a40aa8f Fix bug introduced via CL:37347
Slipped past during rename of the chroot upgrade script from
49 to 50; name was slightly changed but full re-validation of the
rename wasn't done (thus the typo slipped past testing, and review).

Simplify the code via removal of invoking the upgrade script, instead
just doing the relevant commands (fixing chroot awareness issues in
the process).

BUG=None
TEST=manual cros_sdk invocation

Change-Id: I122de8b4cf7ec0845643e09e7919cbcdbd0bb79a
Reviewed-on: https://gerrit.chromium.org/gerrit/41202
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2013-01-14 01:18:33 -08:00
Brian Harring
2499bfbeb2 Move source access to a standard location, add chromite to PYTHONPATH.
Rather than having to find /home/${SUDO_USER:-${USER}}/trunk, instead
just look for /mnt/host/trunk (defined by common.sh as $CHROOT_TRUNK_DIR).
This simplifies code flow, and is a requirement for shoving chromite
into PYTHONPATH globally w/in the chroot.

BUG=chromium-os:37347
TEST=cros_sdk --replace; cros_sdk w/ chroot upgrade.
Change-Id: I9ee3e6556541a91193f49cbf74ffc5a8e090537f
Reviewed-on: https://gerrit.chromium.org/gerrit/39921
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2013-01-14 00:44:03 -08:00
Gilad Arnold
11e0f66cc9 image_to_usb.sh: allow writing to character devices
This is useful for debugging, e.g. --to /dev/null. The user will have to
use --force_non_usb to allow this, in which case all bets are off and we
should let her do this.  Also note that, before this fix, using --to
/dev/null would have given a strange error message (target device does
not exist); with it, we're handling all devices in a more comprehensive
way, spitting the right error message when appropriate.

BUG=None
TEST=--to /dev/null dies as expected; works with --force_non_usb

Change-Id: I514e14e1f7cc49b3d6172a2a53aa6da33ef5ecfd
Reviewed-on: https://gerrit.chromium.org/gerrit/41133
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
2013-01-12 23:06:32 -08:00
Gilad Arnold
8f861c05b6 common.sh: limit pv progress bar initial width to 80 characters
By default, pv automatically infers and uses the full width of the
terminal. This generally makes sense for a console application, but in
the case of pv it just causes the progress bar to be ridiculously wide
when run on wide terminals, to the point it's hard to read. This CL is
setting it to 80 characters, the widely accepted standard width for
a terminal, in cases where the terminal appears to be larger than
80 columns. Note that:

* Even with -w, pv appears to be resizing the progress bar as the
  terminal width changes midway through the run. This means that if
  a user widens the window, then the progress bar will go wide again and
  there's nothing to be done about it.

* Theoretically, in very rare cases this may lead to a progress bar the
  exceeds the width of the terminal (i.e. set to 80 columns on
  a terminal that has just shrunk to fewer columns). The odds for such
  timing are close to nil and even then the damage is minimal.

* This will work for non-terminal runs, or otherwise runs where stty
  does not produce any output.

* To avoid the initialization overhead for all common.sh inclusion,
  replacing the variable with a function that prints the pv/cat command.

BUG=None
TEST=Ran ./image_to_usb on wide and narrow terminal windows, it works.

Change-Id: I549df1dd29e93909ea646ae9b9e09d9a588ad382
Reviewed-on: https://gerrit.chromium.org/gerrit/40937
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
2013-01-12 23:06:31 -08:00
Vic Yang
435611e5ee make_netboot: Enable I2C device driver for netboot kernel
This is needed as I2C device driver is also built-in for install shim
kernel.

BUG=chrome-os-partner:16712
TEST=Build netboot image and check I2C device driver is included.

Change-Id: I71f21eea9cf599454fe18bd8adeeaa629d851db6
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41076
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
2013-01-10 19:23:21 -08:00
David James
7efb76cde5 Remove deprecated mod_image_for_test.sh and references.
mod_image_for_test.sh doesn't work anymore so nobody should be using it.
There are a few places where scripts try to use mod_image_for_test.sh,
and these are timebombs because they fail if a test image needs to actually
be produced.

BUG=chromium-os:31183
TEST=Tested that this script doesn't produce any images anymore, so
     it should be fine to delete it.

Change-Id: If80337407023d62f76117dc44cadfa46801ca236
Reviewed-on: https://gerrit.chromium.org/gerrit/40955
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2013-01-09 18:30:52 -08:00
Vic Yang
90e3b25914 Move ARM factory install shim to initramfs
As USB/SD install shim might be used for ARM devices now, it is
reasonable to move ARM factory install shim to initramfs like on x86.
This converges the code path and build process for ARM and x86.

BUG=chrome-os-partner:15884
TEST=Install with install shim and netboot on Spring.

Change-Id: Ic8d7328502181ca909be3d7542be34f2a904523f
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/40931
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2013-01-09 10:32:24 -08:00
Ahmad Sharif
5d75098098 Start update_engine before doing re-imaging.
Sometimes update_engine isn't running on the device because of a possibly bad
Chrome, etc. So don't assume it is running and always attempt to start it before
updating.

BUG=none
TEST=stop update-engine on the device.
    ./bin/cros_image_to_target.py ... works.

Change-Id: I9aeaed80a9a82f9f685e58774fa987877ec635c9
Reviewed-on: https://gerrit.chromium.org/gerrit/40285
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: asharif <asharif@chromium.org>
Tested-by: asharif <asharif@chromium.org>
2013-01-04 16:54:30 -08:00
David James
4a9d94b262 Remove unused functions from crosutils cros_build_lib.
crosutils cros_build_lib is deprecated in favor of
chromite.lib.cros_build_lib. Remove unused functions to encourage folks
to migrate over to chromite.lib.cros_build_lib instead.

Info and GetCallerName are only used internally so we add an underscore
prefix to discourage others from using it.

BUG=chromium-os:24660, chromium-os:21287
TEST=pylint. Unit tests. Trybot runs.
CQ-DEPEND=CL:40300, CL:40311

Change-Id: Ia34d2770db2c2678b8966f6dceb2164b0a3333a2
Reviewed-on: https://gerrit.chromium.org/gerrit/40301
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
2013-01-03 06:55:44 -08:00
Anush Elangovan
c52c5fbb7c Add support for "skip_kernelblock_install"
CrOS could be used in devices that dont have custom firmware to
interpret the Kernelblock (Part2,4). In such devices skip trying
to make the kernelblock

BUG=none
TEST=./build_image --board=chronos test and verify we dont build the kernel block

Change-Id: I3e9a8dd765ea00db2ebf112553d96c08960e544f
Reviewed-on: https://gerrit.chromium.org/gerrit/40219
Commit-Queue: Anush Elangovan <anush@chromium.org>
Reviewed-by: Anush Elangovan <anush@chromium.org>
Tested-by: Anush Elangovan <anush@chromium.org>
2013-01-02 17:03:40 -08:00
Vic Yang
8e0cd07e03 Build factory install shim by ebuild
Now that we have an ebuild for factory install shim, let's move to that
instead of base image.

BUG=chrome-os-partner:16712
TEST=Test network boot, install shim, RMA shim on Link.
     Test install shim on Snow.
CQ-DEPEND=CL:39952

Change-Id: Ib6a7a598087647b44a4aeca970e293ea72023890
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39955
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2012-12-21 18:54:08 -08:00
Kees Cook
74f163b587 install kernel testcase modules on test image only
Similar to the uinput module, install the testcases/ tree of modules
only on test images.

BUG=chromium-os:37353
TEST=daisy test image build has modules, production does not.
CQ-DEPEND=I16eee5afd1664f0ab4a9ab48b6cb2beaa6f30017

Change-Id: I5e7a48936b3fb45f49ff7ca4d592d46150c5610c
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39920
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
2012-12-21 12:42:42 -08:00
John Sheu
b7b095befd Use cirrus driver for QEMU
Moving to the cirrus driver (instead of std) so we can support
cirrus-fb, in preparation for nonroot-X support.

BUG=chromium-os:388
TEST=local build, run with x86-generic

Change-Id: Ic7d5776f673ac3c15680d62331345d55985f1d73
Reviewed-on: https://gerrit.chromium.org/gerrit/39900
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>
2012-12-20 15:06:03 -08:00
Ryan Cui
eb4595f1e8 setup_board: add --accept_license flag.
Setting the flag will cause make.conf to set the ACCEPT_LICENSE
environment variable.

BUG=chromium-os:37312
TEST=remote trybots

Change-Id: Id478b7cfb8c37d363da46b1d74f33143e8ea159f
Reviewed-on: https://gerrit.chromium.org/gerrit/39801
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-12-19 12:15:59 -08:00
Allen Martin
642c3be66e Update libtool to keep in sync with toolchain
Force a re-emerge of host libtool

BUG=chromium-os:37334
TEST=Added fake "4.6.x-google" version string to libtool and ran
./update_chroot and verified libtool was re-emerged

Change-Id: I82d3da181831a7718b230305c5aca7899d591c2d
Signed-off-by: Allen Martin <amartin@nvidia.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/39858
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2012-12-18 18:18:26 -08:00
Doug Anderson
adf8a003e8 update_kernel: Save .5 seconds by avoiding tmp copy for kernel image
There's no need to store to a temporary file when updating the kernel
partition.  Just stream straight to the right partition.  This appears
to save about .5 seconds.

BUG=None
TEST=Time update_kernel and see savings; verify that kernel still gets
updated.

Change-Id: I5afead3e70720ee6dc9e6a822ef1a98032d93b79
Reviewed-on: https://gerrit.chromium.org/gerrit/39783
Commit-Ready: Doug Anderson <dianders@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
2012-12-17 13:29:08 -08:00
Brian Harring
3d01db2603 Fix minor style issue.
This was identified in CL:39304, but not corrected before landing.

BUG=None
TEST=bash -n build_packages

Change-Id: I17cefc883e191d33a3569d7f53ab2e0a85417da9
Reviewed-on: https://gerrit.chromium.org/gerrit/39753
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-12-15 21:33:02 -08:00
Vic Yang
982556afcc Filter out more things in install shim
This reduces tens of MB of install shim.

BUG=chrome-os-partner:16712
TEST=Build install shim and install with it.

Change-Id: Ic7fab3c6e26d9b78f5181c4f10181217c1c2697a
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39534
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2012-12-11 03:02:12 -08:00
Kees Cook
9ea1347ed9 update_partition_table: dynamically handle resize
When changing the size of the stateful partition, we must be able to
operate on any image, with any arrangement of partitions. The static
templates cannot be used because we don't know what we're starting with.
As such, this change makes the update function walk the list of
partitions, duplicating all their details, and moves any located after
stateful by the change in size, and copies in the new stateful contents.

BUG=chromium-os:37080
TEST=link build and decryption recovery tested

Change-Id: I1131dd8ee91e5db2556bdf8f7ca12b08f35da32b
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39424
Reviewed-by: Will Drewry <wad@chromium.org>
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-12-10 13:56:46 -08:00
Doug Anderson
48b5200b92 update_kernel: Speed copy for kernel, modules, and firmware copy
If possible, we now uses rsync to copy elements from the host to the
device.  Using rsync to copy sped my "no-op" update kernel from 30
seconds down to ~5 seconds.

If rsync isn't available (a non-test build), speed up the fallback
case to:
- Never write tar to disk (on either host or target)--just stream
  straight to/from the network.
- Don't use bzip2 compression.  It's assumed that we've got a fast
  connection to the device so this is overkill and slower.
In this case we're at ~15 seconds for a "no-op" update kernel.

BUG=None
TEST=With old code, run this:
  time ./update_kernel.sh --remote=${REMOTE} --novboot --noreboot
...and see 30 seconds with old code and 4 seconds with new code.
TEST=Use update_kernel for updating kernel.  See that kernel / modules
get updated.

Change-Id: Iafad68221bd459fce5a4c661e07cd649b058d7b9
Reviewed-on: https://gerrit.chromium.org/gerrit/39393
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>
2012-12-10 08:44:29 -08:00
Doug Anderson
4e6783879c remote_access: Add some helper command for copying with rsync
It's nice to be able to use rsync for copies (much faster).  Add a few
helper functions for doing this, handling fallback to just using tar
to send.

BUG=None
TEST=Use in a future CL

Change-Id: I74c481520fc785138875ab6d5ffdaf9935a0b6d1
Reviewed-on: https://gerrit.chromium.org/gerrit/39392
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>
2012-12-10 08:44:29 -08:00
Doug Anderson
5a21b44a37 update_kernel: Add "--novboot" option
This option avoids updating the vboot kernel partition on the target.
This might be useful if you've done something tricky like put a
nv-U-Boot into the vboot kernel partition.

BUG=None
TEST=Put nv-U-Boot in kernel partition and see that ./update_kernel.sh
--novboot doesn't clobber it.  Then try without --novboot and see it
clobbered.
TEST=Run update_kernel --novboot on a system with verity and see
error.

Change-Id: I7c25a7e2ab64a136e427952bb0ac04686fbca805
Reviewed-on: https://gerrit.chromium.org/gerrit/39390
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>
2012-12-10 08:44:28 -08:00
Doug Anderson
b2fe4658f0 update_kernel: Fixup style nits
These style nits are in preexisting code but are similar to style
comments that vapier found on
<https://gerrit.chromium.org/gerrit/#/c/39390/2>.

BUG=None
TEST=Use update_kernel.sh

Change-Id: I26cf133a0f0495feee715e934bf819e90c0a688d
Reviewed-on: https://gerrit.chromium.org/gerrit/39432
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>
2012-12-10 08:44:28 -08:00
Doug Anderson
61e0b6b6a5 update_kernel: Don't double-copy the kernel on ARM
On ARM we were copying the kernel twice: one next to the "copying
kernel" message and once in copy_kernelimage() where we just copied
vmlinux.uimg.  Avoid the second copy.

BUG=None
TEST=On ARM with no verity, still found that the kernel got copied.

Change-Id: I2a8124b47d018195c7e4b1657d6caf961d3d4d0b
Reviewed-on: https://gerrit.chromium.org/gerrit/39391
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>
2012-12-10 08:44:27 -08:00
Josh Triplett
127416ae93 check_deps: Find libraries using RUNPATH too, not just RPATH
check_deps checks for libraries using RPATH, but does not take the
similar RUNPATH into account.  For the purposes of chasing down
library dependencies, finding a library on either path suffices.

BUG=None
TEST=Build an image that includes binaries and associated libraries in a
     non-standard location, with the binaries and libraries setting an
     RUNPATH (and not an RPATH) pointing at that non-standard location.

Change-Id: Ic930bbacbe5c8ddeb367c39960dadea8aaba0cb2
Reviewed-on: https://gerrit.chromium.org/gerrit/39397
Tested-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Josh Triplett <josh@joshtriplett.org>
2012-12-07 15:22:17 -08:00
Brian Harring
17c1fe8073 build_packages: Add --fetch-only pass through to parallel-emerge.
BUG=None
TEST=./build_packages --fetch-only, verify it just fetches.

Change-Id: I290ef23f13446c912724aa37b8c79269a9db6cc0
Reviewed-on: https://gerrit.chromium.org/gerrit/39304
Commit-Ready: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2012-12-05 21:56:24 -08:00
Mike Frysinger
93a2ecaaa9 enter_chroot: clean out stale ssh dirs
Over time, stale ssh agent dirs build up in /tmp.  Have enter_chroot run
a simple rmdir to clean out any empty dirs.  Since we mount over top the
dir, this shouldn't kill any valid mount points.

BUG=None
TEST=`cros_sdk` cleaned out empty ssh dirs in /tmp

Change-Id: Ib9f063f99db61825082818a39a39c5eb01f2d24e
Reviewed-on: https://gerrit.chromium.org/gerrit/39004
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-12-05 14:27:43 -08:00
Darren Krahn
a91800bcc9 Revert "build_image: filter out unused glibc files"
This removes files only used at link time, or when manually debugging,
or by glibc's charset routines (gconv) which are not used by Chromium.

BUG=chromium-os:22939
BUG=chromium-os:23105
TEST=build_image for daisy works
TEST=`cbuildbot {x86,x86_64,arm}-generic-full` worked
TEST=`cbuildbot chromiumos-sdk` worked
TEST=build_image boots & runs fine on an alex

Original-Change-Id: I68d848c2e307c98d53a8faa73924f57571f7887b
Change-Id: I25ffda36d28fd114715053c3a2590cc2248688bf
Reviewed-on: https://gerrit.chromium.org/gerrit/39214
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
2012-12-04 17:03:43 -08:00
Ryan Cui
7a40158fd7 setup_board: fix --regen_config bug.
https://gerrit.chromium.org/gerrit/#/c/38156 introduced a bug where
cross_get_version was moved to install_toolchain but was still
used in setup_board.

setup_board now saves whatever toolchain version is currently configured
and appends that information to the newly generated board config.

BUG=chromium-os:36865
TEST=remote trybot. manual - test case of existence/nonexistence of
board config file and existence/nonexistence of previous toolchain info.

Change-Id: I20e1794c12e7e60fdbbcd5a123ddc5c6bdf86b16
Reviewed-on: https://gerrit.chromium.org/gerrit/39132
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Ryan Cui <rcui@chromium.org>
Tested-by: Ryan Cui <rcui@chromium.org>
2012-12-03 17:47:37 -08:00
Paul Taysom
0c2b408347 Fix for factory build of bootcache
BUG=chromium-os:36862
TEST=./build_image factory_install --board=parrot

Change-Id: If1e59d09eec45340e49b2711b4799eb1f83ea007
Reviewed-on: https://gerrit.chromium.org/gerrit/39133
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Paul Taysom <taysom@chromium.org>
2012-12-03 16:13:15 -08:00
Mike Frysinger
454c526fda build_image: auto-disable bootcache when --noenable_rootfs_verification is used
If devs run `./build_image --noenable_rootfs_verification`, they also
have to manually specify --noenable_bootcache otherwise the default
kicks in.  We can make the default logic slightly smarter and only
enable bootcache by default if rootfs verification is also enabled.

BUG=chromium-os:25441
TEST=`./build_image --board=parrot --enable_rootfs_verification` -> bootcache enabled
TEST=`./build_image --board=parrot --noenable_rootfs_verification` -> bootcache disabled
TEST=`./build_image --board=parrot` -> bootcache enabled
TEST=`./build_image --board=parrot --noenable_bootcache` -> bootcache disabled

Change-Id: I97f40c70c045bca294a903ff73e5eff7554617d4
Reviewed-on: https://gerrit.chromium.org/gerrit/39043
Reviewed-by: Paul Taysom <taysom@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-12-03 10:05:44 -08:00
Mike Frysinger
33776c1cae setup_board: generalize pkg-config paths
The current logic has a few libdirs hardcoded (lib & lib64).  This fails
if the libdir is named something else (like libx32).  Tweak the pkg-config
logic so it returns all pkg-config dirs found in the target.  This won't
work if the target is multilib, but we don't have any plans to do that.

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

Change-Id: I1d856c86d279691e85e5794f429bd3da2eb28675
Reviewed-on: https://gerrit.chromium.org/gerrit/39050
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-12-01 17:02:22 -08:00
Mike Frysinger
5ea15f8a38 build_image: filter out unused glibc files
This removes files only used at link time, or when manually debugging,
or by glibc's charset routines (gconv) which are not used by Chromium.

BUG=chromium-os:22939
BUG=chromium-os:23105
TEST=build_image for daisy works
TEST=`cbuildbot {x86,x86_64,arm}-generic-full` worked
TEST=`cbuildbot chromiumos-sdk` worked
TEST=build_image boots & runs fine on an alex

Change-Id: I68d848c2e307c98d53a8faa73924f57571f7887b
Reviewed-on: https://gerrit.chromium.org/gerrit/37378
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-11-30 15:48:40 -08:00
David James
22dc2ba9d9 Fallback to SUDO_USER when running on NFS.
When running on NFS, the root user may not be able to access ~/.ssh and
~/.gitconfig, so it is necessary to fallback to SUDO_USER to access these
files.

To discourage users from using NFS homedirs, print warnings every time
cros_sdk is run with an NFS homedir.

BUG=chromium-os:36783
TEST=Try cros_sdk --replace and cros_sdk with and without NFS homedirs.

Change-Id: I4cdbceca485d3491656d6f743814da4ebcdd75ad
Reviewed-on: https://gerrit.chromium.org/gerrit/38953
Commit-Ready: David James <davidjames@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2012-11-30 09:06:06 -08:00
Paul Taysom
00df6f6e5b Build script changes needed to enable bootcache
Changes to build_image to allow enabling of bootcache.

./build_image --board=$BOARD --enable_bootcache

A board can be configured to use the bootcache by
the following lines in private-overlays/overlay-<board>-private/scripts

if [[ ${FLAGS_bootcache_use_board_default} -eq ${FLAGS_TRUE} ]]; then
  FLAGS_enable_bootcache=${FLAGS_TRUE}
fi

Setting --noenable_bootcache or --enable_bootcache on the comand
line will override the default.

BUG=chromium-os:25441
TEST=built and installed snow, amd-64(latitude), stumpy

Change-Id: Ie081ef94f4799b0071b53e0587d89f1247b4a11f
Reviewed-on: https://gerrit.chromium.org/gerrit/38414
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Paul Taysom <taysom@chromium.org>
2012-11-28 16:19:40 -08:00
Scott James Remnant
707e277431 Fix configuration to make dbus-monitor work
BUG=none
TEST=dbus-monitor shows method returns and errors

Change-Id: Ib21b3f13e3ecb237615288bd8f8970711992b640
Reviewed-on: https://gerrit.chromium.org/gerrit/38747
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Ready: Scott James Remnant <keybuk@chromium.org>
Tested-by: Scott James Remnant <keybuk@chromium.org>
2012-11-27 12:36:14 -08:00
Jon Salz
5afec63d76 Move symlink to make_factory_packages.py.
BUG=None
CQ-DEPEND=CL:38634,CL:38635,CL:38636,CL:38638,CL:38639,CL:38641
TEST=buildbot

Change-Id: I01e3c02b0d0c266b113a813a890fec113d13e21c
(cherry picked from commit e810d21b6b79e07eb4e614f73ab5c5e3fd450c8c)
Reviewed-on: https://gerrit.chromium.org/gerrit/38638
Commit-Ready: Jon Salz <jsalz@chromium.org>
Reviewed-by: Jon Salz <jsalz@chromium.org>
Tested-by: Jon Salz <jsalz@chromium.org>
2012-11-26 23:10:15 -08:00