Commit Graph

329 Commits

Author SHA1 Message Date
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
Liam McLoughlin
b78a7c3569 Add disk_layout flag to image_to_vm
This allows you to build a VM image using the 4gb-rootfs layout

BUG=none
TEST=Build iamge using 4gb-rootfs and build VM image

Change-Id: I1efa45d1448b22a9905dae764f0e4cdc0538be68
Reviewed-on: https://gerrit.chromium.org/gerrit/37489
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-11-07 10:21:46 -08:00
Liam McLoughlin
12a9a84de9 Add adjust_part flag
BUG=chromium-os:35003
TEST=Build an image specifying above flag, verify image is correct size

Change-Id: I36df212bf1dac41717044da011552d459645d523
Reviewed-on: https://gerrit.chromium.org/gerrit/35105
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-10-30 04:44:53 -07:00
David James
18a9c2513a Move board overlay calculation into chromite (part 3 of 5)
This CL adjusts all scripts to use cros_list_overlays from chromite
instead of cros_overlay_list.

BUG=chromium-os:35514
TEST=Trybot runs with all callers adjusted to use
     cros_list_overlays instead of cros_overlay_list.
CQ-DEPEND=CL:36191

Change-Id: I6b147a64744015f6b199b2a00493e6f1e030376b
Reviewed-on: https://gerrit.chromium.org/gerrit/36167
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
2012-10-23 08:52:03 -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
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
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
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
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
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
Liam McLoughlin
8afcdcd1a6 Add a flag to build_image that provisions both root partitions
BUG=none
TEST=Run build_image with --full, verify two roots are provisioned

Change-Id: I3a90cd18a7546519733bbf6ba51c9ad03e19e2ca
Reviewed-on: https://gerrit.chromium.org/gerrit/27432
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
2012-07-16 20:52:01 -07:00
Liam McLoughlin
07279034a9 Add option to create a hybrid MBR
This allows booting on boards that require their bootloader be on
the first partition of a MBR formatted disk

BUG=chromium-os:32150
TEST=Build an image using the --hybrid_mbr_hack flag, verify that
the ESP is visible on a system with GPT support

Change-Id: I4b137ef672b9ed7327bd42ec0a260d82a8c9d470
Reviewed-on: https://gerrit.chromium.org/gerrit/26071
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-06-26 13:58:51 -07:00
Gilad Arnold
a7536efa24 Temporarily reinstate support for --to=/dev/sdX
This is part of some user's workflow and should be deprecated with
proper advance notice.

- Added a deprecation warning when --to=/dev/sdX is used in
  image_to_usb.sh.

