Commit Graph

61 Commits

Author SHA1 Message Date
Michael Marineau
34c324cc3a fix(build_library): Remove GPT writer scripts, call cgpt directly.
This change removes /usr/sbin/write_gpt.sh from images which we have no
use for. This allows us to drop the indirection of writing partition
tables by first writing out a script to call. Now cgpt.py can call cgpt
directly to initialize the partition layout. This opens the way for
further improvements to how disk images are created.
2013-08-20 21:30:22 -04:00
Michael Marineau
626ebd7eb0 fix(image_to_vm): Remove unused --prod flag, prod_image is the right one 2013-08-01 19:05:16 -04:00
Michael Marineau
7c48115da6 fix(image_to_vm): Use saved version info instead of parsing directory.
Trying to include version info by adding the directory name to VM image
names didn't work and a better solution is for build_image to write out
a version.txt file. This should also fix an issue where uploading from
image_to_vm.sh didn't always go to the same location as the images
uploaded from build_image did.
2013-07-31 21:22:52 -04:00
Michael Marineau
c5cd245603 feat(image_to_vm): Add support for uploading vm images
After this I can make production AMI images available for download! :-D
2013-07-26 16:31:11 -04:00
Michael Marineau
033cf224f1 feat(image_to_vm): Refactor to make adding/changing vm formats easier.
The old script was heading towards spaghetti code realm. This breaks up
all the image variations such as hybrid MBR, OEM packages, etc into
configuration options and small functions that actually do the work.

All this is in the new vm_image_util.sh library but the command line
parsing and overall procedure remains in image_to_vm.sh

As part of this we gain support for putting some qemu options in a
config file as well as Xen virtual machines using pygrub and pvgrub.

Lots of generally unused options have been removed to simplify things
and keep output file names consistent.
2013-07-24 23:11:50 -04:00
Alex Polvi
017ec772a8 add rackspace 2013-07-22 14:55:44 -07:00
Alex Polvi
268a1efd3f feat(image_to_vm): AMI support
add support for the hybrid MBR and OEM partition on Amazon.
2013-07-17 14:27:38 -07:00
Michael Marineau
3fa29024e1 fix(build_image): Configure legacy bootloaders to set root by UUID.
Make use of the new partition UUIDs for ROOT-A and ROOT-B in the root=
kernel parameters provided by the legacy (non-kexec) bootloaders. This
makes all of our images bootable as-is without having to pass them
through image_to_vm.sh. :-D
2013-07-08 16:28:12 -04:00
Brandon Philips
05d70da37c fix(image_to_vm.sh): forward fewer ports
we disabled systemd-rest for now so don't tell people to forward all of
those ports.
2013-07-05 14:08:14 -07:00
Brandon Philips
a45c529549 feat(build*): add CoreOS production image building
This will create a CoreOS production image and support it with the tools
like image_to_vm.sh and build_image.
2013-07-05 12:06:40 -07:00
Brandon Philips
4057d5590d feat(disk_layout): follow new CoreOS partition layout
As outlined here we need a new partition layout, this patch makes the
necessary changes:
https://groups.google.com/forum/#!topic/coreos-dev/bA7gwGGoTng

The first big change is making all of the scripts obey partition numbers
based on labels in the disk_layout.json. This makes it much easier to
change later on.

The second big change is in the layout itself. The json file was updated
to reflect the document above.

And finally the grub boot configuration needed for pv-grub and pygrub
were added to the create_legacy_bootloader_templates.sh library utlity.

