Commit Graph

110 Commits

Author SHA1 Message Date
Paul Stewart
12973e562d Install make.globals and create make.profile directory
Some mod_for_test images don't have the files necessary to run
emerge.  Install them.

BUG=none
TEST=Rerun package install

Review URL: http://codereview.chromium.org/3351016
2010-09-09 20:04:11 -07:00
Anush Elangovan
bc2aaf67f8 Make factory emerge the virtual/kernel atom to support profile based kernel
This is dependent on http://codereview.chromium.org/3317012/show

Change-Id: Ifb6e7511619e9f2000448408dd800dd7043a7783

BUG=5847
TEST=new setupboard and build_packages/image for arm/x86-generic with the CL 3317012 included

Review URL: http://codereview.chromium.org/3328016
2010-09-09 19:40:30 -07:00
Tan Gao
74a07cac15 Issue 6577: remove confirmation to delete output directory
Change-Id: Ib19986121a8988c6cae23527148a7b5d4a58663e

BUG=chromium-os:6577
TEST=(inside chroot) run 4 test cases from src/scripts/, using Ctrl+C to force abort (hence triggering "delete_prompt")
a.) (stdin tty) "./build_image --board=x86-generic < /dev/null", expected = no prompt and delete output dir; actual == expected
b.) (stdout tty) "./build_image --board=x86-generic > foo.txt", expected = no prompt and delete output dir; actual == expected
c.) (normal user case) "./build_image --board=x86-generic",
expected = prompt to delete output dir, if y, output dir is removed; actual == expected
d.) (normal user case) "./build_image --board=x86-generic", expected = prompt to delete output dir, if N, output dir is NOT removed; actual == expected

Review URL: http://codereview.chromium.org/3373003
2010-09-09 11:41:30 -07:00
David James
ffede3b414 Use --usepkgonly in build_image to ensure no accidental builds of packages.
Historically, we used --usepkgonly in build_image to ensure that packages
were not accidentally built during this step. Recently, build_image was
updated to use --usepkg. The benefit of using --usepkg was that it would not
install obsolete binary packages to your image. It was counter-intuitive that
--usepkgonly would install packages to your image that are not actually
installed to your board root. The disadvantage, however, of --usepkg, was that
it sometimes tried to build packages afresh using the image as your build root,
and this failed with strange errors because you're not supposed to do that.

This change fixes build_image to give useful errors by switching back to
--usepkgonly. To fix the problem where --usepkgonly installs packages that are
not installed, we first run eclean-<board> to clean all unused packages from
the board root.

This change is a big improvement because a number of people have run into
strange issues with build_image due to this problem and have had trouble
debugging them.

This change was actually written by Sean Paul, and I am shepherding his change
through for him because he doesn't have a Chromium account yet.

BUG=chromium-os:6437
TEST=
 1) build_packages && build_image should still work
 2) build_packages && ./cros_workon start power_manager && build_image should
    fail with an error that all versions of the power manager are masked. This
    happens because you started working on the power manager, but did not build
    the version of the power manager you were working on before installing it.
 3) Assuming you are working on the power manager, build_packages && build_image
    should succeed because your cros_workon'd version of the package is built.
 4) ( ./cros_workon start power_manager && build_packages &&
      ./cros_workon stop power_manager && build_image ) should fail with the
    same error message as case 2 for similar reasons.
 5) ( ./cros_workon start power_manager && build_packages &&
      ./cros_workon stop power_manager && build_packages && build_image )
    should work because you've built your new version of the stable package.

Change-Id: Ia3858c70997bc6f0ec0b6d1bfaede8d3272a0976

Review URL: http://codereview.chromium.org/3305010
2010-09-07 14:22:38 -07:00
Nick Sanders
446c2115e4 Don't kill sdcards with boot_tries
USB/SDCard boot devices typicaly don't run software updater,
and won't have success ever set. We never want to try to
fall back to the empty B partition either. The workaround
for this is to set the successful bit regardless of actual
boot success.

