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>
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>
The recent changes to image_to_usb.sh assumed that chromiumos_image.bin
is always used for generating a test image. This wasn't the case before
these changes were applied, where a preexisting test image would have
sufficed. This fix eliminates image autodetection entirely when
--test_image it used and falls back to the old behavior: if a test image
exists, it will use it; otherwise, it will generate it from the image
specified by --image_name, or from the default chromiumos_image.bin.
This is not to say that I like this behavior: it is subtle, may lead to
errors (e.g. using a stale test image whereas the user assumes a new one
should be generated), and inconsistent with other behaviors (e.g.
installing a recovery image, where no image generation takes place at
all). I believe that long term we should eliminate the generation of
test images from image_to_usb.sh and have users invoke the necessary
scripts (like mod_image_for_test.sh) explicitly.
BUG=chromium-os:26239
TEST=Ran script with different combinations of --test_image,
--image_name and image files present.
Change-Id: Ib2491a7e45e23eb51ced6ef31d3f129ec7863a25
Reviewed-on: https://gerrit.chromium.org/gerrit/15764
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
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>
Convert image_to_usb.sh, mod_image_for_recovery.sh, and
mod_image_for_test.sh to use get_latest image; previously these
scripts wouldn't honor the 'latest' symlink.
BUG=None
TEST=re-link 'latest' to an alternate directory; test scripts
Change-Id: Ibb56bb993eae9b6ff9dbfea5090c7cae46f2c133
Reviewed-on: http://gerrit.chromium.org/gerrit/10267
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: David James <davidjames@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>
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 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>
If test image is present already, mod_image_for_test should
succeed, even if the input image is missing.
BUG=chromium-os:19087
TEST=Run x86-mario-release builder and verify it works now.
Change-Id: If9729328120c7bbd9c1fffca26d6b1cddf2e980e
Reviewed-on: http://gerrit.chromium.org/gerrit/5831
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
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>
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
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 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>
The problem here is that most were doing their exiting w/in a subshell;
exit within a subshell kills the subshell, not the parent. Not all scripts
were using set -e (which would pick up the failing subshell); as such
just rewriting them to remove the potential via eliminateing the subshelling.
Beyond that, removed a couple of custom (working, although non-standard)
approaches, and removed a duplicate common.sh sourc'ing w/in mk_memento_images.sh
TEST=force 'find_common_sh' to fail, note the scripts fails to exit
BUG=none
Change-Id: Ia1108a091a6399ad6aedd3cade4a107f4411686c
Reviewed-on: http://gerrit.chromium.org/gerrit/3905
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
By default, "cros_debug" should be included in the kernel commandline for
developer and test images. This change adds "cros_debug" to the kernel
commandline for test images when using the deprecated mod_image_for_test.sh
and syncs this file with previous change to build_image:
http://gerrit.chromium.org/gerrit/#change,3790
TEST=Use mod_image_for_test.sh to create a test image, boot it and check
/proc/cmdline for "cros_debug".
BUG=chromium-os:17393
Change-Id: I7774dec80707f702036eff0f6277837858b64182
Reviewed-on: http://gerrit.chromium.org/gerrit/3897
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Arkaitz Ruiz Alvarez <arkaitzr@chromium.org>
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>
The default is --standard_backdoor, which installs well-known ssh keys and sets
a well-known root password. Passing --nostandard_backdoor will cause
mod_image_for_test to use ssh keys from ~/.ssh/*.pub instead of the test keys
and not set the root password.
BUG=chromium-os:11744
TEST=Adhoc
Build an image with --standard_backdoor.
ssh -i ${SRC}/src/scripts/mod_for_test_scripts/ssh_keys/testing_rsa root@${DUT}
ssh root@${DUT} with 'test0000'
cat /root/.ssh/authorized_keys # check for the test key
Build an image with --nostandard_backdoor.
ssh -o PubkeyAuthentication=no root@${DUT} # this will fail
ssh root@${DUT} # this should work
cat /root/.ssh/authorized_keys # check for just your keys
Change-Id: Ie92fbc9d3815f478698c8c94d938daca2b5cd53e
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/3449
Reviewed-by: David Rochberg <rochberg@chromium.org>
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>
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 also deletes the code from mod_for_factory_scripts/200patchInitScript
that created the files that now come from the new package.
BUG=chromium-os:13258
TEST=Build and boot a factory test image
Review URL: http://codereview.chromium.org/6665048
Change-Id: I115d1a2e3afe2fdefc0e07247b21b67e0cf9cc62
BUG=none
TEST=build and boot a factory test image
Review URL: http://codereview.chromium.org/6713049
Change-Id: Ia0c4c9780fccc91c4464acf84ca4c0327b8ea7bd
This CL removes --factory_install support from mod_image_for_test.
Factory install images are no longer produced using mod_image_for_test.
BUG=chromium-os:12899
TEST=manual
Change-Id: Ia6d6cac07f710cb82473fd696c2717ee660543b6
Review URL: http://codereview.chromium.org/6688015
prepare_test_image would prepare the correct image (test or factory)
but its return value would always specify the test image. This meant
that image_to_usb.sh would pick up the wrong image.
This commit fixes this.
BUG=chromium-os:12377
TEST=./image_to_usb --from=... --to=/dev/sdb
also with --factory
also with --test
Make sure it picks up the correct image in each case.
Change-Id: I165b604b448a6c938a47e57a667bd5f001626efe
Review URL: http://codereview.chromium.org/6609016
This addresses the case where we don't have chromiumos_image.bin but don't
actually need it since we've previously generated a test image.
Change-Id: Ie7be0165e0f68bbd9d34156b55e17d971cb86fa9
BUG=chromium-os:12268
TEST=Ran it with --noinplace and missing dev image.
Review URL: http://codereview.chromium.org/6538031
BUG=chromium-os:4230
TEST=grep for references to old parallel_emerge location
Change-Id: I3238e719e01df57648d3d91c0dfd7c37f7a934ee
Review URL: http://codereview.chromium.org/6246058
The original intent of this code was to prevent mounting
of the OEM partition. However, chromeos_startup mounts
/mnt/stateful_partition/home to /home and this file gets
hidden. Given that we might mount the OEM partition always
soon, removing this code.
BUG=chromium-os:11661
TEST=build_packages, build_image, ran suite_Smoke
Change-Id: I7ef4dd5c78484664cbdeb4ffaff26e2fcf8d2507
Review URL: http://codereview.chromium.org/6458007
into mod_image_for_test.sh rather than slightly different versions
of the same in image_to_usb.sh and image_to_vm.sh
Added a function to get a test image into common.sh
Added --inplace option to mod_image_for_test, which is the default,
and preserves the original behaviour. But using --noinplace it will
now do the copy for you.
Found that chromiumos_image.bin appears throughout the scripts, so added it and the test variant to common.sh
BUG=chromiumos-10126
TEST=run mod_image_for_test.sh with and without --noinplace
run image_to_usb.sh and image_to_vm.sh with both options
test on Seaboard that correct image is provided
Really we should have automated testing for these scripts
Change-Id: I5cfa91792c7fded35e7f4ca8f8f27c6b270817fb
Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=4fc5227
Review URL: http://codereview.chromium.org/5271010
Change-Id: I1118a840e8ecc0ae0620003ea79ee0fd4174a96b
BUG=chromium-os:11811
TEST=Boot the system, and run 'xset'. Also, run the BVT suite
TEST=Test mod_image_for_test.sh --factory_install to see that there are no error messages
Review URL: http://codereview.chromium.org/6451009
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
BUG=chromium-os:3828
TEST=Boot with test image. Check that OEM partiotion is not mounted at /mnt/partner_partition
Review URL: http://codereview.chromium.org/3355019
Change-Id: Ib7c15010df7d7f30e49149c42034b26a13d69573
Copying the .ssh directories within client takes up O(2n) space in
the stateful partition
BUG=none
TEST=reran mod_image_for_test.sh
Review URL: http://codereview.chromium.org/2832079
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
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
BUG=4828
TEST=make sure factory image actually builds while chrome ui autotests are included in the build
Review URL: http://codereview.chromium.org/3010035
mod_image_for_test.sh now passes the target architecture to the subscripts
mod_for_test_scripts/710enableAuthTesting generates the /etc/fake_root_cert
databases by running nsscertutil under QEMU.
BUG=3310
TEST=Built autotest enabled images for x86 and arm. On arm, the browser no
longer crashes trying to read the fake root certs.
Review URL: http://codereview.chromium.org/2878033
Added --fast option. Updated the one place that wasn't using sudo when calling
emerge to use sudo like the others. This is safe because we're merging with
--usepkgonly.
TEST=Ran mod_image_for_test.sh with and without the --fast options
BUG=none
Review URL: http://codereview.chromium.org/2834055
BUG=3283
TEST=Tested by running mod_image_for_test and checking the stateful partiton
on the resulting image and verifying that these files exist in the correct
locations.
Review URL: http://codereview.chromium.org/2107013