Everything seems to work and boot now.
2013-05-12 12:31:03 -07:00
Brandon Philips
be7a09d64d feat(image_to_vm): setup grub/menu.lst for xen
xen requires a /boot/grub/menu.lst for pygrub and pvgrub on partition 1.
Put it on the stateful partition for now and come back around and fix
this up when we redo the partition layout.
2013-05-03 18:34:45 -07:00
Brandon Philips
b274a41f11 fix(image_to_vm): cleanup qemu-kvm output
- have the command use -curses to save people hassle on ssh sessions
- forward ssh too
- clean formatting up a bit
2013-04-25 08:47:59 -07:00
Brandon Philips
ffbe6a1a66 fix(image_to_vm): add correct ports for kvm instructions 2013-02-28 10:47:06 -08:00
David James
7efb76cde5 Remove deprecated mod_image_for_test.sh and references.
mod_image_for_test.sh doesn't work anymore so nobody should be using it.
There are a few places where scripts try to use mod_image_for_test.sh,
and these are timebombs because they fail if a test image needs to actually
be produced.

BUG=chromium-os:31183
TEST=Tested that this script doesn't produce any images anymore, so
     it should be fine to delete it.

Change-Id: If80337407023d62f76117dc44cadfa46801ca236
Reviewed-on: https://gerrit.chromium.org/gerrit/40955
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2013-01-09 18:30:52 -08:00
John Sheu
b7b095befd Use cirrus driver for QEMU
Moving to the cirrus driver (instead of std) so we can support
cirrus-fb, in preparation for nonroot-X support.

BUG=chromium-os:388
TEST=local build, run with x86-generic

Change-Id: Ic7d5776f673ac3c15680d62331345d55985f1d73
Reviewed-on: https://gerrit.chromium.org/gerrit/39900
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>
2012-12-20 15:06:03 -08:00
Liam McLoughlin
b78a7c3569 Add disk_layout flag to image_to_vm
This allows you to build a VM image using the 4gb-rootfs layout

BUG=none
TEST=Build iamge using 4gb-rootfs and build VM image

Change-Id: I1efa45d1448b22a9905dae764f0e4cdc0538be68
Reviewed-on: https://gerrit.chromium.org/gerrit/37489
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-11-07 10:21:46 -08:00
Liam McLoughlin
12a9a84de9 Add adjust_part flag
BUG=chromium-os:35003
TEST=Build an image specifying above flag, verify image is correct size

Change-Id: I36df212bf1dac41717044da011552d459645d523
Reviewed-on: https://gerrit.chromium.org/gerrit/35105
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-10-30 04:44:53 -07:00
Liam McLoughlin
aca5e1edfe Fix up OEM partition during image build
BUG=chrome-os-partner:14340
BUG=chromium-os:34688
TEST=Build an image, verify OEM partition has filesystem

Change-Id: Ie3e51427a36f5e8ea288abb7ac3ceeefb20cdb6f
Reviewed-on: https://gerrit.chromium.org/gerrit/33866
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-23 17:00:37 -07:00
Liam McLoughlin
5b37c5443a Simplify and add flexibility to image creation process
This change adds support for building the disk layout from a
configuration file. It also cleans up much of the image creation
code.

install_gpt no longer exists, and has been replaced by cgpt.py's
write action. This spits out a file that has two functions that can
be called to write a partition layout to a disk/file. This gets rid
of the gigantic nest of calculations that built the layout previously.

All instances of partition/filesystem sizes in build scripts should now
be gone in favour of calls to the cgpt.py tool.

create_boot_desc has moved inside the base image creation, in an effort
to simplify build_image.

load_kernel_test is gone since it's apparently not supposed to be called
here anyway (asked wfrichar/rspangler about this one).

Base image creation now uses files rather than loop devices when
building an image. This means we can simply umount them once we're
done and not worry about cleaning up the loop device, since it's
been done for us.

Hash pad calculation has been removed. This is now set manually inside
the partition config file.

Hybrid MBR creation is gone, since it's now possible to do that in a board
specific hook (see overlay-beaglebone/scripts/board_specific_setup.sh).

OEM partition now has a filesystem, which is mounted at /usr/share/oem
during emerge so that packages can stash files here.

root_fs_dir and friends are still globals, but the long-term idea
is to make this not the case.

