Commit Graph

45 Commits

Author SHA1 Message Date
Vic Yang
4051405da9 Add 'vfat' flag when building kernel with initramfs
We are about to separate VFAT support from 'initramfs' flag. Let's add
'vfat' flag first so that when this happens nothing gets broken.

BUG=chrome-os-partner:9805
TEST=Build success. Factory install shim still works.

Change-Id: Ia432e3b1a6186f4f7c817a1283c86066ced5fef1
Reviewed-on: https://gerrit.chromium.org/gerrit/23193
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-05-23 17:49:46 -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
Brian Harring
aa13ea4658 Shift crosutils scripts to use the common.sh they were written against.
Rather than trying to use an old/stale common.sh, use the common.sh
from the invocation point- if invoked via /usr/lib/crosutils, use that
common.sh.  If invoked via src/scripts/, use that, etc.

Trying to intermix it just introduces potential for bugs and invalidly
freezes common.sh api, thus the efforts to revert this and ultimately
revert the existing of a crosutils ebuild.

BUG=chromium-os:27201
TEST=cbuildbot x86-generic-full

Change-Id: I4c6c5fbade3d28c71752bd4c44dccad49af52ec0
Reviewed-on: https://gerrit.chromium.org/gerrit/18303
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
2012-03-15 23:35:06 -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
Gilad Arnold
4ac8731001 mod_image_for_recovery.sh: some cleanup.
Motivated by the need to share the default recovery image name across
scripts (image_to_usb.sh in this case) and have it setup in common.sh.
Includes some general cleanup steps such flags and usage strings,
migrating function definitions to the beginning of the script, etc.

BUG=chromium-os:26010
TEST=Tested mod_image_for_recovery.sh on local host.

Change-Id: Ife3731915302a2e7be8beb750501d0ae9a0c43a4
Reviewed-on: https://gerrit.chromium.org/gerrit/15523
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
2012-02-08 14:44:56 -08:00
Gilad Arnold
1702be631c Do not pass dm-verity options to build_kernel_image.
* Since dm-verity arguments are now read from the install image upon
  recovery, we need not use them in build_kernel_image.

* Also, don't expect or remove /tmp/rootfs.hash, which will not be
  generated by build_kernel_image.

* Cleanup of dead code following the elimination of use of root_dev.

* Updated ASCII art for success/failure condition.

* See corresponding changes to initramfs script (extract verity args
  from install kernel) and chromeos-initramfs ebuild (pull
  dump_kernel_config).

BUG=chromium-os:22530
TEST=Built and successfully installed recovery image on CR-48

Change-Id: I3536c88537bbce277f79f17b676231b67337a0d1
Reviewed-on: https://gerrit.chromium.org/gerrit/12646
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
2011-12-08 14:21:06 -08:00
Gilad Arnold
0c563c6704 Revert "Do not pass dm-verity options to build_kernel_image."
This reverts commit 99182997f90041870db9038837c04be973999800

CL was committed unintentionally; it depends on two other CLs that were not committed yet.

Change-Id: Ica5820b31d7f6857c0553cedb642ee17f5109da9
Reviewed-on: https://gerrit.chromium.org/gerrit/12587
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
2011-12-07 15:45:16 -08:00
Gilad Arnold
826878c84c Do not pass dm-verity options to build_kernel_image.
* Since dm-verity arguments are now read from the install image upon
  recovery, we need not use them in build_kernel_image.

* Also, don't expect or remove /tmp/rootfs.hash, which will not be
  generated by build_kernel_image.

* Cleanup of dead code following the elimination of use of root_dev.

* Updated ASCII art for success/failure condition.

* See corresponding changes to initramfs script (extract verity args
  from install kernel) and chromeos-initramfs ebuild (pull
  dump_kernel_config).

BUG=chromium-os:22530
TEST=Built and successfully installed recovery image on CR-48

Change-Id: I146b6ad707d96c9fbc8731a73ae079e80902a565
Reviewed-on: https://gerrit.chromium.org/gerrit/12335
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
2011-12-07 14:39:03 -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
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
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
Mike Frysinger
2fe928ec7a mod_image_for_recovery.sh: don't silence stderr in non-verbose modes
The current code will silence stderr when operating in non-verbose mode
because it always turns on shell tracing with `set -x`.  Unfortunately,
this also ends up killing error messages from a bunch of places in the
script as well:
 - look for all the "1>&2" uses in mod_image_for_recovery.sh
 - look at missing error() override
 - look at duplication of die() just to undo things

