Commit Graph

9 Commits

Author SHA1 Message Date
Isaac Simha
21c6b03e89 Added password arg to set_shared_user_password.sh
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>
2012-07-25 10:50:08 -07:00
David James
359d3e119d Simplify boilerplate common.sh code in src/scripts.
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>
2012-07-12 10:55:37 -07:00
Brian Harring
7f175a59e1 common.sh: output a backtrace and debug information on failure.
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>
2012-05-07 17:19:41 -07:00
Darin Petkov
61173f6bd1 Cleanup set_shared_user_password related transitional code.
BUG=none
TEST=set_shared_user_passwd, build_image, checked password

Change-Id: Ida251e36f32d6cb116425d475882c5cee601b9f6

Review URL: http://codereview.chromium.org/6904093
2011-04-29 10:24:26 -07:00
Darin Petkov
ab463c0844 Move crypted passwd file to /etc in build_image.
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
2011-02-17 10:42:24 -08:00
Darin Petkov
36e69d0c77 set_shared_user_password.sh updates /etc/shared_user_passwd.txt
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
2011-02-17 09:34:29 -08:00
Greg Spencer
798d75f3be This starts to fix the scripts so that they load from /usr/lib/crosutils
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
2011-02-01 22:04:49 -08:00
Don Garrett
640a0585f5 Added restart_in_chroot_if_needed to common.sh.
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
2010-05-04 16:54:28 -07:00
rspangler@google.com
d74220d772 Start copying over source.
git-svn-id: svn://chrome-svn/chromeos/trunk@4 06c00378-0e64-4dae-be16-12b19f9950a1
2009-10-09 20:56:14 +00:00