Commit Graph

2074 Commits

Author SHA1 Message Date
Hung-Te Lin
19daeedb14 crosutils: move factory setup scripts to ../platform/factory-utils/factory_setup
This CL is the counter part of https://gerrit.chromium.org/gerrit/11190

For creating portable factory archives and simplify scripts folder, we should
move all factory scripts to a tandalone folder. Symlink is set to ease
transition until we've updated all factory documents.

archive_factory was designed for creating bundle so not required anymore.
make_universal_factory_shim and mk_memento_images are only invoked by
make_factory_packages, so they're also simply removed without symlinks.

BUG=chrome-os-partner:5979
TEST=./make_factory_package.sh --config PATH_TO_CONFIG # pass

Change-Id: I1489b012aaf1ade4a9ead91abbb7b625b967dc0f
Reviewed-on: https://gerrit.chromium.org/gerrit/10630
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2011-11-08 23:09:11 -08:00
Katie Roberts-Hoffman
c52bafe621 Append required bootargs for tegra2 recovery images
This is a fix for tegra2 platforms to enable correct bootarg parsing in
recovery images.

BUG=chrome-os-partner:6752
TEST=Manually create recovery image and confirm bootargs are correct

Change-Id: Ibeb68384fcdba52ecfecb87e161c4b049d75b10e
Reviewed-on: https://gerrit.chromium.org/gerrit/11270
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-11-08 19:28:56 -08:00
Jonathan Kliegman
e6932d8986 Fix clean_loopback_devices to actually parse board parameter
clean_loopback_devices was never parsing command line arguments or
properly setting the default board. As such it would always use the
x86-wayland overlay as it came last alphabetically in the directory
listing.

BUG=chromium-os:22671
TEST=Ran clean_loopback_devices with various --board arguments
  Validated correct OUTPUT_DIR values for those, including an error
  and abort on null

Change-Id: Ia8826bbeb88ed5bdac0aa7698dd262f72de2749a
Reviewed-on: https://gerrit.chromium.org/gerrit/11332
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Jon Kliegman <kliegs@chromium.org>
Tested-by: Jon Kliegman <kliegs@chromium.org>
2011-11-08 12:47:34 -08:00
Zdenek Behan
07d2422c91 common.sh: Revert commit 9aa80dc457
This partially reverts and partially clarifies the code in the above
commit. It was still in use, just in an obscure place, so a reference
to that has been added.

BUG=chromium-os:21971
TEST=below
1) build_lib/generate-au-zip.py
2) cd /tmp/au-generator/; unzip au-generator.zip
3) exit chroot; cd $chroot/tmp/au-generator/
4) LD_LIBRARY_PATH="$(pwd)" PATH="${PATH}:$(pwd)" ./cros_generate_update_payload --image something_i_had --output x --outside_chroot

Change-Id: Idfc03937c4f3517c8567efcdebd1cb8ce134fc8e
Reviewed-on: https://gerrit.chromium.org/gerrit/11019
Tested-by: Zdenek Behan <zbehan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Zdenek Behan <zbehan@chromium.org>
2011-11-07 17:28:59 -08:00
Gary Morain
140cc8b16d Look at all upstart configuation scripts for the #for_test hack.
BUG=chromium-os:22446
TEST=Build images and manually inspect configuration files in test and non-test
iamges.

Change-Id: I8b4ff34e40f24f1250e592e5b96d358f064610a8
Reviewed-on: https://gerrit.chromium.org/gerrit/11161
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Gary Morain <gmorain@chromium.org>
Commit-Ready: Gary Morain <gmorain@chromium.org>
2011-11-07 15:55:52 -08:00
Mike Frysinger
cbc51a0929 update hooks: punt old localtime symlinks
Older core ebuilds would install /etc/localtime symlinks that'd confuse
the build system, so scrub them now that the ebuilds in question have
been fixed up.

See http://gerrit.chromium.org/gerrit/10960 for more info.

BUG=chromium-os:21850
TEST=`./build_packages --board=x86-alex` cleaned my old /etc/._cfg*_localtime symlinks

Change-Id: I3b3d2a42e77d259cf9eda380f791e8108fef7458
Reviewed-on: https://gerrit.chromium.org/gerrit/10965
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2011-11-04 10:55:01 -07:00
Mike Frysinger
6b38b1e1af update hooks: undo /etc/portage/env support
This drops the work that we did in 14_board_portage_env as support for
per-package env in the overlay has been moved to profile.bashrc.  That
do not require modification of any /etc/portage/env dirs.