A really simple example:
$ ./mod_image_for_recovery.sh
$
Did it work?  Or did I do something wrong?  Who knows!

So undo the stderr silencing and simply turn on `set -x` only when
requested (verbose mode).

BUG=None
TEST=forced some errors in non-verbose mode and saw no output before change, but saw it after change; made a working recovery image

Change-Id: I31578fba091e390a56a437af97782a621e2137fb
Reviewed-on: http://gerrit.chromium.org/gerrit/6904
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2011-08-31 06:57:27 -07:00
Chris Sosa
50637eebb8 Revert "Add feature to extract kernel image from other recovery image for use in recovery."
This reverts commit c99f52ab42a3204c0b7cee1ffbcbee77acf2d11c

Change-Id: I21c8f759ab49fb947c856f64369a6595ffdbbb0a
Reviewed-on: http://gerrit.chromium.org/gerrit/6373
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
2011-08-19 20:00:41 -07:00
Chris Sosa
493cbf8426 Add feature to extract kernel image from other recovery image for use in recovery.
This CL adds a new option to mod_image_for_recovery that allows a dev to pass
in another recovery image as an option and have mod_image_for_recovery use
the kernel provided in that image when building a new recovery image.

BUG=chromium-os:19189
TEST=Built using option on image signed with non-dev keys using appropriate
recovery image as base.

Change-Id: I02a3c3bf458fb3c9fee556364005d7eaff5acccc
Reviewed-on: http://gerrit.chromium.org/gerrit/6031
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
2011-08-19 13:51:52 -07:00
J. Richard Barnette
e4e3decfc0 Extract some common code for sharing with build_image, et al.
BUG=None
TEST=build regular, test, and recovery images

Change-Id: I2d7d073c27d14fb88be6a63953dcc77fc76a0807
Reviewed-on: http://gerrit.chromium.org/gerrit/5512
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2011-08-11 09:51:31 -07:00
David James
0ea96e4fd6 Install recovery kernel directly to image, not to build dir.
The recovery kernel is different from the regular kernel, and
should be kept sandboxed so that it does not mess with our
build directory.

We also need to give the recovery kernel a different PKGDIR so
that it does not overwrite our prebuilts for the ordinary
kernel.

BUG=chromium-os:18691
TEST=build_image --factory_install, mod_image_for_recovery.sh

Change-Id: I678a94305d5f30bc2c95bf4e53cfe81b2ae9d8ef
Reviewed-on: http://gerrit.chromium.org/gerrit/5305
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-08-05 12:33:15 -07:00
Che-Liang Chiou
e51bdf284c Obsolete --crosbug12352_arm_kernel_signing flag
This reverts commit 451f36e4a8.

Last time I removed the --crosbug12352_arm_kernel_signing flag, buildbot
failed. The reason seemed to be that buildbot still passing this flag to
build_image. However, I cannot find anywhere in the log that indicates
buildbot did pass this flag to build_image. So I think the last failure
should be transient and it is good to obsolete this flag.

BUG=chromium-os:12352
TEST=build_image
TEST=load_kernel_test -b 2 /path/to/image /path/to/recovery_key.vbpubk

Change-Id: Ic757eb2dc4304e7205b483063335f8816b536433
Reviewed-on: http://gerrit.chromium.org/gerrit/4794
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-07-26 21:40:13 -07:00
J. Richard Barnette
8447777820 Simplify standard boilerplate for selected scripts
This shortens the standard boilerplate for finding and sourcing
shell function libraries for build_image, mod_image_for_test.sh and
mod_image_for_recovery.sh.

As a side effect of the change, both mod_image_for_test.sh and
mod_image_for_recovery.sh will now restart inside the chroot if
invoked from outside; this is consistent with the pre-existing
behavior of build_image.

BUG=None
TEST=run the three scripts, from both inside and outside the chroot

