Commit Graph

42 Commits

Author SHA1 Message Date
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
Vic Yang
d0694f5ac9 Check kernel image size when building image
Kernel and ramdisk image together are copied into a 16MB partition.
This CL logs their size when building image. If they are larger than
14MB, warning message is emitted. If they reached 16MB, building fails.

BUG=chromium-os:27739
TEST=Build success on x86 and arm.
     Check log and see kernel image size logged.
     Lower the size limit to 6MB and build x86 factory install shim and
     see build fail.

Change-Id: I4c4895c2989b302aa0c3624127518468566d1148
Reviewed-on: https://gerrit.chromium.org/gerrit/22543
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-05-13 19:57:51 -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
Mike Frysinger
a19cf6e2db build_image: handle diff mount output
Newer versions of util-linux's mount utility will not show:
	/dev/loop0 on /some/path type ext3 (mount,opts)
Instead, it finds out the file backing /dev/loop0 and outputs:
	/some/file on /some/path type ext3 (mount,opts)

This breaks the make_image_bootable helper that attempts to look up the
loop device that mount_gpt_image.sh happened to pick.

Let's scuttle the idea of parsing `mount` and move directly to what the
kernel has to say via /proc/mounts.  Hopefully the ABI there should be
quite a bit more stable.

BUG=None
TEST=build_image works with mount from util-linux-2.16
TEST=build_image (before change) fails with mount from util-linux-2.19
TEST=build_image works with mount from util-linux-2.19

Change-Id: I66908800e82ff2e106face9d57773721e400dc2a
Reviewed-on: https://gerrit.chromium.org/gerrit/11869
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2011-12-01 11:46:16 -08:00
Sonny Rao
3163cf0605 Change script style for ARCH comparisons to double-bracket bash style
BUG=none
TEST=test setup_board, build_packages, build_image, image_to_vm,
on x86-generic and amd64-generic

Change-Id: I43d9d8e6e0e48cbce4d0086b78721ed86b120d4a
Reviewed-on: http://gerrit.chromium.org/gerrit/10209
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
2011-10-17 17:53:48 -07:00
Sonny Rao
1261bc5886 fix up bootloader related scripts to treat amd64 like x86
BUG=chromium-os:21739
TEST=manually verify syslinux is being properly installed on
amd64-generic

Change-Id: I780fba2b9e90a8cf3922b48723f29d96eaf3931e
Reviewed-on: http://gerrit.chromium.org/gerrit/10168
Reviewed-by: David James <davidjames@chromium.org>
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
2011-10-17 14:00:54 -07:00
Hsinyu Chao
4b8a1ebb4d Small cleanup: remove unused local variable.
BUG=None
TEST=`./build_image --board=tegra2_kaen` still work
Change-Id: Ic3936cd2f300716ad48c04e504fbc0e1f36e0683
Reviewed-on: http://gerrit.chromium.org/gerrit/9928
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
2011-10-12 02:46:49 -07:00
Elly Jones
9ca3e4c0fe mod_image_for_recovery: reuse salt.
This will prevent the recovery kernel from having a different salt from the
rootfs it corresponds to.

BUG=chromium-os:20766
TESTED_ON=kaen
TEST=Adhoc
Build a recovery image and do recovery from it.

Change-Id: I96f735e527d807247e09e17aac1ed5b51367f0ef
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/8288
2011-09-28 10:50:10 -07:00
David James
d1679ab864 Don't hardcode output directories in boot.desc.
Right now, output directories are hardcoded in boot.desc. This means that
cros_make_image_bootable will still write to the directories mentioned in
build_image, even if it's working on a different directory. This can
mess with the buildbot, because it can cause cros_make_image_bootable
to mess with the files created for existing images.

This change fixes flaky failures where the buildbot fails with warnings
stating that vmlinuz_hd.vblock does not exist. See bug 19956.

BUG=chromium-os:19956
TEST=Run full canary trybot run and verify cros_make_image_bootable uses
     files from the right directory now.

Change-Id: Ib390aa84570b077cbc8b69b757998056acc091ea
Reviewed-on: http://gerrit.chromium.org/gerrit/7282
Reviewed-by: Will Drewry <wad@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2011-09-06 13:50:40 -07:00
Da Zheng
87465ea735 Create squashfs as the rootfs.
This give users the choice to have rootfs formatted with squashfs.
When --squash_image is specified, the rootfs will be formatted to squashfs.

Users can also use --squash_sort_file to specify the file priority when
squashfs is created.

