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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
* 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>
"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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>