Change-Id: Idd91cbee323346a871b49deea31a76875f5ee3c4
Reviewed-on: http://gerrit.chromium.org/gerrit/4675
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
2011-07-26 14:05:43 -07:00
J. Richard Barnette
f16e1028d6 Delete resize_stateful_partition.sh
The file was written as a script, but in fact was merely a shell
library of mostly unused functions.  Remove the file, and move the
one function actually used to the one place it was used in
mod_image_for_recovery.sh.

BUG=None
TEST=run mod_image_for_recovery.sh
TEST=grep all relevant scripts for references to the deleted file

Change-Id: I424f6986089467d2b8cd95bb033851171c1d1e3a
Reviewed-on: http://gerrit.chromium.org/gerrit/4681
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
2011-07-26 10:17:12 -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
Che-Liang Chiou
451f36e4a8 Revert "obsolete --crosbug12352_arm_kernel_signing flag"
This reverts commit 2d2e825247.

Change-Id: I62d68c063aeab6beca4393ed51a4e754c8d9cc6a
Reviewed-on: http://gerrit.chromium.org/gerrit/4487
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-07-21 04:54:47 -07:00
Che-Liang Chiou
2d2e825247 obsolete --crosbug12352_arm_kernel_signing flag
BUG=chromium-os:12352
TEST=manual

./build_image --board {tegra2_seaboard,x86-mario}
load_kernel_test -b 2 /path/to/chromiumos_image.bin \
  /usr/share/vboot/devkeys/recovery_key.vbpubk

Change-Id: Ide2b641842ce08ec5540c5195356821afaf7d048
Reviewed-on: http://gerrit.chromium.org/gerrit/2864
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-07-21 03:02:30 -07:00
Che-Liang Chiou
93b6effb0b arm: kernel cmdline use root=PARTUUID=UUID/PARTNROFF=%d
Since now the arm firmware can parse %U as x86 bios, and kernel can
parse PARTNROFF=%d, we are able to generate kernel command line with
such construct.

BUG=chromium-os:14022,15683
TEST=manual

1. Build image with root filesystem verification turns off
2. Boot successfully
3. Run 'cat /proc/cmdline' and validate its output
4. Run 'rootdev' and validate its output

Change-Id: I11de0a30928efe9d9b0149feb3389a2f30063516
Reviewed-on: http://gerrit.chromium.org/gerrit/1104
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: <nsanders@google.com>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
2011-07-01 01:33:10 -07:00
Elly Jones
8d87dbfb28 mod_image_for_recovery: be noisy if build_kernel_image fails.
This will prevent nasty surprises when it fails silently and one ends up with a
non-bootable recovery image.

BUG=chromium-os:16366
TEST=Adhoc
Hack /usr/lib/crosutils/build_kernel_image.sh to exit 1, run
mod_image_for_recovery

Change-Id: If23d181959aecf75044cb4581e25f8851d1b9840
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/3097
Reviewed-by: Will Drewry <wad@chromium.org>
2011-06-23 11:13:48 -07:00
Nick Sanders
b795deba76 Cherry-pick: ARM: enable kernel signing by default
This commit is a part of transition to enable ARM kernel signing. It is
at first an option that is enabled manually, and then (in this commit)
enabled by default. After more tests, the scripts that generate unsigned
ARM kernel partition will probably be removed.

BUG=chromium-os:12352
TEST=./build_image && load_kernel_test -b 2 /path/to/chromiumos_image.bin /usr/share/vboot/devkeys/recovery_key.vbpubk

Change-Id: I7d4ecc566f9c5cc0106a7af59255fc63fdfe017a
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/1319
Tested-by: Nick Sanders <nsanders@chromium.org>
2011-05-25 02:56:21 -07:00
Stéphane Marchesin
2d331404a0 Add 64bit support to the build scripts.
Change-Id: Ibbc743981b4d1d2dd4e1ceb586f2f0a092559a27
Reviewed-on: http://gerrit.chromium.org/gerrit/1098
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Anush Elangovan <anush@chromium.org>
2011-05-18 10:07:46 -07:00
Tom Wai-Hong Tam
a4395b5b1c Revert "ARM: enable kernel signing by default"
This reverts commit 9c5d88573f.