bug=6395
Change-Id: I67c625804203b13be9a0c626c404fa38bafb5445

Review URL: http://codereview.chromium.org/3344008
2010-09-03 18:15:35 -07:00
Nick Sanders
ebce8543fc missed feedback from CL
Review URL: http://codereview.chromium.org/3323004
2010-09-02 14:57:34 -07:00
Nick Sanders
c8cb33699e Allow full build of factory install shim in build_image.
BUG=4951
TEST=Build and boot install shim on legacy bios, on H2C

Review URL: http://codereview.chromium.org/3140028
2010-09-01 21:31:30 -07:00
Nick Sanders
ae26a5cbbf * Combine partition setting
* Add dev-rec key to factory installer
* rename factory_install_shim output to be consistent with dev install shim

Change-Id: Ibf8f027edda67626af5c319b4daa164cb53ccfe7

BUG=4382
TEST=Build factory install, build dev install, build normal

Review URL: http://codereview.chromium.org/3286002
2010-08-30 21:59:50 -07:00
Olof Johansson
1f5e84d157 build_image: image_to_vm needs board arg
BUG=none
TEST=build_image + cut and paste image_to_vm in the output

Change-Id: I9def13a56d796c1f034c834a8429e909b45afa02

Review URL: http://codereview.chromium.org/3181038
2010-08-24 20:26:49 -05:00
Tan Gao
7b6d5036f5 Issue 5183: reduce dev install shim size
Change-Id: I7722848872b1712b26c38ac8f163d450c5a08f6d

BUG=chromium-os:5183
TEST=manually built a dev install shim and verified it's bootable on agz device

Review URL: http://codereview.chromium.org/3158021
2010-08-23 08:17:48 -07:00
Will Drewry
12f14ce889 build_image: default to using verified rootfs for x86
This change enables root filesystem integrity checking for all x86
builds by default.  All mod_image_for_* work with this and the
factory_install.  In addition, the BVT tests all pass running on
a dm-verity root.

[I will send a mail to the chromium-os-dev once this lands with instructions on how to build with it and how to turn it off (chromeos-setimage) on an installed machine.]

Once this is functioning, I will start migrating the build/install process over to use the UUID-based boot.

TEST=built x86-generic, mod'd for test, installed, ran suite_BuildVerify
BUG=chromium-os:5100

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

Change-Id: Ib23962b7a5e034ef6aea31b4361944ba894700c6
2010-08-17 17:27:16 -05:00
Will Drewry
d253badb6c build_image: make sure the factory_image size is propagated
Verified rootfs-based factory installers fail because the ROOT_SIZE_BYTES is
updated, but the information is not propagated to the boot.desc which
cros_make_image_bootable uses.  The result is that mod_image_for_test
incorrectly appends the rootfs hash even though it is correctly computed.

Random note:
build_kernel_image uses dumpe2fs to compute the size, but
cros_make_image_bootable uses the supplied size.  These shouldn't
diverge though the partition size should accomodate the addition of the
hashes.
TODO(wad) Add checking of sizes in cros_make_image_bootable

TEST=x86-generic build image with --enable_rootfs_verification and --factory_install; then put in a machine and it no longer spewed dm-verity hash errors and the root hash checked successfully!
BUG=chromium-os:5100

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

Change-Id: I174e3661b80d83b25f3af95ff1eb77f634a7e797
2010-08-17 14:09:41 -05: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
Ken Mixter
0d11563bfd Move leave_core where other similar files exist
BUG=5696

Review URL: http://codereview.chromium.org/3109014
2010-08-13 15:51:07 -07:00
Ken Mixter
1334788772 Leave core files around for developers to inspect.
BUG=5358

Review URL: http://codereview.chromium.org/3170008
2010-08-12 16:51:52 -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
Olof Johansson
58f25cca72 Create a latest link to point at newest image
build_image creates it after a successful build, and get_latest_image
can use it if it exists. Fall back to old behavior for now when there
are directories without a link.

