Commit Graph

1728 Commits

Author SHA1 Message Date
Nick Sanders
0126898d23 Cache sudo in make_factory_package
BUG=chrome-os-partner:2827
TEST=observe sudo cache

Change-Id: Idf0d63ab07ee2e60f028e44ace4cd9707c2e4d6c
Reviewed-on: http://gerrit.chromium.org/gerrit/7580
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2011-09-12 22:43:12 -07:00
David James
83848ede89 Remove old versions of dev-libs/gmp to ease chroot upgrades.
BUG=none
TEST=Run it, make sure old versions are unmerged.

Change-Id: I2a281284fc17e221985c9c2b184a5a23ba90d773
2011-09-12 10:45:18 -07:00
Chinyue Chen
67594116c0 Read script parameters from config file.
make_factory_package.sh needs many parameters and to support multi-board
installation it has to be run twice (without and with --subfolder). This
change adds the functionality to read sections of parameters from a
config file and executes them in order.

BUG=chrome-os-partner:5850
TEST=1. Create a config file (mp_factory.conf) with the following
        content:
       [x86-zgb]
        --factory ~/trunk/src/build/images/${BOARD}/latest/chromiumos_factory_image.bin
        --release ~/trunk/src/build/images/${BOARD}/latest/chromiumos_image.bin
        --hwid_updater ~/trunk/src/platform/chromeos-hwid/hwid_bundle_zgb.sh
        --firmware_updater none
        --detect_release_image

       [x86-zgb-he]
        --subfolder x86-zgb-he
        --factory ~/trunk/src/build/images/${BOARD}/latest/chromiumos_factory_image.bin
        --release ~/trunk/src/build/images/${BOARD}/latest/chromiumos_image.bin
        --hwid_updater ~/trunk/src/platform/chromeos-hwid/hwid_bundle_zgb.sh
        --firmware_updater none
        --detect_release_image

     2. BOARD=x86-zgb ./make_factory_package.sh --config mp_factory.conf

Change-Id: I3435f3afbf40ec3b8bd02a3514f599a7a535510e
Reviewed-on: http://gerrit.chromium.org/gerrit/7473
Tested-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2011-09-09 09:23:26 -07:00
Stefan Reinauer
b392153c54 rename /u-boot --> /firmware
Also drop find_*_component, because it is not used anywhere anymore.

BUG=chrome-os-partner:5459
TEST=none

Change-Id: Iea49a81538c22fee4b91c8b3e5582b5174282151
Reviewed-on: http://gerrit.chromium.org/gerrit/7425
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Anton Staaf <robotboy@chromium.org>
2011-09-08 17:05:10 -07:00
Hung-Te Lin
920482f7f4 crosutils: add HWID folder when building factory test image
To always have HWID bundles in build output, this CL copies the HWID bundle
files from board temporary space into build output folder.

The HWID folder in make_netboot is also removed.

BUG=chrome-os-partner:5796
TEST=./build_image --factory
     # see "hwid" folder in build output

Change-Id: I8c2cd32c257b117261fba3654b52929c71310c82
Reviewed-on: http://gerrit.chromium.org/gerrit/7331
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-09-07 21:11:41 -07:00
Raymes Khoury
d37eb67163 Print friendly error message if the libc tarball is missing.
Advises the user to try running setup_board.

BUG=chromium-os:18934
TEST=Ran with missing tarball and checked message.

Change-Id: Ice444139188756932734f5f89ef22de4cd12ab41
Reviewed-on: http://gerrit.chromium.org/gerrit/6709
Tested-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
2011-09-07 18:19:30 -07:00
David James
d1679ab864 Don't hardcode output directories in boot.desc.
Right now, output directories are hardcoded in boot.desc. This means that
cros_make_image_bootable will still write to the directories mentioned in
build_image, even if it's working on a different directory. This can
mess with the buildbot, because it can cause cros_make_image_bootable
to mess with the files created for existing images.

This change fixes flaky failures where the buildbot fails with warnings
stating that vmlinuz_hd.vblock does not exist. See bug 19956.

BUG=chromium-os:19956
TEST=Run full canary trybot run and verify cros_make_image_bootable uses
     files from the right directory now.

Change-Id: Ib390aa84570b077cbc8b69b757998056acc091ea
Reviewed-on: http://gerrit.chromium.org/gerrit/7282
Reviewed-by: Will Drewry <wad@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-09-06 13:50:40 -07:00
Zdenek Behan
9a995bb37c gcc-update-hook: regenerate latest gcc prior to calling gcc-config
BUG=chromium-os:19613
TEST=below
1) Manually create a chroot with old gcc
2) Let the script update&select new one, unmerge old

