Commit Graph

187 Commits

Author SHA1 Message Date
Michael Marineau
a7e1e5a177 add(image_set_group): New script to set the update group in prod images.
For generating images for groups other than the one given to build_image
run this script along with the usual image_to_vm.sh commands. To avoid
ambiguity with the 'latest' symlink, this script creates $group-latest
symlinks instead. build_image creates the new symlink too.
2014-05-07 15:07:14 -07:00
Michael Marineau
75999b5e2a fix(build_image): Add group prefix to image output directories. 2014-05-01 10:21:51 -07:00
Michael Marineau
4e85b172df feat(build_image): Optionally generate update payload with prod images. 2014-05-01 09:59:58 -07:00
Michael Marineau
e84f922ba5 fix(build_library): remove references to chromeos-common.sh
Nothing from chromeos-common.sh is needed for image building now. Also
kill off build_common.sh which was just a weird way of sourcing
common.sh. The two piddly functions it provided fit better in
build_image_util.sh
2014-01-05 18:39:47 -08:00
Michael Marineau
213472652c add(prod_image_util): Rename what remains of cros_make_image_bootable
cros_make_image_bootable now only is relevant for prod images, so move
the remaining code to prod_image_util in a similar scheme that base and
dev images use.
2013-12-30 16:12:44 -08:00
Michael Marineau
d1fee3653e fix(cros_make_image_bootable): Remove dead command line flags.
Lots of things are either unused or meaningless. A particularly creative
one is the fact that there are command line flags for mount point
locations that are then overwritten.
2013-12-30 16:12:43 -08:00
Michael Marineau
52e1dba3ec fix(build_image): Migrate to new disk_util commands 2013-12-30 16:12:43 -08:00
Michael Marineau
c9c1efd276 fix(build_image): Add --fast to control use of parallel_emerge
This makes it possible to toggle parallel_emerge just as other scripts
do. In other scripts update the help string to be more specific, the
--jobs option can be used to control parallelism.
2013-12-01 16:04:10 -08:00
Michael Marineau
d3a3a88768 fix(base_image_util.sh): Install glibc and gcc libs via emerge. 2013-12-01 16:04:10 -08:00
Michael Marineau
175d88e6e4 fix(build_image_util.sh): Move image install mask to portage profile.
Reduce the spaghetti config a bit...
2013-11-29 23:38:06 -08:00
Michael Marineau
75972cd991 fix(catalyst): Always use the current SDK tarball as seed.
Right now there is some funky logic to either use a previous build as a
seed or the current SDK tarball if it happens to have been downloaded.
This is a bit confusing and doesn't work reliably since it is reasonable
for there to be neither a previous build or the current SDK available if
the SDK chroot was created some time ago. Fix this by using the new SDK
library and always use the latest SDK, downloading it if needed.
2013-11-23 20:32:55 -08:00
Michael Marineau
207cc2f6a3 cleanup(*): Remove unused/broken test and factory images 2013-09-19 19:04:54 -04:00
Michael Marineau
c86eb16098 fix(build_image): Remove defunct bootcache option.
From ChromeOS, not applicable to our systems.
2013-09-19 18:21:32 -04:00
Michael Marineau
325755e923 cleanup(build_image): Remove some unused flags.
Remove --verity_*: Unused, we don't support verity
Remove --usb_disk: Unused, we use PARTUUID now.
Remove --enable_serial: Unused, and serial is enabled for syslinux
2013-08-19 18:09:11 -04:00
Brandon Philips
a45c529549 feat(build*): add CoreOS production image building
This will create a CoreOS production image and support it with the tools
like image_to_vm.sh and build_image.
2013-07-05 12:06:40 -07:00
Brandon Philips
195d052495 fix(*): drop FACTORY images
we don't need factory image functionality. Drop it to simplify our
scripts and prepare for our "production" feature and flags.
2013-07-05 09:37:38 -07:00
Michael Marineau
2482291e7d fix(scripts): Cleanup build version handling.
A few things here:
 - Source manifests/version.txt directly instead of coreos-version.sh
 - Remove Chrome branch from target image directory names.
 - Use proper version instead of timestap for catalyst builds.
 - Move lsb_release script from coreos-overlay to build_library.
2013-07-02 16:12:02 -04:00
Brandon Philips
4057d5590d feat(disk_layout): follow new CoreOS partition layout
As outlined here we need a new partition layout, this patch makes the
necessary changes:
https://groups.google.com/forum/#!topic/coreos-dev/bA7gwGGoTng

The first big change is making all of the scripts obey partition numbers
based on labels in the disk_layout.json. This makes it much easier to
change later on.

The second big change is in the layout itself. The json file was updated
to reflect the document above.

And finally the grub boot configuration needed for pv-grub and pygrub
were added to the create_legacy_bootloader_templates.sh library utlity.

Everything seems to work and boot now.
2013-05-12 12:31:03 -07:00
Paul Taysom
5e39bb6cd1 Configure the serial port for debugging
Enable the serial port from the build_image command line.
Currenly, you have to edit build_kernel_image.sh to enable
the serial port for kernel debugging. Now:

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

Will enable sending printks to the specified serial port.

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

Change-Id: I9ef4f2a20f0d451e132371339c4eba1faf4c94de
Reviewed-on: https://gerrit.chromium.org/gerrit/41638
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>
Tested-by: Paul Taysom <taysom@chromium.org>
2013-01-23 17:44:43 -08:00
Vic Yang
8e0cd07e03 Build factory install shim by ebuild
Now that we have an ebuild for factory install shim, let's move to that
instead of base image.

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

Change-Id: Ib6a7a598087647b44a4aeca970e293ea72023890
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39955
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2012-12-21 18:54:08 -08:00
Paul Taysom
0c2b408347 Fix for factory build of bootcache
BUG=chromium-os:36862
TEST=./build_image factory_install --board=parrot

Change-Id: If1e59d09eec45340e49b2711b4799eb1f83ea007
Reviewed-on: https://gerrit.chromium.org/gerrit/39133
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Paul Taysom <taysom@chromium.org>
2012-12-03 16:13:15 -08:00
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
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
0915c1e100 Fix bug where cros_factory_install didn't end up in the kernel cmdline
BUG=none
TEST=./build_image --board=stumpy factory_install, verify kernel cmdline

Change-Id: Icdf3156ea08e46d0ce5154133d62cb8d98d144f5
Reviewed-on: https://gerrit.chromium.org/gerrit/34102
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-26 06:35:49 -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
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
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
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
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
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
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
Scott Zawalski
53eb7a03b8 Modify build_image_util to preface CHROME_BRANCH with an R 2011-09-28 08:29:19 -07:00
Chris Sosa
905f6164a1 Prefix build folder name with CHROME_BRANCH from chromeos_version.sh.
BUG=chromium-os:15703
TEST=Ran build_image saw right folder.

Change-Id: I646dc7f67dac126436e75299e150ee053d25e810
Reviewed-on: http://gerrit.chromium.org/gerrit/8397
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
2011-09-27 19:05:14 -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
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