BUG=chromium-os:33817
TEST=All types of images and their respective flows
  (VM, recovery, test, factory etc)

Change-Id: I8a596728a4d1845c930e837bea627f5b6a11c098
Reviewed-on: https://gerrit.chromium.org/gerrit/29931
Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
2012-09-23 10:05:12 -07:00
Brian Harring
ece65e0633 Add a umount wrapper to suppress gvfsd/trashd breaking umount calls.
Specifically, detect if the umount failed due to current access, if so,
give it up to 9 more runs (w/ 1s pauses) continuing only if it's still
failing due to currently open files.

Via this, it should suppress the race of gvfs/trashd looking at
quick mounted/umounted pathways.

This CL is a two parter; this adds the script, and converts common.sh
consumers over to using the override.

The next CL will modify the chroot itself to ensure our script gets
picked up/used.

BUG=chromium-os:23443
TEST=trybot, manul validation.

Change-Id: I92dedd91d6133c2063b1e5dbbc1a68366844801d
Reviewed-on: https://gerrit.chromium.org/gerrit/32087
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-09-05 00:00:43 -07:00
Josh Triplett
f4dfd18b12 Drop fixup_image_for_qemu.py; ChromeOS works fine in qemu/kvm without an xorg.conf
fixup_image_for_qemu.py exists only to add an xorg.conf; however, Xorg's
autodetection has handled qemu/kvm just fine for quite a while now, with
or without -vga std.  Drop the script and the call to it from
image_to_vm.sh.

BUG=None
TEST=Build an image, confirm that it still works fine in kvm and
     autodetects an appropriate resolution.

Change-Id: I9f550fef1eebe7387d232795105ec47bfa908f22
Reviewed-on: https://gerrit.chromium.org/gerrit/31181
Tested-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Rahul Chaturvedi <rkc@chromium.org>
Commit-Ready: Josh Triplett <josh@joshtriplett.org>
2012-08-22 18:08:34 -07:00
Mike Frysinger
919bf0c5b8 image_to_vm.sh: avoid subshells
There is a bug in bash where BASH_COMMAND is not correct when an error
is hit in a subshell (it retains the command run *before* the subshell).

Since this has confused a few people using image_to_vm.sh so far, drop
the use of subshells in this file.  They weren't necessary in the first
place so it isn't like we're losing anything.

URL: http://lists.gnu.org/archive/html/bug-bash/2012-08/msg00052.html
BUG=None
TEST=`./image_to_vm.sh --board=x86-alex --from=../build/images/x86-alex/latest` still works
TEST=`rm ../build/images/x86-alex/latest/chromiumos_image.bin && ./image_to_vm.sh --board=x86-alex --from=../build/images/x86-alex/latest/` reports correct line

Change-Id: Iaa7560b4868128119a4f6223b54020611f203635
Reviewed-on: https://gerrit.chromium.org/gerrit/31135
Reviewed-by: Brian Harring <ferringb@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-22 15:03:39 -07:00
Mike Frysinger
c17a493bcc setup DEFAULT_BOARD by default
Rather than forcing all consumers of DEFAULT_BOARD to remember to call
get_default_board, just do it for them automatically.

BUG=None
TEST=`cbuildbot {arm,amd64,x86}-generic-full` works
TEST=`./build_packages --help` shows correct default

Change-Id: I8d6ccb83babb2764a50692318eb9193c45fb3b39
Reviewed-on: https://gerrit.chromium.org/gerrit/17868
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-08-14 10:17:31 -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
J. Richard Barnette
8a7aa3e502 Delete unnecessary -d options from umount
The -d option to umount is unnecessary in cases where the original
mount was created with '-o loop' (it says so in the man page).
Moreover, there's a demonstrable bug when using 'umount -d' in this
case:  umount complains that it's unable to delete the loop device
in this case.  This change silences those messages.