BUG=chromium-os:21787
TEST=update chroot to ver 15, make sure /build/*/etc/portage/env are gone

Change-Id: I4f1d577f125a66efdeabdbbd8f862562c2e5d2e5
Reviewed-on: https://gerrit.chromium.org/gerrit/11047
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2011-11-03 16:13:22 -07:00
David James
e996baa382 Add IGNORE_PREFLIGHT_BINHOST env variable for ignoring PREFLIGHT_BINHOST.
This variable is intended to be used by cbuildbot to allow it to ignore
the preflight binhost when clobbering the preflight builder itself, to
ensure it doesn't pick up the old preflight prebuilts again.

BUG=chromium-os:21788
TEST=Set IGNORE_PREFLIGHT_BINHOST and see that preflight binhosts are ignored.

Change-Id: I2a0ca38ad8d35b34d2f14a980d5cd67ab66c0f07
Reviewed-on: https://gerrit.chromium.org/gerrit/11088
Reviewed-by: Ryan Cui <rcui@chromium.org>
Tested-by: Ryan Cui <rcui@chromium.org>
Commit-Ready: David James <davidjames@chromium.org>
2011-11-02 18:13:58 -07:00
Chris Sosa
4299eb9d52 Fix bug where we may modify FLAGS_factory_install after we source base_image_util.sh
This also simplifies the factory_install logic to all be in the same place :).

BUG=chromium-os:22371
TEST=Ran trybot with this CL + tegra2 build that used make_netboot.sh that uses
the factory install which failed on the buildbot previously.

Change-Id: Id0847b85c061cf230d0e6cc5bb40de2eba0992b9
Reviewed-on: https://gerrit.chromium.org/gerrit/10986
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
2011-11-02 13:45:50 -07:00
Mike Frysinger
40bb0c3152 enter_chroot: ignore errors from copying user ssh files
The current code that syncs the user's ssh files from ~/.ssh/ to the
chroot assumes the user has these files in the first place.  For the
fresh user and/or install, these might not exist.  So ignore errors
from attempting to copy them.  It's not like we attempt to "recover"
anyways, and this sync is more of a "let's make things smoother" than
a "we need this to run properly".

BUG=chromium-os:15005
TEST=`mv ~/.ssh ~/.ssh.bak; mkdir ~/.ssh; cros_sdk` and see no more warnings

Change-Id: I9cac2ecad7c64c088fbdfe55377c0429b3b7ab03
Reviewed-on: https://gerrit.chromium.org/gerrit/10922
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2011-10-31 21:49:19 -07:00
Chris Sosa
ef4a6452d4 Add Shflags usage for build_image.
BUG=chromium-os:22048
TEST=Ran build_image -h

Change-Id: If495d1784b9ba4491ca55537bf0b81395e88ee3c
Reviewed-on: https://gerrit.chromium.org/gerrit/10822
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-10-28 11:39:47 -07:00
Chris Sosa
131eaf5667 Fix message funcs to use $@ and fix callers to use it correctly.
Fixed all callers in my big CL to no longer have to wrap poorly using
\ and start from the beginning of the next line but rather pass in
an array of args i.e.

info "tacos" " are" " delicious".

BUG=None
TEST=Ran to see the errors in parse_build_image and manual eyeing.

Change-Id: I5eac8a5ae7a8d314dbc4e821ee33cf88213711d0
Reviewed-on: https://gerrit.chromium.org/gerrit/10823
Commit-Ready: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-10-28 11:08:58 -07:00
Chris Sosa
b0f5732449 Add ability to pass in specific images you want built rather than use flags.
This CL does two things.

First it introduces an argument interface that works with all the following
combinations:

factory_install | [base|dev[test|factory_test]] rather than use --test etc.

This does not build extra images.  If you just want a test image you can
run build_image --board=<board> test and all that's in your latest_dir is
chromiumos_test_image.bin.

Second, we only build what we ask and only finalize what we ask so on
an invocation of build_image test we only actually run cros_make_image_bootable
once saving 2 minutes on my machine (from 6:50->4:50 on multiple iterations).

BUG=chromium-os:22048
TEST=build_image test, all possible combinations of args through to start of
build.  Built factory_install using new and old methods and dev test with both
methods.  Also verified mod_image_for_test still works as advertises stand-alone.

Change-Id: I9fe2feb50a941c007214decd9ba1627012c050af
Reviewed-on: https://gerrit.chromium.org/gerrit/10621
Commit-Ready: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-10-27 16:33:07 -07:00
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