BUG=none
TEST=Ran script, from within chroot, with no args(prompts for password),
one password arg, and multiple args(prints usage and exits), and each time
echo'd the password before it is encrypted. Each time it is correct. From
outside chroot, it only prints an error and exits.
Change-Id: I9380511e8784e4979e664281c751fe6e6defe7ab
Reviewed-on: https://gerrit.chromium.org/gerrit/25397
Tested-by: Isaac Simha <isimha@nvidia.com>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Isaac Simha <isimha@nvidia.com>
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>
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>
This temporary hack is intended to provide to developers a smooth transition to
the new crypted password file location.
BUG=chromium-os:11664
TEST=build_image
Change-Id: I34383f6e08ee8db53e407b30df604c403c72b5eb
Review URL: http://codereview.chromium.org/6539019
This is necessary so that the baselayout ebuild can be
changed to set /etc/passwd and /etc/shadow appropriately.
A previous attempt to do this through an environment
variable in make.conf.user failed because pkg_postinst
from binary packages run in their prebuilt environment
(and, thus, are not picking the user specific variables).
BUG=chromium-os:11664
TEST=ran set_shared_user_password.sh multiple times, observed
/etc/shared_user_passwd.txt and shared_user_passwd.txt getting updated.
Change-Id: I23b77c7417db0fd18b251f7cca62027813b182a8
Review URL: http://codereview.chromium.org/6534003
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
Add restart_in_chroot_if_needed to common.sh, and modify the build scripts which referred to assert_inside_chroot to use it instead. The effect is that you don't ever have to explicitly enter_chroot.sh to build (still can, it work's fine).
Update mod_image_for_test.sh to use restart_in_chroot_if_needed
Review URL: http://codereview.chromium.org/1736025