Change-Id: I71732da315ed4effc6df48afab797718e44d7a06
Reviewed-on: http://gerrit.chromium.org/gerrit/7117
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2011-09-02 16:30:23 -07:00
Darin Petkov
4b964ca646 Revert "build_kernel_image: use a salt for verity."
Seems to break internal PFQ.

This reverts commit e13e4d94753a585234189f0f34c1723cdbdb36a4

Change-Id: Ia232dc7a50feb87b2af8e945c6940eaa71390525
Reviewed-on: http://gerrit.chromium.org/gerrit/7195
Tested-by: Elly Jones <ellyjones@chromium.org>
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
2011-09-02 13:39:34 -07:00
Elly Jones
6f568e6a94 build_kernel_image: use a salt for verity.
BUG=chromium-os:12138
TEST=Adhoc
TESTED_ON=Kaen
Build an image. Look for "Generating root fs hash tree (salt <foo>)." in the
output. Boot the image, grep for 'salt=' in dmesg. All should be well.

Change-Id: If9dbefbd8a875d06ff45cd54704f166c2511c3b7
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/7174
2011-09-02 12:06:27 -07:00
Chris Sosa
c2a60e2e03 Another copyright fix to test the Commit Queue.
BUG=None
TEST=Visual inspection

Change-Id: I5e3911fca26386a8eea4cc77dd6603b3631a02a4
Reviewed-on: http://gerrit.chromium.org/gerrit/7143
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-09-02 03:24:51 -07:00
Chris Sosa
2eb73c0be1 Quick test.
BUG=None
TEST=Change of copyright.

Change-Id: I9254f9456960a417e8584376d98388d3d8fd4467
Reviewed-on: http://gerrit.chromium.org/gerrit/7140
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-09-01 19:03:39 -07:00
Chris Sosa
c1bd111ef0 Trivial change to test the commit queue by cleaning up Copyright date in bash_history.
BUG=None
TEST=Visual

Change-Id: I6ceb84e47983ac38ba0df7c6176b42c2613f9c58
Reviewed-on: http://gerrit.chromium.org/gerrit/6790
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
2011-09-01 18:48:39 -07:00
Thieu Le
73293cd578 New script to generate stack traces from BVT test failures.
BUG=chromium-os:19565
TEST=Manually ran script

Change-Id: I7f565ddd2e06f4b25aa5d47614cedf7bec786580
Reviewed-on: http://gerrit.chromium.org/gerrit/7093
Reviewed-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
2011-09-01 17:18:12 -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
d7a3503914 crosutils/make_universal_factory_shim.sh: allow creating images in arbitrary layout
We need more flexible image creation tool for various layout, like "RMA with
multiple release images" which needs 4 images (install, test, release A,
release B).

To make the creation of image more flexible, this CL changes
make_universal_factory_shim to using a "layout file" that can describe any disk
image format we want.

Image creation speed is also improved by aligning partition offsets and
restricting oflag=dsync applied only when being used for block devices so that
make_universal_factory_shim (outputs to a normal temporary file) becomes faster
by utilizing system cache.

For a system with every images already cached:
 - Time for building 3 in 1 factory instal shim:
   Before = 8 seconds, After = 5 seconds.
 - Time for full RMA shim creation:
   Before = 1m25s, After = 40-50 seconds.

BUG=chrome-os-partner:4108
TEST=./make_universal_factory_shim.sh image1 image2 image3 image4
     # boots correctly after being imaged to SD card.
     ./make_factory_package.sh --usbimg RMA ....
     # RMA image can install images and works correctly

Change-Id: I645196d6d6e0a24d3dfa4c413a338279df4c0d5b
Reviewed-on: http://gerrit.chromium.org/gerrit/6893
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2011-08-31 23:37:55 -07:00
Hung-Te Lin
662588686a crosutils: clean up factory test image modification scripts
This is the counterpart of http://gerrit.chromium.org/gerrit/6992 ,
which moves init modification from scripts folder into ebuild file.
The 'customizeRelease' is also already deprecated.

BUG=chromium-os:9596
TEST=build_images --factory # pass