BUG=None
TEST=Manually tested "--squash_image", and the image can be installed
from USB stick. Also tried "--squash_sort_file=sort-prio.list", and files
in squashfs are sorted.

Change-Id: I5fd818ac9d1203598926efa82e94fa105cd86ebc
Reviewed-on: http://gerrit.chromium.org/gerrit/5664
Tested-by: Da Zheng <zhengda@chromium.org>
Reviewed-by: Da Zheng <zhengda@chromium.org>
2011-08-26 13:04:29 -07:00
J. Richard Barnette
9fb286ea02 Skip filling in kernel partition until cros_make_image_bootable
When first creating an image, vmlinuz was extracted from /boot, and
installed in its place in the kernel partition.  However, none of
that was necessary, because cros_make_image_bootable walks over the
same ground later in the build process.

BUG=chromium-os:17390
TEST=build_image, boot base and dev images on ZGB and legacy device
TEST=inspect build output directory, to confirm no stray artifacts

Change-Id: Iaf332b6603e0bcb17585adbc95a7b65bb8bfe790
Reviewed-on: http://gerrit.chromium.org/gerrit/5107
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
2011-08-01 16:09:00 -07:00
Richard Barnette
c6818be0da Revert "Skip filling in kernel partition until cros_make_image_bootable"
This reverts commit a966c2bad686f787268f01a7529851a1a2a6ad9b

Change-Id: I0990252c34853f7e1884da19b2649ed32e52e078
Reviewed-on: http://gerrit.chromium.org/gerrit/5091
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-01 13:53:34 -07:00
J. Richard Barnette
77ec32a128 Skip filling in kernel partition until cros_make_image_bootable
When first creating an image, vmlinuz was extracted from /boot, and
installed in its place in the kernel partition.  However, none of
that was necessary, because cros_make_image_bootable walks over the
same ground later in the build process.

BUG=chromium-os:17390
TEST=build_image, boot base and dev images on ZGB and legacy device
TEST=inspect build output directory, to confirm no stray artifacts

Change-Id: Icd4902f5a823241f24eb64f68f80c8e5e5198341
Reviewed-on: http://gerrit.chromium.org/gerrit/4928
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
2011-08-01 11:41:17 -07:00
Puneet Kumar
0fffd2bc75 Reenable crosbug12352_arm_kernel_signing flag as a dummy
This is being done so that the image parser run by the bots
can still parse images built with this flag

BUG=chromium-os:18299
TEST=Wait for bots to cycle green with old images

Change-Id: Ibebe62f0db60ab3a57e04964f872398028ee48c8
Reviewed-on: http://gerrit.chromium.org/gerrit/4824
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Puneet Kumar <puneetster@chromium.org>
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
2011-07-27 11:37:23 -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
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
Arkaitz Ruiz Alvarez
26d68ecaa5 Add cros_debug to kernel commandline in dev images
Every developer image (and test images based on the developer image) should
include "cros_debug" in the kernel commandline. This flag is used by the
crossystem application to determine if the image being run is a developer
image. cros_make_image_bootable receives a new flag, --force_developer_mode
that appends "cros_debug" to the boot args.

BUG=chromium-os:16951
TEST=build images. Flash a base image and confirm the absence of "cros_debug"
in /proc/cmdline. Flash the developer image and confirm the existence of the
string.

Change-Id: I9f748638b5dac384be991908239e8b447ddf3b5e
Reviewed-on: http://gerrit.chromium.org/gerrit/3169
Tested-by: Arkaitz Ruiz Alvarez <arkaitzr@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
2011-06-27 10:45:16 -07:00
Antoine Labour
4c64b507db Disable fsck in cros_make_image_bootable
cros_make_image_bootable is called up to 4 times in a typical workflow. The fsck
check can take up to a minute or more because it first copies 2G of the image to
run the fsck on. It adds several minutes to the build.
The check itself is just a sanity check that shouldn't trigger in normal builds.

BUG=none
TEST=build_image

Change-Id: I86512f7efc67027fe687f0c0ad8f6df32579dbe2
Reviewed-on: http://gerrit.chromium.org/gerrit/2250
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
2011-06-07 15:47:06 -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
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
Mandeep Singh Baines
95026958c1 cros_make_image_bootable: default to verity_depth=0
Verity only supports a depth of 0. Passing anything other than 0 will
cause a verity failure.

BUG=14314
TEST=Verified that verity does not fail when do depth is passed.
     Before this change, verity would fail with the error message
     reported in the bug.