BUG=none
TEST=Try building an image, check link. Rebuild, check new link.

Review URL: http://codereview.chromium.org/3014051
2010-08-04 21:18:49 -07:00
David James
0366864a98 Enable fast build by default in build_image and mod_image_for_test.sh.
The fast build is stable enough now that we can enable it for everybody.
I ran the build constantly all weekend on two machines and I only ran into
one (rare) error, which I've fixed in a separate patch.

See <http://codereview.chromium.org/2856048/show>

TEST=Ran lots and lots of fast builds
BUG=none

Review URL: http://codereview.chromium.org/3059001
2010-07-28 17:08:29 -07:00
Nikita Kostylev
c8bba90ae4 Make oem_customization flag optional.
BUG=chromium-os:1888
TEST=Manual. build_image should run fine when oem_customization flag is not specified.

Review URL: http://codereview.chromium.org/3076009
2010-07-28 17:05:26 +04:00
Will Drewry
efce66880f image_to_vm: convert to calling setimage directly
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
2010-07-23 19:43:27 -05:00
Will Drewry
9926ee2879 build_image: avoid losetup -c because older kernels seem to balk
Instead of resizing the loop device after adding padding for the
hash tree data.  Just ensure that the mkfs.ext3 call doesn't exceed
the rootfs size.

TEST=reran build_image on my lucid machine and checked the rootfs size; asked someone with hardy machine to test.
BUG=none

Change-Id: I59f95e1d17e35aca265bd44bb863da6069c05bd2

Review URL: http://codereview.chromium.org/3048009
2010-07-21 15:11:10 -05:00
Will Drewry
78992a33f4 build_image, build_kernel_image, update_bootloaders: fix up rootfs_verification
This change adds
- --rootfs_hash_pad to specify the MBs reserved for the pad
- the implementation of the above flag
- check if total fs size + pad size exceeds the partition size
- hash appending in make_image_bootable()

Fixes:
- a style for ROOT_FS_HASH usage
- bad mount|grep
- bad bash subst for root devices in all boot paths
- fixed a typo in the update_bootloaders table creation
- disables verified usb for now

Adding the padding argument ensures that the generated hash tree for the root filesystem is appended to the image.  Assuming the rootfs is _never_ mounted read-write
again, that hash tree will be valid and vboot will be able to proceed.

BUG=chromium-os:2693
TEST=manual build_image

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

Change-Id: I67d9b0f91cacdefa309c0cc2dd7fed1d2eddd7a7
2010-07-21 14:02:20 -05:00
Will Drewry
721d94f429 build_image,update_bootloaders: directly update the built image
Instead of playing mount and loop device games, this change adds support for
update_bootloaders.sh to directly update the EFI system partition living in the
image if a file, offset, and size is supplied.

TEST=build_image for x86-generic; booted resulting image
BUG=broken build

Change-Id: I3d891fd965df6fb4abfc63d660e314c497a4184d

Review URL: http://codereview.chromium.org/3006006
2010-07-16 14:39:45 -05:00
Andrew de los Reyes
3172b7e296 build_image: add temporary hack to fix syslinux building.
Will Drewry is working on the proper fix, but this unblocks people who
build images that boot w/ syslinux.

Review URL: http://codereview.chromium.org/3009003
2010-07-15 22:10:47 -07:00
Zelidrag Hornung
478a0d44a4 Renamed VM image to match naming convention of other images.
Review URL: http://codereview.chromium.org/2955014
2010-07-14 11:47:39 -07:00
Denis Romanov
95bdf47a1a Added command line parameter to specify OEM content location.
Added populating OEM partner partition with content.
Added creating flag file .consider_oobe for OEM partition to get mounted on OOBE.

BUG=http://crosbug.com/3828
TEST=Install Chrome OS on the device from USB stick. /mnt/partner_partition contains etc/... directory with customization manifests on first boot.