Change-Id: I8087f627f4b13d9f6b1d4bf6003630298a87c627
Reviewed-on: http://gerrit.chromium.org/gerrit/7040
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-08-31 23:37:12 -07:00
Zdenek Behan
00626700a8 version_hooks: add a version hook for host gcc upgrade
Recently, a gcc-4.4.6 has been unmasked in the host, but no effort
has been made to make sure the developers select it with gcc-config.

BUG=chromium-os:19613
TEST=ran the tests below with set -x and observed
1) manually set the MINIMUM version to 4.4.7, see it fail
2) two gccs, current + old, set to old, observed the switch and unmerge
3) above, but set to new, same result
4) only one gcc, the current, observed nothing happening
5) only have old gcc, let the script update&select new one, unmerge old

Change-Id: Id2a285a13f5b27d7531eae4db35e36f6b8cc5f4f
Reviewed-on: http://gerrit.chromium.org/gerrit/6694
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
2011-08-31 11:40:56 -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
Mike Frysinger
2fe928ec7a mod_image_for_recovery.sh: don't silence stderr in non-verbose modes
The current code will silence stderr when operating in non-verbose mode
because it always turns on shell tracing with `set -x`.  Unfortunately,
this also ends up killing error messages from a bunch of places in the
script as well:
 - look for all the "1>&2" uses in mod_image_for_recovery.sh
 - look at missing error() override
 - look at duplication of die() just to undo things

A really simple example:
$ ./mod_image_for_recovery.sh
$
Did it work?  Or did I do something wrong?  Who knows!

So undo the stderr silencing and simply turn on `set -x` only when
requested (verbose mode).

BUG=None
TEST=forced some errors in non-verbose mode and saw no output before change, but saw it after change; made a working recovery image

Change-Id: I31578fba091e390a56a437af97782a621e2137fb
Reviewed-on: http://gerrit.chromium.org/gerrit/6904
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2011-08-31 06:57:27 -07:00
Kris Rambish
4d290ef5a4 Evaluate full paths for image and build_root
BUG=chromium-os:19854
TEST=Ran it
STATUS=Verified

Change-Id: I2fd7d77145e3607c29cfc64500fca8525e9b5992
Reviewed-on: http://gerrit.chromium.org/gerrit/6939
Reviewed-by: Kris Rambish <krisr@chromium.org>
Tested-by: Kris Rambish <krisr@chromium.org>
Reviewed-by: Stanley Wong <stanleyw@chromium.org>
Tested-by: Stanley Wong <stanleyw@chromium.org>
2011-08-30 16:50:42 -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
Kris Rambish
8591b508bf Add more help when vboot doesn't exist
TEST=Ran it
STATUS=Verified
BUG=chromium-os:19850

Change-Id: I2628cf0e4750f1dfff566cfe105af8672bce81f1
Reviewed-on: http://gerrit.chromium.org/gerrit/6928
Tested-by: Kris Rambish <krisr@chromium.org>
Reviewed-by: Kris Rambish <krisr@chromium.org>
Reviewed-by: Stanley Wong <stanleyw@chromium.org>
2011-08-30 14:39:22 -07:00
Matt Tennant
d4316fe32f When entering chroot, copy ~/.gdata_cred.txt if it exists.
The process of updating the Portage package status spreadsheet on
buildbots requires a credentials file at ~/.gdata_cred.txt in the
chroot.  All buildbot VMs have this file outside the chroot now,
so this change adds that file to the list of things created in
the user's homedir when entering the chroot.

BUG=None
TEST=Run cros_sdk in these scenarios:
~/.gdata_cred.txt exists -> Same file should be at $HOME in chroot
~/.gdata_cred.txt does not exist -> No file created in chroot

Change-Id: I5c0f333a9308f5efa5324ce2e202a7c9e9fdb48b
Reviewed-on: http://gerrit.chromium.org/gerrit/6911
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Tested-by: Matt Tennant <mtennant@chromium.org>
2011-08-30 13:43:13 -07:00
Hung-Te Lin
0288219071 make_netboot: change HWID bundle filename
This is the counter part of https://gerrit-int.chromium.org/4790

BUG=none, see https://gerrit-int.chromium.org/4790
TEST=see https://gerrit-int.chromium.org/4790

Change-Id: If4adc586509c81808c1deb3e781317fbc244ff07
Reviewed-on: http://gerrit.chromium.org/gerrit/6892
Reviewed-by: Dave Parker <dparker@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-08-30 10:05:46 -07:00
mukesh agrawal
72f7c86449 crosutils: add new mod_for_test script, to keep flimflam away from
test wi-fi devices.

