Commit Graph

1911 Commits

Author SHA1 Message Date
Hung-Te Lin
9cd98ea2dc make_factory_package: add --run_omaha to simplify factory setup flow
Adds a shortcut to start mini-omaha server directly.

BUG=chrome-os-partner:21512
TEST=./make_factory_package.sh --release RELEASE --factory FACTORY \
       --hwid none --run_omaha
     # omaha server starts after packages are prepared.
 ./make_factory_package.sh --config CONFIG --run_omaha # success

Change-Id: I444d63cb92e6360e0dd95e79153d10dd0f91d4b8
Reviewed-on: https://gerrit.chromium.org/gerrit/10622
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2011-10-26 21:06:58 -07:00
Aaron Plattner
130d363aaa Bind-mount /run if it exists
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>
2011-10-26 20:25:20 -07:00
Hung-Te Lin
e7c2d1c82b make_factory_package: support using firmware updater from release rootfs
For most use case, we want to use the firmware updater from release image
rootfs. It'd be more convenient if make_factory_package extracts updater from
release image by default.

BUG=chromium-os:21512
TEST=./make_factory_package --release RELEASE --factory FACTORY --hwid none
     # success, seeing "firmware: XXXX" in output
     ./make_factory_package --release RELEASE --factory FACTORY --hwid none --firmware none
     # success, not seeing firmware in mini-omaha configuration
     ./make_factory_package --release RELEASE --factory FACTORY --hwid none --firmware FIRMWARE
     # success, seeing "firmware: XXXX" in mini-omaha configuration
     ./make_factory_package --release RELEASE --factory FACTORY --hwid none \
       --diskimg ssd.img
     # success, no firmware messages
     ./make_factory_package --release RELEASE --factory FACTORY --hwid none \
       --diskimg ssd.img --firmware FIRMWARE
     # failure as expected - firmware is not supported in --diskimg.

Change-Id: Ic368031a8a5ece89e3e7fd56e2ee4fd1143a67a7
Reviewed-on: https://gerrit.chromium.org/gerrit/10561
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
2011-10-26 20:25:20 -07:00
Kris Rambish
d1b808a6ae Fix comments
TEST=None
BUG=chromium-os:22069

Change-Id: I1f92395a2839ac7d6178598d76161334e00812b0
Reviewed-on: http://gerrit.chromium.org/gerrit/10672
Commit-Ready: Kris Rambish <krisr@chromium.org>
Reviewed-by: Kris Rambish <krisr@chromium.org>
Tested-by: Kris Rambish <krisr@chromium.org>
Reviewed-by: Stanley Wong <stanleyw@chromium.org>
2011-10-25 14:38:29 -07:00
Kris Rambish
1c165c055b Make the autotest sub dir world readable
TEST=Ran it
BUG=chromium-os:22069
STATUS=Fixed