The demonstrated bug in umount is a plausible explanation for build
failures characterized by unexpected failures of 'mount -o loop';
see the BUG, below.

BUG=chromium-os:24975
TEST=run the changed commands, see no loopback devices leaked

Change-Id: I1df9f60b40eabd279164b79ee66994ff9f644ee9
Reviewed-on: https://gerrit.chromium.org/gerrit/15998
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
2012-02-15 18:23:14 -08:00
Liam McLoughlin
c9f1dab46e Added sudo to VBoxManage call, to fix permission denied error when building a VirtualBox image
BUG=None
TEST=Run image_to_vm.sh to build a VirtualBox image for the x86-generic board, confirm image builds successfully

Change-Id: I3ce9aac1eef6dfa695747e92e7d7e75ddd524027
Reviewed-on: https://gerrit.chromium.org/gerrit/12449
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Liam McLoughlin <hexxeh@hexxeh.net>
Commit-Ready: Jon Kliegman <kliegs@chromium.org>
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
2012-01-09 16:25:34 -08: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
David James
596520acd9 Resize image without using a loop device to avoid sync.
To resize an image, there's no need to use a loop device. We can just operate
on the image directly. This is simpler and avoids doing a sync which can
noticeably delay the build.

BUG=chromium-os:19150
TEST=Run image_to_vm.sh --board=x86-mario

Change-Id: Idbfc99cee9fd890aaad6379fbde511b273cc1d41
Reviewed-on: http://gerrit.chromium.org/gerrit/6036
Reviewed-by: Anush Elangovan <anush@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-08-15 17:18:05 -07:00
David James
63f62623d4 Update image_to_vm to run sync again prior to detaching loop device.
Prevents errors like this:
  loop: can't delete device /dev/loop0: Device or resource busy

See http://build.chromium.org/p/chromiumos/builders/x86%20pineview%20full/builds/119/steps/BuildTarget/logs/stdio

BUG=chromium-os:19150
TEST=Ran image_to_vm.sh

Change-Id: I8300b4770e1b194045fc068b08ff549984361897
Reviewed-on: http://gerrit.chromium.org/gerrit/6024
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2011-08-15 15:21:33 -07:00
David James
b01cc8d2d3 Remove unnecessary sync calls from build_image and image_to_vm.sh.
Calling sync in build scripts pauses the build unnecessarily, particularly
when other steps are running in parallel.

BUG=chromium-os:19150
TEST=Run cbuildbot release build and watch faster performance.

Change-Id: Ia2469e3be68fdd38474ab4e6f67b06339c04822f
Reviewed-on: http://gerrit.chromium.org/gerrit/5966
Reviewed-by: Thieu Le <thieule@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: <taysom@google.com>
Tested-by: David James <davidjames@chromium.org>
2011-08-15 10:07:09 -07:00
Brian Harring
d5d5dbffa1 Fix/standardize exiting if common.sh can't be found
The problem here is that most were doing their exiting w/in a subshell;
exit within a subshell kills the subshell, not the parent.  Not all scripts
were using set -e (which would pick up the failing subshell); as such
just rewriting them to remove the potential via eliminateing the subshelling.

Beyond that, removed a couple of custom (working, although non-standard)
approaches, and removed a duplicate common.sh sourc'ing w/in mk_memento_images.sh

TEST=force 'find_common_sh' to fail, note the scripts fails to exit
BUG=none

Change-Id: Ia1108a091a6399ad6aedd3cade4a107f4411686c
Reviewed-on: http://gerrit.chromium.org/gerrit/3905
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2011-07-22 12:06:59 -07:00
David James
8b9643f7d8 Fix losetup race condition.
The following pattern creates a race condition:

   LOOP_DEV=$(sudo losetup -f)
   ...
   sudo losetup "${LOOP_DEV}" "${ROOT_FS_IMG}"