in http://gerrit.chromium.org/gerrit/6405, we introduced support
for running some WiFi autotests in a VM (running a test image).
for those tests to work, the connection manager must not attempt
to manage the devices used by the APs.

this change adds a mod_for_test script that updates flimflam's
init script, adding command-line arguments that tell flimflam
to ignore the AP devices.

BUG=chromium-os:16348
TEST=manual: built test image, checked flimflam args in /etc/init/flimflam.conf

Change-Id: I7a26d817e78f5743e2922a35c20ad6bee139445d
Reviewed-on: http://gerrit.chromium.org/gerrit/6443
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
2011-08-29 11:46:09 -07:00
Kris Rambish
8e5634c34b Copy pyauto_function.py in scrub.
BUG=chromium-os:19748
STATUS=Fixed
TEST=Ran it

Change-Id: Id71df8fe568dd1016e657e89fb942f2bbd319500
Reviewed-on: http://gerrit.chromium.org/gerrit/6803
Reviewed-by: Nirnimesh <nirnimesh@chromium.org>
Tested-by: Nirnimesh <nirnimesh@chromium.org>
2011-08-26 18:37:09 -07:00
Da Zheng
87465ea735 Create squashfs as the rootfs.
This give users the choice to have rootfs formatted with squashfs.
When --squash_image is specified, the rootfs will be formatted to squashfs.

Users can also use --squash_sort_file to specify the file priority when
squashfs is created.

BUG=None
TEST=Manually tested "--squash_image", and the image can be installed
from USB stick. Also tried "--squash_sort_file=sort-prio.list", and files
in squashfs are sorted.

Change-Id: I5fd818ac9d1203598926efa82e94fa105cd86ebc
Reviewed-on: http://gerrit.chromium.org/gerrit/5664
Tested-by: Da Zheng <zhengda@chromium.org>
Reviewed-by: Da Zheng <zhengda@chromium.org>
2011-08-26 13:04:29 -07:00
Zdenek Behan
908a843d78 cros_image_to_target: when in chroot, call the chroot tools relative to /
This fixes a problem with chroots named other than 'chroot', but only
when running inside the chroot.

BUG=chromium-os:19596
TEST=run it inside the chroot

Change-Id: I9532fe7762e2d7e277305fb948e5cabc242a5213
Reviewed-on: http://gerrit.chromium.org/gerrit/6597
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
2011-08-24 18:29:04 -07:00
Zdenek Behan
7b57a7731d placeholders: update depot_tools for people who didn't read PSA
BUG=chromium-os:19544
TEST=none

Change-Id: I9e516d6b14db63a814c085e4194b6c4c24594a7d
Reviewed-on: http://gerrit.chromium.org/gerrit/6521
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Anush Elangovan <anush@chromium.org>
2011-08-24 12:33:57 -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
David James
985cd88444 Add connection timeout to ssh attempts.
BUG=chromium-os:19210
TEST=Run a few dozen cbuildbot runs.

Change-Id: I276f23135bfe1dfc95575ffd15507cce6fb2461c
Reviewed-on: http://gerrit.chromium.org/gerrit/6383
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-08-23 11:29:51 -07:00
Hung-Te Lin
8dd73fc105 make_factory_package.sh: force assigning --hwid and --firmware.
The --hwid and --firmware should be assigned with real files by default.

BUG=chromium-os:16751
TEST=./make_factory_package.sh --release RELEASE --factory FACTORY # see error
     ./make_factory_package.sh --help # see hints to 'none'
     ./make_factory_package.sh --release RELEASE --factory FACTORY \
       --hwid HWID --firmware FIRMWARE # see mini-omaha configured correctly

Change-Id: Ib797cd66e864bd2105622c989b4b03443f361a69
Reviewed-on: http://gerrit.chromium.org/gerrit/6461
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-08-22 20:21:46 -07:00
J. Richard Barnette
8e6750dee7 Clean up sdk_lib/enter_chroot.sh startup boilerplate.
BUG=None
TEST=run cros_sdk

Change-Id: I39fafd58c7cc9fd536fe9b75f314f9970766a483
Reviewed-on: http://gerrit.chromium.org/gerrit/6414
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2011-08-22 12:57:34 -07:00
Zdenek Behan
cc6d2e7f85 crosutils: switch enter_chroot.sh and make_chroot for placeholders
* This CL deprecates the use of enter_chroot and make_chroot completely,
leaving the functionality exposed only through cros_sdk.

