Added --remote flag, and some "NonWorkon" methods that complement the "Workon"
methods.
To add a non-workon project to the local_manifest.xml, specify a remote.
The remote tag will be added as part of the new entry in local_manifest.xml.
BUG=chromium-os:32247
TEST=In conjunction with a change in cros_workon, tested that non-workon
projects can be added to the local_manifest.xml.
Change-Id: I1bc4247532647e9bc5962acef988ab57445f4b0e
Signed-off-by: Andrew Chew <achew@nvidia.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/26346
Reviewed-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-by: David James <davidjames@chromium.org>
Currently, the scripts in src/scripts have multiple implementations
for handling when common.sh fails to load, some of which are buggy.
To simplify the boilerplate, these scripts now just exit if common.sh
fails to load. The shell itself will print the following message if
common.sh is not found:
/usr/lib/crosutils/common.sh: No such file or directory
BUG=chromium-os:32442
TEST=Run these scripts with and without common.sh installed.
Change-Id: Ie54420b6c649774f9cb039c14c80f4cf6c6ebc07
Reviewed-on: https://gerrit.chromium.org/gerrit/27058
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
To avoid needing to migrate fresh dev images's /var contents when
using the encrypted partition, move the /var bits out of the old
stateful_partition/var location into stateful_partition/var_overlay.
The (initially empty) system /var will continue to either live
in stateful_partition/var (in the unencrypted case), or in
stateful_partition/encrypted/var (in the encrypted case).
The contents needed for gmerge will be symlinked into place at runtime
(via CL I6e68b1f334f5d5b3c4d2977008435bd929191ce7). While the installer
already makes sure that /var is not shipped on an image, this change
additionally make sure that the other contents installed by the ebuilds
will not show up in the actual /var either.
BUG=chromium-os:22172
TEST=link build, boot, install, manual testing.
Change-Id: Ie6480a59929818fe5d36a46abf533b648fb78850
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26355
Reviewed-by: Chris Sosa <sosa@chromium.org>
Kernel and ramdisk image together are copied into a 16MB partition.
This CL logs their size when building image. If they are larger than
14MB, warning message is emitted. If they reached 16MB, building fails.
BUG=chromium-os:27739
TEST=Build success on x86 and arm.
Check log and see kernel image size logged.
Lower the size limit to 6MB and build x86 factory install shim and
see build fail.
Change-Id: I4c4895c2989b302aa0c3624127518468566d1148
Reviewed-on: https://gerrit.chromium.org/gerrit/22543
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
The "function" keyword is superfluous, not in POSIX, is inconsistent
between bash files, and generally makes me angry. So convert every
instance to the form:
foo() {
BUG=None
TEST=`cbuildbot x86-generic-paladin` works
Change-Id: I97f5ca30a3edfef7222b1e08ac23917dc613b556
Reviewed-on: https://gerrit.chromium.org/gerrit/22467
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
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>
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>
Old default conflicted with a new service running on the DUT.
BUG=None
TEST=Rerun cros_image_to_target
Change-Id: I982b68500d6cb59c884a286229688ee41ff6d76d
Reviewed-on: https://gerrit.chromium.org/gerrit/17434
Reviewed-by: Ryan Cairns <rtc@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Previously this script never honored the user --port option.
BUG=None
TEST=Manual: Run with or without --port option
Change-Id: I971ee69818a37e6706ce70327b1d243fd78d214d
Reviewed-on: https://gerrit.chromium.org/gerrit/16429
Reviewed-by: Ryan Cairns <rtc@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Newer versions of util-linux's mount utility will not show:
/dev/loop0 on /some/path type ext3 (mount,opts)
Instead, it finds out the file backing /dev/loop0 and outputs:
/some/file on /some/path type ext3 (mount,opts)
This breaks the make_image_bootable helper that attempts to look up the
loop device that mount_gpt_image.sh happened to pick.
Let's scuttle the idea of parsing `mount` and move directly to what the
kernel has to say via /proc/mounts. Hopefully the ABI there should be
quite a bit more stable.
BUG=None
TEST=build_image works with mount from util-linux-2.16
TEST=build_image (before change) fails with mount from util-linux-2.19
TEST=build_image works with mount from util-linux-2.19
Change-Id: I66908800e82ff2e106face9d57773721e400dc2a
Reviewed-on: https://gerrit.chromium.org/gerrit/11869
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
BUG=chromium-os:10993
TEST=Downloaded a latest image via cros_download_latest_image with
rootfs verification enabled and disabled; confirmed that the results
were as expected.
Change-Id: I489a20452bd29ac13fa45fec66214a045086634d
Reviewed-on: http://gerrit.chromium.org/gerrit/10405
Reviewed-by: Zelidrag Hornung <zelidrag@chromium.org>
Commit-Ready: Rahul Chaturvedi <rkc@chromium.org>
Tested-by: Rahul Chaturvedi <rkc@chromium.org>
BUG=chromium-os:21822
TEST=manual
testing: ran with --debug, and verified that the chosen image file
is appropriate. (test image is chosen, unless --no-test is specified.
if both --test and --no-test are present, image file is chosen
according to whichever option appears last.)
Change-Id: Ia0a6d0ebac889a347d1b8989b8b2c3db8231dcae
Reviewed-on: http://gerrit.chromium.org/gerrit/10265
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Pass --use_emerged flag on to run_remote_tests
BUG=None
TEST=Run comman with flag
Change-Id: Iacaf967a0a018e1686295179a9ef0a3e8eb9e2d5
Reviewed-on: http://gerrit.chromium.org/gerrit/8817
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
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
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>
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>
"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>
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>
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>
cros_download_latest_image was using cros_gsdcurl, which has stopped working,
even when you use application-specific passwords. I've updated it to use
gsutil instead, which is more supported.
BUG=chromium-os:17512
TEST=Try downloading the latest x86-generic image.
Change-Id: Ia7b0704a8c7ff6897508c44e882f87bc44ccbe28
Reviewed-on: http://gerrit.chromium.org/gerrit/5031
Reviewed-by: Rahul Chaturvedi <rkc@chromium.org>
Tested-by: David James <davidjames@chromium.org>
This is being done so that the image parser run by the bots
can still parse images built with this flag
BUG=chromium-os:18299
TEST=Wait for bots to cycle green with old images
Change-Id: Ibebe62f0db60ab3a57e04964f872398028ee48c8
Reviewed-on: http://gerrit.chromium.org/gerrit/4824
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Puneet Kumar <puneetster@chromium.org>
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
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>
This change addresses a defect which prevents simultaneous use of
'cros_image_to_target.py'.
The issue is that the default invocation will always use the same port
number of HTTP communication. This change, with default parameters,
will now start at the same port number, but will now instead iterate
through a number of ports (the number of ports is set to 10).
If no available port can be found, the script will fail with an
appropriate message.
If the user specifies a specific port, then only that port number will
be used; if the port is not available, the script will fail with an
approrpriate message.
BUG=chromium-os:17558
TEST=Uploaded two images simultaneously to different boards.
Change-Id: Icbbea12468fd766897daeecb0b7f1d3929f52a1c
Signed-off-by: Taylor Hutt <thutt@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/4110
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Terry Lambert <tlambert@chromium.org>
Since now the arm firmware can parse %U as x86 bios, and kernel can
parse PARTNROFF=%d, we are able to generate kernel command line with
such construct.
BUG=chromium-os:14022,15683
TEST=manual
1. Build image with root filesystem verification turns off
2. Boot successfully
3. Run 'cat /proc/cmdline' and validate its output
4. Run 'rootdev' and validate its output
Change-Id: I11de0a30928efe9d9b0149feb3389a2f30063516
Reviewed-on: http://gerrit.chromium.org/gerrit/1104
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: <nsanders@google.com>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
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>
cros_make_image_bootable is called up to 4 times in a typical workflow. The fsck
check can take up to a minute or more because it first copies 2G of the image to
run the fsck on. It adds several minutes to the build.
The check itself is just a sanity check that shouldn't trigger in normal builds.
BUG=none
TEST=build_image
Change-Id: I86512f7efc67027fe687f0c0ad8f6df32579dbe2
Reviewed-on: http://gerrit.chromium.org/gerrit/2250
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
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>
This reverts commit c7dc24c89e.
BUG=15076
TEST=Unit tests pass. Scrubbed kernel from local_manifest.xml and then
worked on it again.
Change-Id: Ia0052cf2efa330e1c6422f2876d146bf6f297378
Reviewed-on: http://gerrit.chromium.org/gerrit/625
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mandeep Singh Baines <msb@chromium.org>
Fix to handle new repository naming. Instead name="kernel", the kernel
is now name="chromiumos/third_party/kernel".
BUG=15076
TEST=Ran unittests and verified that local_manifest.xml got created
correctly when working on the kernel for the first time.
Change-Id: Ib0eef7ecb0522c3b5bcc111d0f30467c8ca19ec5
Reviewed-on: http://gerrit.chromium.org/gerrit/546
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Mandeep Singh Baines <msb@chromium.org>
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>
In both cases move making contact with the remote board to
an earlier step and default the "board" option to whatever
is reported by the remote.
BUG=n0ne
TEST=Run without board flag or .default_board
Change-Id: I53330ce5ab05b4cff92ac3a384ae0202fc156953
Reviewed-on: http://gerrit.chromium.org/gerrit/433
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Verity only supports a depth of 0. Passing anything other than 0 will
cause a verity failure.
BUG=14314
TEST=Verified that verity does not fail when do depth is passed.
Before this change, verity would fail with the error message
reported in the bug.
Change-Id: I68495c4486284744ee0779b6c9cdc0ef214519c7
R=gauravsh@google.com,scottz@google.com,drewry@google.com
Review URL: http://codereview.chromium.org/6873134
For run_remote_tests this required "fixing" restart_in_chroot if required. Right now that script ->only<- works if its run on a scripts being called from src/scripts. This change makes it more generic by doing this for any script called from within our source tree.
I borrow reinterpret_path_for_chroot from image_to_live. Other CL to remove it from there.
Change-Id: If717beccd777ac178366d58b91521b9a62d55d85
BUG=chromium-os:11172
TEST=Ran them
Review URL: http://codereview.chromium.org/6730012
Change-Id: I8233aaab234eb6a3a7948abb1d311c4c9c162190
BUG=chromium-os:11172
TEST=Ran from new symlinks from previous locations.
Review URL: http://codereview.chromium.org/6731005