Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Issue 5271010: Factored out the code to copy an image and modify it for test (Closed)

Created:
10 years ago by sjg
Modified:
9 years, 7 months ago
Reviewers:
Nick Sanders, sosa
CC:
chromium-os-reviews_chromium.org, Mandeep Singh Baines, anush, sosa
Visibility:
Public.

Description

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 Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=142ca06

Patch Set 1 #

Total comments: 26

Patch Set 2 : Changes as suggested #

Total comments: 10

Patch Set 3 : Minor changes #

Total comments: 6

Patch Set 4 : Changed to use a temp variable #

Total comments: 2

Patch Set 5 : Update to try to fix buildbot issue #

Patch Set 6 : Rebased to ToT #

Total comments: 2

Patch Set 7 : Default force_copy to TRUE in image_to_vm.sh #

Patch Set 8 : Final upload to check before push #

Unified diffs Side-by-side diffs Delta from patch set Stats (+111 lines, -84 lines) Patch
M common.sh View 1 2 3 4 5 3 chunks +57 lines, -0 lines 0 comments Download
M image_to_usb.sh View 1 2 3 4 5 8 chunks +16 lines, -49 lines 0 comments Download
M image_to_vm.sh View 1 2 3 4 5 6 3 chunks +11 lines, -34 lines 0 comments Download
M mod_image_for_test.sh View 1 2 3 4 5 6 7 3 chunks +27 lines, -1 line 0 comments Download

Messages

Total messages: 18 (0 generated)
sjg
http://codereview.chromium.org/5271010/diff/1/image_to_usb.sh File image_to_usb.sh (right): http://codereview.chromium.org/5271010/diff/1/image_to_usb.sh#newcode150 image_to_usb.sh:150: SRC_IMAGE="${FLAGS_from}/${FLAGS_image_name}" This was moved to make the script more ...
10 years ago (2010-11-30 21:07:29 UTC) #1
sosa
http://codereview.chromium.org/5271010/diff/1/common.sh File common.sh (right): http://codereview.chromium.org/5271010/diff/1/common.sh#newcode18 common.sh:18: PV_OK=1 These vars are pretty short, watch out for ...
10 years ago (2010-11-30 22:01:43 UTC) #2
sosa
Also please file a cleanup issue to fill in the bug! Thanks for looking into ...
10 years ago (2010-11-30 22:05:21 UTC) #3
sjg
Hi, Have cleaned up everything except this... Re the function request, this is hard, because ...
10 years ago (2010-12-01 00:57:04 UTC) #4
sosa
Why not just redirect to stderr i.e. ./mod_image_for_test.sh > /dev/stderr On Tue, Nov 30, 2010 ...
10 years ago (2010-12-01 01:09:16 UTC) #5
sjg
Hi, Have made all these changes. Also found another use of pv. I hope it ...
10 years ago (2010-12-01 20:02:31 UTC) #6
sosa
http://codereview.chromium.org/5271010/diff/10001/common.sh File common.sh (right): http://codereview.chromium.org/5271010/diff/10001/common.sh#newcode556 common.sh:556: # SRC_IMAGE=$(prepare_test_image "/path/to/image") Dcoument both $1 and $2 ...
10 years ago (2010-12-01 20:37:45 UTC) #7
sjg
http://codereview.chromium.org/5271010/diff/10001/common.sh File common.sh (right): http://codereview.chromium.org/5271010/diff/10001/common.sh#newcode569 common.sh:569: if [ ${FLAGS_factory_install} -eq ${FLAGS_TRUE} ]; then On 2010/12/01 ...
10 years ago (2010-12-01 20:54:00 UTC) #8
Nick Sanders
http://codereview.chromium.org/5271010/diff/16001/common.sh File common.sh (right): http://codereview.chromium.org/5271010/diff/16001/common.sh#newcode141 common.sh:141: CHROMEOS_TEST_IMAGE_NAME="chromiumos_test_image.bin" Can you modify the output name based on ...
10 years ago (2010-12-02 00:01:48 UTC) #9
Nick Sanders
http://codereview.chromium.org/5271010/diff/16001/common.sh File common.sh (right): http://codereview.chromium.org/5271010/diff/16001/common.sh#newcode579 common.sh:579: --image="$1/$2" --noinplace ${args} >/dev/stderr Can you get this output ...
10 years ago (2010-12-02 00:07:51 UTC) #10
sjg
http://codereview.chromium.org/5271010/diff/16001/common.sh File common.sh (right): http://codereview.chromium.org/5271010/diff/16001/common.sh#newcode141 common.sh:141: CHROMEOS_TEST_IMAGE_NAME="chromiumos_test_image.bin" On 2010/12/02 00:01:48, Nick Sanders wrote: > Can ...
10 years ago (2010-12-02 00:28:52 UTC) #11
sjg
10 years ago (2010-12-04 01:46:26 UTC) #12
sjg
Hi, I have made the changes as suggested - did either of you see it ...
10 years ago (2010-12-07 17:21:24 UTC) #13
sosa
LGTM w/ quote nits http://codereview.chromium.org/5271010/diff/23001/image_to_usb.sh File image_to_usb.sh (right): http://codereview.chromium.org/5271010/diff/23001/image_to_usb.sh#newcode152 image_to_usb.sh:152: SRC_IMAGE=${CHROMEOS_RETURN_VAL} Quotes around val http://codereview.chromium.org/5271010/diff/23001/image_to_vm.sh ...
10 years ago (2010-12-07 17:40:28 UTC) #14
sosa
Tested ... added comments with why the pfq failed http://codereview.chromium.org/5271010/diff/31002/image_to_vm.sh File image_to_vm.sh (right): http://codereview.chromium.org/5271010/diff/31002/image_to_vm.sh#newcode113 image_to_vm.sh:113: ...
9 years, 10 months ago (2011-02-09 02:58:52 UTC) #15
sosa
actually force_copy is just set to false here but true otherwise ... prob just need ...
9 years, 10 months ago (2011-02-09 03:02:21 UTC) #16
sjg
Ok here it is with the fix - thanks, Simon
9 years, 10 months ago (2011-02-09 19:36:29 UTC) #17
sosa
9 years, 10 months ago (2011-02-09 19:53:13 UTC) #18
LGTM again!

Powered by Google App Engine
This is Rietveld 408576698