BUG=chromium-os:18750
TEST=run them

Change-Id: I864960b4e25245341431c3a3950638fa569820ed
Reviewed-on: http://gerrit.chromium.org/gerrit/6358
Reviewed-by: Anush Elangovan <anush@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
2011-08-20 11:06:16 -07:00
Chris Sosa
50637eebb8 Revert "Add feature to extract kernel image from other recovery image for use in recovery."
This reverts commit c99f52ab42a3204c0b7cee1ffbcbee77acf2d11c

Change-Id: I21c8f759ab49fb947c856f64369a6595ffdbbb0a
Reviewed-on: http://gerrit.chromium.org/gerrit/6373
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-08-19 20:00:41 -07:00
Zdenek Behan
2811c16f55 crosutils: globally replace enter_chroot with cros_sdk
"cros_sdk" is a drop-in replacement of enter_chroot.sh. The only
important difference is in the calling path, specifically that
cros_sdk is in path but has to be called from $(pwd) being inside the
repo checkout, while enter_chroot.sh is called by explicit path.

Invariably, "./enter_chroot.sh" can be replaced, as pwd=src/scripts.
Calling by absolute path can be replaced by first changing directory
anywhere into the repo checkout, and then calling cros_sdk.

BUG=chromium-os:18750
TEST=run them

Change-Id: Ieff91a27bb419e1121361d5b3a11e4c87ff7a087
Reviewed-on: http://gerrit.chromium.org/gerrit/6273
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
2011-08-19 15:35:32 -07:00
J. Richard Barnette
c316521760 Remove mod_for_test_scripts/002enableDumps as dead code
The script created etc/enable_chromium_minidumps in the
stateful partition; however that file isn't on the whitelist
of stateful files that chromeos-install will install on dev
and test images.

BUG=None
TEST=install test image from USB with and without the change; observe the file is absent in both cases

Change-Id: I841cf9ed4c819a9f18cbdd11a3d42af196ab87bb
Reviewed-on: http://gerrit.chromium.org/gerrit/6354
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
2011-08-19 15:26:58 -07:00
Chris Sosa
493cbf8426 Add feature to extract kernel image from other recovery image for use in recovery.
This CL adds a new option to mod_image_for_recovery that allows a dev to pass
in another recovery image as an option and have mod_image_for_recovery use
the kernel provided in that image when building a new recovery image.

BUG=chromium-os:19189
TEST=Built using option on image signed with non-dev keys using appropriate
recovery image as base.

Change-Id: I02a3c3bf458fb3c9fee556364005d7eaff5acccc
Reviewed-on: http://gerrit.chromium.org/gerrit/6031
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
2011-08-19 13:51:52 -07:00
Mike Frysinger
4fc9c2706d enter_chroot.sh: always generate en_US locales
The buildbot code forces the en_US.UTF8 locale itself, and does so inside
of the chroot, so our auto-detection code doesn't catch it.  Always create
these locales that the buildbot uses.

BUG=None
TEST=cleared out locales, emptied out active locale env vars, ran enter_chroot, saw that en_US{,UTF8} were created

Change-Id: I9ad65007a340333e19743985c9cbeea9403823fa
Reviewed-on: http://gerrit.chromium.org/gerrit/6168
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-08-17 12:42:54 -07:00
David James
d899f8d93f Recompile any old perl modules after perl upgrade
Whenever perl is upgraded, it is a good idea to clean out any old
modules and recompile them. This check ensures that perl-cleaner is run
once and only once after each major perl upgrade.

BUG=chromium-os:19244
TEST=Run preflight queue with perl upgrade and old sdk. Verify that old
     perl modules are removed in the first run. Verify perl-cleaner is
     not run again in subsequent runs. Run sdk builder and confirm sdk
     builder runs perl-cleaner every time since it starts with an old
     version of perl.

Change-Id: Ib14f9d73122d5ff2c7a23afc3f56905e30ff2cbc
Reviewed-on: http://gerrit.chromium.org/gerrit/6149
Reviewed-by: Anush Elangovan <anush@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-08-17 11:03:25 -07:00
Mike Frysinger
6601c52b1f enter_chroot: auto generate user locales
Since we no longer force LC_ALL=C on everyone, the few times that perl
does get run by people, it spews the expected "Setting locale failed"
warnings.  This isn't as big a deal as with Debian systems as perl usage
is uncommon in Gentoo.