Change-Id: Id6e96e5602c02956b6a1592ff54ad60935e1620e
Reviewed-on: http://gerrit.chromium.org/gerrit/10660
Commit-Ready: Kris Rambish <krisr@chromium.org>
Reviewed-by: Kris Rambish <krisr@chromium.org>
Tested-by: Kris Rambish <krisr@chromium.org>
Reviewed-by: Stanley Wong <stanleyw@chromium.org>
2011-10-25 13:08:26 -07:00
Zdenek Behan
4748e87341 update_chroot: update toolchain and portage first, also select gcc
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>
2011-10-25 11:01:58 -07:00
Chris Sosa
9d9a1b1017 Change the pid logic to reuse a file if the pid no longer exists.
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>
2011-10-25 08:12:33 -07:00
Jon Salz
67145df2a4 Add cros_factory_install kernel command-line argument when running
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>
2011-10-25 08:12:32 -07:00
Kees Cook
84a4c7a620 Use fully qualified path for helpers.
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>
2011-10-24 14:04:24 -07:00
Elly Jones
fa5b8ff89f mod_image_for_recovery: log mounts and loopdevs.
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
2011-10-21 15:00:55 -07:00
Mike Frysinger
328b9eab02 update hooks: add /etc/portage/env support
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>
2011-10-20 11:06:39 -07:00
Rahul Chaturvedi
1e4d0c0b3d Add the enable_rootfs_verification flag to cros_download_latest_image.
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>
2011-10-20 10:27:11 -07:00
Hung-Te Lin
4c90853861 make_factory_package.sh: fix --diskimg for ARM images
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>
2011-10-20 01:45:19 -07:00
Mike Frysinger
c9dfcaf480 get_latest_image: ignore files when searching for latest images
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>
2011-10-19 19:14:42 -07:00
Mike Frysinger
6bae49985e update hooks: drop useless +x perms on files
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>
2011-10-19 16:48:55 -07:00
Mike Frysinger
9aa80dc457 cros_sdk: always pull shflags from local tree
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>
2011-10-19 14:15:12 -07:00
Kees Cook
43a3213f33 update_kernel: use $TMP for generated outputs
"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>
2011-10-19 11:05:33 -07:00
J. Richard Barnette
8b1328b17c Convert various scripts to use get_latest_image
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>
2011-10-19 11:05:33 -07:00
Kees Cook
7d7d2ef0f0 update_kernel: update the syslinux partition too
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>
2011-10-19 10:13:58 -07:00
Hung-Te Lin
23fe17a20e crosutils: fix factory install shim when booting with legacy EFI firmware
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>
2011-10-18 19:46:54 -07:00
mukesh agrawal
5aa31fe38a cros_utils: change default image type for cros_image_to_target
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>
2011-10-18 19:13:53 -07:00
Sonny Rao
3163cf0605 Change script style for ARCH comparisons to double-bracket bash style
BUG=none
TEST=test setup_board, build_packages, build_image, image_to_vm,
on x86-generic and amd64-generic

Change-Id: I43d9d8e6e0e48cbce4d0086b78721ed86b120d4a
Reviewed-on: http://gerrit.chromium.org/gerrit/10209
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
2011-10-17 17:53:48 -07:00
Sonny Rao
1261bc5886 fix up bootloader related scripts to treat amd64 like x86
BUG=chromium-os:21739
TEST=manually verify syslinux is being properly installed on
amd64-generic

Change-Id: I780fba2b9e90a8cf3922b48723f29d96eaf3931e
Reviewed-on: http://gerrit.chromium.org/gerrit/10168
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
2011-10-17 14:00:54 -07:00
Sonny Rao
e2e33f1b17 Add a migration script to enable the gold linker on x86 and amd64
BUG=chromium-os:21619
TEST=run build_packages on x86-generic and amd64-generic and
ensure gold linker is enabled via "binutils-config -l"

Change-Id: I7026fad808587a5d6158421c3dac9d18b7141242
Reviewed-on: http://gerrit.chromium.org/gerrit/9996
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
2011-10-13 21:35:27 -07:00
Chinyue Chen
342dbdaf10 Escape open bracket when parsing config file.
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>
2011-10-13 18:14:44 -07:00
Zdenek Behan
eeaf674db4 update hooks: 3c1d3d8be6, take two
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>
2011-10-13 09:56:07 -07:00
Chris Sosa
0f0c985357 Revert "update hooks: add a hook for fixing all pending config updates"
This reverts commit dbcbca5139eb83768dad3dc5e4d27e9e89ca3451

Seems like this change broke SSL http://build.chromium.org/i/chromiumos/builders/x86%20generic%20PFQ/builds/1237/steps/BuildBoard/logs/stdio