Change-Id: I68495c4486284744ee0779b6c9cdc0ef214519c7

R=gauravsh@google.com,scottz@google.com,drewry@google.com

Review URL: http://codereview.chromium.org/6873134
2011-04-20 16:28:54 -07:00
Che-Liang Chiou
75ac2beb67 Add transitional flag for enabling arm kernel signing
For now arm kernel partitions are not signed. This CL is a transitionsl.
That is, the added flag should be removed after arm verified boot is stable.

To properly create an arm kernel partition, we also need another CL for
vbutil_kernel utility that turns off x86-only modifications on kernel
image. See CL:6538015.

BUG=chromium-os:3790,chromium-os:12352
TEST=see below

Build images for x86 and arm successfully, and notice that load_kernel_test
passes for x86 and signed arm image.

$ build_image --board=tegra2_seaboard --crosbug12352_arm_kernel_signing
$ build_image --board=tegra2_seaboard --nocrosbug12352_arm_kernel_signing
$ build_image --board=x86-generic

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

Change-Id: I1be381bae2fc367a0603ac2ec67ee70fc9a257e4
2011-02-24 12:00:16 +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
Gaurav Shah
d02793a5d7 cros_make_image_bootable: Do a final sanity check on the rootfs by running e2fsck
This is a complement to the proposed fix for http://crosbug.com/9447, and I am getting it out first since it is a relatively simple change.

This change ensures that the rootfs on the image output by cros_make_image_bootable wasn't corrupted accidentally (for example, no boot.desc was provided and the defaults were incorrect for the image). This should catch rootfs errors that we end up discovering at delta AU time.

BUG=chromium-os:9578
TEST= Ran cros_make_image_bootable manually on an existing image with and without boot.desc. As expected, without boot.desc the output image rootfs had errors.

Also ran ./build_image - which worked fine too.

Change-Id: I4ed3a56634f37ab7d5ff2dc052ad607740356a40