This is also highlights the long-existing small issue of only specific
locales being available in the chroot.  So for non US english speaking
users, they've been having non-optimal experiences.

So parse the user's active locale and automatically generate the missing
ones in the chroot so that when they do enter, things "just work".

BUG=chromium-os:19139
TEST=set locale to non-existent ones, enter_chroot, & verify locales are created

Change-Id: I43f809a1ee1472e4797edab0f32cecf582ea8b48
Reviewed-on: http://gerrit.chromium.org/gerrit/5986
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2011-08-17 07:33:34 -07:00
David James
4a5c48622e Delete archive_build.sh, which is no longer used.
BUG=chromium-os:19222
TEST=Check cbuildbot no longer uses archive_build.sh.

Change-Id: I6f580269d0e8dfdc4762119b1111a78459c6566c
Reviewed-on: http://gerrit.chromium.org/gerrit/6082
Reviewed-by: Anush Elangovan <anush@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-08-17 05:37:52 -07:00
Hung-Te Lin
eef76808c6 crosutils: support recovery image as release image param for make_factory_package
This CL makes --usbimg (RMA shim mode) supporting recovery image as --release
image source, by creating a temporary disk image.

BUG=chromium-os:15050
TEST=./make_factory_package.sh ... --release RECOVERY_IMAGE --usbimg rma.bin

Change-Id: I5295053ac204869616fc82e2c7a514506082426f
Reviewed-on: http://gerrit.chromium.org/gerrit/5982
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-08-15 21:58:36 -07:00
Hung-Te Lin
28a753b22c crosutils: refine factory and imaging scripts
In order to support building arbitrary image, the partition copying scripts has
been changed to support "copying partitions in same size" and "overwriting
partitions in different size", and "copying partition from external file".

We need these APIs to create disk/usb image with release images that is using
partition with different size (ex, recovery images).

Image copying buffer selection and disk image creation time are also improved.

BUG=chromium-os:15050
TEST=./make_factory_package.sh ... --diskimg preimage.bin
     ./make_factory_package.sh ... --usbimg rma.bin
     ./make_factory_package.sh ...  # omaha mode

Change-Id: I6a4c820abf59e780985c95dc35f9340b347bd952
Reviewed-on: http://gerrit.chromium.org/gerrit/5981
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-08-15 21:58:23 -07:00
Hung-Te Lin
5c67986738 make_factory_pack: auto detect release image type (--detect_release_image)
The release image parameter must be an image signed for SSD booting. This CL
adds detection code and allows on-the-fly conversion from recovery to SSD image.

BUG=chromium-os:15050
TEST=./make_factory_package --release RECOVERY --factory FACTORY # success
     # Seeing: INFO    : Image type is [recovery]:...
     ./make_factory_package --release USB --factory FACTORY # success
     # Seeing:  Image type is [usb]:...
     ./make_factory_package --release SSD --factory FACTORY # success
     # Seeing:  Image type is [ssd]:...
     ./make_factory_package --release GARBAGE --factory FACTORY # failure
     # Seeing:  Image type is [invalid]:...
     ./make_factory_package --release GARBAGE --factory FACTORY --nodetect_release_image # success
     # No image type messages

Change-Id: I8530b3f58574a4298b4d6d904a12bb92636c7365
Reviewed-on: http://gerrit.chromium.org/gerrit/5965
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2011-08-15 21:40:55 -07:00
David James
596520acd9 Resize image without using a loop device to avoid sync.
To resize an image, there's no need to use a loop device. We can just operate
on the image directly. This is simpler and avoids doing a sync which can
noticeably delay the build.

BUG=chromium-os:19150
TEST=Run image_to_vm.sh --board=x86-mario

Change-Id: Idbfc99cee9fd890aaad6379fbde511b273cc1d41
Reviewed-on: http://gerrit.chromium.org/gerrit/6036
Reviewed-by: Anush Elangovan <anush@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-08-15 17:18:05 -07:00
David James
63f62623d4 Update image_to_vm to run sync again prior to detaching loop device.
Prevents errors like this:
  loop: can't delete device /dev/loop0: Device or resource busy

See http://build.chromium.org/p/chromiumos/builders/x86%20pineview%20full/builds/119/steps/BuildTarget/logs/stdio

BUG=chromium-os:19150
TEST=Ran image_to_vm.sh

Change-Id: I8300b4770e1b194045fc068b08ff549984361897
Reviewed-on: http://gerrit.chromium.org/gerrit/6024
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2011-08-15 15:21:33 -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