Change-Id: Ica876e1be20dc9ab60666af476294e093fd59498
Reviewed-on: http://gerrit.chromium.org/gerrit/762
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
2011-05-12 12:39:53 -07:00
Che-Liang Chiou
9c5d88573f ARM: enable kernel signing by default
This commit is a part of transition to enable ARM kernel signing. It is
at first an option that is enabled manually, and then (in this commit)
enabled by default. After more tests, the scripts that generate unsigned
ARM kernel partition will probably be removed.

BUG=chromium-os:12352
TEST=./build_image && load_kernel_test -b 2 /path/to/chromiumos_image.bin /usr/share/vboot/devkeys/recovery_key.vbpubk

Change-Id: I6d48d1603cd7c96514892bcbbf8994b2d4cc2a08
Reviewed-on: http://gerrit.chromium.org/gerrit/512
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2011-05-09 03:13:56 -07:00
Mandeep Singh Baines
118692ab3f src/scripts: remove all references to verity_depth
This option is now deprecated. Remove from all scripts

To understand the impact of this change ran the following searches:

http://codesearch.google.com/codesearch?as_q=package%3Achromiumos+verity_depth
http://codesearch.google.com/codesearch?hl=en&lr=&q=package%3Achromiumos+verity_tree_depth

BUG=chromium-os:14357
TEST=Ran build_image, mod_image_for_test.sh, chromeos-install, and mod_image_for_recovery.sh.

Change-Id: I79e0e5fe1c917fbb54cc7c7f152d3c97d5f5c9b5

R=wad@chromium.org,scottz@chromium.org,gauravsh@chromium.org

Review URL: http://codereview.chromium.org/6901005
2011-04-28 13:50:33 -07:00
Tom Wai-Hong Tam
1f6a0ba388 Enable fbconsole in recovery and factory shims
This CL depends on http://codereview.chromium.org/6765018 which adds fbconsole
USE flag.

Change-Id: I159680e2cd53b6493545f6c0b1caaa8a7e833cb3

BUG=chromium-os:13607
TEST=run mod_image_for_recovery.sh and boot to recovery image to see messages
showed on framebuffer console.

Review URL: http://codereview.chromium.org/6814041
2011-04-26 18:09:16 +08:00
Tom Wai-Hong Tam
b42af678be Add transitional flag for ARM kernel signing in mod_image_for_recovery.sh.
Enable the ARM kernel signing procedure in the recovery image. Will remove it
when the procedure is stable.

BUG=chromium-os:12352,chromium-os:1305
TEST=run "build_image" and "mod_image_for_recovery.sh
--crosbug12352_arm_kernel_signing" to create a recovery image.
Then use u-boot recovery mode to boot the recovery image. Successfully verify
and boot the kernel.

Change-Id: I1bf911176c6f3adaebf3aa9abc86488a48a60494

Review URL: http://codereview.chromium.org/6635010
2011-03-08 09:55:10 +08:00
Will Drewry
b910de849c kernel build: use %U+1 for dm-verity booting
Using %U+1 will ensure that we avoid device enumeration issues during recovery mode
boots.

TEST=build_image+dev recovery kernel and boot to it on new cros fw / fixed enumeration problem
         used build with mp recovery kernel on cr-48 -> installed then booted fine
         used dev recovery kernel on a legacy machine; installed fine, booted fine
         tested with cr-48, mp recovery kernel, and noenable_rootfs_verification to ensure /dev/sd%D%P still worked as normal.

Change-Id: I5b1277a47536738a78c18988fd912cc05ebddd4b

BUG=chromium-os:5470

Review URL: http://codereview.chromium.org/6549034
2011-02-23 13:26:50 -06: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
David Hendricks
6edcc4d952 Copy recovery kernel to syslinux path only on x86.
This is intended to fix a build error seen on ARM platforms where
the path "$esp_mnt/syslinux" does not exist.

Change-Id: I0b9e2d1fae376a7137d7e196901fbea4f2e796bc

BUG=http://code.google.com/p/chromium-os/issues/detail?id=9713
TEST=Not tested.