Review URL: http://codereview.chromium.org/2938003
2010-07-12 22:44:42 +04:00
Mandeep Singh Baines
87b169428f build_image: modify to not get devkeys from vboot_reference checkout
An earlier CL modifies the vboot_reference ebuild to install the
keys into /usr/share/vboot.

TEST=verified that build_image fails without this change and no
vboot_reference checkout but succeeds with this change and no
vboot_reference checkout

Change-Id: Ie2bc1091b52c36fd56cd5f763ee275afc91765c3

Review URL: http://codereview.chromium.org/2896008
2010-07-09 20:52:41 -07:00
Will Drewry
07e350578b build_image: enable syslinux installation for x86
Adds the --install_syslinux to the update_bootloaders call for x86.

BUG=chromium-os:2693
TEST=build_image with both tegra2 and x86-generic in progress. Doesn't affect actual booting until we change the active gpt boot partition.

Review URL: http://codereview.chromium.org/2911003
2010-07-09 14:50:42 -07:00
Will Drewry
1670d481a1 build_image, build_kernel_image, legacy_bootloaders: Rename vboot flags
The use_vboot and vboot_ flags were confusing from a functionality perspective
since verified boot as a feature encompasses firmware and kernel functionality.
The firmware bits are always enabled, but use_vboot enabled the image-integrity
portion of vboot.  It is not called
  --enable_rootfs_verification
and all options for the kernel functionality is under --verity_* given that
verity/dm-verity is the current working name for the module and userspace tool.

TEST=ran x86-generic build_image & tegra2-dev-board build_image and checked the resulting boot.config files (with and without --enable_rootfs_verification).
BUG=chromium-os:2693

Review URL: http://codereview.chromium.org/2917008
2010-07-09 13:08:38 -07:00
David James
fd7403ab89 Revert "Use --fast by default in build_image when --jobs is enabled."
See if this fixes the symlink problems we've been running into.

This reverts commit 8edffbaec5.
2010-07-09 12:00:17 -07:00
David James
8edffbaec5 Revert "Revert "Use --fast by default in build_image when --jobs is enabled.""
parallel_emerge prints a message every 30 seconds now so that buildbot doesn't
kill us early. Per discussion with cmasone, reverting the revert.

This reverts commit debaa3d8cf.
2010-07-08 21:21:41 -07:00
Chris Masone
debaa3d8cf Revert "Use --fast by default in build_image when --jobs is enabled."
This reverts commit f0fb864e8d.

This change needs to be reverted because it suppresses logging output
from the build process.  Thus, when something goes wrong...the
sherriff is left completely helpless in terms of debugging the issue.

TBR: davidjames@chromium.org
2010-07-08 21:10:23 -07:00
David James
f0fb864e8d Use --fast by default in build_image when --jobs is enabled.
Also update eretry to not pass in $EMERGE_JOBS anymore, in coordination with my previous change, which passed it in directly instead of depending on eretry to do so: http://codereview.chromium.org/2944004/show

TEST=Ran build_image --jobs 2 and build_packages --jobs 2
BUG=none

Review URL: http://codereview.chromium.org/2914004
2010-07-08 20:17:45 -07:00
Tien-Ren Chen
71ff3fc632 fix disappearing vmlinuz_hd.vblock problem
Review URL: http://codereview.chromium.org/2905001
2010-07-08 15:27:59 +08:00
Tammo Spalink
cfc0c64823 Allow python to find gtk module. (originally nsanders CL)
BUG=4464
TEST=manually edit file so far

Review URL: http://codereview.chromium.org/2850045
2010-07-07 10:51:21 +08:00
Louis Yung-Chieh Lo
85d49fc1d9 Copy vmlinuz_hd.vblock only in x86 platform.
Review URL: http://codereview.chromium.org/2842044
2010-07-05 22:55:31 +08:00
Louis Yung-Chieh Lo
ca1c2b0430 Change code of copy vmlinuz_hd.vblock to make_image_bootable().
Review URL: http://codereview.chromium.org/2857037
2010-07-05 17:37:05 +08:00
Louis Yung-Chieh Lo
3602040b74 Use the new developer keys to sign things. (submit for Bill)
The original CL is http://codereview.chromium.org/2868044/show