- Removed mention of /dev/sdX from the output of build_image. Also
  simplified this output a bit (it should be obvious to a user who just
  invoked build_image that the other scripts should be invoked
  similarly, from inside the chroot's scripts directory).

BUG=chromium-os:32023
TEST=Invoked image_to_usb.sh with different --to values

Change-Id: Ib93d1b55f425b0978c4a9680be7755ae031c46e6
Reviewed-on: https://gerrit.chromium.org/gerrit/25819
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
2012-06-25 07:15:45 -07:00
Vic Yang
4051405da9 Add 'vfat' flag when building kernel with initramfs
We are about to separate VFAT support from 'initramfs' flag. Let's add
'vfat' flag first so that when this happens nothing gets broken.

BUG=chrome-os-partner:9805
TEST=Build success. Factory install shim still works.

Change-Id: Ia432e3b1a6186f4f7c817a1283c86066ced5fef1
Reviewed-on: https://gerrit.chromium.org/gerrit/23193
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-05-23 17:49:46 -07:00
Brian Harring
7f175a59e1 common.sh: output a backtrace and debug information on failure.
Currently, if set -e spots a nonzero exit we basically have
no real debug information- it just stops immediately without stating
where or why.  This forces our scripts to be stupidly verbose so
we can track roughly where they were, thus when they fail we can
use that information to localize the rough exit point.

Instead we should be traping that set -e induced exit and
outputing necessary debug information to run it down.  This includes
outputing the relevant stack trace, or at least what we can get of
it.

The 'die' function is now enhanced to automatically dump the trace
that lead to it.  For most consumers this is desired- however for
commandline parsing induced dies ("--board is missing" for example),
the trace is noise.  For those cases, a 'die_notrace' function was
added that retains the original non-backtrace behaviour.

Example output via instrumenting cros_generate_breakpad_symbols
w/ the failing command '/bin/false' (nonzero exit code).

Before:
./cros_generate_breakpad_symbols  monkeys --board=x86-alex
<no output at all, just exit code 1>

With this CL:
./cros_generate_breakpad_symbols  monkeys --board=x86-alex
ERROR   : script called: ./cros_generate_breakpad_symbols 'monkeys' '--board=x86-alex'
ERROR   : Backtrace:  (most recent call is last)
ERROR   :   file cros_generate_breakpad_symbols, line 207, called: main 'monkeys' '--board=x86-alex'
ERROR   :   file cros_generate_breakpad_symbols, line 163, called: die_err_trap '/bin/false' '1'
ERROR   :
ERROR   : Command failed:
ERROR   :   Command '/bin/false' exited with nonzero code: 1

BUG=chromium-os:30598
TEST=inject a failing command into a script, verify the output.
TEST=inject a 'command not found', verify the output
TEST=cbuildbot x86-generic-full --remote
TEST=cbuildbot arm-tegra2-full --remote
TEST=cbuildbot chromiumos-sdk --remote

Change-Id: I517ffde4d1bb7e2310a74f5a6455b53ba2dea86c
Reviewed-on: https://gerrit.chromium.org/gerrit/17225
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
2012-05-07 17:19:41 -07:00
Peter Mayo
82975f96c5 Add root growth option.
This allows us to specify a boost size where we know we are growing Chrome,
but don't know what the default sizes are, nor whether we are overriding them
elsewise.

BUG=chromium-os:29829
TEST=try(lumpy-chrome-pfq,lumpy-canary)

Change-Id: I3b7c927874fdfedace027e7a2398d9e97a9d3527
Reviewed-on: https://gerrit.chromium.org/gerrit/21519
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Peter Mayo <petermayo@chromium.org>
Tested-by: Peter Mayo <petermayo@chromium.org>
2012-05-07 12:16:13 -07:00
Chris Sosa
dbc853b2bf Add an advanced option to build_image so that a caller can specify the version.
This change adds the ability for a caller to pass a specific version name
to build_image rather than rely on parsing of chromeos_version.sh + attempt
number.

BUG=chromium-os:29077
TEST=Ran build_image w/ w/out option

Change-Id: I69b76ae4bfc148325686902606476a0aae293e56
Reviewed-on: https://gerrit.chromium.org/gerrit/19861
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-04-10 13:06:46 -07:00
Brian Harring
aa13ea4658 Shift crosutils scripts to use the common.sh they were written against.
Rather than trying to use an old/stale common.sh, use the common.sh
from the invocation point- if invoked via /usr/lib/crosutils, use that
common.sh.  If invoked via src/scripts/, use that, etc.

Trying to intermix it just introduces potential for bugs and invalidly
freezes common.sh api, thus the efforts to revert this and ultimately
revert the existing of a crosutils ebuild.

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

Change-Id: I4c6c5fbade3d28c71752bd4c44dccad49af52ec0
Reviewed-on: https://gerrit.chromium.org/gerrit/18303
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-03-15 23:35:06 -07:00
David James
dee866c121 Remove --build_root from all scripts except mod_image_for_pyauto.sh.
For all scripts, --build_root defaults to /build and is never used. To
remove option clutter, I've deleted this option.

The only script which still references build_root in src/scripts is
mod_image_for_pyauto.sh, which seems to support it for grabbing pyauto
dependencies from a location other than /build/*. This might conceivably
be useful, so I haven't touched that script.

BUG=chromium-os:27364
TEST=Remote trybot run. git grep for references to build_root.

Change-Id: I502f7df0123a598fc62a4ef4ed847ceb182f65b8
Reviewed-on: https://gerrit.chromium.org/gerrit/18283
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
2012-03-15 18:55:26 -07:00
David James
855afb7561 Clean up options to build scripts.
1. Remove options that are already deprecated:
   --chromefromsource --chromebuild --chromebase
   --crosbug12352_arm_kernel_signing
2. Remove the --retries option and associated function eretry.
3. Move seldomly used options out of --help to avoid confusing
   developers. Developers who need these options can read the
   source.
4. Alphabetize all options.
5. Add description of each script to --help.

BUG=chromium-os:27364
TEST=Run --help with each script. Full canary trybot run.

Change-Id: I95675b069781f7e950d75d32dbad744adce6b830
Reviewed-on: https://gerrit.chromium.org/gerrit/18194
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
2012-03-15 15:54:43 -07:00
Chris Sosa
e9e2d66366 Remove --nofast --nostatefuldev from build_image as they are never used.
BUG=chromium-os:27362
TEST=Built a test image.

Change-Id: I884acd534f06d9070b28d5cd74862e2774822578
Reviewed-on: https://gerrit.chromium.org/gerrit/17759
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-03-12 10:55:51 -07:00
Chris Sosa
c9422fa467 Deprecate --test, --withdev, --factory, --factory_install from build_image.
Using these flags directly was deprecated a while back and is causing confusion
which way is the right way.  This CL removes all these FLAGS from build_image
(though keeps support of them in mod_image_for_test/image_to_usb invocations
in common.sh).  In this change I've also defaulted build_image to build the
developer image (and only the developer image).

BUG=chromium-os:27362
TEST=Been busy testing.  Have built the following combinations and verified them:

build_image base
build_image
build_image base dev test
build_image dev
build_image dev factory_test
build_image factory_install

Change-Id: Ie534c276a9ec571926964320ac176daa91b12a81
Reviewed-on: https://gerrit.chromium.org/gerrit/17386
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-03-09 12:41:50 -08:00
Hung-Te Lin
7119cb1499 build_image: Enable initramfs for factory install shims on amd64.
On both x86 and x64(amd64) platforms, we should enable initramfs for
factory install shim so that partner can remove shim.

BUG=chrome-os-partner:8376
TEST=./build_image --board lXXk --factory_install # pass, bootable with initramfs

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

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

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

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

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

Change-Id: I82b4505c74cd31e718aaff4a319d50b69b2c852c
Reviewed-on: https://gerrit.chromium.org/gerrit/14473
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2012-01-20 17:54:11 -08:00
Chris Sosa
93e7b78eea Fix bug with building on the base image with build_image base.
This comes from not correctly negating all FLAGS and also the weird
way we set PRISTINE_IMAGE_NAME.  Addressed in both cases and
simplified FLAGS_* logic in build_image_util.sh

BUG=chromium-os:24627
TEST=build_image base so far.

Change-Id: I92e8550db3ea713cda1f997b702777035145d8d5
Reviewed-on: https://gerrit.chromium.org/gerrit/13636
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2012-01-05 11:55:43 -08:00
Anush Elangovan
d39f1de7e5 Increase factory shim rootfs to 320MB to accomodate larger 64bit binaries
I will attempt to shrink this rootfs size back to the original size.

BUG=chromium-os:22932
TEST=./build_image --board=amd64-corei7 --noenable_rootfs_verification --symlink=factory_shim factory_install

Change-Id: I3bf571c569330480293f35ec3390c9ab6b76f4e2
Reviewed-on: https://gerrit.chromium.org/gerrit/11637
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Anush Elangovan <anush@chromium.org>
Commit-Ready: Anush Elangovan <anush@chromium.org>
2011-11-14 15:02:53 -08:00
Chris Sosa
4299eb9d52 Fix bug where we may modify FLAGS_factory_install after we source base_image_util.sh
This also simplifies the factory_install logic to all be in the same place :).

BUG=chromium-os:22371
TEST=Ran trybot with this CL + tegra2 build that used make_netboot.sh that uses
the factory install which failed on the buildbot previously.

Change-Id: Id0847b85c061cf230d0e6cc5bb40de2eba0992b9
Reviewed-on: https://gerrit.chromium.org/gerrit/10986
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2011-11-02 13:45:50 -07:00
Chris Sosa
ef4a6452d4 Add Shflags usage for build_image.
BUG=chromium-os:22048
TEST=Ran build_image -h

Change-Id: If495d1784b9ba4491ca55537bf0b81395e88ee3c
Reviewed-on: https://gerrit.chromium.org/gerrit/10822
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-10-28 11:39:47 -07:00
Chris Sosa
131eaf5667 Fix message funcs to use $@ and fix callers to use it correctly.
Fixed all callers in my big CL to no longer have to wrap poorly using
\ and start from the beginning of the next line but rather pass in
an array of args i.e.

info "tacos" " are" " delicious".

BUG=None
TEST=Ran to see the errors in parse_build_image and manual eyeing.

Change-Id: I5eac8a5ae7a8d314dbc4e821ee33cf88213711d0
Reviewed-on: https://gerrit.chromium.org/gerrit/10823
Commit-Ready: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-10-28 11:08:58 -07:00
Chris Sosa
b0f5732449 Add ability to pass in specific images you want built rather than use flags.
This CL does two things.

First it introduces an argument interface that works with all the following
combinations:

factory_install | [base|dev[test|factory_test]] rather than use --test etc.

This does not build extra images.  If you just want a test image you can
run build_image --board=<board> test and all that's in your latest_dir is
chromiumos_test_image.bin.

Second, we only build what we ask and only finalize what we ask so on
an invocation of build_image test we only actually run cros_make_image_bootable
once saving 2 minutes on my machine (from 6:50->4:50 on multiple iterations).

BUG=chromium-os:22048
TEST=build_image test, all possible combinations of args through to start of
build.  Built factory_install using new and old methods and dev test with both
methods.  Also verified mod_image_for_test still works as advertises stand-alone.

Change-Id: I9fe2feb50a941c007214decd9ba1627012c050af
Reviewed-on: https://gerrit.chromium.org/gerrit/10621
Commit-Ready: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-10-27 16:33:07 -07:00
Jon Salz
67145df2a4 Add cros_factory_install kernel command-line argument when running
the factory install shim.

BUG=chrome-os-partner:6535
TEST=Ran factory install shim on Alex and in VM

Change-Id: I32761736d8565d16323c6962058b478511a3ee8c
Reviewed-on: http://gerrit.chromium.org/gerrit/10398
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Jon Salz <jsalz@chromium.org>
Commit-Ready: Jon Salz <jsalz@chromium.org>
2011-10-25 08:12:32 -07:00
Elly Jones
9ca3e4c0fe mod_image_for_recovery: reuse salt.
This will prevent the recovery kernel from having a different salt from the
rootfs it corresponds to.

BUG=chromium-os:20766
TESTED_ON=kaen
TEST=Adhoc
Build a recovery image and do recovery from it.

Change-Id: I96f735e527d807247e09e17aac1ed5b51367f0ef
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/8288
2011-09-28 10:50:10 -07:00
J. Richard Barnette
8e48095cb3 Delete some unused options from build_image and mod_image_for_recovery.sh
BUG=None
TEST=run both scripts, boot the images

Change-Id: I7209421d3b438d6daf37f210d5e73c0b9f91eb1d
Reviewed-on: http://gerrit.chromium.org/gerrit/6941
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
2011-09-01 09:18:26 -07:00
Hung-Te Lin
f7f8cd871f build_image: fix --factory output file name
BUG=chromium-os:19868
TEST=build_image --factory # see output as chromiumos_factory_image.bin
     build_image --test # see output as chromiumos_test_image.bin

Change-Id: Ice1aa576cfe297db0900e6c42de8d362aa94729a
Reviewed-on: http://gerrit.chromium.org/gerrit/6993
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-31 08:53:44 -07:00
J. Richard Barnette
a308b39eae Share commonality between build_image and mod_image_for_test.sh
BUG=None
TEST=run the commands in various combinations.

Change-Id: I94fb167d8312a90818910085adebfb1d0396cdbe
Reviewed-on: http://gerrit.chromium.org/gerrit/6866
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-30 15:40:51 -07:00
J. Richard Barnette
5f9dbe46a6 Create a function library for mounting/unmounting images.
The functions are shared between build_image and mod_image_for_test.sh.

BUG=None
TEST=build_image

Change-Id: Ib6d860a6818abee380dde97460f57943cc0a070c
Reviewed-on: http://gerrit.chromium.org/gerrit/6444
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-23 13:39:03 -07:00
J. Richard Barnette
aaef76166f Convert build_library/test_image to a shell library.
Renamed the fuction from "test_image" to "test_image_content";
renamed the source file to match.

BUG=None
TEST=build both x86 and arm images

Change-Id: I158f2c5bc0f2fc260d48bd125a1899e6a21d7b79
Reviewed-on: http://gerrit.chromium.org/gerrit/5821
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-15 14:23:10 -07:00
David James
b01cc8d2d3 Remove unnecessary sync calls from build_image and image_to_vm.sh.
Calling sync in build scripts pauses the build unnecessarily, particularly
when other steps are running in parallel.

BUG=chromium-os:19150
TEST=Run cbuildbot release build and watch faster performance.

Change-Id: Ia2469e3be68fdd38474ab4e6f67b06339c04822f
Reviewed-on: http://gerrit.chromium.org/gerrit/5966
Reviewed-by: Thieu Le <thieule@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: <taysom@google.com>
Tested-by: David James <davidjames@chromium.org>
2011-08-15 10:07:09 -07:00
David James
27d00f3c9e Update build_image to not use -uDN for developer packages.
The main benefit of this change is that it is no longer necessary to specify
custom use flags to build_image because it just merges what you already have
installed in your buildroot. It does not second guess the packages you already
have installed and just installs them, as it should.

1. Packages in the developer image should already be up to date, so there
   is no need to specify '-u' for --update or '-D' for --deep.
2. The developer image should have identical use flags to the base image,
   so there is no need to specify -N for '--newuse'.
3. The --verbose flag is generally useful, so I've updated all emerges to
   use them so you can see what the use flags are used for the emerges.

BUG=chromium-os:19078
TEST=Verify build_image builds same image and installs same packages
     with and without change. Verified specifying USE= is not necessary
     if a few dev packages were customized.

Change-Id: I4c205c961cca84ca3161b49f59cdd37a5a4ed5b1
Reviewed-on: http://gerrit.chromium.org/gerrit/5816
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-08-12 10:43:08 -07:00
David James
4dd4c54ccb Fix race condition by using different symlinks for factory images.
Both the tests and archive_build read and write the latest symlink.
This CL fixes a race condition in archive_build by moving away from
using the latest symlink in archive_build.

BUG=chromium-os:18967
TEST=Run release cbuildbot archive_build on x86-mario-release.
     Verify it completes successfully and that latest symlink
     is unchanged now.

Change-Id: Ia32d20903f3ef74e360944fbabdd9834c0edb99a
Reviewed-on: http://gerrit.chromium.org/gerrit/5746
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-08-11 12:44:02 -07:00
J. Richard Barnette
e4e3decfc0 Extract some common code for sharing with build_image, et al.
BUG=None
TEST=build regular, test, and recovery images

Change-Id: I2d7d073c27d14fb88be6a63953dcc77fc76a0807
Reviewed-on: http://gerrit.chromium.org/gerrit/5512
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2011-08-11 09:51:31 -07:00
Elly Jones
377939c760 build_image: keep quiet about the autotest file list
This one rsync command is responsible for over 50% of the length of a typical
buildbot log file.

BUG=chromium-os:18830
TEST=Adhoc
Build a test image, both with build_image and mod_image_for_test.sh.

Change-Id: I8d35b605b0d3f1d0c97698bad815ed3dab36cba0
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5460
2011-08-08 08:09:24 -07:00
J. Richard Barnette
46657a3d09 Delete support for build_image --preserve
A survey of users on chromium-os-dev@chromium.org found no-one uses
the option.  Furthermore, the option was meant merely for
performance improvements, but parallel emerge is more effective for
that purpose.

BUG=None
TEST=build and boot image

Change-Id: I42ab4a9cb5d70f1181915e957a5cc9fc4e3dbed7
Reviewed-on: http://gerrit.chromium.org/gerrit/5356
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-05 13:45:06 -07:00
David James
0ea96e4fd6 Install recovery kernel directly to image, not to build dir.
The recovery kernel is different from the regular kernel, and
should be kept sandboxed so that it does not mess with our
build directory.

We also need to give the recovery kernel a different PKGDIR so
that it does not overwrite our prebuilts for the ordinary
kernel.

BUG=chromium-os:18691
TEST=build_image --factory_install, mod_image_for_recovery.sh

Change-Id: I678a94305d5f30bc2c95bf4e53cfe81b2ae9d8ef
Reviewed-on: http://gerrit.chromium.org/gerrit/5305
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-08-05 12:33:15 -07:00
J. Richard Barnette
9fb286ea02 Skip filling in kernel partition until cros_make_image_bootable
When first creating an image, vmlinuz was extracted from /boot, and
installed in its place in the kernel partition.  However, none of
that was necessary, because cros_make_image_bootable walks over the
same ground later in the build process.

BUG=chromium-os:17390
TEST=build_image, boot base and dev images on ZGB and legacy device
TEST=inspect build output directory, to confirm no stray artifacts

Change-Id: Iaf332b6603e0bcb17585adbc95a7b65bb8bfe790
Reviewed-on: http://gerrit.chromium.org/gerrit/5107
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
2011-08-01 16:09:00 -07:00
Richard Barnette
c6818be0da Revert "Skip filling in kernel partition until cros_make_image_bootable"
This reverts commit a966c2bad686f787268f01a7529851a1a2a6ad9b

Change-Id: I0990252c34853f7e1884da19b2649ed32e52e078
Reviewed-on: http://gerrit.chromium.org/gerrit/5091
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-01 13:53:34 -07:00
J. Richard Barnette
77ec32a128 Skip filling in kernel partition until cros_make_image_bootable
When first creating an image, vmlinuz was extracted from /boot, and
installed in its place in the kernel partition.  However, none of
that was necessary, because cros_make_image_bootable walks over the
same ground later in the build process.

BUG=chromium-os:17390
TEST=build_image, boot base and dev images on ZGB and legacy device
TEST=inspect build output directory, to confirm no stray artifacts

Change-Id: Icd4902f5a823241f24eb64f68f80c8e5e5198341
Reviewed-on: http://gerrit.chromium.org/gerrit/4928
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-01 11:41:17 -07:00
J. Richard Barnette
bb783007ce Delete dead code in build_image relating to ESP_LOOP_DEV
BUG=None
TEST=build_image

Change-Id: I10aba40538e9c6aeaf803ffc50bb029dcf6d4be5
Reviewed-on: http://gerrit.chromium.org/gerrit/5009
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-07-29 11:55:04 -07:00
J. Richard Barnette
0fad3d7171 Make build_gpt.sh into a shell function library.
Converted build_library/build_gpt.sh from a shell script to a shell
library defining a function to replace the script.

Converted build_library/emit_gpt_scripts.sh into a shell function
that is defined in build_library/build_gpt.sh.

BUG=chromium-os:17390
TEST=build_image
TEST=inspect and run pack_ and unpack_partitions.sh on new image

Change-Id: Ifdcb58f492f871e120cbec9c67bdeab94d1a4d3f
Reviewed-on: http://gerrit.chromium.org/gerrit/4866
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-07-28 08:11:28 -07:00
J. Richard Barnette
f2206118f3 Isolate scripts and files that are used only in build_image
A modest number of different scripts and files have a usage
restricted to build_image.  Move those files to build_library,
to prevent them accumulating unwanted clients.

BUG=chromium-os:17390
TEST=build_image
TEST=grep relevant sources for references to all the files

Change-Id: I3e9f6447ec34c09ea2d61f29ac343386a1e122b9
Reviewed-on: http://gerrit.chromium.org/gerrit/4762
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-07-27 08:46:01 -07:00
Che-Liang Chiou
611d5b7b0a Add a dummy flag to fix buildbot failure
BUG=chrome-os-partner:5177
TEST=./build_image -h | grep crosbug12352_arm_kernel_signing

Change-Id: Id61889f4e16ed7e4e774c00c3cb886811c5ccfd7
Reviewed-on: http://gerrit.chromium.org/gerrit/4805
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-07-27 01:05:37 -07:00
Che-Liang Chiou
e51bdf284c Obsolete --crosbug12352_arm_kernel_signing flag
This reverts commit 451f36e4a8.

Last time I removed the --crosbug12352_arm_kernel_signing flag, buildbot
failed. The reason seemed to be that buildbot still passing this flag to
build_image. However, I cannot find anywhere in the log that indicates
buildbot did pass this flag to build_image. So I think the last failure
should be transient and it is good to obsolete this flag.

BUG=chromium-os:12352
TEST=build_image
TEST=load_kernel_test -b 2 /path/to/image /path/to/recovery_key.vbpubk

Change-Id: Ic757eb2dc4304e7205b483063335f8816b536433
Reviewed-on: http://gerrit.chromium.org/gerrit/4794
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-07-26 21:40:13 -07:00
J. Richard Barnette
5b80a0b22c Incorporate the contents of create_esp.sh inline in build_image
Stripped of its boilerplate, create_esp.sh was a one-line
script called from only one place in the source.  Replace the
script with the one command it represented.

BUG=chromium-os:17390
TEST=build_image
TEST=grep all relevant sources for "create_esp"

Change-Id: Iaa4be285066b524ff169f5185c455e2566177648
Reviewed-on: http://gerrit.chromium.org/gerrit/4756
Reviewed-by: Will Drewry <wad@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-07-26 16:16:47 -07:00
J. Richard Barnette
8447777820 Simplify standard boilerplate for selected scripts
This shortens the standard boilerplate for finding and sourcing
shell function libraries for build_image, mod_image_for_test.sh and
mod_image_for_recovery.sh.

As a side effect of the change, both mod_image_for_test.sh and
mod_image_for_recovery.sh will now restart inside the chroot if
invoked from outside; this is consistent with the pre-existing
behavior of build_image.

BUG=None
TEST=run the three scripts, from both inside and outside the chroot

Change-Id: Idd91cbee323346a871b49deea31a76875f5ee3c4
Reviewed-on: http://gerrit.chromium.org/gerrit/4675
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
2011-07-26 14:05:43 -07:00
David James
8b9643f7d8 Fix losetup race condition.
The following pattern creates a race condition:

   LOOP_DEV=$(sudo losetup -f)
   ...
   sudo losetup "${LOOP_DEV}" "${ROOT_FS_IMG}"

If two steps similar to the above run in parallel, and both steps pick up
the same free loop device, they may try to mount different images with the
same loop device and one of the two stages will get a "device is busy" error.

To fix this, we should switch to the following pattern:
   LOOP_DEV=$(sudo losetup --show -f "${ROOT_FS_IMG}")

This CL implements the above.`

BUG=chromium-os:18046
TEST=Run buildbot run. Test case where we run out of loop devices and verify
     logic still works.

Change-Id: Ie457701fda61e5fc3b9112c1bfef9fb9713ea265
Reviewed-on: http://gerrit.chromium.org/gerrit/4555
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
2011-07-22 00:02:53 -07:00
Che-Liang Chiou
451f36e4a8 Revert "obsolete --crosbug12352_arm_kernel_signing flag"
This reverts commit 2d2e825247.

Change-Id: I62d68c063aeab6beca4393ed51a4e754c8d9cc6a
Reviewed-on: http://gerrit.chromium.org/gerrit/4487
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-07-21 04:54:47 -07:00
Che-Liang Chiou
2d2e825247 obsolete --crosbug12352_arm_kernel_signing flag
BUG=chromium-os:12352
TEST=manual

./build_image --board {tegra2_seaboard,x86-mario}
load_kernel_test -b 2 /path/to/chromiumos_image.bin \
  /usr/share/vboot/devkeys/recovery_key.vbpubk

Change-Id: Ide2b641842ce08ec5540c5195356821afaf7d048
Reviewed-on: http://gerrit.chromium.org/gerrit/2864
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-07-21 03:02:30 -07:00
Arkaitz Ruiz Alvarez
2bf8859cf8 Fix test images kernel commandline arguments
By default, "cros_debug" should be included in the kernel commandline for
developer images. This change adds "cros_debug" to the kernel commandline
for test images, which are based on developer images but overwrite the boot
arguments.

TEST=Build test image, install on machine and grep "cros_debug" /proc/cmdline
BUG=chromium-os:17393

Change-Id: Ie0de11baf60a3a69a7fef0639247e2edae455ffb
Reviewed-on: http://gerrit.chromium.org/gerrit/3790
Tested-by: Arkaitz Ruiz Alvarez <arkaitzr@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
2011-07-08 12:19:20 -07:00
Ahmad Sharif
8c86db51d7 Changed build_image to use toolchain_utils.sh to install gcc libs.
BUG=none
TEST=buildbot.py arm-generic-full
buildbot.py x86-generic-full

Change-Id: I6cdc22d50422afb721ce0d743c8a80398719f9b4
Reviewed-on: http://gerrit.chromium.org/gerrit/3556
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: asharif <asharif@chromium.org>
Tested-by: asharif <asharif@chromium.org>
2011-07-07 18:39:08 -07:00
Paul Taysom
0737a550b9 Clean-up of extlinux and dd preparing for ext4
BUG=chromium-os:14756
TEST=ran it on cr48 and Latitiude 13

Change-Id: I3c46337f0e4741786ec980100cdebc24fdc02ef9
Reviewed-on: http://gerrit.chromium.org/gerrit/3093
Reviewed-by: Paul Taysom <taysom@google.com>
Tested-by: Paul Taysom <taysom@google.com>
2011-07-06 09:28:16 -07:00
David Rochberg
cf93237b86 Port standard_backdoor to build_image --test
BUG=chromium-os:11744
TEST=Built test images with and without the standard backdoor.
   Could log in with it.
   Could not without.

Change-Id: I23fa55cbb1287f9385b0589b04f4c006903b9eef
Reviewed-on: http://gerrit.chromium.org/gerrit/3530
Tested-by: David Rochberg <rochberg@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
2011-06-30 19:19:11 -07:00
Hung-Te Lin
54a83b774c mod_for_factory: remove 500populateQualDbs
The '500populateQualDbs' script is now deprecated by the new chromeos-hwid
ebuild package.

HWQual database are merged into images automatically, no more need for
post-processing.

QUALDB and --qualdb are also removed, with typo in comments fixed.

BUG=chrome-os-partner:4276
TEST=./build_image --factory

Change-Id: I76d9a72943567444e26200fccc6fe5dff95b2687
Reviewed-on: http://gerrit.chromium.org/gerrit/3431
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-06-30 19:04:38 -07:00
Ahmad Sharif
150b11985a Revert "Changed build_image to use toolchain_utils.sh to install gcc libs."
This reverts commit f51b39a0e3.

Change-Id: I0b05abd75765e146e3413f15ef1ee0c3f5f8b348
Reviewed-on: http://gerrit.chromium.org/gerrit/3514
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: asharif <asharif@chromium.org>
Reviewed-by: asharif <asharif@chromium.org>
2011-06-30 16:07:37 -07:00
Ahmad Sharif
f51b39a0e3 Changed build_image to use toolchain_utils.sh to install gcc libs.
toolchain_utils.sh contains the relevant function to switch cross-gcc's
and copy over the libraries.

BUG=none
TEST=./setup_board --board=x86-mario --nousepkg &&
./build_packages --board=x86-mario &&
./build_image --board=x86-mario &&
./mod_image_for_vm.sh --board=x86-mario &&
tested image on vm.
Also ran:
cbuildbot.py --buildroot=checkout --resume --noarchive --nosync
--nouprev --noprebuilts x86-generic-full and it passed.

Change-Id: Ic38752eaadbf4f033a9ec7ee288a560f24a6c0b2
Reviewed-on: http://gerrit.chromium.org/gerrit/3212
Reviewed-by: asharif <asharif@chromium.org>
Tested-by: asharif <asharif@chromium.org>
2011-06-30 14:38:12 -07:00
Arkaitz Ruiz Alvarez
26d68ecaa5 Add cros_debug to kernel commandline in dev images
Every developer image (and test images based on the developer image) should
include "cros_debug" in the kernel commandline. This flag is used by the
crossystem application to determine if the image being run is a developer
image. cros_make_image_bootable receives a new flag, --force_developer_mode
that appends "cros_debug" to the boot args.

BUG=chromium-os:16951
TEST=build images. Flash a base image and confirm the absence of "cros_debug"
in /proc/cmdline. Flash the developer image and confirm the existence of the
string.

Change-Id: I9f748638b5dac384be991908239e8b447ddf3b5e
Reviewed-on: http://gerrit.chromium.org/gerrit/3169
Tested-by: Arkaitz Ruiz Alvarez <arkaitzr@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
2011-06-27 10:45:16 -07:00
Raymes Khoury
61e2bff39e Made libc debug symbols get copied to image when building a dev image.
libc debug symbols (libpthread in particular) are needed to debug threaded software with gdb. This CL copies
debug symbols for glibc when building a dev image.

This CL also removes an old hack related to selecting the correct path to the glibc tarball.

BUG=chromium-os:16847
TEST=Build dev image (--withdev is the default). Checked that debug info is copied. Booted image and checked
the debugging threaded programs works with gdb. Build non-dev image (--nowithdev) checked that debug info is
not copied.

Change-Id: Id908e8260b1431ed1256a13dfb86b05ac242f263
Reviewed-on: http://gerrit.chromium.org/gerrit/3091
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Raymes Khoury <raymes@chromium.org>
2011-06-24 12:53:54 -07:00
Vince Laviano
6aebf31a00 build_image: incorporate mod_image_for_test
Incorporate mod_image_for_test.sh into build_image to simplify the user
interface to the build system and to remove the redundant setup that
occurs in both scripts.

We're not porting the --force_copy, --inplace, or --yes flags, because
the user is no longer passing in an existing image as input.

BUG=chromium-os:12899
TEST=Run build_image w/ various flag combos, inspect output dir, and
  boot resulting images. Flags tested include: none, --test, --factory,
  --factory_install, --factory_install --test.

Change-Id: Ie3b504b3c58fbe19f1ce351985e5f1043353766a
Reviewed-on: http://gerrit.chromium.org/gerrit/2421
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: Anush Elangovan <anush@chromium.org>
2011-06-16 11:27:35 -07:00
Rong Chang
c291a48995 Add "blkdevram" USE flag when building ARM factory install kernel
Default netroot factory install kernel mounts rootfs in ram. The
USE flag "blkdevram" was implemented in
  http://gerrit.chromium.org/gerrit/#change,1802

BUG=None
TEST=Build factory install kernel and rootfs uimg. Kernel should
be able to mount the in-ram initrd downloaded from tftp.

Change-Id: Idb83375e0587432c5dec87357a8aa8e229f40af2
Reviewed-on: http://gerrit.chromium.org/gerrit/1803
Reviewed-by: Rong Chang <rongchang@chromium.org>
Tested-by: Rong Chang <rongchang@chromium.org>
2011-06-03 00:30:15 -07:00
Nick Sanders
b795deba76 Cherry-pick: ARM: enable kernel signing by default
This commit is a part of transition to enable ARM kernel signing. It is
at first an option that is enabled manually, and then (in this commit)
enabled by default. After more tests, the scripts that generate unsigned
ARM kernel partition will probably be removed.

BUG=chromium-os:12352
TEST=./build_image && load_kernel_test -b 2 /path/to/chromiumos_image.bin /usr/share/vboot/devkeys/recovery_key.vbpubk

Change-Id: I7d4ecc566f9c5cc0106a7af59255fc63fdfe017a
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/1319
Tested-by: Nick Sanders <nsanders@chromium.org>
2011-05-25 02:56:21 -07:00
David James
72759e8c1e Update build_image to use ldd distributed with target if it's present.
BUG=chromium-os:13977
TEST=Build an image with new compiler, boot image and verify new ldd is used.
     Build image with old compiler and verify old ldd is used.

Change-Id: I8cbc5b87342245106f0a8fd0fa80ae42329eff60
Reviewed-on: http://gerrit.chromium.org/gerrit/1367
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
2011-05-23 11:16:03 -07:00
David James
35269d23f8 Run eclean before checking blacklist to ensure correct blacklist check.
As reported in Bug 15561, build_image sometimes reports incorrect blacklist
packages if it reports an error about a package that is not actually installed.

For example, if you install =dev-libs/glib-2.28.6, and then replace it with
=dev-libs/glib-2.26.1-r1, build_image will report a blacklist failure because
glib depends on Python. But that's wrong -- it's looking at the wrong package.

BUG=chromium-os:15561
TEST=Test that build_image does not report an error when the package it's
     complaining about is not installed anymore.

Change-Id: I86b25684d0e211fd144231c7a34276ecf5607ad7
Reviewed-on: http://gerrit.chromium.org/gerrit/1227
Reviewed-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-05-20 12:12:30 -07:00
Stéphane Marchesin
2d331404a0 Add 64bit support to the build scripts.
Change-Id: Ibbc743981b4d1d2dd4e1ceb586f2f0a092559a27
Reviewed-on: http://gerrit.chromium.org/gerrit/1098
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Anush Elangovan <anush@chromium.org>
2011-05-18 10:07:46 -07:00
Tom Wai-Hong Tam
a4395b5b1c Revert "ARM: enable kernel signing by default"
This reverts commit 9c5d88573f.

Change-Id: Ica876e1be20dc9ab60666af476294e093fd59498
Reviewed-on: http://gerrit.chromium.org/gerrit/762
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
2011-05-12 12:39:53 -07:00
David James
f86703dd5d Move libcros check from chromeos-chrome into test_build_root.
This is needed for eliminating the dependency between chromeos-chrome and libcros.
This also has the benefit that builds will fail if you take a binary version of
chromeos-chrome with an incompatible version of libcros.

BUG=chromium-os:15145, chromium-os:15148
TEST=build_packages --nousepkg && build_image.
     Test that test_image fails when libcros version is wrong.

Change-Id: I46cbc4494d36b13ba1bdda699eccb6dc7fea162c
Reviewed-on: http://gerrit.chromium.org/gerrit/633
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-05-10 15:05:12 -07:00
Che-Liang Chiou
9c5d88573f ARM: enable kernel signing by default
This commit is a part of transition to enable ARM kernel signing. It is
at first an option that is enabled manually, and then (in this commit)
enabled by default. After more tests, the scripts that generate unsigned
ARM kernel partition will probably be removed.

BUG=chromium-os:12352
TEST=./build_image && load_kernel_test -b 2 /path/to/chromiumos_image.bin /usr/share/vboot/devkeys/recovery_key.vbpubk

Change-Id: I6d48d1603cd7c96514892bcbbf8994b2d4cc2a08
Reviewed-on: http://gerrit.chromium.org/gerrit/512
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2011-05-09 03:13:56 -07:00
Darin Petkov
61173f6bd1 Cleanup set_shared_user_password related transitional code.
BUG=none
TEST=set_shared_user_passwd, build_image, checked password

Change-Id: Ida251e36f32d6cb116425d475882c5cee601b9f6

Review URL: http://codereview.chromium.org/6904093
2011-04-29 10:24:26 -07:00
J. Richard Barnette
b290366b6e Fix build_image --factory_install to work again.
There were two bugs:
 1) The test [ ${ARCH} -eq "arm" ] was wrong because -eq is a
    numeric comparison operator, not legal on strings.
 2) Variable ${ARCH} was used before set.

The code change includes comment changes to clarify the reasons for
the code, and a future-proofing logic change.

Change-Id: I63f502cc33cf8a9a441b4b305fc49ed57d0a55b1

BUG=None
TEST=build_image --factory_install, and boot the resulting image

Review URL: http://codereview.chromium.org/6905119
2011-04-28 17:14:34 -07:00
Mandeep Singh Baines
118692ab3f src/scripts: remove all references to verity_depth
This option is now deprecated. Remove from all scripts

To understand the impact of this change ran the following searches:

http://codesearch.google.com/codesearch?as_q=package%3Achromiumos+verity_depth
http://codesearch.google.com/codesearch?hl=en&lr=&q=package%3Achromiumos+verity_tree_depth

BUG=chromium-os:14357
TEST=Ran build_image, mod_image_for_test.sh, chromeos-install, and mod_image_for_recovery.sh.

Change-Id: I79e0e5fe1c917fbb54cc7c7f152d3c97d5f5c9b5

R=wad@chromium.org,scottz@chromium.org,gauravsh@chromium.org

Review URL: http://codereview.chromium.org/6901005
2011-04-28 13:50:33 -07:00
Tom Wai-Hong Tam
a6af201ff8 Use initramfs on x86 but not on arm for factory install image.
On x86, booting factory install shim on SD card needs to have the kernel
initrmafs enabled. But on ARM, booting factory install image on network does
not needs initramfs.

TEST=build_image --factory_install
BUG=chromium-os:13211

Change-Id: Id008a3bfaf4f17772e04f02d18844dd09b33fbe1

R=rongchang@chromium.org

Review URL: http://codereview.chromium.org/6901047
2011-04-28 12:12:08 +08:00
Tom Wai-Hong Tam
1f6a0ba388 Enable fbconsole in recovery and factory shims
This CL depends on http://codereview.chromium.org/6765018 which adds fbconsole
USE flag.

Change-Id: I159680e2cd53b6493545f6c0b1caaa8a7e833cb3

BUG=chromium-os:13607
TEST=run mod_image_for_recovery.sh and boot to recovery image to see messages
showed on framebuffer console.

Review URL: http://codereview.chromium.org/6814041
2011-04-26 18:09:16 +08:00
J. Richard Barnette
eb5246f8d9 Standardize invocations of emerge in build_image.
Also includes a style nit fix:  don't quote arguments to numeric
comparison test operators.

BUG=chromium-os:13582
TEST=setup_board --force && build_packages && build_image; boot the result

Review URL: http://codereview.chromium.org/6801027

Change-Id: I689ca9697a05cf93a789fde1242fb2fa50f21612
2011-04-08 10:34:31 -07:00
Mandeep Singh Baines
de162521ed build_image: hard-code verity_depth to 0
Plan is to eventually deprecate depth as a configurable parameter.
depth=0 means compute the depth based on a regular trie with a
single block of hashes at the root node.

BUG=chromium-os:9752
TEST=platform_DMVerity

Change-Id: I5c5f1b1f2c2079d7e1ef6c7a55c859b463a59aee

R=wad@chromium.org,taysom@chromium.org,ups@chromium.org,gauravsh@chromium.org,jimherbert@chromium.org

Review URL: http://codereview.chromium.org/6810006
2011-04-07 10:12:08 -07:00
Zdenek Behan
b3cf233d4c build_image: provide USE flags when installing chromeos-dev
This fixes an issue where passing USE= to build_packages would always
cause build_image to fail.

BUG=none
TEST=create a USE-inconsistent package, run build_image, observe it working

Change-Id: Id9eb3891d9c292423c837a0d097a33155f03b794

R=davidjames@chromium.org,kliegs@chromium.org

Review URL: http://codereview.chromium.org/6677163
2011-04-05 23:20:16 +02:00
Mandeep Singh Baines
63ca269c69 build_image: set verity_depth default to 3
This is in preparation for moving to a level 0 count of 1.

Seems to give about 200ms boot speedup.

Before(verity_depth = 1):

  seconds_power_on_to_login                                       7.73
  seconds_power_on_to_login{1}                                    7.97
  seconds_power_on_to_login{2}                                    7.8
  seconds_power_on_to_login{3}                                    7.86
  seconds_power_on_to_login{4}                                    7.84
  seconds_power_on_to_login{5}                                    7.81
  seconds_power_on_to_login{6}                                    7.85
  seconds_power_on_to_login{7}                                    7.85
  seconds_power_on_to_login{8}                                    7.85
  seconds_power_on_to_login{9}                                    7.82

After(verity_depth = 3)

  seconds_power_on_to_login                                       7.57
  seconds_power_on_to_login{1}                                    7.89
  seconds_power_on_to_login{2}                                    7.54
  seconds_power_on_to_login{3}                                    7.56
  seconds_power_on_to_login{4}                                    7.53
  seconds_power_on_to_login{5}                                    7.56
  seconds_power_on_to_login{6}                                    7.79
  seconds_power_on_to_login{7}                                    7.58
  seconds_power_on_to_login{8}                                    7.56
  seconds_power_on_to_login{9}                                    7.62

BUG=chromium-os:9752
TEST=platform_BootPerfServer

Change-Id: I7f6e39ad2ed2c2e8ebc463860578c3f97b8295a2

R=wad@chromium.org,jrbarnette@chromium.org

Review URL: http://codereview.chromium.org/6759016
2011-03-30 10:47:48 -07:00
Zdenek Behan
7454a5e6f5 build_image: always specify filesystem type for mount
BUG=chromium-os:13221
TEST=Run build_images without ext2 loaded

Specifying a filesystem type explicitly for ext* filesystems will avoid
weird fallbacks like mounting ext2 filesystem as ext3 or even ext4.
Instead it attempts to autoload the given filesystem as a module if
available or fail right away.

Change-Id: I6be7f3f994babd8efc8eda97ea9c802e04d98be6

R=dgarret@chromium.org,sosa@chromium.org

Review URL: http://codereview.chromium.org/6696092
2011-03-25 01:25:41 +01:00
Zdenek Behan
aeb8352706 build_image: silence the "No space left on device" message
BUG=chromium-os:12219
TEST=run it, see the message gone

Change-Id: I54174c50dd38e74989e7d63a798dc7f9ea011933

R=thieule@chromium.org

Review URL: http://codereview.chromium.org/6696095
2011-03-25 01:19:16 +01:00
Vince Laviano
96d116d25e build_image: remove --dev_install flag
The dev install shim is deprecated. This CL removes --dev_install
support from build_image.

This is part of a larger rewrite of build_image to allow it to be the
single script from which all image types are generated.

BUG=chromium-os:12899
TEST=manual

Change-Id: Ic3a49f0d476d198f81001a05c75f24f16bc640c0

Review URL: http://codereview.chromium.org/6694042
2011-03-17 11:32:07 -07:00
Darin Petkov
a586930227 Switch build_image to use cros_set_lsb_release directly.
Also remove obsolete customize_rootfs symlink.

BUG=chromium-os:4628
TEST=build_image

Change-Id: Id2af4b87585c3e127cffd02525cc0da5fb11bbfd

Review URL: http://codereview.chromium.org/6602062
2011-03-01 17:15:59 -08:00
Raymes Khoury
9e1084c7b8 Modified build_image to support new crossdev.
BUG=none
TEST=Ran build_image with and without the crossdev upgrade. Made sure it was picking up the correct tarball.

Review URL: http://codereview.chromium.org/6592013

Change-Id: I83e1c35b0d971aa9a5d69fb404a69f2a712bbe38
2011-02-25 14:01:10 -08:00
Dmitry Polukhin
0a649b57d9 Remove /mnt/partner_partition
BUG=chromium-os:6840
TEST=Build and install Chrome OS image, no issues observed

Change-Id: I24ea3a96490a81c8926852eff6d2451e57e196f7

Review URL: http://codereview.chromium.org/6546045
2011-02-24 13:02:52 +03:00
Che-Liang Chiou
75ac2beb67 Add transitional flag for enabling arm kernel signing
For now arm kernel partitions are not signed. This CL is a transitionsl.
That is, the added flag should be removed after arm verified boot is stable.

To properly create an arm kernel partition, we also need another CL for
vbutil_kernel utility that turns off x86-only modifications on kernel
image. See CL:6538015.

BUG=chromium-os:3790,chromium-os:12352
TEST=see below

Build images for x86 and arm successfully, and notice that load_kernel_test
passes for x86 and signed arm image.

$ build_image --board=tegra2_seaboard --crosbug12352_arm_kernel_signing
$ build_image --board=tegra2_seaboard --nocrosbug12352_arm_kernel_signing
$ build_image --board=x86-generic

Review URL: http://codereview.chromium.org/6538014

Change-Id: I1be381bae2fc367a0603ac2ec67ee70fc9a257e4
2011-02-24 12:00:16 +08:00
David James
e8875485ea Update build_image to link to make.globals directly, instead of to directory.
The xorg-server ebuild creates /usr/share/portage on the rootfs partition. This
breaks build_image which wants to point the same directory at the stateful
partition.

To work around this we just link to make.globals directly. This workaround fixes
gmerge but doesn't address the problem that there might be more files inside
/usr/share/portage. A better fix should be addressed as part of
crosbug.com/11502

BUG=chromium-os:12441
TEST=Run build_image and verify /usr/share/portage/config/make.globals points to
     /usr/local/share/portage/config/make.globals and that the latter also
     exists.

Review URL: http://codereview.chromium.org/6583001

Change-Id: I52fd9d34bf29573fbf6ca013ba49d1c8608e066d
2011-02-23 15:24:14 -08:00
David James
49523439a1 Update make.globals fixing code to point at new location of make.globals.
BUG=chromium-os:12264
TEST=Ran build_image, verified existence of /usr/share/portage/config/make.globals

Review URL: http://codereview.chromium.org/6532038

Change-Id: I621110738a1e8d789a4f58bdc1db1a7b2251ad29
2011-02-17 15:19:16 -08:00
Darin Petkov
ab463c0844 Move crypted passwd file to /etc in build_image.
This temporary hack is intended to provide to developers a smooth transition to
the new crypted password file location.

BUG=chromium-os:11664
TEST=build_image

Change-Id: I34383f6e08ee8db53e407b30df604c403c72b5eb

Review URL: http://codereview.chromium.org/6539019
2011-02-17 10:42:24 -08:00
David James
1ed7fe6b70 Update links to point at new location of parallel_emerge.
BUG=chromium-os:4230
TEST=grep for references to old parallel_emerge location

Change-Id: I3238e719e01df57648d3d91c0dfd7c37f7a934ee

Review URL: http://codereview.chromium.org/6246058
2011-02-14 14:49:25 -08:00
Zdenek Behan
23bc6ca892 build_image: use string comparison for comparing strings
BUG=n0ne
TEST=./build_image and see it fail and ask me a question, instead of death

Change-Id: I27f7ac71ce74ff711e8b152ee202121d518045cd

Review URL: http://codereview.chromium.org/6417001
2011-02-10 02:04:58 +01:00
David James
17d44e3659 Verify that SCRIPTS_DIR exists in build_image.
This hack is necessary for old chroots to ensure that we source a good
common.sh when the one inside the chroot is out of date. We'll be able
to get rid of this after everybody has updated their chroot to have a working
version of common.sh and/or we have deprecated running scripts from the
source directory.

Also fix logic for when common.sh is missing to exit properly.

BUG=chromium-os:11598
TEST=Verify that build_image still works when the old common.sh is present in
     the chroot.

Change-Id: I2e8c2fd5ad06446e669ad665ee2e70f4364958fe

Review URL: http://codereview.chromium.org/6286084
2011-02-08 14:48:51 -08:00
Greg Spencer
798d75f3be This starts to fix the scripts so that they load from /usr/lib/crosutils
from within the chroot.

It also fixes a number of style issues.

It changes the meaning of cros_workon "list-all" to list all available
packages, and adds "list-live" to list all live packages.

It changes things that load chromeos-common.sh from the installer to
load it from /usr/lib/installer.

BUG=chromium-os:4230
TEST=synced, rebuilt chroot, made packages, made images, built chrome
from source, and wrote an image to a USB stick.

Review URL: http://codereview.chromium.org/6240018

Change-Id: I90c34420af1a64020402bafef8e9e77f56837c02
2011-02-01 22:04:49 -08:00
Chris Sosa
3ee8b17d63 Don't prompt the build bot to delete its dir on error.
Change-Id: I9a4fc8ea0ed51a11a912f3d1c896579369fd8880

BUG=Tac0
TEST=Ran with USER=chrome-bot ./build_image and hit Ctrl+C

Review URL: http://codereview.chromium.org/6288012
2011-01-24 15:55:46 -08:00
Will Drewry
d07f61d812 build_image: enable Chrome OS partition/hardware error behavior in dm-verity
ARM (kernel-next) should now be in sync with kernel.git so that we get similar
error handling behavior on all targeted platforms (with our partition layout).

This change makes that the default.

BUG=chromium-os:9697
TEST=manual build_image with kernel-next profile; booted and validated failover error behavior

Change-Id: I281302adb3cbc96aa5770630898f103b0d3639ca

Review URL: http://codereview.chromium.org/6220002
2011-01-12 10:39:54 -06:00
David McMahon
48db5d2068 Moving chromeos_version.sh to chromiumos_overlay.
BUG=chromium-os:9714
TEST=

Review URL: http://codereview.chromium.org/5513009

Change-Id: Ib569fe59f4e14551b198568b24014208b5d65647
2010-12-14 16:19:24 -08:00
Raja Aluri
888e07c9c8 Adding missing test
Change-Id: I1bbb4b0b54632878bcebdf2fac9fcbe105e2d6cd

BUG=None
TEST=Ran build_image with empty directory.

Review URL: http://codereview.chromium.org/5781009
2010-12-14 10:36:34 -08:00
Thieu Le
171321f8ff Zero free space on rootfs so it's more compressible for auto-update
BUG=chromium-os:10228
TEST=Build image, install image to Mario, make sure image still boots

Change-Id: Idc3c2a929515d39cb06926611eff37960074889c

Review URL: http://codereview.chromium.org/5704004
2010-12-13 11:37:42 -08:00
Trevor Bourget
8e6abb04c6 scripts: repair build_image nostatefuldev collision
Change-Id: Ib9fcc078d8e0223cd1b1376db91d8e71ae8359a6

BUG=cp file to itself fails in case of nostatefuldev
TEST=ran build_image with and without statefuldev

Review URL: http://codereview.chromium.org/4959001
Patch from Trevor Bourget <tbourget@codeaurora.org>.
2010-12-13 09:44:32 -07:00
Raja Aluri
aeb1048742 Moving generating au-generator.zip file to build_image.
Change-Id: Id4ed6af96e0b621f4ad36966fad45c887b991373

BUG=None
TEST=Ran a fresh build_packages and build_image for x86-generic.

Review URL: http://codereview.chromium.org/5689004
2010-12-10 13:03:09 -08:00
Mandeep Singh Baines
4ea330f007 build_image: honor USE flags from environment
BUG=n0ne
TEST=Ran the following command to test:

USE="-compat_wireless" ./build_image

Change-Id: I4b3fd12c1f62e1b2551045a5831a63d848fe2a3f

Review URL: http://codereview.chromium.org/5139003
2010-11-17 18:11:58 -08:00
Will Drewry
226522a011 build_image: rollback default error behavior until kernel-next merge
kernel-next lacks error mode 3.  Rolling back until merged.

TEST=none: rolling back to old value
BUG=chromium-os:8442

Change-Id: I0c1a89dc3e00fe5f315b3c15c5070209b0fd79d0

Review URL: http://codereview.chromium.org/4512004
2010-11-05 20:20:47 -05:00
Will Drewry
137eab6129 build_image: enable new cros specific error handling in dm-verity
A new error mode for dm-verity exists which can be called as
"cros" or "3".  This change enables that mode in builds by default.

TEST=build_image had the correct argument; functionality was there [in progress]
BUG=chromium-os:8442

Change-Id: I3eb3f4a662c5d36011542af4e50718db50ab63bd

Review URL: http://codereview.chromium.org/4530003
2010-11-04 22:06:41 -05:00
Andrew de los Reyes
0eb6d764ad Rootfs: increase size to 850MiB.
BUG=not sure, but this is CL 2/2 to fix broken L13 build
TEST=tested usb intall/auto update

Change-Id: I14cdd1ec941a0653ac25ec7ef72f69f2ec8f64c9

Review URL: http://codereview.chromium.org/4270002
2010-11-01 18:27:53 -07:00
Chris Sosa
765db0f771 Add sed to remove path dependency for wget
Change-Id: Iecdea822e9600249a9596c059e4db980b409c0a0

BUG=8082
TEST=Built a vm image and ran sudo gmerge metrics

Review URL: http://codereview.chromium.org/4118001
2010-10-25 15:08:55 -07:00
Chris Sosa
e38f90f309 Add ability to blacklist packages from chromeos-base/chromeos.
Change-Id: I05370137dbe9f9adc7b18f2ff77d1b7680275c37

BUG=7973
TEST=Ran with/without current blacklist file.  Also, added chromeos-base/chromeos-chrome
to test it actually dies correctly.

Review URL: http://codereview.chromium.org/4005002
2010-10-20 16:04:23 -07:00
Will Drewry
55b42c94ca cros_make_image_bootable, mount_gpt_image, common.sh: root filesystem changes: ext2, ro by default
This change makes more of the root filesyste metadata static across builds, but
more can be done there.  It also changes the root filesystem to use ext2 as
we don't need journaling in normal mode.  Optionally we could use ext3 for
non-verified if desired (it's an easy change).

In particular, this change cleans up the following:
- clears the rootfs uuid
- labels it C-ROOT (instead of C-KEYFOB)
- removes reserved inodes and blocks

The major feature of this change, however, is that it adds two simple
helpers to common.sh: disable_rw_mount and enable_rw_mount.  They will
set high order byte (le) in the ro compat field to be 0xff.  This will
tell the kernel that the filesystem uses features R24-R31 which are safe
for use on the running kernel iff the filesystem is mounted read-only.

These functions are called in cros_make_image_bootable and
mount_gpt_image, respectively.  mount_gpt_image will always
enable_rw_mount and cros_make_image_bootable will disable_rw_mount if
--enable_rootfs_verification is true.

The approach is ugly but reasonably well contained.  If ext2 ever gets a
new revision and new features in the same range are introduced, then we
would be getting inconsistent behavior.  That said, it is unlikely that
that churmn will happen and if the impact is negative, it will ideally
show up during testing.

N.B., this will likely result in changes needing to be made to the
signing scripts in vboot_reference to ensure that rw mounting is
enabled/disabled in the same way (E.g., during stamping).

BUG=chromium-os:7468
TEST=- built x86-generic, imaged to usb stick, attempted to mount rw /dev/sdc3 on the host and was properly bounced.
     - booted to the image just fine on a dogfood device.
     - mod'd for recovery, then installed and booted.
     - mod_image_for_test runs with no errors; booted the resulting image as well
     - booted a factory_install with the pending dm changes
     - BVT passed with build_image x86-generic (vboot enabled)
     - [in progress] autotest that checks if the rootdev = /dev/dm-0 and
       then does a dumpe2fs | grep -q FEATURE_R31

Review URL: http://codereview.chromium.org/3916002

Change-Id: If4dcba7568a110f4e32627c916d9e5741e5e5414
2010-10-20 15:44:11 -05:00
Chris Sosa
6304adc473 Setup python symlinks for python on stateful partition.
Change-Id: Ifbfbd3b55ae97ea94ea5bba40a001c6a1ddbf7a0

BUG=720
TEST=Ran suite_Smoke in a VM and ran python from command line and checked
to see if I could import packages from /usr/local/site-packages.

Review URL: http://codereview.chromium.org/3972001
2010-10-20 13:40:33 -07:00
Will Drewry
32d8c11747 build_image & make_bootable: allow additional kernel cmdline args
In order to more easily test kernel commandline tweaks, ensure that
--boot_args is propagated to all kernel cmdline sinks.

This is useful for changing default schedulers and any other kernel argument
tweaks we may want to quickly test out.

TEST=build and tested x86-generic
BUG=none

Change-Id: I5138755aa8c5e32e7f117f18291d2ae197e95bef

Review URL: http://codereview.chromium.org/3644004
2010-10-11 15:37:17 -05:00
Will Drewry
52c40f8d35 build_image: fix verity defaults
This changes defaults failure to a panic/recovery reboot and
disables the debugging max_bios argument to ensure that we don't
trigger race conditions in the kernel during un-protected
pending_bio count decrements.  (Can lead to a hung-system.)

TEST=built x86-generic; ensured -1 and the panic changes worked
BUG=chromium-os:6956

Review URL: http://codereview.chromium.org/3595015

Change-Id: I81c9e1a7f406e551cd528d5226902c89165b30f9
2010-10-06 14:54:38 -05:00
Hung-Te Lin
2ffe2bed8b crosutils: refine imaging output message (as instructions)
image_to_usb has been made to work inside chroot for quite some time
(maybe since http://codereview.chromium.org/1991006), and some special
modes may even require it to be executed inside chroot.
However the output messages were not fixed, so we should remove the
"OUTSIDE CHROOT" alerts.

BUG=none
TEST=manually:
1. executed build_image and verified that output messages is correct, and the image is really built successfully.
2. executed image_to_usb.sh --from=... --to=/dev/sde and verified output messages is correct, and the USB device is really imaged by the given target

Change-Id: I8f4274c5f59a0aa585471469ac285e91c0cead13

Review URL: http://codereview.chromium.org/3519003
2010-10-05 08:15:40 +08:00
Kenneth Waters
e3049de00f build_image: Merge x86 and ARM where possible.
- I looked at all of the x86 and ARM paths through out build image scripts,
  these changes clean up stale comments, stale code, and unforks some small
  things.

BUG=none
TEST=Built images for x86-generic, arm-generic and tegra2-seaboard, booted tegra2-seaboard image.

Review URL: http://codereview.chromium.org/3448022

Change-Id: Ibad2774ff2cbf5f15528454506542b87e43e24a2
2010-09-30 14:20:34 -07:00
Kenneth Waters
ed54d93e2c build_image: Add verity support for ARM.
- Build a "kernel image" which contains a uboot script and a uboot kernel
  image.
- Fix some sd* assumptions.
- Remove cruft that has never done anything usefull from update_bootloaders

BUG=none
TEST=Built, booted, and updated on tegra2_dev-board

Review URL: http://codereview.chromium.org/3396011

Change-Id: I00ecf57faa5fe64c8e33dd4c042f1dbed806c10a
2010-09-21 10:29:54 -07:00
Paul Stewart
12973e562d Install make.globals and create make.profile directory
Some mod_for_test images don't have the files necessary to run
emerge.  Install them.

BUG=none
TEST=Rerun package install

Review URL: http://codereview.chromium.org/3351016
2010-09-09 20:04:11 -07:00
Anush Elangovan
bc2aaf67f8 Make factory emerge the virtual/kernel atom to support profile based kernel
This is dependent on http://codereview.chromium.org/3317012/show

Change-Id: Ifb6e7511619e9f2000448408dd800dd7043a7783

BUG=5847
TEST=new setupboard and build_packages/image for arm/x86-generic with the CL 3317012 included

Review URL: http://codereview.chromium.org/3328016
2010-09-09 19:40:30 -07:00
Tan Gao
74a07cac15 Issue 6577: remove confirmation to delete output directory
Change-Id: Ib19986121a8988c6cae23527148a7b5d4a58663e

BUG=chromium-os:6577
TEST=(inside chroot) run 4 test cases from src/scripts/, using Ctrl+C to force abort (hence triggering "delete_prompt")
a.) (stdin tty) "./build_image --board=x86-generic < /dev/null", expected = no prompt and delete output dir; actual == expected
b.) (stdout tty) "./build_image --board=x86-generic > foo.txt", expected = no prompt and delete output dir; actual == expected
c.) (normal user case) "./build_image --board=x86-generic",
expected = prompt to delete output dir, if y, output dir is removed; actual == expected
d.) (normal user case) "./build_image --board=x86-generic", expected = prompt to delete output dir, if N, output dir is NOT removed; actual == expected

Review URL: http://codereview.chromium.org/3373003
2010-09-09 11:41:30 -07:00
David James
ffede3b414 Use --usepkgonly in build_image to ensure no accidental builds of packages.
Historically, we used --usepkgonly in build_image to ensure that packages
were not accidentally built during this step. Recently, build_image was
updated to use --usepkg. The benefit of using --usepkg was that it would not
install obsolete binary packages to your image. It was counter-intuitive that
--usepkgonly would install packages to your image that are not actually
installed to your board root. The disadvantage, however, of --usepkg, was that
it sometimes tried to build packages afresh using the image as your build root,
and this failed with strange errors because you're not supposed to do that.

This change fixes build_image to give useful errors by switching back to
--usepkgonly. To fix the problem where --usepkgonly installs packages that are
not installed, we first run eclean-<board> to clean all unused packages from
the board root.

This change is a big improvement because a number of people have run into
strange issues with build_image due to this problem and have had trouble
debugging them.

This change was actually written by Sean Paul, and I am shepherding his change
through for him because he doesn't have a Chromium account yet.

BUG=chromium-os:6437
TEST=
 1) build_packages && build_image should still work
 2) build_packages && ./cros_workon start power_manager && build_image should
    fail with an error that all versions of the power manager are masked. This
    happens because you started working on the power manager, but did not build
    the version of the power manager you were working on before installing it.
 3) Assuming you are working on the power manager, build_packages && build_image
    should succeed because your cros_workon'd version of the package is built.
 4) ( ./cros_workon start power_manager && build_packages &&
      ./cros_workon stop power_manager && build_image ) should fail with the
    same error message as case 2 for similar reasons.
 5) ( ./cros_workon start power_manager && build_packages &&
      ./cros_workon stop power_manager && build_packages && build_image )
    should work because you've built your new version of the stable package.

Change-Id: Ia3858c70997bc6f0ec0b6d1bfaede8d3272a0976

Review URL: http://codereview.chromium.org/3305010
2010-09-07 14:22:38 -07:00
Nick Sanders
446c2115e4 Don't kill sdcards with boot_tries
USB/SDCard boot devices typicaly don't run software updater,
and won't have success ever set. We never want to try to
fall back to the empty B partition either. The workaround
for this is to set the successful bit regardless of actual
boot success.

bug=6395
Change-Id: I67c625804203b13be9a0c626c404fa38bafb5445

Review URL: http://codereview.chromium.org/3344008
2010-09-03 18:15:35 -07:00
Nick Sanders
ebce8543fc missed feedback from CL
Review URL: http://codereview.chromium.org/3323004
2010-09-02 14:57:34 -07:00
Nick Sanders
c8cb33699e Allow full build of factory install shim in build_image.
BUG=4951
TEST=Build and boot install shim on legacy bios, on H2C

Review URL: http://codereview.chromium.org/3140028
2010-09-01 21:31:30 -07:00
Nick Sanders
ae26a5cbbf * Combine partition setting
* Add dev-rec key to factory installer
* rename factory_install_shim output to be consistent with dev install shim

Change-Id: Ibf8f027edda67626af5c319b4daa164cb53ccfe7

BUG=4382
TEST=Build factory install, build dev install, build normal

Review URL: http://codereview.chromium.org/3286002
2010-08-30 21:59:50 -07:00
Olof Johansson
1f5e84d157 build_image: image_to_vm needs board arg
BUG=none
TEST=build_image + cut and paste image_to_vm in the output

Change-Id: I9def13a56d796c1f034c834a8429e909b45afa02

Review URL: http://codereview.chromium.org/3181038
2010-08-24 20:26:49 -05:00
Tan Gao
7b6d5036f5 Issue 5183: reduce dev install shim size
Change-Id: I7722848872b1712b26c38ac8f163d450c5a08f6d

BUG=chromium-os:5183
TEST=manually built a dev install shim and verified it's bootable on agz device

Review URL: http://codereview.chromium.org/3158021
2010-08-23 08:17:48 -07:00
Will Drewry
12f14ce889 build_image: default to using verified rootfs for x86
This change enables root filesystem integrity checking for all x86
builds by default.  All mod_image_for_* work with this and the
factory_install.  In addition, the BVT tests all pass running on
a dm-verity root.

[I will send a mail to the chromium-os-dev once this lands with instructions on how to build with it and how to turn it off (chromeos-setimage) on an installed machine.]

Once this is functioning, I will start migrating the build/install process over to use the UUID-based boot.

TEST=built x86-generic, mod'd for test, installed, ran suite_BuildVerify
BUG=chromium-os:5100

Review URL: http://codereview.chromium.org/3143025

Change-Id: Ib23962b7a5e034ef6aea31b4361944ba894700c6
2010-08-17 17:27:16 -05:00
Will Drewry
d253badb6c build_image: make sure the factory_image size is propagated
Verified rootfs-based factory installers fail because the ROOT_SIZE_BYTES is
updated, but the information is not propagated to the boot.desc which
cros_make_image_bootable uses.  The result is that mod_image_for_test
incorrectly appends the rootfs hash even though it is correctly computed.

Random note:
build_kernel_image uses dumpe2fs to compute the size, but
cros_make_image_bootable uses the supplied size.  These shouldn't
diverge though the partition size should accomodate the addition of the
hashes.
TODO(wad) Add checking of sizes in cros_make_image_bootable

TEST=x86-generic build image with --enable_rootfs_verification and --factory_install; then put in a machine and it no longer spewed dm-verity hash errors and the root hash checked successfully!
BUG=chromium-os:5100

Review URL: http://codereview.chromium.org/3155025

Change-Id: I174e3661b80d83b25f3af95ff1eb77f634a7e797
2010-08-17 14:09:41 -05:00
Tan Gao
843b70acf4 Issue 5183: Create a developer shim for release builds
Change-Id: I14cd9dc365093c0450210d7853ad5f67ffa0ddd0

BUG=chromium-os:5183
TEST=1) manually built a dev install shim and verified it's only bootable when dev switch is ON

Review URL: http://codereview.chromium.org/3153001
2010-08-17 09:41:48 -07:00
Ken Mixter
0d11563bfd Move leave_core where other similar files exist
BUG=5696

Review URL: http://codereview.chromium.org/3109014
2010-08-13 15:51:07 -07:00
Ken Mixter
1334788772 Leave core files around for developers to inspect.
BUG=5358

Review URL: http://codereview.chromium.org/3170008
2010-08-12 16:51:52 -07:00
Will Drewry
6793ba78ca build_image,cros_make_image_bootable: fix missing arm argument
Adds arm_extra_bootargs to boot.desc and to cros_make_image_bootable.

TEST=tegra2 dev-board build_packages, build_image --fast worked
BUG=broken tree

Change-Id: Ifdfeda66f1eb5e5b1e618706eeba269f31fa9913

Review URL: http://codereview.chromium.org/3069031
2010-08-05 16:17:46 -05:00
Will Drewry
7ab698d713 build_image, mod_image_for_*: break out make_image_bootable
Breaks make_image_bootable out of build_image into a separate
script.  In addition, it make a helper .sh in the OUTPUT_DIR
to let make_image_bootable be re-run on an image with the same
arguments that were passed in via build_image.

This change also removes the use of the boot/ directory in
OUTPUT_DIR.

TEST=build_image verified; image_to_usb --test_image; booted l13
           build_image; image_to_vm; qemu booted
           build_image verified; image_to_usb; booted l13
BUG=chromium-os:5081

Review URL: http://codereview.chromium.org/3066037

Change-Id: I627d678089aa71c353347f387ad5b14063fd4e7b
2010-08-05 13:57:52 -05:00
Olof Johansson
58f25cca72 Create a latest link to point at newest image
build_image creates it after a successful build, and get_latest_image
can use it if it exists. Fall back to old behavior for now when there
are directories without a link.

BUG=none
TEST=Try building an image, check link. Rebuild, check new link.

Review URL: http://codereview.chromium.org/3014051
2010-08-04 21:18:49 -07:00
David James
0366864a98 Enable fast build by default in build_image and mod_image_for_test.sh.
The fast build is stable enough now that we can enable it for everybody.
I ran the build constantly all weekend on two machines and I only ran into
one (rare) error, which I've fixed in a separate patch.

See <http://codereview.chromium.org/2856048/show>

TEST=Ran lots and lots of fast builds
BUG=none

Review URL: http://codereview.chromium.org/3059001
2010-07-28 17:08:29 -07:00
Nikita Kostylev
c8bba90ae4 Make oem_customization flag optional.
BUG=chromium-os:1888
TEST=Manual. build_image should run fine when oem_customization flag is not specified.

Review URL: http://codereview.chromium.org/3076009
2010-07-28 17:05:26 +04:00
Will Drewry
efce66880f image_to_vm: convert to calling setimage directly
The last changes to the installer broke image_to_vm.  Since image_to_vm
doesn't need to run postinst, but just change the active image, it
now just calls chromeos-setimage and passes in its needed flags (already
supported by the last installer change).  It will also detect whether
the image was built with verification of the rootfs enabled or not
by looking at the default.cfg file.

Also updates the location of where you should run the command in
build_image.

TEST=built a new image with --enable_rootfs_verification and started with qemu -curses -hda [output]; did the same without verification
BUG=chromium-os:2963

Review URL: http://codereview.chromium.org/3034030

Change-Id: I265d6ad8971f9427b78cc07d784fced9cceb5974
2010-07-23 19:43:27 -05:00
Will Drewry
9926ee2879 build_image: avoid losetup -c because older kernels seem to balk
Instead of resizing the loop device after adding padding for the
hash tree data.  Just ensure that the mkfs.ext3 call doesn't exceed
the rootfs size.

TEST=reran build_image on my lucid machine and checked the rootfs size; asked someone with hardy machine to test.
BUG=none

Change-Id: I59f95e1d17e35aca265bd44bb863da6069c05bd2

Review URL: http://codereview.chromium.org/3048009
2010-07-21 15:11:10 -05:00
Will Drewry
78992a33f4 build_image, build_kernel_image, update_bootloaders: fix up rootfs_verification
This change adds
- --rootfs_hash_pad to specify the MBs reserved for the pad
- the implementation of the above flag
- check if total fs size + pad size exceeds the partition size
- hash appending in make_image_bootable()

Fixes:
- a style for ROOT_FS_HASH usage
- bad mount|grep
- bad bash subst for root devices in all boot paths
- fixed a typo in the update_bootloaders table creation
- disables verified usb for now

Adding the padding argument ensures that the generated hash tree for the root filesystem is appended to the image.  Assuming the rootfs is _never_ mounted read-write
again, that hash tree will be valid and vboot will be able to proceed.

BUG=chromium-os:2693
TEST=manual build_image

Review URL: http://codereview.chromium.org/3043011

Change-Id: I67d9b0f91cacdefa309c0cc2dd7fed1d2eddd7a7
2010-07-21 14:02:20 -05:00
Will Drewry
721d94f429 build_image,update_bootloaders: directly update the built image
Instead of playing mount and loop device games, this change adds support for
update_bootloaders.sh to directly update the EFI system partition living in the
image if a file, offset, and size is supplied.

TEST=build_image for x86-generic; booted resulting image
BUG=broken build

Change-Id: I3d891fd965df6fb4abfc63d660e314c497a4184d

Review URL: http://codereview.chromium.org/3006006
2010-07-16 14:39:45 -05:00
Andrew de los Reyes
3172b7e296 build_image: add temporary hack to fix syslinux building.
Will Drewry is working on the proper fix, but this unblocks people who
build images that boot w/ syslinux.

Review URL: http://codereview.chromium.org/3009003
2010-07-15 22:10:47 -07:00
Zelidrag Hornung
478a0d44a4 Renamed VM image to match naming convention of other images.
Review URL: http://codereview.chromium.org/2955014
2010-07-14 11:47:39 -07:00
Denis Romanov
95bdf47a1a Added command line parameter to specify OEM content location.
Added populating OEM partner partition with content.
Added creating flag file .consider_oobe for OEM partition to get mounted on OOBE.

BUG=http://crosbug.com/3828
TEST=Install Chrome OS on the device from USB stick. /mnt/partner_partition contains etc/... directory with customization manifests on first boot.

Review URL: http://codereview.chromium.org/2938003
2010-07-12 22:44:42 +04:00
Mandeep Singh Baines
87b169428f build_image: modify to not get devkeys from vboot_reference checkout
An earlier CL modifies the vboot_reference ebuild to install the
keys into /usr/share/vboot.

TEST=verified that build_image fails without this change and no
vboot_reference checkout but succeeds with this change and no
vboot_reference checkout

Change-Id: Ie2bc1091b52c36fd56cd5f763ee275afc91765c3

Review URL: http://codereview.chromium.org/2896008
2010-07-09 20:52:41 -07:00
Will Drewry
07e350578b build_image: enable syslinux installation for x86
Adds the --install_syslinux to the update_bootloaders call for x86.

BUG=chromium-os:2693
TEST=build_image with both tegra2 and x86-generic in progress. Doesn't affect actual booting until we change the active gpt boot partition.

Review URL: http://codereview.chromium.org/2911003
2010-07-09 14:50:42 -07:00
Will Drewry
1670d481a1 build_image, build_kernel_image, legacy_bootloaders: Rename vboot flags
The use_vboot and vboot_ flags were confusing from a functionality perspective
since verified boot as a feature encompasses firmware and kernel functionality.
The firmware bits are always enabled, but use_vboot enabled the image-integrity
portion of vboot.  It is not called
  --enable_rootfs_verification
and all options for the kernel functionality is under --verity_* given that
verity/dm-verity is the current working name for the module and userspace tool.

TEST=ran x86-generic build_image & tegra2-dev-board build_image and checked the resulting boot.config files (with and without --enable_rootfs_verification).
BUG=chromium-os:2693

Review URL: http://codereview.chromium.org/2917008
2010-07-09 13:08:38 -07:00
David James
fd7403ab89 Revert "Use --fast by default in build_image when --jobs is enabled."
See if this fixes the symlink problems we've been running into.

This reverts commit 8edffbaec5.
2010-07-09 12:00:17 -07:00