Review URL: http://codereview.chromium.org/5404001
2010-11-30 17:21:39 -08:00
Gaurav Shah
dc4a6446e9 Set success=1 for the recovery kernel
This will prevent the firmware from updating the tries flag on a USB recovery image.

Change-Id: I47bf276eab5b40ae54b732d0e082e4c9f58bfed3

BUG=chromium-os:6550
TEST=build_package, build_image, cgpt show recovery_image.bin (successful flag should be set to 1)

Review URL: http://codereview.chromium.org/4979007
2010-11-17 14:11:43 -08:00
Will Drewry
16106bade8 mod_image_for_recovery: keep the stateful partition around.
Developer images may have data on stateful they want to keep. In that case, just swap the kernels.

BUG=chromium-os:7451
TEST=tested with a --withdev build and stateful was intact and the recovery install worked.

Change-Id: I59d7f2e99892448d1eaf964e6292611accb2035c

Review URL: http://codereview.chromium.org/4418002
2010-11-05 10:10:22 -05:00
Will Drewry
53320366b5 mod_image_for_recovery: supprt new recovery model
With a change for chromeos-installer and http://codereview.chromium.org/4120005,
switched to a kernel image based approach.

BUG=chromium-os:7451
TEST= See http://codereview.chromium.org/4120005

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

Change-Id: I84ac794dae652578682c04fdfdbfaa3f0c5c8b33
2010-11-01 17:34:14 -05:00
Tan Gao
e1e306566a Issue 6759: reduce size of stateful partition for non-developer recovery image
Change-Id: I636f3156e549508230515174edffaff650c9d46e

BUG=chromium-os:6759
TEST=(1)manually built a non-developer recovery image and verified recovery install
completes on an agz device and the device is able to boot from HD upon reboot
(2) repeat for a developer recovery image and verified dev image from dev_payload is installed onto target and the target is able to boot from HD

Review URL: http://codereview.chromium.org/3391018
2010-10-08 15:22:51 -07:00
Tan Gao
4515028a2d Issue 5871: support user-specified output image name in mod_image_for_recovery.sh
Change-Id: Ibd1990747d20b3f11a8bf9d5b558405067589d0e

BUG=chromium-os:5871
TEST=manually ran the script with and without --output flag and verified output
image took default name and user-specified name, respectively

Review URL: http://codereview.chromium.org/3155042
2010-08-25 12:51:07 -07:00
Tan Gao
2fcfbbe8cf replace mod_image_for_recovery.sh with new --recovery flag to build_image
Change-Id: I407d39ca461bbe609812e2b3bd2a51e67e331659

TEST=manually built a recovery image (non-dev mode, --withnodev) and verified
chromeos-install completed successfully when installing from USB to target HD

Review URL: http://codereview.chromium.org/3174005
2010-08-16 11:25:51 -07:00
Will Drewry
7ab698d713 build_image, mod_image_for_*: break out make_image_bootable
Breaks make_image_bootable out of build_image into a separate
script.  In addition, it make a helper .sh in the OUTPUT_DIR
to let make_image_bootable be re-run on an image with the same
arguments that were passed in via build_image.

This change also removes the use of the boot/ directory in
OUTPUT_DIR.

TEST=build_image verified; image_to_usb --test_image; booted l13
           build_image; image_to_vm; qemu booted
           build_image verified; image_to_usb; booted l13
BUG=chromium-os:5081

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

Change-Id: I627d678089aa71c353347f387ad5b14063fd4e7b
2010-08-05 13:57:52 -05:00
Tan Gao
7ead6c4fa1 issue 2825046
Change-Id: I8eb21d76e75f97270596907fb309b81e8b6c8d2e

Review URL: http://codereview.chromium.org/3007005
2010-07-19 10:12:37 -07:00
Tan Gao
8ae113bb42 remove handling of kernel verification block from recovery image
Change-Id: I749dc652651fdb02b49b290863e2fa9adc6b904e

Review URL: http://codereview.chromium.org/2948005
2010-07-13 07:04:48 -07:00
Tan Gao
40551cd9ca recovery installer: fix build_gpt and build_image
Change-Id: I3cbb62827a33894f47d26dd047134b6c39c6667b

Review URL: http://codereview.chromium.org/2813029
2010-06-24 16:33:32 -07:00