Review URL: http://codereview.chromium.org/5216003
2010-11-24 12:48:14 -08:00
Will Drewry
55b42c94ca cros_make_image_bootable, mount_gpt_image, common.sh: root filesystem changes: ext2, ro by default
This change makes more of the root filesyste metadata static across builds, but
more can be done there.  It also changes the root filesystem to use ext2 as
we don't need journaling in normal mode.  Optionally we could use ext3 for
non-verified if desired (it's an easy change).

In particular, this change cleans up the following:
- clears the rootfs uuid
- labels it C-ROOT (instead of C-KEYFOB)
- removes reserved inodes and blocks

The major feature of this change, however, is that it adds two simple
helpers to common.sh: disable_rw_mount and enable_rw_mount.  They will
set high order byte (le) in the ro compat field to be 0xff.  This will
tell the kernel that the filesystem uses features R24-R31 which are safe
for use on the running kernel iff the filesystem is mounted read-only.

These functions are called in cros_make_image_bootable and
mount_gpt_image, respectively.  mount_gpt_image will always
enable_rw_mount and cros_make_image_bootable will disable_rw_mount if
--enable_rootfs_verification is true.

The approach is ugly but reasonably well contained.  If ext2 ever gets a
new revision and new features in the same range are introduced, then we
would be getting inconsistent behavior.  That said, it is unlikely that
that churmn will happen and if the impact is negative, it will ideally
show up during testing.

N.B., this will likely result in changes needing to be made to the
signing scripts in vboot_reference to ensure that rw mounting is
enabled/disabled in the same way (E.g., during stamping).

BUG=chromium-os:7468
TEST=- built x86-generic, imaged to usb stick, attempted to mount rw /dev/sdc3 on the host and was properly bounced.
     - booted to the image just fine on a dogfood device.
     - mod'd for recovery, then installed and booted.
     - mod_image_for_test runs with no errors; booted the resulting image as well
     - booted a factory_install with the pending dm changes
     - BVT passed with build_image x86-generic (vboot enabled)
     - [in progress] autotest that checks if the rootdev = /dev/dm-0 and
       then does a dumpe2fs | grep -q FEATURE_R31

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

Change-Id: If4dcba7568a110f4e32627c916d9e5741e5e5414
2010-10-20 15:44:11 -05:00
Will Drewry
32d8c11747 build_image & make_bootable: allow additional kernel cmdline args
In order to more easily test kernel commandline tweaks, ensure that
--boot_args is propagated to all kernel cmdline sinks.

This is useful for changing default schedulers and any other kernel argument
tweaks we may want to quickly test out.

TEST=build and tested x86-generic
BUG=none

Change-Id: I5138755aa8c5e32e7f117f18291d2ae197e95bef

Review URL: http://codereview.chromium.org/3644004
2010-10-11 15:37:17 -05:00
Chris Sosa
2cc5cd4155 Add ctest that calls the au test harness.
Change-Id: Ief14528b7e98d792da4be39976ff0fe48219f93b

BUG=6913
TEST=Ran image_to_vm, cros_au_test_harness, and ctest using internal urls.

Review URL: http://codereview.chromium.org/3606008
2010-10-06 14:29:45 -07:00
Chris Sosa
c1b14b52d0 Add defaults for cros_make_image_bootable.
This will allow dev who didn't build an image to still use cros_make_image_bootable
to update their image -- including mod_image_for_test / image_to_vm.

Change-Id: I1ba4292223b28b21d5416745e7744641100fa4ad

BUG=7370
TEST=Ran image_to_vm with other image and image I built myself.  Also ran
cros_make_image_bootable directly on a the same two images.

Review URL: http://codereview.chromium.org/3569015
2010-10-05 13:23:50 -07:00
Kenneth Waters
e3049de00f build_image: Merge x86 and ARM where possible.
- I looked at all of the x86 and ARM paths through out build image scripts,
  these changes clean up stale comments, stale code, and unforks some small
  things.

BUG=none
TEST=Built images for x86-generic, arm-generic and tegra2-seaboard, booted tegra2-seaboard image.

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

Change-Id: Ibad2774ff2cbf5f15528454506542b87e43e24a2
2010-09-30 14:20:34 -07:00
Kenneth Waters
9bc78b3acb make_image: Fake vmlinuz_hd.vblock on ARM.
- This unbreaks the devserver's update server for ARM.
- This also unforks some of build_image.

BUG=None
TEST=Installed to tegra2_seaboard from USB without --skip_vblock,
     updated tegra2_seaboard.

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

Change-Id: I6e66344de51609393407934f78aa20f49974efef
2010-09-22 13:54:44 -07:00
Chris Sosa
e8c3cdc91c cros_make_image_bootable is not compatible with restart_inside_chroot
restart_inside_chroot first assumes that the calling script is in
src/scripts.  Next any paths are not converted when passed so if
someone passes the most recent image, this will also not be interpreted
correctly.

Change-Id: Icb2dfc661eb84e134b4d8c5cf0354a6c1ab161f0

BUG=
TEST=Manually tested running outside chroot (getting error) and inside chroot.

Review URL: http://codereview.chromium.org/3421025
2010-09-21 17:45:15 -07:00
Kenneth Waters
ed54d93e2c build_image: Add verity support for ARM.
- Build a "kernel image" which contains a uboot script and a uboot kernel
  image.
- Fix some sd* assumptions.
- Remove cruft that has never done anything usefull from update_bootloaders

BUG=none
TEST=Built, booted, and updated on tegra2_dev-board

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

Change-Id: I00ecf57faa5fe64c8e33dd4c042f1dbed806c10a
2010-09-21 10:29:54 -07:00
Will Drewry
537caa90c0 Clean up cros_make_image_bootable and image_to_vm
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
2010-08-20 20:30:56 -05:00
Kenneth Waters
eca76464c7 make_image: Install u-boot scripts to ESP partition.
BUG=1150
TEST=Built image for tegra2_dev_board, and x86-generic

Review URL: http://codereview.chromium.org/3109018
2010-08-18 11:17:01 -07:00
Tan Gao
843b70acf4 Issue 5183: Create a developer shim for release builds
Change-Id: I14cd9dc365093c0450210d7853ad5f67ffa0ddd0

BUG=chromium-os:5183
TEST=1) manually built a dev install shim and verified it's only bootable when dev switch is ON

Review URL: http://codereview.chromium.org/3153001
2010-08-17 09:41:48 -07:00
Will Drewry
6793ba78ca build_image,cros_make_image_bootable: fix missing arm argument
Adds arm_extra_bootargs to boot.desc and to cros_make_image_bootable.

TEST=tegra2 dev-board build_packages, build_image --fast worked
BUG=broken tree

Change-Id: Ifdfeda66f1eb5e5b1e618706eeba269f31fa9913

Review URL: http://codereview.chromium.org/3069031
2010-08-05 16:17:46 -05: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