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>
On second checking, this got overlooked; no breakage/impact, but
prefer to get it sorted now before manifests start appearing.
BUG=chromium-os:11308
TEST=N/A
Change-Id: Ia375426673e03dd4f66574adf68610d256858bef
Reviewed-on: http://gerrit.chromium.org/gerrit/8836
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@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>
Upgraded sys-apps/sed to version 4.2.1 on amd64, arm, x86
BUG=chromium-os:21247
TEST=trybot runs
x86-generic-pre-flight-queue
chromiumos-sdk
Change-Id: I3503923c2533ea0f77598591984c12d4611706fc
Reviewed-on: http://gerrit.chromium.org/gerrit/8754
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Matt Tennant <mtennant@chromium.org>
Commit-Ready: Matt Tennant <mtennant@chromium.org>
Libtool has a bug where it assumes the default lib path is always
"/lib /usr/lib", and it searches /etc/ld.so.conf for additional
paths. This does not play well when cross-compiling for a multilib
which uses a path other than /lib (like x86_64 which uses /lib64).
So libtool ends up adding -Wl,-rpath,/usr/lib64 when linking libs
which means it searches the chroot which means it can easily lead
to link failure.
So import the latest libtool.eclass and ELT-patches from upstream
Gentoo which has added a patch specifically to address this: the
sys-lib-dlsearch patch. We have to import all the other files as
libtool.eclass only searches the ELT-patches/ subdir from the tree
from which it is loaded.
BUG=chromium-os:20636
TEST=`emerge-amd64-generic app-crypt/tpm-tools` now works
TEST=`./build_packages && ./build_image` for x86-alex still works
Change-Id: Id10c732cfd4f13df995f32af950a341e8c7bbc6c
Reviewed-on: http://gerrit.chromium.org/gerrit/8648
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Upgraded sys-libs/ncurses to version 5.7-r7 on amd64, arm, x86
Upgraded sys-apps/less to version 441 on amd64, arm, x86
Upgraded sys-apps/man to version 1.6f-r4 on amd64
Upgraded sys-apps/man-pages to version 3.32 on amd64
Upgraded dev-libs/libaio to version 0.3.109-r2 on amd64
BUG=chromium-os:20923
TEST=trybot runs:
chromiumos-sdk
x86-generic-pre-flight-queue
x86-generic-full
Change-Id: I4955bd46815676abf4c593133aacb4370a97744c
Reviewed-on: http://gerrit.chromium.org/gerrit/8660
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Matt Tennant <mtennant@chromium.org>
Tested-by: Matt Tennant <mtennant@chromium.org>
Specifically, use thin-manifest (format designed for git), and
direct portage to use manifests (including create) but not yet
strictly require it- need to do a full audit/regen of the manifests
for the repository prior to switching to strict mode.
BUG=chromium-os:11308
TEST=./runtests.sh from the source, doing trybot runs.
Change-Id: Ib83591d2f048b1665e2d739e0d561ee27b215733
Reviewed-on: http://gerrit.chromium.org/gerrit/8081
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@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>
Right now, it seems that we don't consistently detect when the kvm is rebooted.
To improve this, I've added ServerKeepAlive messages, such that our connection
will be dropped if the target host is unreachable for 15 seconds. Further, I've
also tightened the ConnectTimeout from 120 seconds to 30 seconds so that we
detect timeouts earlier, but added 4 retries, so that all connections are
robust to temporary unresponsiveness (e.g. ssh server restarting).
BUG=chromium-os:21082, chromium-os:20305
TEST=alex-binary trybot run.
Change-Id: Ibd000bc3158138ee9c617e56bd7b11d4bd8bcb61
Reviewed-on: http://gerrit.chromium.org/gerrit/8574
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
The cros_sdk tool runs a lot of helper programs which can be replaced
with bash builtins, or condensed multiple calls into a single one. By
themselves they aren't that slow, but add them all up and run them a
whole lot, and it starts to make a difference.
External programs to bash internals:
- dirname $f -> ${f%/*}
- f=$(cat $f) -> f=$(<$f)
- which f -> type -P f
Simpler expressions:
- [[ ( ... ) ]] -> [[ ... ]]
- eval v=\$$f -> v=${!f}
Common/clearer expressions:
- ! var=$(cmd) -> var=$(cmd || :)
Condensed tools:
- sort | uniq -> uniq -u
BUG=None
TEST=`cros_sdk --enter` still works with simultaneous runs
TEST=`cros_sdk --enter -- ls` still works
Change-Id: Ice5e5e252237082a2249990644e051895d61d1fd
Reviewed-on: http://gerrit.chromium.org/gerrit/8029
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Most of the time the files in the chroot /etc/ are already changed to
the proper owner. Only on the first run do they need to be changed.
So check the owner before doing the sudo as that is a bit faster. If
we do end up needing to run sudo, bundle the commands up to avoid having
to execute sudo multiple times.
BUG=None
TEST=`sudo chown root chroot/etc/resolv.conf && cros_sdk --enter`; see /etc/resolv.conf owned by me
Change-Id: Ifd974ace168ab309fdc2e7583d135ee23576a5bb
Reviewed-on: http://gerrit.chromium.org/gerrit/8418
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Now that input-cmt is fixed, we can import this. This is required for xserver 1.11.0.
Change-Id: I850648ff978da8951c4da9914189800e884ba050
Reviewed-on: http://gerrit.chromium.org/gerrit/8463
Reviewed-by: Antoine Labour <piman@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
BUG=chromium-os:20975
TEST=Built chromeos with atk-1.32.0-r1 for x86-generic and arm-generic.
Ran suite_Smoke tests.
Change-Id: I0a834d7a936c4de7a0a9ece9ea6ce16a816e015b
Reviewed-on: http://gerrit.chromium.org/gerrit/8464
Reviewed-by: Seigo Nonaka <nona@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
This is required for the new xorg-2.eclass, which is required for xorg-server 1.11.0.
Change-Id: Iee25454730ab038b161229afd7020f3f8856d3c3
Reviewed-on: http://gerrit.chromium.org/gerrit/8471
Reviewed-by: Antoine Labour <piman@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
This is needed for the xorg-2.eclass update, which is needed for the xserver update.
Change-Id: Ic4e839f05f55e4023864364236d36cfc93aa816c
Reviewed-on: http://gerrit.chromium.org/gerrit/8468
Reviewed-by: Antoine Labour <piman@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Pull udev-171-r2 and accompanying files/ directory from cros/gentoo
in portage to here, as we don't need to modify anymore.
BUG=none
TEST=emerge, build_packages and build_image (with USE flags & A_K)
Change-Id: I1ba6d5809b74c5853b3609995d98a232cb16629f
Reviewed-on: http://gerrit.chromium.org/gerrit/8391
Tested-by: Scott James Remnant <keybuk@chromium.org>
Reviewed-by: Mike Frysinger <vapier@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
Since we grab a lock before mounting anything, we know that the relevant
list of mounts won't change (since we haven't changed it yet). So we can
cache the output of `mount` and re-use that in every subsequent check.
BUG=None
TEST=`cros_sdk --enter` still works with simultaneous runs
TEST=`cros_sdk --enter -- ls` still works
Change-Id: I27c98c923761fb777686632fe6e6604ca543cfb6
Reviewed-on: http://gerrit.chromium.org/gerrit/8030
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Checking the permission of files is faster than assuming they're broken
and then running `sudo chmod`, so do just that.
BUG=None
TEST=run `cros_sdk --enter` with bad perms and see them fixed
TEST=run `cros_sdk --enter` with correct perms and see sudo skipped
TEST=the buildbot failure was due to other changes, not this one
Change-Id: Ie69b4e766e2e3652944e4723d091ce589d07a4f6
Reviewed-on: http://gerrit.chromium.org/gerrit/8028
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
We try to set the cache type to unsafe, which is a new kvm feature,
else we set the cache type to writeback. The hope is that these cache
types will perform better on the bots, especially in the case of the
guest trying to flush data to disk.
The CL includes code to determine which version of kvm is running, and
the cache type is chosen based on that.
BUG=chromium-os:20305
TEST=trybot
Change-Id: Icf7dbb8f0056a330282ebeb81d0902b3d54f34c5
Reviewed-on: http://gerrit.chromium.org/gerrit/8360
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
A fix went into upstream for amd64 multilib installs which we need:
`gpg-error-config` likes to display -L/usr/lib64 when cross-compiling.
BUG=chromium-os:20636
TEST=`emerge-x86-generic libgpg-error`; `/build/x86-generic/usr/bin/gpg-error-config --libs` shows correct output (no -L flag)
TEST=`emerge-x86-generic libgcrypt` still works
TEST=`emerge-amd64-generic libgpg-error`; `/build/amd64-generic/usr/bin/gpg-error-config --libs` shows correct output (no -L flag)
TEST=`emerge-x86-generic libgcrypt` now works
Change-Id: I7a869789c8eb65b99ea9a907912b0befdf81887e
Reviewed-on: http://gerrit.chromium.org/gerrit/8286
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
This CL changes remote_ssh to re-run the command verbosely if the
command failed with an SSH error (code 255).
BUG=chromium-os:19198
TEST=Ran it. Simulated SSH error by closing KVM instance in cros_run_vm_update
while it was intiializing. Saw re-run verbosely run correctly.
Change-Id: I9f95aac3fb2d00bc7d26b0b9298409d8ce2db594
Reviewed-on: http://gerrit.chromium.org/gerrit/8313
Commit-Ready: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
Reviving that change now that ARM is fixed.
Change-Id: I9aa03db8b2b1c2d58f292378894628813d0b7ce3
Reviewed-on: http://gerrit.chromium.org/gerrit/8284
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
This reverts commit 521fd67202ca2b6756f9ca288e44935b991c0fa9
Change-Id: Ia66162e89ddea170bdce5ea7f81b60a567ce604c
Reviewed-on: http://gerrit.chromium.org/gerrit/8273
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Dave Moore <davemoore@chromium.org>
Upgraded app-editors/vim to version 7.3.189 on amd64, arm, x86
Upgraded app-editors/vim-core to version 7.3.189 on amd64, arm, x86
BUG=chromium-os:20788
TEST=Run vim in chroot, edit python file, looks ok to me.
Change-Id: Ifc3234a261e407d316002fc6945b314c7697341c
Reviewed-on: http://gerrit.chromium.org/gerrit/8245
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Matt Tennant <mtennant@chromium.org>
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Tested-by: Matt Tennant <mtennant@chromium.org>
No need to call `git var | sed` multiple times when we can call it once
and then use bash string parsing routines to extract the relevant info.
BUG=None
TEST=delete .gitconfig in chroot; enter chroot; verify .gitconfig is up-to-date
Change-Id: I900e4241a5c53bc46c90eb0f2a01152f4bfba577
Reviewed-on: http://gerrit.chromium.org/gerrit/8027
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
A parallel change in run_remote_tests.sh (http://gerrit.chromium.org/gerrit/8090)
ensures that the output of the command isn't ignored (since now it is only verbose
when it needs to be).
BUG=chromium-os:20695
TEST=Ran run_remote_tests.sh with both valid and invalid ip (again).
Change-Id: I185c81b0a8193bfa5f88ff2b9eea38dabe24edcc
Reviewed-on: http://gerrit.chromium.org/gerrit/8089
Commit-Ready: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
Upgraded app-admin/eselect-ruby to version 20100603 on amd64
BUG=chromium-os:20781
TEST=This is only used in chroot, so test with trybot chromiumos-sdk
Change-Id: I6c85f120b57afb86ba4b84652b74b9cf10d6ab24
Reviewed-on: http://gerrit.chromium.org/gerrit/8226
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Matt Tennant <mtennant@chromium.org>
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Tested-by: Matt Tennant <mtennant@chromium.org>
Upgraded app-admin/eselect to version 1.2.15 on amd64
Upgraded app-admin/eselect-ctags to version 1.13 on amd64
BUG=chromium-os:20770
TEST=trybot run of chromiumos-sdk
Change-Id: I65874253d3d57d97ff0d047c78e80f7106d7ca53
Reviewed-on: http://gerrit.chromium.org/gerrit/8206
Commit-Ready: Matt Tennant <mtennant@chromium.org>
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Tested-by: Matt Tennant <mtennant@chromium.org>
BUG=chromium-os:20746
TEST=emerge xl2tpd-1.3.0 for x86-generic and arm-generic
Change-Id: Iedc3cc3a16484f0fea205f756f8b53d2936b6e92
Reviewed-on: http://gerrit.chromium.org/gerrit/8176
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
POSIX says that the first arg to substr() counts from 1 which means
that awk implementations interpret a value of 0 in their own special
way. With gawk, it does the logical thing (imo), but with mawk, it
does it by one less.
Example:
echo abc | mawk '{print substr($0, 0, 2)}' -> a
echo abc | gawk '{print substr($0, 0, 2)}' -> ab
echo abc | mawk '{print substr($0, 1, 2)}' -> ab
echo abc | gawk '{print substr($0, 1, 2)}' -> ab
So stick to the POSIX spec and count from 1.
While we're here, using "len" rather than "l" to improve readability.
URL=http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html
BUG=chrome-os-partner:6026
TEST=set /usr/bin/awk to mawk; run `cros_sdk --enter -- true`; see everything unmounted
TEST=set /usr/bin/awk to gawk; run `cros_sdk --enter -- true`; see everything unmounted
Change-Id: I48f57d642730a0b3d909079027edf6ebf1bb9459
Reviewed-on: http://gerrit.chromium.org/gerrit/8163
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Normally safe_umount_tree isn't called if there are no mount points in the
chroot, but there are some edge cases (like early setup errors) where it
may be possible. So add a simple check to make sure that there are mount
points for us to work on before calling umount.
BUG=None
TEST=add early `die` before mounts; see no umount error output
Change-Id: I57e5022c3242c635097bceed44772f10eecf6a64
Reviewed-on: http://gerrit.chromium.org/gerrit/8026
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
BUG=chromium-os:20305
TEST=manual test of image_to_live.sh
Change-Id: I964088673d0dc2867e911368d9cc4ec73085a4f4
Reviewed-on: http://gerrit.chromium.org/gerrit/8082
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
First let's add a chroot upgrade hook that'll declare a small list of
locales to speed up glibc upgrades.
The other blocker was that `cros_sdk --enter` took an inordinate amount
of time to execute (`locale-gen -u` specifically) when the number of
existing locales is huge. This seems to be a bug in the bash/glibc
stack which is resolved in newer versions, but we can workaround the
issue by forcing locale-gen to run in a C locale. The tool itself does
not care about its locale and we silence its output.
BUG=chromium-os:20378
TEST=`cros_sdk --enter`; see no locales in /etc/locale.gen; run `./build_packages` and see upgrade hook work
TEST=generate all 400 locales; `cros_sdk --enter`; see that it was quick
Change-Id: I8fcc5e26bd8e1bcfd52b6a6c7ef3cacf0a252081
Reviewed-on: http://gerrit.chromium.org/gerrit/7806
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>