Ubuntu 11.10, for whatever reason, moved /dev/shm to /run/shm. Since
/run is not mounted in the chroot, /dev/shm is a dangling symlink and
various things that require shared memory start failing.
If /run and /run/shm exist, bind-mount them in the chroot.
Because /run doesn't yet exist in the SDK tarballs, try to create it
(and /run/shm if necessary) as root if it and can't be created as a
normal user.
BUG=chromium-os:19871
TEST=Run cros_sdk, verify that /dev/shm has the expected contents
Change-Id: I61583c1c0d409c1234fa8d8930a9b64544c9a8e7
Reviewed-on: https://gerrit.chromium.org/gerrit/10222
Tested-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
BUG=chromium-os:21474
TEST=run the script, see my chroot being updated, cases below:
1) run normally, see the latest gcc being selected
2) run while having an older gcc manually selected, see no updates
3) set an invalid native profile, see it being fixed
Change-Id: Ic84187b8acf39fba11f2e39f36457e6f696ad7e4
Reviewed-on: http://gerrit.chromium.org/gerrit/9832
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
BUG=chromium-os:21610
TEST=Ran cros_start_vm/cros_stop_vm ... start_vm with same pid after manually
closing it, etc.
Change-Id: If4062c452a135d39a280374cbbebfa852e744022
Reviewed-on: http://gerrit.chromium.org/gerrit/9974
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
the factory install shim.
BUG=chrome-os-partner:6535
TEST=Ran factory install shim on Alex and in VM
Change-Id: I32761736d8565d16323c6962058b478511a3ee8c
Reviewed-on: http://gerrit.chromium.org/gerrit/10398
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Jon Salz <jsalz@chromium.org>
Commit-Ready: Jon Salz <jsalz@chromium.org>
Change helper invocation to use discovered script path so image_to_vm.sh
and mount_gpt_image.sh can be run outside of ~/trunk/src/scripts.
Additionally, minimize SCRIPT_ROOT boilerplate to not potentially mix
execution locations, as suggested by David James.
BUG=None
TEST=Built images from outside of ~/trunk/src/scripts
Change-Id: I4851cc74e7da8e08b4e7be79651fb41ce8868aed
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/10241
Reviewed-by: David James <davidjames@chromium.org>
We have problems with loopdev leaks occasionally (see crosbug.com/16651); this
will help us figure out what we're leaking and to whom.
BUG=chromium-os:16651
TEST=build,mod_image_for_recovery
Change-Id: I12ae1fe433f54ffee0ec18bf1ce4db111b53f13d
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/10301
Newer setup_board now sets up /etc/portage/env in the board root as a
symlink. Add an update hook to fix up all existing boards.
Also migrate /etc/portage/bashrc in the chroot.
BUG=chromium-os:21787
TEST=update chroot from ver 13 to ver 14; make sure /build/*/etc/portage/env are symlinks
Change-Id: I8b828b8773998e1aa0104c42bad2dd2ac5c8416c
Reviewed-on: http://gerrit.chromium.org/gerrit/10344
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Commit-Ready: 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>
Legacy boot loader like syslinux is only for x86 platforms.
We should ignore the configuration files if they don't exist.
BUG=chromium-os:21887
TEST=./make_factory_package --diskimg OUTPUT \
--release PATH_TO_ARM_IMAGE \
--factory PATH_TO_ARM_IMAGE \
--hwid none # success
# do the same for x86 builds, mount ESP (#12)
# and found 'sda3' in root.A.cfg
Change-Id: I53a8b418045465a69d700298b73793d60187f31a
Reviewed-on: http://gerrit.chromium.org/gerrit/10385
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
If files are in the board build dir with newer mtimes than the dirs
or symlinks, then the get_latest_image code selects the file instead
of the latest dir. And then it all falls down:
Cannot find image directory /path/to/file
So tweak the look up code by having bash do the expansion of dirs
only, and then let ls do the mtime sorting.
BUG=None
TEST=`./image_to_usb.sh --board=x86-alex -y --to=/dev/sdb` still works after deleting "latest"
Change-Id: Ic06a2ddd0206748d35cb7762009df67a267d4746
Reviewed-on: http://gerrit.chromium.org/gerrit/10258
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
These files need not be +x to work since we source them directly.
BUG=None
TEST=update chroot from ver 12 to ver 13
Change-Id: I3133cf532286bed63308e82767f0c95900f54e84
Reviewed-on: http://gerrit.chromium.org/gerrit/10342
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Since we need this anyways (can't assume the host outside of the chroot
provides shflags), always source the local copy rather than searching
for versions provided by the chroot.
BUG=chromium-os:21742
TEST=`cros_sdk --enter` works
TEST=`./build_packages --board=amd64-generic` works
Change-Id: Ia390042131f59948472b124cfe4e273483eada6a
Reviewed-on: http://gerrit.chromium.org/gerrit/10231
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
"new_kern.bin" was being generated in the current directory and not
being cleaned up. Additionally, without this change, it is not safe to
run update_kernel.sh concurrently to separate devices.
BUG=None
TEST=Updated a kernel on a running VM, verified /tmp/update_kernel.* was
created and used for generated outputs.
Change-Id: I27cd236ee9d38263dcca361ce063078a13b11864
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/10240
Reviewed-by: Olof Johansson <olofj@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>
The KVM examples boot from the syslinux partiton, so update the kernel
that lives there too.
BUG=None
TEST=correctly updated a kernel in a VM
Change-Id: I1526064f85d6c9233696590e9e746bc91bcd6d2a
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/10239
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Verified boot is not supported yet for USB+EFI boot, which is the case
of factory install shim. We need to select normal boot in legacy boot
loaders when building factory install shim.
BUG=chrome-os-partner:6358
TEST=build_image --factory_install
# boots successfully under ZGB H2O firmware
Change-Id: Ic4645a1766514bf7e0c31f8a4df21452bf195705
Reviewed-on: http://gerrit.chromium.org/gerrit/10013
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Nick Sanders <nsanders@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>
Section header like [x86-zgb] would match any single-character
file/directory name within 6-z. Escape open brackets to prevent
config section headers from being evaluated to match local files.
BUG=chromium-os:21518
TEST=1. Create a single-character file 'u', under the same
directory where you'll run make_factory_package.
2. Create a test.conf with section header "x86-zgb".
3. ./make_factory_package.sh --config test.conf
4. Verify u is not part of the executed command.
Change-Id: Ia6178b7fc2f8d707830ee7fed54f9e5ab60d6836
Reviewed-on: http://gerrit.chromium.org/gerrit/10012
Tested-by: Chinyue Chen <chinyue@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Chinyue Chen <chinyue@chromium.org>
add a hook for fixing all pending config updates
BUG=chromium-os:13987
TEST=below
1) export CONFIG_PROTECT="/etc /usr/share"
2) checkout as old as possible revision of cros-overlay, update chroot to it
3) checkout HEAD and update back
4) run the hook, see it update thousands of files correctly
Change-Id: Idabf5475516ed58b76ceee6ffdc817a5f46839ad
Reviewed-on: http://gerrit.chromium.org/gerrit/10022
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Tested-by: Zdenek Behan <zbehan@chromium.org>
BUG=chromium-os:13987
TEST=below
1) export CONFIG_PROTECT="/etc /usr/share"
2) checkout as old as possible revision of cros-overlay, update chroot to it
3) checkout HEAD and update back
4) run the hook, see it update thousands of files correctly
Change-Id: I4213de8ccba6e573541e96591ea0d033a10218a5
Reviewed-on: http://gerrit.chromium.org/gerrit/8938
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
This causes the script to treat amd64 the same as x86.
BUG=chromium-os:21284
TEST=./build_image for amd64-generic shouldn't generate an invalid
architecture error
Change-Id: I37284def3cb2f0b16ece20a74d65bdb8e0116cff
Reviewed-on: http://gerrit.chromium.org/gerrit/9962
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
This causes the script to treat amd64 the same as x86.
BUG=chromium-os:21284
TEST=./build_image for amd64-generic shouldn't generate an invalid
architecture error
Change-Id: I8f40a827684dde1258158d470a38623a8c936bca
Reviewed-on: http://gerrit.chromium.org/gerrit/9963
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
BUG=chromium-os:21030 chromium-os:21417
TEST=test uploads with ARM and x86 targets
test that Chrome symbols are ~87M when stripped down from ~160MB
Change-Id: I9207b3f6a5b757ffa58468c58b4440467dc44738
Reviewed-on: http://gerrit.chromium.org/gerrit/8777
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ken Mixter <kmixter@chromium.org>
Commit-Ready: Ken Mixter <kmixter@chromium.org>
To help developers knowing the proper usage of such command.
BUG=none
TEST=./make_factory_package --help
Change-Id: I5a5d0efd215d0239bd56830165f0a057ad7c7474
Reviewed-on: http://gerrit.chromium.org/gerrit/9707
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Usually make_factory_package operates with normal files that does not need root
permission - except if output is a block device.
This CL tries to grant root permission by sudo if a block device is assigned to
--diskimg.
BUG=chrome-os-partner:2827
TEST=(as normal user) ./make_factory_acpakge --factory FACTORY \
--release RELEASE --hwid none --diskimg /dev/sde # completed
Change-Id: Ie1285e6b6f46f1af286e795a02a83294fce4eeaa
Reviewed-on: http://gerrit.chromium.org/gerrit/8789
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Tammo Spalink <tammo@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tegra2 systems require a minimum vmalloc bootarg to successfully
reserve the graphics carveout memory. If the vmalloc is insufficient
a crash can result prior to any serial output reported. The minimum
vmalloc is >= carveout size + framebuffer - 32MB, thus for a 256MB
graphics carveout (with 10MB framebuffer), vmalloc>=234MB. This
arg is not added in the u-boot configs to avoid tightly coupling
the u-boot and kernel and is discussed in greater depth at
http://gerrit.chromium.org/gerrit/#change,8293.
BUG=chrome-os-partner:5197,chrome-os-partner:5902
TEST=Manually observe /proc/cmdline reflects change
Change-Id: I66b35b266c7542771f2d4fc497dd4429587529f8
Reviewed-on: http://gerrit.chromium.org/gerrit/8373
Commit-Ready: Katie Roberts-Hoffman <katierh@chromium.org>
Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org>
Tested-by: Katie Roberts-Hoffman <katierh@chromium.org>
It was not marked executable, and was also broken. Now updates the
CHROMEOS_RELEASE_TRACK to be testimage-channel for test images.
BUG=chromium-os:20019
TEST=Manual
Change-Id: I8741f0e21831fe3d9184ca11b73dcea96a1b01b1
Reviewed-on: http://gerrit.chromium.org/gerrit/9801
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
The sync pid file is created without using sudo which means we should be
able to delete it without using sudo. By default, run `rm` directly and
if it fails, fall back to sudo like we historically have.
BUG=None
TEST=`cros_sdk --enter true`; see pid file deleted
Change-Id: I26d898f6d594eb9ea4652335468345dd11303122
Reviewed-on: http://gerrit.chromium.org/gerrit/8644
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
This change causes build_gpt to treat x86 and amd64 as the same.
BUG=chromium-os:21284
TEST=./build_image for amd64-generic shouldn't generate an invalid
architecture error
Change-Id: I60424515e162a257b9c8d99885cac18f6bb013cd
Reviewed-on: http://gerrit.chromium.org/gerrit/9705
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
BUG=chromium-os:21383
TEST=Manual run of cros_generate_stacks_bvt against a test result that
has a minidump buried 6 levels deep
Change-Id: Iebb24f02d086c24feaae47603460ec83ded15800
Reviewed-on: http://gerrit.chromium.org/gerrit/8924
Tested-by: Thieu Le <thieule@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
This adds support for using debug tarballs located on the
local machine instead of only ones on remote servers. (If
the first argument is a local file, we use it; otherwise, we
try to download it.)
It also makes us download the (tiny) minidumps before the
(huge) tarball so we can bail out quickly if the minidump
URL is wrong.
BUG=chromium-os:19565
TEST=manual: ran it successfully with both local and remote tarballs and checked that it fails early when given an invalid minidump path
Change-Id: Ie427b50e4b7e37c6c81a1137eb34a28e25f32c8e
Reviewed-on: http://gerrit.chromium.org/gerrit/8910
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Ready: Daniel Erat <derat@chromium.org>
Metrics unit tests fail if /does/not directory is present, so we need to
clean this up as a followup to a build_packages fix that stopped
creating that directory.
BUG=none
TEST=Metrics unit tests actually work now.
Change-Id: I7c470e8225e4c5c7a77f6decc4c4bcadb72cd246
Reviewed-on: http://gerrit.chromium.org/gerrit/8848
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@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>
BUG=none
TEST=Metrics unit tests work now.
Change-Id: If5830c17bbd2f389df3c390fb0de7057b05aa9aa
Reviewed-on: http://gerrit.chromium.org/gerrit/8845
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
It seems that the intermittent failure we see on the login screen
is due to a sort of mixed-content error, where there's a failure
within the page to load some embedded resource due to a cert error.
Make the SSL cert we inject work for any google.com server to
work around this.
BUG=chromium-os:20323
TEST=login_CryptohomeMounted 50x, suite_Smoke
Change-Id: Ic8e5b9bec799cd19cccfeddd2990fe3a494d2184
Reviewed-on: http://gerrit.chromium.org/gerrit/8818
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
We call `readlink -f` on the chroot mount point to resolve any symlinks
in the path (since that is what `mount` records). But the only paths
that can have symlinks are in the base chroot mount. Everything below
that we know are not going to be symlinks (since we've set up the paths
ourselves). So process the chroot mount point with readlink once and
reuse that value everywhere else.
BUG=None
TEST=`cros_sdk --enter true` still mounts & unmounts properly
Change-Id: Id1e734d20c0cb766f5490583b793930af77b3b14
Reviewed-on: http://gerrit.chromium.org/gerrit/8645
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Rather than hardcoding every possible multilib path that we might come
across, look up the native multilib path that the target system is using
by finding the native ELF interpreter. We use /bin/sh as a known good
file since you can't really have a system without this.
BUG=chromium-os:20636
TEST=`./check_deps /build/amd64-generic /bin/bash` now finds libs without explicit ld.so.conf
TEST=`./build_image --board=x86-alex` still works
Change-Id: Ib80824312a5e5a0f9e17e8ae18a2d42248771eb7
Reviewed-on: http://gerrit.chromium.org/gerrit/8564
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
The chrome root code doesn't attempt to mount the tree if there is no
source root configured. So re-order the code from:
- is chrome source mounted ?
- does a chrome source exist ?
- mount chrome source
to the more logical:
- does a chrome source exist ?
- use ensure_mounted to check+mount
This lets us use the mount cache for the chrome mounting and unifies
duplicated mount/checking logic.
BUG=None
TEST=`cros_sdk --enter` still works with simultaneous runs
TEST=`cros_sdk --enter -- ls` still works
Change-Id: I7e6af9dd7f65cefa04438c2862c931f06237060a
Reviewed-on: http://gerrit.chromium.org/gerrit/8032
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
The depot_tools mount code is exactly like ensure_mounted except that it
prints a warning instead of dying when things can't be mounted. So take
the current api and extend it slightly to support warning or dying. This
also lets us re-use the existing mount cache and avoid the forks as well
as clean up duplicated code.
BUG=None
TEST=`cros_sdk --enter` still works with simultaneous runs
TEST=`cros_sdk --enter -- ls` still works
Change-Id: I89336778b6aa16191e79d900a51774929cadf06b
Reviewed-on: http://gerrit.chromium.org/gerrit/8031
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
The ld.so.conf file supports an "include" directive where it'll include
all the files matched by the following glob. Since Gentoo has started
using this, we need to support parsing of it too. So move the parsing
code into a dedicated function and recursively call ourselves when we
hit an include directive.
BUG=chromium-os:20636
TEST=`./check_deps /build/amd64-generic /bin/bash` now finds libs
TEST=`./build_image --board=x86-alex` still works
Change-Id: I8894ca42358d91d8f2ee6e95b47faf9334ccdd26
Reviewed-on: http://gerrit.chromium.org/gerrit/8494
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>