In order to support building arbitrary image, the partition copying scripts has
been changed to support "copying partitions in same size" and "overwriting
partitions in different size", and "copying partition from external file".
We need these APIs to create disk/usb image with release images that is using
partition with different size (ex, recovery images).
Image copying buffer selection and disk image creation time are also improved.
BUG=chromium-os:15050
TEST=./make_factory_package.sh ... --diskimg preimage.bin
./make_factory_package.sh ... --usbimg rma.bin
./make_factory_package.sh ... # omaha mode
Change-Id: I6a4c820abf59e780985c95dc35f9340b347bd952
Reviewed-on: http://gerrit.chromium.org/gerrit/5981
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
The release image parameter must be an image signed for SSD booting. This CL
adds detection code and allows on-the-fly conversion from recovery to SSD image.
BUG=chromium-os:15050
TEST=./make_factory_package --release RECOVERY --factory FACTORY # success
# Seeing: INFO : Image type is [recovery]:...
./make_factory_package --release USB --factory FACTORY # success
# Seeing: Image type is [usb]:...
./make_factory_package --release SSD --factory FACTORY # success
# Seeing: Image type is [ssd]:...
./make_factory_package --release GARBAGE --factory FACTORY # failure
# Seeing: Image type is [invalid]:...
./make_factory_package --release GARBAGE --factory FACTORY --nodetect_release_image # success
# No image type messages
Change-Id: I8530b3f58574a4298b4d6d904a12bb92636c7365
Reviewed-on: http://gerrit.chromium.org/gerrit/5965
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
When we want to separate kernel and rootfs, there must be a more flexible syntax
to assign input source.
The partition info parsing code is also improved to detect errors.
BUG=chromium-os:15050
TEST=./make_factory_package --release RECOVERY --factory FACTORY
Change-Id: Ie74b3e23117480a7f503488b39dedceadbfb41e3
Reviewed-on: http://gerrit.chromium.org/gerrit/5962
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
When running outside chroot, we should use locate_cgpt + "$GPT" to invoke cgpt;
otherwise it may be not in system PATH.
For dealing with a true SSD image (over USB, for example) this CL also improved
data writing speed from <2M/s to 8M/s+ (over USB).
BUG=chromium-os:10531
TEST=./make_factory_package.sh \
--factory=../build/images/x86-mario/latest/chromiumos_factory_image.bin \
--release=../build/images/x86-mario/latest//chromiumos_image.bin \
--diskimg=/dev/sdb
Also tested:
--diskimg=blah # local file
(chroot) --diskimg=/dev/sdd
(chroot) --diskimg=blah
Change-Id: I647d97fe388f5b6a6223fa8cacfecdf00265f60c
Review URL: http://codereview.chromium.org/6261003
Major changes are:
- prefix functions in cros_image_common with 'image' to avoid naming conflicts
- use awk to replace grep+sed+cut
- use case to handle board name list
- factory_setup.sh should return error if applying patch failed
- refine for shell script coding style guide:
* replace `` with $()
* quote variables
* replace "! -z" by "-n"
* no space between redirection symbol (>) and target name (eg, >>filename)
* 1> should be simply >
* no trailing \ for && and ||
BUG=chrome-os-partner:1583
TEST=manually verified:
./image_to_usb.sh --factory # calls mod_image_for_test --factory, and works fine
./make_factory_package.sh --factory PATH_TO_IMAGE --release PATH_TO_IMAGE ...
# factory payloads were created successfully
Change-Id: I6bb10bdfb12cbdb14e9816b3ad72dfe4b7b0472f
Review URL: http://codereview.chromium.org/5168001
The team is moving utility/library scripts into 'lib' folder.
image_common.sh should follow this policy.
Also refined the parameter check of mk_memento_images.sh
BUG=chromium-os:5208
TEST=./make_factory_package.sh --factory PATH_TO_FACTORY --release PATH_TO_RELEASE;
# factory bundle created successfully
./mk_memento_images.sh PATH_TO_PART2 PATH_TO_PART3
# update.gz created successfully
./mk_memento_images.sh PATH_TO_IMGE 2 3
# update.gz created successfully
Change-Id: I3afecf05da2832986723f28b595045d0540ea9e9
Review URL: http://codereview.chromium.org/4825004