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>
"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>
Much of this file quotes paths which could possibly contain breaking
chars (e.g. spaces), but a few are missed. In general, this probably
doesn't break as no one is adventurous enough to use spaces, but might
as well do it for the fun of it. And to be consistent. One of those.
BUG=None
TEST=ran make_chroot/enter_chroot/build_packages; seemed to be OK
Change-Id: Ic64d60790f50bb812c87a4672e2a24fafbccd749
Reviewed-on: http://gerrit.chromium.org/gerrit/5759
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
If you trace any script with `set -x` enabled, bash will dump the color
variables and all of your output will be colored. So move the "reset"
color to last so that the bleeding is localized to a few lines rather
than a few hundred. There should be no functional difference.
BUG=None
TEST=ran setup_board with and w/out -x to create x86-generic to check result
Change-Id: I1e598cc4a38e9f217f2f670a00bd676bf70c2338
Reviewed-on: http://gerrit.chromium.org/gerrit/5804
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
The recovery kernel is different from the regular kernel, and
should be kept sandboxed so that it does not mess with our
build directory.
We also need to give the recovery kernel a different PKGDIR so
that it does not overwrite our prebuilts for the ordinary
kernel.
BUG=chromium-os:18691
TEST=build_image --factory_install, mod_image_for_recovery.sh
Change-Id: I678a94305d5f30bc2c95bf4e53cfe81b2ae9d8ef
Reviewed-on: http://gerrit.chromium.org/gerrit/5305
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
This makes it possible for chromeos-kernel to include a source tree,
without the tree being installed to CrOS images.
BUG=None
TEST=Manual with modified chromeos-kernel
Change-Id: I9f1193277638e828ffa116c5a397609a3246c80b
Reviewed-on: http://gerrit.chromium.org/gerrit/4760
Reviewed-by: Chris Wolfe <cwolfe@chromium.org>
Tested-by: Chris Wolfe <cwolfe@chromium.org>
This is the first in three stages of changes to transition from separate
"u-boot" and "coreboot" output directories to a single "firmware"
directory. This change/stage will give scripts a facility to easily be
compatible with both schemes. The second stage will transition all the
scripts to use the mechanism, and then finally the third stage will
switch the directories over. Some additional work may be needed if there
are file name clashes, although those sorts of problems would likely
already be present. These new functions could also optionally be taken back
out after the transition.
This change adds find_fw_component, find_u_boot_component, and
find_coreboot_component functions to common.sh. The first function provides
the bulk of the functionality, while the second and third wrap the first and
pass it parameters appropriate for u-boot or coreboot. The first function
accepts an override which it returns if set, and if not it checks for a file
in each of the directories it's passed in the second parameter one by one and
returns the first one it finds. If it doesn't find any it defaults to the last
one.
BUG=chromium-os:18107
TEST=Modified some u-boot related ebuilds to put some files in the firmware
directory. Ran the ebuilds and verified the files showed up where expected.
Modified the cros_write_firmware.sh script to use these new functions. Ran
cros_write_firmware and saw it find the files in their new location.
Also verified that the firmware on the target was updated as expected.
Change-Id: Ic664e0e1c4a5b27efc9fb892ff5bd91cf1b5be56
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/5170
Tested-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
This also removes all the tput noise we are seeing in buildbot logs.
("tput: No value for $TERM and no -T specified", "tput: unknown terminal
"unknown", etc.)
BUG=none
TEST=manual below
src/platform/scripts$ TERM=unknown; ./enter_chroot (No more tput errors)
Change-Id: Ic74a0bd66d7e0cedcf7b65ec3a5f43b61b8276f9
Reviewed-on: http://gerrit.chromium.org/gerrit/4763
Tested-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
BUG=None
TEST=setup_board, build_packages, build_image
TEST=grep all sources for the unused functions
Change-Id: Iaac5589aaba6f6f48aa00cdab76a7765f8d931ce
Reviewed-on: http://gerrit.chromium.org/gerrit/4580
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
These hacks are all at least three months old, and our official policy is to
remove hacks after two weeks. For future hacks, the plan is to use the chroot
upgrader script so that old chroots can be supported indefinitely.
Thanks to the Gerrit transition, there are probably few old chroots around
anyway that aren't going to be recreated anyway.
BUG=chromium-os:16151
TEST=Verify enter_chroot.sh still works.
Change-Id: Ie0c777aabbd70d2a0c88b59ddd71e9b67965ca94
Reviewed-on: http://gerrit.chromium.org/gerrit/2158
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Tested-by: David James <davidjames@chromium.org>
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
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
BUG=chromium-os:11981
TEST=run cros_sign_bootstub with and without CROS_LOG_PREFIX set.
Change-Id: I320622d4161479dcc29ebdee68e160d94f1d3196
Review URL: http://codereview.chromium.org/6596108
These functions make it easy to do testing in scripts for required
files and tools and provide useful error messages when the files
or tools are not found.
BUG=chromium-os:11981
TEST=run cros_sign_bootstub in configurations that test all paths in
these functions.
Change-Id: Ia63cfabd1eecba6473331b756486745d71e6b699
Review URL: http://codereview.chromium.org/6591056
The build bots run things a little different it seems. I'll look into
what it is that they do that a normal run doesn't do that causes
this change to fail there. But for now I'm reverting it.
This reverts commit 6d65c0f1b3.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/6594062
Change-Id: I7cdfb25c28f1c139981aaf7382cd3e9dbfd4446b
BUG=chromium-os:11981
TEST=run cros_sign_bootstub with and without CROS_LOG_PREFIX set.
Change-Id: I320622d4161479dcc29ebdee68e160d94f1d3196
Review URL: http://codereview.chromium.org/6597053
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
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
If we are inside the chroot then we assume that the "gclient" root
is ~/trunk. If we are outside the chroot we continue with the
previous search mechanism to find the "gclient" root.
Change-Id: Ia40de609ea596228fec2644ff3046e376b112b06
BUG=chromium-os:4230
TEST=run "src/scripts/cros_overlay_list --board tegra2 --variant seaboard" inside and outside the chroot, and under sudo.
Review URL: http://codereview.chromium.org/6265028
Review URL: http://codereview.chromium.org/6344016
If we are inside the chroot then we assume that the "gclient" root
is ~/trunk. If we are outside the chroot we continue with the
previous search mechanism to find the "gclient" root.
Change-Id: Ia40de609ea596228fec2644ff3046e376b112b06
BUG=chromium-os:4230
TEST=run "src/scripts/cros_overlay_list --board tegra2 --variant seaboard" inside and outside the chroot.
Review URL: http://codereview.chromium.org/6265028
These are used to run virtual or nested X servers, which we
don't do. Removing the binaries saves 3.4 MB.
Change-Id: I528231a781f8a7a0202ca109f8064c3b11ff172b
BUG=chromium-os:8073
TEST=built an image and checked that the files were gone
Review URL: http://codereview.chromium.org/5990003
This reverts the main change of
84e72fab23
and undoes the breakage of scripts that are symlinks to
...chromeos/scripts..., but at the cost of re-breaking scripts under
scripts/bin. The correct fix is a combination of removing all the
symlinks to ...chromeos/scripts... and a more robust way of finding
the chroot path of the executable. But that will have to wait until
someone else does it next week or I return from vacation
TEST=Ran all of these outside chroot. None seemed more broken than when run in the chroot. /setup_board --board=x86-generic, ./cros_workon list --all --board=x86-mario, ./start_devserver , ./build_image --help, ./build_packages --help, ./cros_upgrade_chroot --help, ./enter_chroot.sh , ./customize_rootfs --help, ./run_remote_tests.sh , ./verify_rootfs_chksum.sh , ./set_shared_user_password.sh
BUG=n0ne
Change-Id: Ic2b7484e53e6a977ed6ae675fe99e109b385020d
Review URL: http://codereview.chromium.org/5946003
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
Review URL: http://codereview.chromium.org/5271010
BUG=chromium-os:9877
TEST=ran bin/cros_workon_now, cros_workon, set_shared_user_password
Note---this introduces another bashism to common.sh. However, despite
comments to the contrary, common.sh does not actually parse under dash
without this change
Change-Id: I1e6b9751afa8341c100f3b8e0b96284835a53d17
Review URL: http://codereview.chromium.org/5444002
The --fast support for build_packages is stable now, and should significantly
improve the speed of our official builders. We should turn it on so that
builders can finish their builds in less than 8 hours.
BUG=chromium-os:6706
TEST=Run ./enter_chroot.sh --official_build and verify that --fast is on by
default now
Change-Id: I6ad126b9b6ce16ffc9887a7af22c2e3f85afbf42
Review URL: http://codereview.chromium.org/3418001
Change-Id: Ifc47ed28dc3efc0e7ebd018f6703b36913ffd39c
BUG=8716
TEST=Ran the script inside the chroot to makesure it is generating the package.
Review URL: http://codereview.chromium.org/4425004
BUG=8544
TEST=build image with --factory_install, ensure that image does not have data in /usr/local/autotest-pkgs
Change-Id: I5ed17d794392ec654bc122fa15f7ab8a7abbba2d
Review URL: http://codereview.chromium.org/4756001
2. Source shflags, if they are in the current directory
Change-Id: Id22e597a6fb71905f2d0ca5c4a1d94ce5a8a931f
Review URL: http://codereview.chromium.org/4177005
echo -ne isn't portable but printf with octals is so this
makes the switch.
In addition, the current offset is off by 3 and is updating the UUID space.
This was from style cleanup and all functional test passed - of course.
This change fixes that too.
TEST=built and installed and checked ro enforcement works
BUG=chromium-os:7972
Change-Id: Ifb3cb2c6f3219af819baff5750453439e1ba6edf
Review URL: http://codereview.chromium.org/3997001
This change makes more of the root filesyste metadata static across builds, but
more can be done there. It also changes the root filesystem to use ext2 as
we don't need journaling in normal mode. Optionally we could use ext3 for
non-verified if desired (it's an easy change).
In particular, this change cleans up the following:
- clears the rootfs uuid
- labels it C-ROOT (instead of C-KEYFOB)
- removes reserved inodes and blocks
The major feature of this change, however, is that it adds two simple
helpers to common.sh: disable_rw_mount and enable_rw_mount. They will
set high order byte (le) in the ro compat field to be 0xff. This will
tell the kernel that the filesystem uses features R24-R31 which are safe
for use on the running kernel iff the filesystem is mounted read-only.
These functions are called in cros_make_image_bootable and
mount_gpt_image, respectively. mount_gpt_image will always
enable_rw_mount and cros_make_image_bootable will disable_rw_mount if
--enable_rootfs_verification is true.
The approach is ugly but reasonably well contained. If ext2 ever gets a
new revision and new features in the same range are introduced, then we
would be getting inconsistent behavior. That said, it is unlikely that
that churmn will happen and if the impact is negative, it will ideally
show up during testing.
N.B., this will likely result in changes needing to be made to the
signing scripts in vboot_reference to ensure that rw mounting is
enabled/disabled in the same way (E.g., during stamping).
BUG=chromium-os:7468
TEST=- built x86-generic, imaged to usb stick, attempted to mount rw /dev/sdc3 on the host and was properly bounced.
- booted to the image just fine on a dogfood device.
- mod'd for recovery, then installed and booted.
- mod_image_for_test runs with no errors; booted the resulting image as well
- booted a factory_install with the pending dm changes
- BVT passed with build_image x86-generic (vboot enabled)
- [in progress] autotest that checks if the rootdev = /dev/dm-0 and
then does a dumpe2fs | grep -q FEATURE_R31
Review URL: http://codereview.chromium.org/3916002
Change-Id: If4dcba7568a110f4e32627c916d9e5741e5e5414
This function is now called by enter_chroot.sh. A separate change
will call the function from make_chroot
Change-Id: I4fc07c413e56db3e5e7617428f20f2ffc02790d7
BUG=chromium-os:7072
TEST=Took root out of sudoers and ran enter_chroot.sh script; saw that it was re-added.
Review URL: http://codereview.chromium.org/3909001
It's sometimes useful to run a command in chroot and redirect/pipe stdout. Any objections to having enter_chroot send its chatter to stderr?
Review URL: http://codereview.chromium.org/3160024
Autotest installs stuff to the image via ssh, so there's no need to include
all of this stuff to the image. This saves disk space. Note that
/usr/local/autotest-chrome is currently already excluded from the image
because of a hack in the chrome ebuild, and that /usr/local/autotest is
usually also excluded from the image because autotest is not included
as a dependency of any packages that are installed.
In the factory setting, it looks like the factory has its own code for
installing autotests via rsync. Presumbably, if the factory tests are
managing the autotest directly, they won't want emerge mucking with the
directory as well on the image. Currently, emerge doesn't muck with the same
directory, but we probably want to ensure that it doesn't start doing that in
future to ensure sanity.
TEST=Built images. Modded for factory test. Verified that (a) build directory contains autotests, (b) regular images do not contain autotests; and (c) images modified for factory test do contain autotests
Review URL: http://codereview.chromium.org/3124010
BUG=none
TEST=run build_image, happen to finish on a time with less than 10 seconds in it, watch the missing 0-padding
Review URL: http://codereview.chromium.org/3050047
This change checks for and sources shflags from /usr/lib before
depending on the gclient-style path.
TEST=None
BUG=4230
Review URL: http://codereview.chromium.org/3010045
Change-Id: I3085c2356c40c691a2a72bf79c1d9167162d6dca
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
parallel_emerge prints a message every 30 seconds now so that buildbot doesn't
kill us early. Per discussion with cmasone, reverting the revert.
This reverts commit debaa3d8cf.
This reverts commit f0fb864e8d.
This change needs to be reverted because it suppresses logging output
from the build process. Thus, when something goes wrong...the
sherriff is left completely helpless in terms of debugging the issue.
TBR: davidjames@chromium.org
Also update eretry to not pass in $EMERGE_JOBS anymore, in coordination with my previous change, which passed it in directly instead of depending on eretry to do so: http://codereview.chromium.org/2944004/show
TEST=Ran build_image --jobs 2 and build_packages --jobs 2
BUG=none
Review URL: http://codereview.chromium.org/2914004
TEST=Ran unittests with 2 test failures (powerd and update engine).
Will check with authors to fix these before moving the default over
to this.
Review URL: http://codereview.chromium.org/2837004
TEST=Tested with building a new image, looking in the output directory, running
the image and running vi.
Review URL: http://codereview.chromium.org/2075019
I verified that if I whack /usr/lib/debug folder and run build_image, it works fine. This is important since I plan to check in this issue first and then the fix to add debug flags.
Review URL: http://codereview.chromium.org/2113007