Change-Id: I02b1e46a6032bc48d54e6fb3d9908d3ea5ca489f
Reviewed-on: http://gerrit.chromium.org/gerrit/10015
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-10-13 08:30:08 -07:00
Zdenek Behan
3c1d3d8be6 update hooks: 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: 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>
2011-10-12 20:52:44 -07:00
Sonny Rao
3494498738 Add amd64 recognition create_legacy_bootloader_templates.sh
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>
2011-10-12 15:14:00 -07:00
Sonny Rao
0679b368c9 Add amd64 recognition to build_kernel_image.sh
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>
2011-10-12 15:14:00 -07:00
Hsinyu Chao
4b8a1ebb4d Small cleanup: remove unused local variable.
BUG=None
TEST=`./build_image --board=tegra2_kaen` still work
Change-Id: Ic3936cd2f300716ad48c04e504fbc0e1f36e0683
Reviewed-on: http://gerrit.chromium.org/gerrit/9928
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
2011-10-12 02:46:49 -07:00
Kris Rambish
9d8477cbd7 Replace the chronos user with 1000
BUG=chromium-os:21542
TEST=Ran it

Change-Id: Idca77b20c119b9995218b990f9fb5accd7cfa580
Reviewed-on: http://gerrit.chromium.org/gerrit/9879
Reviewed-by: Kris Rambish <krisr@chromium.org>
Tested-by: Kris Rambish <krisr@chromium.org>
Reviewed-by: Stanley Wong <stanleyw@chromium.org>
Commit-Ready: Kris Rambish <krisr@chromium.org>
Commit-Ready: Stanley Wong <stanleyw@chromium.org>
2011-10-11 14:46:07 -07:00
Ken Mixter
243590f4ba crosutil: automatically strip CFI when uploading x86 symbols
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>
2011-10-11 10:00:48 -07:00
Hung-Te Lin
4474c15e7b crosutils: comments for environment variables in make_factory_package
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>
2011-10-11 02:12:45 -07:00
Hung-Te Lin
abfb85f6b2 make_factory_package: sudo if --diskimg is a block device
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>
2011-10-11 02:12:31 -07:00
Katie Roberts-Hoffman
8429b4eb07 Append vmalloc arg for ARM in build_kernel_image
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>
2011-10-10 17:12:18 -07:00
Don Garrett
d1c012e718 Add a new script to change the update channel for test images.
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>
2011-10-10 14:19:27 -07:00
Mike Frysinger
470be99f4f enter_chroot: try to avoid sudo when deleting sync pid file
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>
2011-10-07 08:10:29 -07:00
Sonny Rao
0c80dfb97d build_gpt.sh: accept amd64 as a valid architecture
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>
2011-10-06 23:31:04 -07:00
Thieu Le
8bfc4b5247 Support finding minidumps located deeper in the test results tree.
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>
2011-10-06 17:43:17 -07:00
Daniel Erat
056c3f53bd scripts: Make cros_generate_stacks_bvt user-friendlier.
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>
2011-10-06 15:45:33 -07:00
David James
c801b10af3 Actually rm -rf /does/not instead to fix metrics unit tests.
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>
2011-10-06 00:19:03 -07:00
Paul Stewart
14b5aa6747 cros_run_wifi_tests: Add --use_emerged flag
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>
2011-10-06 00:13:28 -07:00
David James
dd7e5cf244 rm -rf /does/not/exist to fix metrics unit tests.
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>
2011-10-05 23:22:32 -07:00
Chris Masone
9953aa3faf [crosutils] Make auth-testing cert CN be *.google.com
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>
2011-10-05 15:29:20 -07:00
Mike Frysinger
0a0e6ecee3 enter_chroot: avoid multiple readlink calls on mount point
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>
2011-10-03 12:27:55 -07:00
Mike Frysinger
4ad673ecfc check_deps: dynamically insert native multilib path
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>
2011-10-03 07:42:29 -07:00
Mike Frysinger
9a50b64449 enter_chroot: re-factor chrome_root mounting to use ensure_mounted
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>
2011-10-03 07:42:28 -07:00
Mike Frysinger
b4d7c4b7b8 enter_chroot: extend ensure_mounted api to use it with depot_tools
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>
2011-09-30 22:29:42 -07:00
Mike Frysinger
564dcfbde6 check_deps: handle "include" directives in ld.so.conf
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>
2011-09-30 22:29:41 -07:00