Review URL: http://codereview.chromium.org/2818045
2010-07-05 13:23:34 +08:00
Will Drewry
25861ee160 TBR: use the correct output directory
Pushed with the rootfs instead of output dir.

TBR=fes
BUG=none
TEST=manual
2010-07-04 05:09:41 -07:00
Will Drewry
c985ae271f TBR: build_image chmods the /boot copy
TBR=fes
BUG=none
TEST=manual (no local archive_build)
2010-07-04 05:06:50 -07:00
Will Drewry
82780e5c37 TBR: clean up arm
Right now, the created arm.mbr is the size of the ESP
partition. It should be truncated though to just the mbr size.

In addition, dm= doesnt do anything on arm yet so replacing use with a todo and adding a check if it isn't there.

TEST=manually ran
BUG=none
TBR=fes
2010-07-03 18:27:10 -07:00
Will Drewry
821d07cb42 build_image: fix hash perms & arm image path
This should fix the bad parsing and the failed archiving.
EMphasis on should. I'll keep monitoring.

TEST=in progress
BUG=none

Review URL: http://codereview.chromium.org/2812044
2010-07-03 17:14:58 -07:00
Will Drewry
4a675e18a0 [PATCH 5/5] build_image: refactor bootloaders and enable vboot config paths
This change adds make_image_bootable which combines the
prior changes to make ARM, x86-legacy, x86-efi, and x86-fw
share kernel commandlines (where possible) and not rely on
keeping data stored on the rootfs to do so.

It does not enable a cut over to syslinux yet, though.

TEST=manually built image and tested boot and install (in progress)
BUG=chromium-os:327

Review URL: http://codereview.chromium.org/2834038
2010-07-03 13:35:02 -05:00
Will Drewry
1ee156fd00 [PATCH 3/5] Unify efi and legacy bootloader configuration generation
This change unifies the creation of extlinux.conf,
syslinux cfgs, and grub efi files.  It shouldn't change the
existing behavior but does add support for further arguments
and future use of syslinux (once it is properly rewritten by
an installer or other script).

TEST=in progress; manual run
BUG=chromium-os:327

Review URL: http://codereview.chromium.org/2829038
2010-07-03 13:27:19 -05:00
Bill Richardson
2ace49e0a4 Generate and use .vbprivk files for signing now.
Review URL: http://codereview.chromium.org/2817047
2010-07-01 10:23:27 -07:00
Nick Sanders
f2dee6c5df Add --fast to build_image
Include checked in parallel emerge,
with an optional (default false) argument
in build_image to turn it on.

Review URL: http://codereview.chromium.org/2827037
2010-07-01 00:21:32 -07:00
Denis Romanov
110615446e Added empty ext3 filesystem initialization for OEM partner partition.
BUG=http://crosbug.com/3828
TEST=When mounted, /dev/sd8 (OEM partition) has a valid empty filesystem on it.

Review URL: http://codereview.chromium.org/2867030
2010-06-29 04:23:53 +04:00
Eric Li
5cf288fb1c Increase stateful test partition size to 1G, to accommodate autotest package pre-installation under /usr/local.
Review URL: http://codereview.chromium.org/2865018
2010-06-28 12:46:26 -07:00
David James
868d7bb6b9 Added --preserve option and logic.
Other changes:
- Added update_base_packages() method.
- Fix a get_latest_image.sh problem when the image does not already exist.
- Cleanup method invocations, and remove OUTPUT_IMG global variable.
- Add kernel testing logic back (it was accidentally deleted in an earlier patch.)

TEST=Built regular image. Updated old image to contain new packages.
BUG=none

Patch by: Don Garrett <dgarrett@chromium.org>
(Tweaked by me to address review feedback.)

Review URL: http://codereview.chromium.org/2857020
2010-06-24 21:48:14 -07:00