If two steps similar to the above run in parallel, and both steps pick up
the same free loop device, they may try to mount different images with the
same loop device and one of the two stages will get a "device is busy" error.

To fix this, we should switch to the following pattern:
   LOOP_DEV=$(sudo losetup --show -f "${ROOT_FS_IMG}")

This CL implements the above.`

BUG=chromium-os:18046
TEST=Run buildbot run. Test case where we run out of loop devices and verify
     logic still works.

Change-Id: Ie457701fda61e5fc3b9112c1bfef9fb9713ea265
Reviewed-on: http://gerrit.chromium.org/gerrit/4555
Tested-by: David James <davidjames@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
2011-07-22 00:02:53 -07:00
Arkaitz Ruiz Alvarez
2bf8859cf8 Fix test images kernel commandline arguments
By default, "cros_debug" should be included in the kernel commandline for
developer images. This change adds "cros_debug" to the kernel commandline
for test images, which are based on developer images but overwrite the boot
arguments.

TEST=Build test image, install on machine and grep "cros_debug" /proc/cmdline
BUG=chromium-os:17393

Change-Id: Ie0de11baf60a3a69a7fef0639247e2edae455ffb
Reviewed-on: http://gerrit.chromium.org/gerrit/3790
Tested-by: Arkaitz Ruiz Alvarez <arkaitzr@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
2011-07-08 12:19:20 -07:00
Stéphane Marchesin
7e0b3d8d9f Use 1280x1024 resolution when running ChromeOS under qemu.
BUG=none
TEST=Run ChromeOS under qemu, the screen should be 1280x1024 not 800x600.

Review URL: http://codereview.chromium.org/6768009

Change-Id: I9a73025244a85d3b07e98136b373b00bb40cd9dd
2011-03-29 06:58:17 -07:00
Stéphane Marchesin
78bd46d457 Do not enable the use_tablet flag in qemu, as this breaks the mouse.
Change-Id: I52901180e962c463bdaacbc573f93700cf9ab4bd

BUG=None
TEST=Run Chrome OS in qemu, check that the mouse is back.

Review URL: http://codereview.chromium.org/6749020
2011-03-25 16:35:01 -07:00
Chris Sosa
8dad50d97f Update test harness to take in optional public and private keys to sign payloads.
In addition some refactoring to make this cleaner and easier.

Change-Id: I1607700d065c71aff2b2833b10acbd3ebace68ce

BUG=chromium-os:8212
TEST=Ran with Simple ... running now with full

Review URL: http://codereview.chromium.org/6482017
2011-02-14 15:29:32 -08:00
Simon Glass
142ca06512 Factored out the code to copy an image and modify it for test
into mod_image_for_test.sh rather than slightly different versions
of the same in image_to_usb.sh and image_to_vm.sh

Added a function to get a test image into common.sh

Added --inplace option to mod_image_for_test, which is the default,
and preserves the original behaviour. But using --noinplace it will
now do the copy for you.

Found that chromiumos_image.bin appears throughout the scripts, so added it and the test variant to common.sh

BUG=chromiumos-10126
TEST=run mod_image_for_test.sh with and without --noinplace
run image_to_usb.sh and image_to_vm.sh with both options
test on Seaboard that correct image is provided

Really we should have automated testing for these scripts

Change-Id: I5cfa91792c7fded35e7f4ca8f8f27c6b270817fb

Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=4fc5227

Review URL: http://codereview.chromium.org/5271010
2011-02-09 13:39:43 -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
Anush Elangovan
0de6de66db Enable virtio for tests
Change-Id: I1d0e546f6ea837928ba426e4690007ef2649f68e

BUG=10102
TEST=test KVM with -net virtio and ensure it boots and can copy files in etc

Review URL: http://codereview.chromium.org/5543006
2010-12-07 17:31:48 -08:00
Chris Masone
7d04c7aacb [crosutils] bump default size of VM disk to allow for bigger stateful partition
BUG=8544
TEST=create an VM image with image_to_vm.sh; the stateful partition should be 2GB in size.

Change-Id: I6c0ee9e2cb513e42c25e4f0d1616835a41f378d7

Review URL: http://codereview.chromium.org/4737001
2010-11-09 08:24:13 -08:00
Chris Sosa
1b11f3813f Add sync after resize to avoid /dev/loop- is busy errors.
Change-Id: I7d38b7f78e5d32744ec3a9e1579d09bd16d64888

BUG=
TEST=Ran it.

Review URL: http://codereview.chromium.org/4108001
2010-10-25 15:10:26 -07:00
Chris Sosa
9fe00b9b13 Use minimums if options are too small.
Change-Id: Icd9402aec8a55c613c8fa12e917bf3fd63272271

BUG=
TEST=Ran it and saw minimums change.

Review URL: http://codereview.chromium.org/3956005
2010-10-22 12:34:16 -07:00
Will Drewry
f929c3012c image_to_vm: fix up the rootfs for mounting rw
Use new helper for accessing a verified rootfs.

TEST=ran image_to_vm and it worked
BUG=tree b0rked

Change-Id: I03c1c55d1e1056081078cbdd8797235636d4845d

Review URL: http://codereview.chromium.org/4023001
2010-10-20 18:48:20 -05:00
Olof Johansson
1688a6d416 Change KVM to use e1000
add -net nic,model=e1000 in start_kvm and in the suggested command as
output by image_to_vm.sh

Signed-off-by: Olof Johansson <olofj@chromium.org>

BUG=none
TEST=Boot an image, run lspci in a terminal, see intel nic

Review URL: http://codereview.chromium.org/3779007

Change-Id: Id7f614adec0ae69b8f4de152832538a13ea4cbad
2010-10-14 19:08:44 -05:00
Chris Sosa
020aa69f37 Fixes for cbuild to work with ctest.
1)  image_to_vm aborts because e2fschk requires a terminal to
be connected in order to check whether or not you want to repair the fs.  Since
we always want this to be true, set -p

2)  Clean up test harness to only verify the number of tests that passed on the
base image are the same on the update back to.  This is because older images
have many tests that fail.  I leave 10% as a reasonable number to pass.

3)  Redirect output from autotest in run_remote_tests to stderr so it gets
logged in a calling script that captures stdout.

Change-Id: If412274353683add20d136747113eb9c2bd41330

BUG=4690, 5533, 7287
TEST=Ran with internal tools for builders.

Review URL: http://codereview.chromium.org/3536018
2010-10-08 16:36:20 -07:00
Chris Sosa
bd61304ebe Pass --board to get_latest_image.sh.
Change-Id: Iaa388bc6dd3ef8b07199ee42de6693cad2f4368f

BUG=
TEST=rm src/scripts/default_board and ran image_to_vm --board x86-generic.

Review URL: http://codereview.chromium.org/3530007
2010-10-04 13:29:23 -07:00
Chris Sosa
45bec936f6 Move vm constants into their own file. This will make it easier to share these constants.
Also fixed get latest image logic in image_to_vm and allowed for using the most recent image in cros_run_vm_test to follow other shell convention of using latest.

Change-Id: I60ed4c03d609500da7f6ae34ef57ba2e32f4b0bb

BUG=
TEST=Tested by running image_to_vm with --full and cros_run_vm_test with suite_Smoke

Review URL: http://codereview.chromium.org/3597001
2010-09-29 15:38:53 -07:00
Olof Johansson
3ed8d12f48 image_to_vm: print launch command for qemu images
Change-Id: Id62c28eac319caf15a2bf83a69b4f727f9e9d56b

BUG=none
TEST=sudo emerge qemu-kvm ; image_to_vm <...> ; cut and paste of output

Review URL: http://codereview.chromium.org/3418031
2010-09-27 13:29:40 -05:00