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>
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>
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>
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>
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>
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>
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>
BUG=none
TEST=Run ChromeOS under qemu, the screen should be 1280x1024 not 800x600.
Review URL: http://codereview.chromium.org/6768009
Change-Id: I9a73025244a85d3b07e98136b373b00bb40cd9dd
Change-Id: I52901180e962c463bdaacbc573f93700cf9ab4bd
BUG=None
TEST=Run Chrome OS in qemu, check that the mouse is back.
Review URL: http://codereview.chromium.org/6749020
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
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
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
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
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
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
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
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
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
Change-Id: I63bdcaa3630c179d407310f6544c102f5353fa4d
BUG=5530
TEST=Ran both cros_run_vm_test and new script and had the latter update successfully.
Review URL: http://codereview.chromium.org/3427011
image_to_vm.sh was running chromeos-setimage. This script
was not meant to be run outside of a CrOS environment, but
its use here predates the cros_make_image_bootable script.
The change converts the rehashing and imaging over to using
cros_make_image_bootable. The vm image uses the usb boot target but defaults
the usb drive to sda3.
update_bootloaders is fixed to not clobber existing syslinux
templates.
cros_make_image_bootable flag override support was broken and this fixes it.
TEST=build a new image wtih rootfs checking and without and ensure both woth with image_to_vm. Also make sure they still boot normally on available hardware.
BUG=chromium-os:5939
Review URL: http://codereview.chromium.org/3189018
Change-Id: Ib4ac25f1a76f25ac7ce4538614ba247df9caea91
Change-Id: I7d17db3cb522a52ec2dac688f4bf83fb5ae6a2d1
related CL: http://codereview.chromium.org/3031049/show
TEST=(1)Manually built an image using build_image script, which exercised "build_gpt.sh"; (2) manually built a Qemu VM image using "image_to_vm.sh" and verified the VM is bootable (up to login screen); (3) manually built a dev recovery image using "mod_image_for_dev_recovery.sh" and verified image functions properly for dev recovery purpose
Review URL: http://codereview.chromium.org/3050039
The last changes to the installer broke image_to_vm. Since image_to_vm
doesn't need to run postinst, but just change the active image, it
now just calls chromeos-setimage and passes in its needed flags (already
supported by the last installer change). It will also detect whether
the image was built with verification of the rootfs enabled or not
by looking at the default.cfg file.
Also updates the location of where you should run the command in
build_image.
TEST=built a new image with --enable_rootfs_verification and started with qemu -curses -hda [output]; did the same without verification
BUG=chromium-os:2963
Review URL: http://codereview.chromium.org/3034030
Change-Id: I265d6ad8971f9427b78cc07d784fced9cceb5974
Added the flags required for mounted images to the postinst call.
Scripts no longer need to fixup postinst hence that code is removed.
Review URL: http://codereview.chromium.org/3027012